flash调试-用adb通过sysfs点亮flash

通过sysfs启用Flash和Torch LEDs:
1. Echo a nonzero number into the brightness node to configure the current.
2. Echo 1 into the switch’s regulator node to enable the Flash regulator (BoB).
3. Echo 1 into the switch’s brightness node.

切换节点有两个:
1.  Switch_0 for LED0/1
2.  Switch_1 for LED2

每次重新触发Flash/Torch时,必须重置当前值。(重启一下便可)

运行以下命令来测试每个flash:

adb shell "echo 1000 > /sys/class/leds/led:flash_0/brightness"
adb shell "echo 1 > /sys/class/leds/led:switch_0/brightness"

运行以下命令来启用两个前端flash:

adb shell "echo 500 > /sys/class/leds/led:flash_0/brightness"
adb shell "echo 500 > /sys/class/leds/led:flash_1/brightness"
adb shell "echo 1 > /sys/class/leds/led:switch_0/brightness"

运行以下命令来禁用两个前端flash:

adb shell "echo 0 > /sys/class/leds/led:switch_0/brightness"

运行以下命令打开torch:

adb shell "echo 100 > /sys/class/leds/led:torch_0/brightness"
adb shell "echo 100 > /sys/class/leds/led:torch_1/brightness"
adb shell "echo 1 > /sys/class/leds/led:switch_0/brightness"

led:switch node:开关节点可以同时打开或关闭多个led。为了简化操作,LED开关节点从其他节点获得多个现有属性。LED开关节点是可选的,以保持向后兼容性。

相关文件:

kernel/drivers/leds/leds-qpnp-flash-v2.

猜你喜欢

转载自blog.csdn.net/qq_36247447/article/details/108172121