3 Replies Latest reply on Apr 2, 2016 10:13 AM by shabaz

    Control of LEDs on Cirrus Logic Audio Card




      Can we control the LEDs on the Cirrus Logic Audio Card?  There is a green one and a red one. My interest was piqued by noticing this line:


      # vcdbg log msg


      dtparam: pwr_led_gpio=35


      However /sys/class/leds contains only the 2 standard LEDs (on the Raspberry Pi itself).  Perhaps I was dreaming thinking I'd find them listed there...




        • Re: Control of LEDs on Cirrus Logic Audio Card

          It isn't advised, the schematics are here:

          Cirrus Logic Audio Card for B+ and A+ Onwards Schematics

          From that you can see that one is hard-wired to a supply rail, and although the other does go to a GPIO connection, it is marked

          '2 wire' and '3 wire' in the schematic, so it could be an activity indicator for I2C or some other serial bus activity (I've not checked the detail to see how the card is configured, because I don't use this board).

          1 of 1 people found this helpful
            • Re: Control of LEDs on Cirrus Logic Audio Card

              Thanks shabaz:

              I was just looking at the schematics, and I agree the green one seems hard-wired to the 3.3v rail, so will always be on.  Bah.  Better news, though - I just got the red one under control:

              echo 23 > /sys/class/gpio/export

              and it now appears in /sys/class/gpio/gpio23/ - so it can be turned into an "output" pin with:

              echo out > /sys/class/gpio/gpio23/direction

              and then turned on / off with:

              echo 0 > /sys/class/gpio/gpio23/value

              echo 1 > /sys/class/gpio/gpio23/value

              Disappointingly, though, the /sys/class/gpio/gpio23/ directory doesn't have the nifty "trigger" functionality that's  available for the leds in /sys/class/leds/  so I can't make it "heartbeat" when recording, which would be very useful (headless operation, so I need all the output devices I can get).  I wonder how a gpio pin gests "registered" as a candidate to live in /sys/class/leds/ ? I am way out of my depth.


              I note your point about it potentially interfering with other things, but it seems like all the fiddling I've done with gpio23 hasn't affected the ongoing recording I am doing.  (I can't say for playback, I don't do playback).  Audio recording is clean, and nothing in dmesg...