The fixed regulator voltage driver can be used to control these chips. Please connect the ENable switch pin to any available GPIO port on your CPU. This driver adapts to voltage and current regulator framework in Linux kernel.
Function | File |
---|---|
driver | drivers/regulator/fixed.c |
include | include/linux/regulator/fixed.h |
The default platform info defined in bf537-stamp board file is for ad122. If you want to customize this driver for other switch only regulator, you should revise the platform information accordingly.
Enable generic GPIO lib in kernel option.
Device Drivers ---> [*] GPIO Support --->
Select voltage and current regulator framework support and enable adp_switch driver. Don't forget to select userspace regulator consumer driver as a module. adp_switch driver is initialized after userspace consumer driver, if both are built into kernel.
Device Drivers ---> [*] Voltage and Current Regulator Support ---> <*> Fixed voltage regulator support <*> Userspace regulator consumer support
Check regulator driver initialization information at kernel booting.
regulator: core version 0.5 regulator: adp122: 2500 mV
Check if adp122 is probed properly.
root:/> ls sys/class/regulator/ regulator.0 root:/> ls sys/class/regulator/regulator.0/ device name power subsystem uevent microvolts num_users state type root:/> cat sys/class/regulator/regulator.0/name adp122 root:/> cat sys/class/regulator/regulator.0/type voltage root:/> cat sys/class/regulator/regulator.0/microvolts 2500000 root:/> cat sys/class/regulator/regulator.0/state disabled root:/> cat sys/class/regulator/regulator.0/num_users 0
Insert user space consumer driver module and check usability.
root:/> modprobe userspace-consumer root:/> ls sys/devices/platform/reg-userspace-consumer.0/ driver power microamps_requested_adp122 state modalias subsystem name uevent root:/> cat sys/devices/platform/reg-userspace-consumer.0/name adp122 root:/> cat sys/devices/platform/reg-userspace-consumer.0/state disabled root:/> echo enabled > sys/devices/platform/reg-userspace-consumer.0/state root:/> cat sys/devices/platform/reg-userspace-consumer.0/state enabled
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !