Skip to contentSkip to conversation

How to access vendor specific AC97 codec register ?

DISCUSSION alasinski 4 participants 15 messages Apr 20, 2006

lore
Share & tools
lore

alasinski

author
#0 lore raw

Hi,

I need to do IO specific operation from UCB1400 on Snapper Arm board. This has to be done from C code as it is part of a larger project. All what I need is to be able to read and write content of the few vendor specific AC97 codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

I have ALSA installed and running with simple programs that can successfully open controller with snd_ctl_open () and list available control elements. This is basically J.C.Georgas sample I found. I can read content of all AC97 registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures me that all driver and lib parts are working. All what I need is to write a simple piece of code ....

However, I spent 2 days reading through ALSA back and forth and I find this task very daunting to say at least. For one things I was not able to find an architecture document explaining how parts of ALSA work, to be able to find some sort of direction. There are samples dedicated to solving some of a problems, unfortunately not my problem. Man pages and reference are only little more then code browsing. Tutorials explain in brief what I don't need to know. In summary: typical situation when you are tasked with something that is off main stream.

I have an inkling that I should prepare UCB1400.conf file to define control elements that map to the registers (how ?). Then I should be able to snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
around: something like making ioctl() call on a driver directly w/o libasound. I'm in lost.

I will appreciate any suggestions and helpful hints

cheers
-al

a l a s i n s k i @ r o g e r s . c o m

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#1 lore raw

At Thu, 20 Apr 2006 11:05:38 -0400,

Quoted 25 lines · alasinski

Hi,

I need to do IO specific operation from UCB1400 on Snapper Arm board. This has to be done from C code as it is part of a larger project. All what I need is to be able to read and write content of the few vendor specific AC97 codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

I have ALSA installed and running with simple programs that can successfully open controller with snd_ctl_open () and list available control elements. This is basically J.C.Georgas sample I found. I can read content of all AC97 registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures me that all driver and lib parts are working. All what I need is to write a simple piece of code ....

However, I spent 2 days reading through ALSA back and forth and I find this task very daunting to say at least. For one things I was not able to find an architecture document explaining how parts of ALSA work, to be able to find some sort of direction. There are samples dedicated to solving some of a problems, unfortunately not my problem. Man pages and reference are only little more then code browsing. Tutorials explain in brief what I don't need to know. In summary: typical situation when you are tasked with something that is off main stream.

Quoted 5 lines

I have an inkling that I should prepare UCB1400.conf file to define control elements that map to the registers (how ?). Then I should be able to snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
around: something like making ioctl() call on a driver directly w/o libasound. I'm in lost.

You have to implement an accessor (e.g. via ALSA control API) to the certain ac97 registers in the driver. There is no generic interface allowing you to access the all ac97 registers.
(The proc file is an exception. It's provided only for debugging
purpose.)

Takashi

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#5 lore raw
In reply to alasinski
Quoted 5 lines · alasinski

I need to do IO specific operation from UCB1400 on Snapper Arm board. This has to be done from C code as it is part of a larger project. All what I need is to be able to read and write content of the few vendor specific AC97 codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

Did you read the "Writing an ALSA driver" document? It sounds like you just want simple mixer controls (change the value of the codec register when user toggles a mixer control)? Look at any existing ALSA driver for an example.

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#2 lore raw
In reply to Takashi Iwai

Thx Takashi,

since I'm not being well frased in ALSA terminology I need some guidance:
- what "accessor" is ?
- Is it part of the driver or asoundlib ?
- what ALSA files, calls are involved ?
- where can I find some explanation on it ?
- do you have a sample that implements other (similar ?) accessor ?

cheers
-al

"Takashi Iwai" <[email protected]> wrote in message
news:s5hbquwb7f0.wl%[email protected]...

Quoted 53 lines

At Thu, 20 Apr 2006 11:05:38 -0400,

Quoted 34 lines · alasinski

Hi,

I need to do IO specific operation from UCB1400 on Snapper Arm board. This
has to be done from C code as it is part of a larger project. All what I need is to be able to read and write content of the few vendor specific AC97
codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

