Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176329
b: refs/heads/master
c: 4eb174b
h: refs/heads/master
i:
  176327: 00bbe59
v: v3
  • Loading branch information
Michael Hennerich authored and Linus Torvalds committed Dec 15, 2009
1 parent c4896be commit a1543c8
Show file tree
Hide file tree
Showing 5 changed files with 739 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00b55864bb37200d7f05143c44f5e2edfc8c4578
refs/heads/master: 4eb174bee6f8623fed1af0072f1bebfc3b513a52
57 changes: 57 additions & 0 deletions trunk/Documentation/misc-devices/ad525x_dpot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---------------------------------
AD525x Digital Potentiometers
---------------------------------

The ad525x_dpot driver exports a simple sysfs interface. This allows you to
work with the immediate resistance settings as well as update the saved startup
settings. Access to the factory programmed tolerance is also provided, but
interpretation of this settings is required by the end application according to
the specific part in use.

---------
Files
---------

Each dpot device will have a set of eeprom, rdac, and tolerance files. How
many depends on the actual part you have, as will the range of allowed values.

The eeprom files are used to program the startup value of the device.

The rdac files are used to program the immediate value of the device.

The tolerance files are the read-only factory programmed tolerance settings
and may vary greatly on a part-by-part basis. For exact interpretation of
this field, please consult the datasheet for your part. This is presented
as a hex file for easier parsing.

-----------
Example
-----------

Locate the device in your sysfs tree. This is probably easiest by going into
the common i2c directory and locating the device by the i2c slave address.

# ls /sys/bus/i2c/devices/
0-0022 0-0027 0-002f

So assuming the device in question is on the first i2c bus and has the slave
address of 0x2f, we descend (unrelated sysfs entries have been trimmed).

# ls /sys/bus/i2c/devices/0-002f/
eeprom0 rdac0 tolerance0

You can use simple reads/writes to access these files:

# cd /sys/bus/i2c/devices/0-002f/

# cat eeprom0
0
# echo 10 > eeprom0
# cat eeprom0
10

# cat rdac0
5
# echo 3 > rdac0
# cat rdac0
3
14 changes: 14 additions & 0 deletions trunk/drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ menuconfig MISC_DEVICES

if MISC_DEVICES

config AD525X_DPOT
tristate "Analog Devices AD525x Digital Potentiometers"
depends on I2C && SYSFS
help
If you say yes here, you get support for the Analog Devices
AD5258, AD5259, AD5251, AD5252, AD5253, AD5254 and AD5255
digital potentiometer chips.

See Documentation/misc-devices/ad525x_dpot.txt for the
userspace interface.

This driver can also be built as a module. If so, the module
will be called ad525x_dpot.

config ATMEL_PWM
tristate "Atmel AT32/AT91 PWM support"
depends on AVR32 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

obj-$(CONFIG_IBM_ASM) += ibmasm/
obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/
obj-$(CONFIG_AD525X_DPOT) += ad525x_dpot.o
obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o
obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o
obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o
Expand Down
Loading

0 comments on commit a1543c8

Please sign in to comment.