This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
resources:tools-software:linux-drivers:regulator:ad5398 [05 Sep 2012 14:17] Michael Hennerich [Status] |
resources:tools-software:linux-drivers:regulator:ad5398 [11 Feb 2016 21:16] Lars-Peter Clausen [Status] |
||
---|---|---|---|
Line 17: | Line 17: | ||
===== Status ===== | ===== Status ===== | ||
- | ^ Source ^ Mainlined? ^ | + | ^ Source ^ Mainlined? ^ |
- | | [[git.linux.org>drivers/regulator/ad5398.c|git]] | [[git.linux.org>drivers/regulator/ad5398.c|Yes]] | | + | | [[git.linux.org>drivers/regulator/ad5398.c|git]] | [[git.linux.org>drivers/regulator/ad5398.c|Yes]] | |
===== Files ===== | ===== Files ===== | ||
Line 30: | Line 30: | ||
"make qconfig") | "make qconfig") | ||
- | <note> | + | <WRAP round help> |
The AD5398/AD5821 Driver depends on **CONFIG_I2C** | The AD5398/AD5821 Driver depends on **CONFIG_I2C** | ||
- | </note> | + | </WRAP> |
Select voltage and current regulator framework support and enable AD5398/AD5821 driver. Don't forget to select virtual regulator consumer and userspace regulator consumer as module. Because AD5398 driver is loaded after I2C bus finish initialization at kernel booting, built-in consumers may be loaded earlier and find supply in AD5398 driver is not available. | Select voltage and current regulator framework support and enable AD5398/AD5821 driver. Don't forget to select virtual regulator consumer and userspace regulator consumer as module. Because AD5398 driver is loaded after I2C bus finish initialization at kernel booting, built-in consumers may be loaded earlier and find supply in AD5398 driver is not available. | ||
Line 63: | Line 63: | ||
Check regulator driver initialization information at kernel booting. | Check regulator driver initialization information at kernel booting. | ||
- | <box 100% green|shell prompt running on the target> | + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> | ||
regulator: core version 0.5 | regulator: core version 0.5 | ||
Line 70: | Line 70: | ||
ad5398 0-000c: ad5398 regulator driver loaded | ad5398 0-000c: ad5398 regulator driver loaded | ||
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc01400 | i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc01400 | ||
- | </xterm></box> | + | </xterm></WRAP> |
Check if AD5398 is probed properly. | Check if AD5398 is probed properly. | ||
- | <box 100% green|shell prompt running on the target> | + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> | ||
root:/> ls -l sys/class/regulator/regulator.0/ | root:/> ls -l sys/class/regulator/regulator.0/ | ||
Line 103: | Line 103: | ||
root:/> cat sys/class/regulator/regulator.0/state | root:/> cat sys/class/regulator/regulator.0/state | ||
disabled | disabled | ||
- | </xterm></box> | + | </xterm></WRAP> |
Insert virtual consumer driver module and check usability. | Insert virtual consumer driver module and check usability. | ||
- | <box 100% green|shell prompt running on the target> | + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> | ||
root:/> modprobe virtual | root:/> modprobe virtual | ||
Line 131: | Line 131: | ||
root:/> cat sys/devices/platform/reg-virt-consumer.0/max_microamps | root:/> cat sys/devices/platform/reg-virt-consumer.0/max_microamps | ||
120000 | 120000 | ||
- | </xterm></box> | + | </xterm></WRAP> |
Insert user space consumer driver module and check usability. | Insert user space consumer driver module and check usability. | ||
- | <box 100% green|shell prompt running on the target> | + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
<xterm> | <xterm> | ||
root:/> modprobe userspace-consumer | root:/> modprobe userspace-consumer | ||
Line 154: | Line 154: | ||
root:/> cat sys/devices/platform/reg-userspace-consumer.0/state | root:/> cat sys/devices/platform/reg-userspace-consumer.0/state | ||
enabled | enabled | ||
- | </xterm></box> | + | </xterm></WRAP> |
- | <note tip>To control ADC to output a given current, you only need to set the value to sysfs entry min_microamps in virtual consumer platform device. The driver adjusts the output according to the min current value received.</note> | + | <WRAP tip>To control ADC to output a given current, you only need to set the value to sysfs entry min_microamps in virtual consumer platform device. The driver adjusts the output according to the min current value received.</WRAP> |