I have ALSA installed and running with simple programs that can successfully
open controller with snd_ctl_open () and list available control elements. This is basically J.C.Georgas sample I found. I can read content of all AC97
registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures me
that all driver and lib parts are working. All what I need is to write a simple piece of code ....

However, I spent 2 days reading through ALSA back and forth and I find this
task very daunting to say at least. For one things I was not able to find an
architecture document explaining how parts of ALSA work, to be able to find
some sort of direction. There are samples dedicated to solving some of a problems, unfortunately not my problem. Man pages and reference are only little more then code browsing. Tutorials explain in brief what I don't need
to know. In summary: typical situation when you are tasked with something that is off main stream.

Quoted 6 lines

I have an inkling that I should prepare UCB1400.conf file to define control
elements that map to the registers (how ?). Then I should be able to snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
around: something like making ioctl() call on a driver directly w/o libasound. I'm in lost.

You have to implement an accessor (e.g. via ALSA control API) to the certain ac97 registers in the driver. There is no generic interface allowing you to access the all ac97 registers.
(The proc file is an exception. It's provided only for debugging purpose.)

Takashi

Quoted 6 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#6 lore raw

Re: How to access vendor specific AC97 codec register?

In reply to Lee Revell

Thx Lee,

I have looked at pxa2xx-ac97.c driver. It provides generic functions to read/write any ac97 register: pxa2xx_ac97_read/write that are made available to generic ac97_codec with snd_ac97_bus() call. My problem is I don't know how to invoke those functions with proper arguments from application level. It all goes through the generic concept of element I suppose. I fail to correlate element value with a particular register I want. So far I'm lead to believe that there is no need to change a driver, perhaps only do configuration on asoundlib.

Do you see the way how to do it ?

cheers
-al

"Lee Revell" <[email protected]> wrote in message news:1145546855.3008.0.camel@mindpipe...

Quoted 16 lines · alasinski
Quoted 5 lines

I need to do IO specific operation from UCB1400 on Snapper Arm board. This has to be done from C code as it is part of a larger project. All what I need is to be able to read and write content of the few vendor specific AC97 codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

Did you read the "Writing an ALSA driver" document? It sounds like you just want simple mixer controls (change the value of the codec register when user toggles a mixer control)? Look at any existing ALSA driver for an example.

Lee

Quoted 6 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#3 lore raw
In reply to alasinski

At Thu, 20 Apr 2006 11:34:22 -0400,

Quoted 5 lines · alasinski

Thx Takashi,

since I'm not being well frased in ALSA terminology I need some guidance:
- what "accessor" is ?

I meant in a general sense. The method to access to the hardware.

Quoted 1 line

- Is it part of the driver or asoundlib ?

As written, in driver.

Quoted 1 line

- what ALSA files, calls are involved ?

Depends on your hardware.

Quoted 1 line

- where can I find some explanation on it ?

In the source code.

Quoted 1 line

- do you have a sample that implements other (similar ?) accessor ?

It should be just like other mixer elements accessing to ac97 registers.

Takashi

Quoted 69 lines

cheers
-al

"Takashi Iwai" <[email protected]> wrote in message
news:s5hbquwb7f0.wl%[email protected]...

Quoted 53 lines

At Thu, 20 Apr 2006 11:05:38 -0400,

Quoted 34 lines · alasinski

Hi,

I need to do IO specific operation from UCB1400 on Snapper Arm board. This
has to be done from C code as it is part of a larger project. All what I need is to be able to read and write content of the few vendor specific AC97
codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

I have ALSA installed and running with simple programs that can successfully
open controller with snd_ctl_open () and list available control elements. This is basically J.C.Georgas sample I found. I can read content of all AC97
registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures me
that all driver and lib parts are working. All what I need is to write a simple piece of code ....

However, I spent 2 days reading through ALSA back and forth and I find this
task very daunting to say at least. For one things I was not able to find an
architecture document explaining how parts of ALSA work, to be able to find
some sort of direction. There are samples dedicated to solving some of a problems, unfortunately not my problem. Man pages and reference are only little more then code browsing. Tutorials explain in brief what I don't need
to know. In summary: typical situation when you are tasked with something that is off main stream.

Quoted 6 lines

I have an inkling that I should prepare UCB1400.conf file to define control
elements that map to the registers (how ?). Then I should be able to snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
around: something like making ioctl() call on a driver directly w/o libasound. I'm in lost.

You have to implement an accessor (e.g. via ALSA control API) to the certain ac97 registers in the driver. There is no generic interface allowing you to access the all ac97 registers.
(The proc file is an exception. It's provided only for debugging purpose.)

Takashi

Quoted 6 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Quoted 10 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#7 lore raw

Re: Re: How to access vendor specific AC97 codec register?

In reply to alasinski
Quoted 6 lines · alasinski

Thx Lee,

I have looked at pxa2xx-ac97.c driver. It provides generic functions to read/write any ac97 register: pxa2xx_ac97_read/write that are made available to generic ac97_codec with snd_ac97_bus() call. My problem is I don't know how to invoke those functions with proper arguments from application level.

You will only be able to access these functions from an ad-hoc AC97 driver. Please see the UCB14xx touch driver for implementation details.

Alternatively, you could always export the vendor specific registers using sysfs. That way your user space program could read and write to the codec registers exported. I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

HTH

Liam

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#4 lore raw
In reply to Takashi Iwai

Thx Takashi,

In my case I'm using pxa2xx-ac97 driver by N.Pitre. It has pxa2xx_ac97_write(ac97, reg, val) function that can write to any register reg value val. This function is being registered with generic pci/ac97/ac97_codec layer that implements ac97 spec. ac97_codec presents it in all in unified way to the client with the concept of elements. This is where I'm loosing on my tracing through the code and things becoming boor. I'm led to believe that driver is generic enough to handle any register call if I can find a way to request it. Does this picture make sense ?

cheers
-al

"Takashi Iwai" <[email protected]> wrote in message
news:s5h64l4b5nh.wl%[email protected]...

Quoted 127 lines

At Thu, 20 Apr 2006 11:34:22 -0400,

Quoted 5 lines · alasinski

Thx Takashi,

since I'm not being well frased in ALSA terminology I need some guidance:
- what "accessor" is ?

I meant in a general sense. The method to access to the hardware.

Quoted 1 line

- Is it part of the driver or asoundlib ?

As written, in driver.

Quoted 1 line

- what ALSA files, calls are involved ?

Depends on your hardware.

Quoted 1 line

- where can I find some explanation on it ?

In the source code.

Quoted 1 line

- do you have a sample that implements other (similar ?) accessor ?

It should be just like other mixer elements accessing to ac97 registers.

Takashi

Quoted 82 lines

cheers
-al

"Takashi Iwai" <[email protected]> wrote in message
news:s5hbquwb7f0.wl%[email protected]...

Quoted 64 lines

At Thu, 20 Apr 2006 11:05:38 -0400,

Quoted 45 lines · alasinski

Hi,

I need to do IO specific operation from UCB1400 on Snapper Arm board. This
has to be done from C code as it is part of a larger project. All what I
need is to be able to read and write content of the few vendor specific
AC97
codec registers: 0x5A,0x5C. I'm not interested with any other ALSA functionality.

I have ALSA installed and running with simple programs that can successfully
open controller with snd_ctl_open () and list available control elements.
This is basically J.C.Georgas sample I found. I can read content of all
AC97
registers by cat /proc/asound/card0/codec97#/ac97#0-0+regs. That assures
me
that all driver and lib parts are working. All what I need is to write a
simple piece of code ....

However, I spent 2 days reading through ALSA back and forth and I find this
task very daunting to say at least. For one things I was not able to find
an
architecture document explaining how parts of ALSA work, to be able to find
some sort of direction. There are samples dedicated to solving some of a
problems, unfortunately not my problem. Man pages and reference are only
little more then code browsing. Tutorials explain in brief what I don't
need
to know. In summary: typical situation when you are tasked with something
that is off main stream.

Quoted 6 lines

I have an inkling that I should prepare UCB1400.conf file to define control
elements that map to the registers (how ?). Then I should be able to snd_ctl_elem_read() or .._write() to them. Perhaps there is other way
around: something like making ioctl() call on a driver directly w/o libasound. I'm in lost.

You have to implement an accessor (e.g. via ALSA control API) to the certain ac97 registers in the driver. There is no generic interface allowing you to access the all ac97 registers.
(The proc file is an exception. It's provided only for debugging purpose.)

Takashi

Quoted 8 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Quoted 12 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Quoted 6 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#8 lore raw

Re: Re: How to access vendor specific AC97 codec register?

In reply to Liam Girdwood

At Thu, 20 Apr 2006 17:13:47 +0100,

Quoted 5 lines · Liam Girdwood

Alternatively, you could always export the vendor specific registers using sysfs. That way your user space program could read and write to the codec registers exported. I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

Well, I don't think sysfs as an API is a good idea although you can use it as a simple workaround...

Takashi

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#9 lore raw

Re: Re: How to access vendor specific AC97 codec register?

Quoted 11 lines · Takashi Iwai

At Thu, 20 Apr 2006 17:13:47 +0100,

Quoted 5 lines · Liam Girdwood

Alternatively, you could always export the vendor specific registers using sysfs. That way your user space program could read and write to the codec registers exported. I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

Well, I don't think sysfs as an API is a good idea although you can use it as a simple workaround...

Agreed, I really only use it for testing. Although, a standard AC97 gpio API would be nice (if anyone has the time to add one).

Liam

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#10 lore raw

Re: Re: How to access vendor specific AC97 codecregister?

In reply to Liam Girdwood

Thx Liam,

Quoted 2 lines

You will only be able to access these functions from an ad-hoc AC97 driver. Please see the UCB14xx touch driver for implementation details.

- where I can find it ?

Quoted 4 lines

Alternatively, you could always export the vendor specific registers using sysfs. That way your user space program could read and write to the codec registers exported. I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

How to go about using sysfs() to access to registers ? It provides info on file system equivalent to /proc/filesystems content I'm told. I know of one way to do it: I can map registers into user space with open("/dev/mem",...) followed by mmap (...). Then I'm a king and can read/write to any of them. This is actually my fallback plan if ALSA proves to be to difficult (which start looking right now). Interacting with registers directly from a user program is not a recommended way: first timing become an issue, secondly I'm afraid of unexpected interaction with a driver that is already loaded, thirdly there is an initialization stuff that needs to be done on UCB1400 as part of generic AC97 "bring to life" that I would rather delegate to ALSA driver rather then go over it all myself.

Quoted 2 lines

I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

Did you handled AC97 initialization yourself, or you relied on other driver (exp: ALSA) ?

cheers
-al

"Liam Girdwood" <[email protected]> wrote in message news:[email protected]...

Quoted 27 lines · alasinski
Quoted 9 lines

Thx Lee,

I have looked at pxa2xx-ac97.c driver. It provides generic functions to read/write any ac97 register: pxa2xx_ac97_read/write that are made available
to generic ac97_codec with snd_ac97_bus() call. My problem is I don't know
how to invoke those functions with proper arguments from application level.

You will only be able to access these functions from an ad-hoc AC97 driver. Please see the UCB14xx touch driver for implementation details.

Alternatively, you could always export the vendor specific registers using sysfs. That way your user space program could read and write to the codec registers exported. I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

HTH

Liam

Quoted 6 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#11 lore raw

Re: Re: Re: How to access vendor specific AC97 codecregister?

Quoted 5 lines · alasinski

Thx Liam,

Quoted 2 lines

You will only be able to access these functions from an ad-hoc AC97 driver. Please see the UCB14xx touch driver for implementation details.

- where I can find it ?

Please use Google.

Quoted 5 lines
Quoted 5 lines

Alternatively, you could always export the vendor specific registers using sysfs. That way your user space program could read and write to the codec registers exported. I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

As Takashi said this is really not a standard way to do this. Your probably better of writing your own driver to handle your codec GPIO needs.

Quoted 4 lines

How to go about using sysfs() to access to registers ? It provides info on file system equivalent to /proc/filesystems content I'm told. I know of one way to do it: I can map registers into user space with open("/dev/mem",...) followed by mmap (...). Then I'm a king and can read/write to any of them.

This wont work for AC97 codec registers as they are not part of the host memory map and are accessed via the hosts AC97 controller.

Quoted 5 lines
Quoted 2 lines

I've done this with the codec GPIO status register (0x54) for the WM97xx touch drivers.

Did you handled AC97 initialization yourself, or you relied on other driver (exp: ALSA) ?

I used the standard Alsa AC97 codec driver and every thing works fine for me.

Liam

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#12 lore raw

Re: Re: Re: How to access vendor specific AC97codecregister?

Quoted 5 lines · Liam Girdwood
Quoted 3 lines
Quoted 2 lines

You will only be able to access these functions from an ad-hoc AC97 driver. Please see the UCB14xx touch driver for implementation details.

- where I can find it ?

Please use Google.

Your Google must be better then mine. But I don't give up, I'm still looking. For sure UCB14xx leads nowhere. Little hint could go long way.

Quoted 11 lines
Quoted 8 lines

How to go about using sysfs() to access to registers ? It provides info on
file system equivalent to /proc/filesystems content I'm told. I know of one
way to do it: I can map registers into user space with open("/dev/mem",...)
followed by mmap (...). Then I'm a king and can read/write to any of them.

This wont work for AC97 codec registers as they are not part of the host memory map and are accessed via the hosts AC97 controller.

It should. What I intended to do is make same calls as pxa2xx_ac97_read. It talks to memory mapped AC97 codec registers to obtain content of UCB1400 registers. They appear to be mapped 1 to 1 with gsr_bit toggled as a handshake protocol.

Is sysfs() going to be more helpfull ?

cheers
-al

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#13 lore raw

Re: Re: Re: Re: How to access vendor specific AC97codecregister?

Quoted 10 lines · alasinski
Quoted 5 lines · Liam Girdwood
Quoted 3 lines
Quoted 2 lines

You will only be able to access these functions from an ad-hoc AC97 driver. Please see the UCB14xx touch driver for implementation details.

- where I can find it ?

Please use Google.

Your Google must be better then mine. But I don't give up, I'm still looking. For sure UCB14xx leads nowhere. Little hint could go long way.

Google for "linux ucb touchscreen driver"

Also look in drivers/mfd/

Quoted 8 lines
Quoted 3 lines

This wont work for AC97 codec registers as they are not part of the host memory map and are accessed via the hosts AC97 controller.

It should. What I intended to do is make same calls as pxa2xx_ac97_read. It talks to memory mapped AC97 codec registers to obtain content of UCB1400 registers. They appear to be mapped 1 to 1 with gsr_bit toggled as a handshake protocol.

I'm afraid it's not a simple as that (only register 0x54 can work this way - see pxa manual on AC97 slot 12). You still have to check and clear the command and status done bits in GSR. You will also have to manage access with the audio driver as only one read/write can take place at a time over the AC97 link. I'm not sure how your going to use your mmap vm_ops to do all this.

Quoted 2 lines

Is sysfs() going to be more helpfull ?

It depends on what your trying to do.

Liam

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#14 lore raw

Re: Re: Re: Re: How to access vendor specificAC97codecregister?

Quoted 4 lines
Quoted 2 lines

Your Google must be better then mine. But I don't give up, I'm still looking. For sure UCB14xx leads nowhere. Little hint could go long way.

Google for "linux ucb touchscreen driver"
Also look in drivers/mfd/

OK, I have: drivers/mfd/ucb1x00*.* I will look at those. Thx

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines

This wont work for AC97 codec registers as they are not part of the host
memory map and are accessed via the hosts AC97 controller.

It should. What I intended to do is make same calls as pxa2xx_ac97_read. It
talks to memory mapped AC97 codec registers to obtain content of UCB1400 registers. They appear to be mapped 1 to 1 with gsr_bit toggled as a handshake protocol.

Quoted 6 lines

I'm afraid it's not a simple as that (only register 0x54 can work this way - see pxa manual on AC97 slot 12). You still have to check and clear the command and status done bits in GSR. You will also have to manage access with the audio driver as only one read/write can take place at a time over the AC97 link. I'm not sure how your going to use your mmap vm_ops to do all this.

I'm not sure either. If pxa2xx_ac97_read() can do it (remenber /proc/...regs where all registers are listed?), why applying same strategy in a user code would fail ? At that point I will just cobble some code and let it try. As far interference with existing ALSA it may be tricky. I will find out a hard way, I'm afraid. Will keep you posted. Thx.

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642