Cirrus Logic Audio Card and PWM - Raspberry Pi Forums


hello all,

have raspberry pi 2 cirrus logic audio card running raspbian distro provided cirrus logic. interested in enabling pwm output of clac. done entirely in wm5102, unsure of best way go writing correct values correct registers make chip right thing.

needs happen @ chip level input of pwm generator input assigned appropriate aif bus, , appropriate wm5102 (not rpi!) gpio pin assigned pwm generator. there's more that, 2 things critical steps.

these documented in wm5102 spec sheet (rev 4.2) page 94 (pwm) , page 199 (gpio).

there's several ways this, i'm loathe start cramming data down spi bus , hope hit right thing.

had kind of put on burner time back, assuming require in-depth poking around in kernel-level functionality, in nosing around sysfs other day, spotted appear user-level exposures these things:

code: select all

root@raspberrypi:/sys# find . -name "arizona*" ./bus/spi/drivers/arizona ./bus/platform/devices/arizona-pwm ./bus/platform/devices/arizona-gpio ./bus/platform/devices/arizona-ldo1 ./bus/platform/devices/arizona-micsupp ./bus/platform/devices/arizona-extcon ./bus/platform/devices/arizona-haptics ./bus/platform/drivers/arizona-gpio ./bus/platform/drivers/arizona-gpio/arizona-gpio ./bus/platform/drivers/arizona-ldo1 ./bus/platform/drivers/arizona-ldo1/arizona-ldo1 ./bus/platform/drivers/arizona-micsupp ./bus/platform/drivers/arizona-micsupp/arizona-micsupp ./devices/soc/3f204000.spi/spi_master/spi0/spi0.1/arizona-pwm ./devices/soc/3f204000.spi/spi_master/spi0/spi0.1/arizona-gpio ./devices/soc/3f204000.spi/spi_master/spi0/spi0.1/arizona-ldo1 ./devices/soc/3f204000.spi/spi_master/spi0/spi0.1/arizona-micsupp ./devices/soc/3f204000.spi/spi_master/spi0/spi0.1/arizona-extcon ./devices/soc/3f204000.spi/spi_master/spi0/spi0.1/arizona-haptics ./module/arizona_spi ./module/snd_soc_core/holders/arizona_micsupp ./module/regmap_spi/holders/arizona_spi ./module/arizona_ldo1 ./module/arizona_micsupp 
of interest, of course, "arizona-gpio" , "arizona-pwm" entries.

question is: of these usable manipulate pwm generator and/or gpio pins on wm5102, , if so, how? in /sys/class/gpio "gpiochip507" entry. if export against that:

code: select all

root@raspberrypi:/home/pi# cd /sys/class/gpio/ root@raspberrypi:/sys/class/gpio# echo 507 > export root@raspberrypi:/sys/class/gpio# ls export	gpio507  gpiochip0  gpiochip507  unexport root@raspberrypi:/sys/class/gpio# cd gpio507 root@raspberrypi:/sys/class/gpio/gpio507# ls -la total 0 drwxr-xr-x 2 root root    0 sep 29 16:14 . drwxr-xr-x 4 root root    0 sep 29 15:41 .. -rw-r--r-- 1 root root 4096 sep 29 16:14 active_low lrwxrwxrwx 1 root root    0 sep 29 16:14 device -> ../../../arizona-gpio -rw-r--r-- 1 root root 4096 sep 29 16:14 direction lrwxrwxrwx 1 root root    0 sep 29 16:14 subsystem -> ../../../../../../../../../class/gpio -rw-r--r-- 1 root root 4096 sep 29 16:14 uevent -rw-r--r-- 1 root root 4096 sep 29 16:14 value 
"gpio507/device" symlinks "arizona-gpio", somewhere has been mapped. fine fundamental gpio stuff, useless writing control register gpio on wm5102. or wrong here?

shorter form of question is: in order write correct values control registers of wm5102 on clac, going need directly spi bus, or there way of utilizing objects in sysfs perform these functions me?

or, of course, there third, fourth, or fifth way haven't thought of yet? ;)

advance,
--thom rounds



raspberrypi



Comments