Onboard LEDs connected to the RK805-1 out1 and out2 GPIO pins
#4
I have found that I can control them by bypassing the driver and directly writing to the chip registers. The RK805 is connected to i2c-1 with address 0x18 and the two GPIOs can be controlled by the two lowest bits in register 0x52.

They are low-active, so to turn them both off write 3 to the register (binary 0b00000011):


Code:
i2cset -f -y 1 0x18 0x52 3



and to turn them on set the corresponding bit to 0, so by writing any of the numbers 0, 1, 2, 3 to that register both LEDs can be controlled.

But this is not the proper way to do it!

I had to use -f because the rk808 driver is already using that bus address! I'm interfering with its function in a very dangerous way by issuing commands directly to the chip behind the driver's back. And it is the power supply chip, I guess I could wreak havok by accidentally changing one of the output voltages, I would rather not mess around on the i2c of this chip directly.
Is here somebody who knows enough about the rk808 driver to tell me the proper way to control these two bits in the out register of the chip or whether they are already registered in the sysfs as a gpio under some other obscure name that I did not find? Where should I look next?

there is also /sys/bus/platform/devices/rk8xx-gpio which belongs to this driver but I have no idea how it works and how to use it.

writing 0b11 to this register to turn them off will even survive a warm reboot! The LEDs are still off!
So neither the rk808 driver nor anything else will even try to initialize them, they don't seem to be controlled by anything at the moment, despite the entries in the device tree.
  Reply


Messages In This Thread
RE: Onboard LEDs connected to the RK805-1 out1 and out2 GPIO pins - by prof7bit - 02-25-2018, 03:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock64 Rev3 doesn't boot and leds blinking fast dishins 6 7,906 06-30-2022, 06:28 PM
Last Post: rookie_267
  need a dts file to set some pins as pulldown interrupts in kernel using a DTO dkebler 0 2,047 02-05-2020, 10:58 PM
Last Post: dkebler
  Gpio error wile using GPIOtest.py Aditya Rastogi 0 1,939 01-31-2019, 02:41 AM
Last Post: Aditya Rastogi
  Migrate Linux from microSD to onboard eMMC elik745i 7 10,024 11-03-2018, 08:23 AM
Last Post: mara
  Memory addresses of GPIO pins AckRite 3 5,024 10-23-2018, 03:18 PM
Last Post: AckRite
  GPIO indicators via DTB Mentaluproar 0 1,510 07-10-2018, 04:58 PM
Last Post: Mentaluproar
  RFLink connected to /dev/ttyUSB0 not working ulysse132 9 9,573 05-17-2018, 01:15 PM
Last Post: Rocklobster
  Onboard IR receiver plambe 3 4,373 03-01-2018, 04:28 AM
Last Post: plambe
  What is name of gpio hardware on a rock64? gene83 6 6,694 10-05-2017, 07:57 AM
Last Post: gene83

Forum Jump:


Users browsing this thread: 1 Guest(s)