staging: iio: ADI drivers for staging-next
Subsystems (4)
cover staging: iio: ADI drivers for staging-next
I've rebased all the drivers onto staging-next. I've only fixed the API breakage due to the changes made after 2.6.36 (and fixed a few warnings). I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided with regards to driver correctness or direction. That stuff I'm leaving up to Michael Hennerich since it's his job and he actually understands this.
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". We will still look into feedback given, but we'd like to focus on that rather than random sed changes as API names change.
This patchset supersedes all other "new driver" patches I've posted in the last 48 hours.
Barry Song (16):
staging: iio: new adis16201 driver
staging: iio: new adis16203 driver
staging: iio: new adis16204 driver
staging: iio: adc: new driver for AD7150/1/6 devices
staging: iio: adc: new driver for AD7152/3 devices
staging: iio: adc: new driver for AD7745/6/7 devices
staging: iio: gyro: new driver for ADIS16261 devices
staging: iio: gyro: new driver for ADIS16060 digital output gyros
staging: iio: gyro: new driver for ADIS16080 digital output gyros
staging: iio: gyro: new driver for ADIS16130 digital output gyros
staging: iio: dac: new driver for AD5624R devices
staging: iio: meter: new driver for ADE7753/6 devices
staging: iio: meter: new driver for ADE7754 devices
staging: iio: meter: new driver for ADE7758 devices
staging: iio: meter: new driver for ADE7759 devices
staging: iio: meter: new driver for ADE7854/58/68/78 devices
Cliff Cai (6):
staging: iio: dds: new driver for AD5930/2 devices
staging: iio: dds: new driver for AD9832/3/4/5 devices
staging: iio: dds: new driver for AD9850/1 devices
staging: iio: dds: new driver for AD9852/4 devices
staging: iio: dds: new driver for AD9910 devices
staging: iio: dds: new driver for AD9951 devices
Graf Yang (3):
staging: iio: resolver: new driver for AD2S90 devices
staging: iio: resolver: new driver for AD2S1200/1205 devices
staging: iio: resolver: new driver for AD2S1210 devices
Sonic Zhang (11):
staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver
staging: iio: adc: new driver for AD7291 devices
staging: iio: adc: new driver for AD7298 devices
staging: iio: adc: new driver for AD7314 devices
staging: iio: adc: new driver for AD7414/5 devices
staging: iio: adc: new driver for AD7416/7/8 devices
staging: iio: adc: new driver for AD7816 devices
staging: iio: adc: new driver for ADT75 temperature sensors
staging: iio: adc: new driver for ADT7310 temperature sensors
staging: iio: adc: new driver for ADT7408 temperature sensors
staging: iio: adc: new driver for ADT7410 temperature sensors
drivers/staging/iio/Kconfig | 6 +- drivers/staging/iio/Makefile | 7 +- drivers/staging/iio/accel/Kconfig | 27 + drivers/staging/iio/accel/Makefile | 12 + drivers/staging/iio/accel/accel.h | 20 + drivers/staging/iio/accel/adis16201.h | 150 ++ drivers/staging/iio/accel/adis16201_core.c | 640 +++++++ drivers/staging/iio/accel/adis16201_ring.c | 218 +++ drivers/staging/iio/accel/adis16201_trigger.c | 122 ++ drivers/staging/iio/accel/adis16203.h | 143 ++ drivers/staging/iio/accel/adis16203_core.c | 568 ++++++ drivers/staging/iio/accel/adis16203_ring.c | 211 +++ drivers/staging/iio/accel/adis16203_trigger.c | 122 ++ drivers/staging/iio/accel/adis16204.h | 151 ++ drivers/staging/iio/accel/adis16204_core.c | 613 +++++++ drivers/staging/iio/accel/adis16204_ring.c | 206 +++ drivers/staging/iio/accel/adis16204_trigger.c | 122 ++ drivers/staging/iio/adc/Kconfig | 91 + drivers/staging/iio/adc/Makefile | 15 + drivers/staging/iio/adc/ad7150.c | 877 +++++++++ drivers/staging/iio/adc/ad7152.c | 610 +++++++ drivers/staging/iio/adc/ad7291.c | 1039 +++++++++++ drivers/staging/iio/adc/ad7298.c | 501 +++++ drivers/staging/iio/adc/ad7314.c | 308 ++++ drivers/staging/iio/adc/ad7414.c | 573 ++++++ drivers/staging/iio/adc/ad7416.c | 777 ++++++++ drivers/staging/iio/adc/ad774x.c | 719 ++++++++ drivers/staging/iio/adc/ad7816.c | 538 ++++++ drivers/staging/iio/adc/adt7310.c | 951 ++++++++++ drivers/staging/iio/adc/adt7408.c | 1006 +++++++++++ drivers/staging/iio/adc/adt7410.c | 917 ++++++++++ drivers/staging/iio/adc/adt75.c | 734 ++++++++ drivers/staging/iio/addac/Kconfig | 25 + drivers/staging/iio/addac/Makefile | 7 + drivers/staging/iio/addac/adt7316-i2c.c | 169 ++ drivers/staging/iio/addac/adt7316-spi.c | 179 ++ drivers/staging/iio/addac/adt7316.c | 2402 +++++++++++++++++++++++++ drivers/staging/iio/addac/adt7316.h | 33 + drivers/staging/iio/dac/Kconfig | 11 + drivers/staging/iio/dac/Makefile | 5 + drivers/staging/iio/dac/ad5624r.h | 21 + drivers/staging/iio/dac/ad5624r_spi.c | 313 ++++ drivers/staging/iio/dac/dac.h | 6 + drivers/staging/iio/dds/Kconfig | 46 + drivers/staging/iio/dds/Makefile | 10 + drivers/staging/iio/dds/ad5930.c | 170 ++ drivers/staging/iio/dds/ad9832.c | 266 +++ drivers/staging/iio/dds/ad9850.c | 156 ++ drivers/staging/iio/dds/ad9852.c | 314 ++++ drivers/staging/iio/dds/ad9910.c | 454 +++++ drivers/staging/iio/dds/ad9951.c | 254 +++ drivers/staging/iio/gyro/Kconfig | 28 + drivers/staging/iio/gyro/Makefile | 12 + drivers/staging/iio/gyro/adis16060.h | 101 + drivers/staging/iio/gyro/adis16060_core.c | 319 ++++ drivers/staging/iio/gyro/adis16080.h | 102 ++ drivers/staging/iio/gyro/adis16080_core.c | 271 +++ drivers/staging/iio/gyro/adis16130.h | 108 ++ drivers/staging/iio/gyro/adis16130_core.c | 313 ++++ drivers/staging/iio/gyro/adis16261.h | 176 ++ drivers/staging/iio/gyro/adis16261_core.c | 770 ++++++++ drivers/staging/iio/meter/Kconfig | 61 + drivers/staging/iio/meter/Makefile | 15 + drivers/staging/iio/meter/ade7753.c | 730 ++++++++ drivers/staging/iio/meter/ade7753.h | 140 ++ drivers/staging/iio/meter/ade7754.c | 756 ++++++++ drivers/staging/iio/meter/ade7754.h | 161 ++ drivers/staging/iio/meter/ade7758.h | 171 ++ drivers/staging/iio/meter/ade7758_core.c | 866 +++++++++ drivers/staging/iio/meter/ade7758_ring.c | 212 +++ drivers/staging/iio/meter/ade7758_trigger.c | 125 ++ drivers/staging/iio/meter/ade7759.c | 670 +++++++ drivers/staging/iio/meter/ade7759.h | 122 ++ drivers/staging/iio/meter/ade7854-i2c.c | 272 +++ drivers/staging/iio/meter/ade7854-spi.c | 360 ++++ drivers/staging/iio/meter/ade7854.c | 680 +++++++ drivers/staging/iio/meter/ade7854.h | 244 +++ drivers/staging/iio/meter/meter.h | 396 ++++ drivers/staging/iio/resolver/Kconfig | 54 + drivers/staging/iio/resolver/Makefile | 7 + drivers/staging/iio/resolver/ad2s120x.c | 310 ++++ drivers/staging/iio/resolver/ad2s1210.c | 872 +++++++++ drivers/staging/iio/resolver/ad2s90.c | 159 ++ drivers/staging/iio/sysfs.h | 6 + 84 files changed, 27422 insertions(+), 2 deletions(-) create mode 100644 drivers/staging/iio/accel/adis16201.h create mode 100644 drivers/staging/iio/accel/adis16201_core.c create mode 100644 drivers/staging/iio/accel/adis16201_ring.c create mode 100644 drivers/staging/iio/accel/adis16201_trigger.c create mode 100644 drivers/staging/iio/accel/adis16203.h create mode 100644 drivers/staging/iio/accel/adis16203_core.c create mode 100644 drivers/staging/iio/accel/adis16203_ring.c create mode 100644 drivers/staging/iio/accel/adis16203_trigger.c create mode 100644 drivers/staging/iio/accel/adis16204.h create mode 100644 drivers/staging/iio/accel/adis16204_core.c create mode 100644 drivers/staging/iio/accel/adis16204_ring.c create mode 100644 drivers/staging/iio/accel/adis16204_trigger.c create mode 100644 drivers/staging/iio/adc/ad7150.c create mode 100644 drivers/staging/iio/adc/ad7152.c create mode 100644 drivers/staging/iio/adc/ad7291.c create mode 100644 drivers/staging/iio/adc/ad7298.c create mode 100644 drivers/staging/iio/adc/ad7314.c create mode 100644 drivers/staging/iio/adc/ad7414.c create mode 100644 drivers/staging/iio/adc/ad7416.c create mode 100644 drivers/staging/iio/adc/ad774x.c create mode 100644 drivers/staging/iio/adc/ad7816.c create mode 100644 drivers/staging/iio/adc/adt7310.c create mode 100644 drivers/staging/iio/adc/adt7408.c create mode 100644 drivers/staging/iio/adc/adt7410.c create mode 100644 drivers/staging/iio/adc/adt75.c create mode 100644 drivers/staging/iio/addac/Kconfig create mode 100644 drivers/staging/iio/addac/Makefile create mode 100644 drivers/staging/iio/addac/adt7316-i2c.c create mode 100644 drivers/staging/iio/addac/adt7316-spi.c create mode 100644 drivers/staging/iio/addac/adt7316.c create mode 100644 drivers/staging/iio/addac/adt7316.h create mode 100644 drivers/staging/iio/dac/Kconfig create mode 100644 drivers/staging/iio/dac/Makefile create mode 100644 drivers/staging/iio/dac/ad5624r.h create mode 100644 drivers/staging/iio/dac/ad5624r_spi.c create mode 100644 drivers/staging/iio/dac/dac.h create mode 100644 drivers/staging/iio/dds/Kconfig create mode 100644 drivers/staging/iio/dds/Makefile create mode 100644 drivers/staging/iio/dds/ad5930.c create mode 100644 drivers/staging/iio/dds/ad9832.c create mode 100644 drivers/staging/iio/dds/ad9850.c create mode 100644 drivers/staging/iio/dds/ad9852.c create mode 100644 drivers/staging/iio/dds/ad9910.c create mode 100644 drivers/staging/iio/dds/ad9951.c create mode 100644 drivers/staging/iio/gyro/adis16060.h create mode 100644 drivers/staging/iio/gyro/adis16060_core.c create mode 100644 drivers/staging/iio/gyro/adis16080.h create mode 100644 drivers/staging/iio/gyro/adis16080_core.c create mode 100644 drivers/staging/iio/gyro/adis16130.h create mode 100644 drivers/staging/iio/gyro/adis16130_core.c create mode 100644 drivers/staging/iio/gyro/adis16261.h create mode 100644 drivers/staging/iio/gyro/adis16261_core.c create mode 100644 drivers/staging/iio/meter/Kconfig create mode 100644 drivers/staging/iio/meter/Makefile create mode 100644 drivers/staging/iio/meter/ade7753.c create mode 100644 drivers/staging/iio/meter/ade7753.h create mode 100644 drivers/staging/iio/meter/ade7754.c create mode 100644 drivers/staging/iio/meter/ade7754.h create mode 100644 drivers/staging/iio/meter/ade7758.h create mode 100644 drivers/staging/iio/meter/ade7758_core.c create mode 100644 drivers/staging/iio/meter/ade7758_ring.c create mode 100644 drivers/staging/iio/meter/ade7758_trigger.c create mode 100644 drivers/staging/iio/meter/ade7759.c create mode 100644 drivers/staging/iio/meter/ade7759.h create mode 100644 drivers/staging/iio/meter/ade7854-i2c.c create mode 100644 drivers/staging/iio/meter/ade7854-spi.c create mode 100644 drivers/staging/iio/meter/ade7854.c create mode 100644 drivers/staging/iio/meter/ade7854.h create mode 100644 drivers/staging/iio/meter/meter.h create mode 100644 drivers/staging/iio/resolver/Kconfig create mode 100644 drivers/staging/iio/resolver/Makefile create mode 100644 drivers/staging/iio/resolver/ad2s120x.c create mode 100644 drivers/staging/iio/resolver/ad2s1210.c create mode 100644 drivers/staging/iio/resolver/ad2s90.c
Signature · 1 line
1.7.3.2
PATCH 1/36 staging: iio: new adis16201 driver
From: Barry Song <[email protected]>
IIO driver for dual Axis Accelerometer/inclinometer adis16201 parts.
--- drivers/staging/iio/accel/Kconfig | 9 + drivers/staging/iio/accel/Makefile | 4 + drivers/staging/iio/accel/adis16201.h | 150 ++++++ drivers/staging/iio/accel/adis16201_core.c | 640 +++++++++++++++++++++++++ drivers/staging/iio/accel/adis16201_ring.c | 218 +++++++++ drivers/staging/iio/accel/adis16201_trigger.c | 122 +++++ 6 files changed, 1143 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/accel/adis16201.h create mode 100644 drivers/staging/iio/accel/adis16201_core.c create mode 100644 drivers/staging/iio/accel/adis16201_ring.c create mode 100644 drivers/staging/iio/accel/adis16201_trigger.c
drivers/staging/iio/accel/Kconfig +9 -0
@@ -3,6 +3,15 @@ # comment "Accelerometers" +config ADIS16201 + tristate "Analog Devices ADIS16201 Dual-Axis Digital Inclinometer and Accelerometer" + depends on SPI + select IIO_TRIGGER if IIO_RING_BUFFER + select IIO_SW_RING if IIO_RING_BUFFER + help + Say yes here to build support for Analog Devices adis16201 dual-axis + digital inclinometer and accelerometer. + config ADIS16209 tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer" depends on SPI
drivers/staging/iio/accel/Makefile +4 -0
@@ -2,6 +2,10 @@ # Makefile for industrial I/O accelerometer drivers # +adis16201-y := adis16201_core.o +adis16201-$(CONFIG_IIO_RING_BUFFER) += adis16201_ring.o adis16201_trigger.o +obj-$(CONFIG_ADIS16201) += adis16201.o + adis16209-y := adis16209_core.o adis16209-$(CONFIG_IIO_RING_BUFFER) += adis16209_ring.o adis16209_trigger.o obj-$(CONFIG_ADIS16209) += adis16209.o
drivers/staging/iio/accel/adis16201.h new file +150 -0
150 lines not on this page · raw message
drivers/staging/iio/accel/adis16201_core.c new file +640 -0
640 lines not on this page · raw message
drivers/staging/iio/accel/adis16201_ring.c new file +218 -0
218 lines not on this page · raw message
drivers/staging/iio/accel/adis16201_trigger.c new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 2/36 staging: iio: new adis16203 driver
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
IIO driver for Programmable 360 Degrees Inclinometer adis16203 parts.
--- drivers/staging/iio/accel/Kconfig | 9 + drivers/staging/iio/accel/Makefile | 4 + drivers/staging/iio/accel/adis16203.h | 143 +++++++ drivers/staging/iio/accel/adis16203_core.c | 568 +++++++++++++++++++++++++ drivers/staging/iio/accel/adis16203_ring.c | 211 +++++++++ drivers/staging/iio/accel/adis16203_trigger.c | 122 ++++++ 6 files changed, 1057 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/accel/adis16203.h create mode 100644 drivers/staging/iio/accel/adis16203_core.c create mode 100644 drivers/staging/iio/accel/adis16203_ring.c create mode 100644 drivers/staging/iio/accel/adis16203_trigger.c
drivers/staging/iio/accel/Kconfig +9 -0
@@ -12,6 +12,15 @@ config ADIS16201 Say yes here to build support for Analog Devices adis16201 dual-axis digital inclinometer and accelerometer. +config ADIS16203 + tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer" + depends on SPI + select IIO_TRIGGER if IIO_RING_BUFFER + select IIO_SW_RING if IIO_RING_BUFFER + help + Say yes here to build support for Analog Devices adis16203 Programmable + 360 Degrees Inclinometer. + config ADIS16209 tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer" depends on SPI
drivers/staging/iio/accel/Makefile +4 -0
@@ -6,6 +6,10 @@ adis16201-y := adis16201_core.o adis16201-$(CONFIG_IIO_RING_BUFFER) += adis16201_ring.o adis16201_trigger.o obj-$(CONFIG_ADIS16201) += adis16201.o +adis16203-y := adis16203_core.o +adis16203-$(CONFIG_IIO_RING_BUFFER) += adis16203_ring.o adis16203_trigger.o +obj-$(CONFIG_ADIS16203) += adis16203.o + adis16209-y := adis16209_core.o adis16209-$(CONFIG_IIO_RING_BUFFER) += adis16209_ring.o adis16209_trigger.o obj-$(CONFIG_ADIS16209) += adis16209.o
drivers/staging/iio/accel/adis16203.h new file +143 -0
143 lines not on this page · raw message
drivers/staging/iio/accel/adis16203_core.c new file +568 -0
568 lines not on this page · raw message
drivers/staging/iio/accel/adis16203_ring.c new file +211 -0
211 lines not on this page · raw message
drivers/staging/iio/accel/adis16203_trigger.c new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 3/36 staging: iio: new adis16204 driver
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
IIO driver for Programmable High-g Digital Impact Sensor and Recorder.
--- drivers/staging/iio/accel/Kconfig | 9 + drivers/staging/iio/accel/Makefile | 4 + drivers/staging/iio/accel/accel.h | 20 + drivers/staging/iio/accel/adis16204.h | 151 ++++++ drivers/staging/iio/accel/adis16204_core.c | 613 +++++++++++++++++++++++++ drivers/staging/iio/accel/adis16204_ring.c | 206 +++++++++ drivers/staging/iio/accel/adis16204_trigger.c | 122 +++++ 7 files changed, 1125 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/accel/adis16204.h create mode 100644 drivers/staging/iio/accel/adis16204_core.c create mode 100644 drivers/staging/iio/accel/adis16204_ring.c create mode 100644 drivers/staging/iio/accel/adis16204_trigger.c
drivers/staging/iio/accel/Kconfig +9 -0
@@ -21,6 +21,15 @@ config ADIS16203 Say yes here to build support for Analog Devices adis16203 Programmable 360 Degrees Inclinometer. +config ADIS16204 + tristate "Analog Devices ADIS16204 Programmable High-g Digital Impact Sensor and Recorder" + depends on SPI + select IIO_TRIGGER if IIO_RING_BUFFER + select IIO_SW_RING if IIO_RING_BUFFER + help + Say yes here to build support for Analog Devices adis16204 Programmable + High-g Digital Impact Sensor and Recorder. + config ADIS16209 tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer" depends on SPI
drivers/staging/iio/accel/Makefile +4 -0
@@ -10,6 +10,10 @@ adis16203-y := adis16203_core.o adis16203-$(CONFIG_IIO_RING_BUFFER) += adis16203_ring.o adis16203_trigger.o obj-$(CONFIG_ADIS16203) += adis16203.o +adis16204-y := adis16204_core.o +adis16204-$(CONFIG_IIO_RING_BUFFER) += adis16204_ring.o adis16204_trigger.o +obj-$(CONFIG_ADIS16204) += adis16204.o + adis16209-y := adis16209_core.o adis16209-$(CONFIG_IIO_RING_BUFFER) += adis16209_ring.o adis16209_trigger.o obj-$(CONFIG_ADIS16209) += adis16209.o
drivers/staging/iio/accel/accel.h +20 -0
@@ -65,3 +65,23 @@#define IIO_DEV_ATTR_ACCEL_Z (_show, _addr) \ IIO_DEVICE_ATTR(accel_z_raw, S_IRUGO, _show, NULL, _addr) +#define IIO_DEV_ATTR_ACCEL_XY (_show, _addr) \ + IIO_DEVICE_ATTR(accel_xy, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_ACCEL_PEAK (_show, _addr) \ + IIO_DEVICE_ATTR(accel_peak, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_ACCEL_XPEAK (_show, _addr) \ + IIO_DEVICE_ATTR(accel_xpeak, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_ACCEL_YPEAK (_show, _addr) \ + IIO_DEVICE_ATTR(accel_ypeak, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_ACCEL_ZPEAK (_show, _addr) \ + IIO_DEVICE_ATTR(accel_zpeak, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_ACCEL_XYPEAK (_show, _addr) \ + IIO_DEVICE_ATTR(accel_xypeak, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_ACCEL_XYZPEAK (_show, _addr) \ + IIO_DEVICE_ATTR(accel_xyzpeak, S_IRUGO, _show, NULL, _addr)
drivers/staging/iio/accel/adis16204.h new file +151 -0
151 lines not on this page · raw message
drivers/staging/iio/accel/adis16204_core.c new file +613 -0
613 lines not on this page · raw message
drivers/staging/iio/accel/adis16204_ring.c new file +206 -0
206 lines not on this page · raw message
drivers/staging/iio/accel/adis16204_trigger.c new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 4/36 staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
IIO driver for temperature sensor, ADC and DAC devices over SPI and I2C.
--- drivers/staging/iio/Kconfig | 1 + drivers/staging/iio/Makefile | 1 + drivers/staging/iio/addac/Kconfig | 25 + drivers/staging/iio/addac/Makefile | 7 + drivers/staging/iio/addac/adt7316-i2c.c | 169 +++ drivers/staging/iio/addac/adt7316-spi.c | 179 +++ drivers/staging/iio/addac/adt7316.c | 2402 +++++++++++++++++++++++++++++++ drivers/staging/iio/addac/adt7316.h | 33 + 8 files changed, 2817 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/addac/Kconfig create mode 100644 drivers/staging/iio/addac/Makefile create mode 100644 drivers/staging/iio/addac/adt7316-i2c.c create mode 100644 drivers/staging/iio/addac/adt7316-spi.c create mode 100644 drivers/staging/iio/addac/adt7316.c create mode 100644 drivers/staging/iio/addac/adt7316.h
drivers/staging/iio/Kconfig +1 -0
@@ -42,6 +42,7 @@ config IIO_TRIGGER source "drivers/staging/iio/accel/Kconfig" source "drivers/staging/iio/adc/Kconfig" +source "drivers/staging/iio/addac/Kconfig" source "drivers/staging/iio/gyro/Kconfig" source "drivers/staging/iio/imu/Kconfig" source "drivers/staging/iio/light/Kconfig"
drivers/staging/iio/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_IIO_SW_RING) += ring_sw.o obj-y += accel/ obj-y += adc/ +obj-y += addac/ obj-y += gyro/ obj-y += imu/ obj-y += light/
drivers/staging/iio/addac/Kconfig new file +25 -0
@@ -0,0 +1,25 @@ +# +# ADDAC drivers +# +comment "Analog digital bi-direction convertors" + +config ADT7316 + tristate "Analog Devices ADT7316/7/8 ADT7516/7/9 temperature sensor, ADC and DAC driver" + help + Say yes here to build support for Analog Devices ADT7316/7/8 + and ADT7516/7/9 temperature sensors, ADC and DAC. + +config ADT7316_SPI + tristate "support SPI bus connection" + depends on SPI && ADT7316 + default y + help + Say yes here to build SPI bus support for Analog Devices ADT7316/7/8 + and ADT7516/7/9. + +config ADT7316_I2C + tristate "support I2C bus connection" + depends on I2C && ADT7316 + help + Say yes here to build I2C bus support for Analog Devices ADT7316/7/8 + and ADT7516/7/9.
drivers/staging/iio/addac/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for industrial I/O ADDAC drivers +# + +obj-$(CONFIG_ADT7316) += adt7316.o +obj-$(CONFIG_ADT7316_SPI) += adt7316-spi.o +obj-$(CONFIG_ADT7316_I2C) += adt7316-i2c.o
drivers/staging/iio/addac/adt7316-i2c.c new file +169 -0
169 lines not on this page · raw message
drivers/staging/iio/addac/adt7316-spi.c new file +179 -0
179 lines not on this page · raw message
drivers/staging/iio/addac/adt7316.c new file +2402 -0
2,402 lines not on this page · raw message
drivers/staging/iio/addac/adt7316.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* ADT7316 digital temperature sensor driver supporting ADT7316/7/8 ADT7516/7/9 +* +* Copyright 2010 Analog Devices Inc. +* +* Licensed under the GPL-2 or later. +*/ + +#ifndef _ADT7316_H_ +#define _ADT7316_H_ + +#include <linux/types.h> + +#define ADT7316_REG_MAX_ADDR 0x3F + +struct adt7316_bus { +void *client; +int irq; +int irq_flags; +int (*read) (void *client,u8 reg,u8 *data); +int (*write) (void *client,u8 reg,u8 val); +int (*multi_read) (void *client,u8 first_reg,u8 count,u8 *data); +int (*multi_write) (void *client,u8 first_reg,u8 count,u8 *data); +}; + +#ifdef CONFIG_PM +int adt7316_disable (struct device *dev); +int adt7316_enable (struct device *dev); +#endif +int adt7316_probe (struct device *dev,struct adt7316_bus *bus,const char *name); +int adt7316_remove (struct device *dev); + +#endif
Signature · 1 line
1.7.3.2
PATCH 5/36 staging: iio: adc: new driver for AD7150/1/6 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 2 + drivers/staging/iio/adc/ad7150.c | 877 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 886 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7150.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -27,6 +27,13 @@ config MAX1363_RING_BUFFER Say yes here to include ring buffer support in the MAX1363 ADC driver. +config AD7150 + tristate "Analog Devices ad7150/1/6 capacitive sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices capacitive sensors. + (ad7150, ad7151, ad7156) Provides direct access via sysfs. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +2 -0
@@ -14,3 +14,5 @@ obj-$(CONFIG_AD799X) += ad799x.o ad7476-y := ad7476_core.o ad7476-$(CONFIG_IIO_RING_BUFFER) += ad7476_ring.o obj-$(CONFIG_AD7476) += ad7476.o + +obj-$(CONFIG_AD7150) += ad7150.o
drivers/staging/iio/adc/ad7150.c new file +877 -0
877 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 6/36 staging: iio: adc: new driver for AD7152/3 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7152.c | 610 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 618 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7152.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -34,6 +34,13 @@ config AD7150 Say yes here to build support for Analog Devices capacitive sensors. (ad7150, ad7151, ad7156) Provides direct access via sysfs. +config AD7152 + tristate "Analog Devices ad7152/3 capacitive sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices capacitive sensors. + (ad7152, ad7153) Provides direct access via sysfs. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
@@ -16,3 +16,4 @@ ad7476-$(CONFIG_IIO_RING_BUFFER) += ad7476_ring.o obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD7150) += ad7150.o +obj-$(CONFIG_AD7152) += ad7152.o
drivers/staging/iio/adc/ad7152.c new file +610 -0
610 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 7/36 staging: iio: adc: new driver for AD7291 devices
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7291.c | 1039 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 1047 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7291.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -41,6 +41,13 @@ config AD7152 Say yes here to build support for Analog Devices capacitive sensors. (ad7152, ad7153) Provides direct access via sysfs. +config AD7291 + tristate "Analog Devices AD7291 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices AD7291 + temperature sensors. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD7150) += ad7150.o obj-$(CONFIG_AD7152) += ad7152.o +obj-$(CONFIG_AD7291) += ad7291.o
drivers/staging/iio/adc/ad7291.c new file +1039 -0
1,039 lines not on this page · raw message
Signature · 1 line
1.7.3.2
BUILD ISSUE: Re: [PATCH 07/36] staging: iio: adc: new driver for AD7291 devices
Quoted 1 line · Mike Frysinger
From: Sonic Zhang <[email protected]>
Build test results (cross compiled for arm) on top of staging-next
drivers/staging/iio/adc/ad7291.c: In function 'ad7291_probe':drivers/staging/iio/adc/ad7291.c:951: error: 'struct i2c_client' has no member named 'irq_flags' drivers/staging/iio/adc/ad7291.c:966: error: 'struct i2c_client' has no member named 'irq_flags'
Google tells me you guys have posted a patch adding this a couple of weeks back. Doesn't
look like Jean liked it... If it is merging you need to tell Greg that there is a dependency
on it when you send him the merge request. Otherwise just remove the usage and rely on it happening in board setup code. Personally I agree with what the patch was trying to do, but if it isn't merging we don't want to hold this driver up waiting for it.
Quoted 1,082 lines
Signed-off-by Sonic Zhang <[email protected]>Signed-off-by Mike Frysinger <[email protected]>--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7291.c | 1039 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 1047 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7291.cdrivers/staging/iio/adc/Kconfig +7
-0@@ -41,6 +41,13 @@ config AD7152 Say yes here to build support for Analog Devices capacitive sensors. (ad7152, ad7153) Provides direct access via sysfs. +config AD7291 + tristate "Analog Devices AD7291 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices AD7291 + temperature sensors. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2Cdrivers/staging/iio/adc/Makefile +1
-0@@ -17,3 +17,4 @@ obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD7150) += ad7150.o obj-$(CONFIG_AD7152) += ad7152.o +obj-$(CONFIG_AD7291) += ad7291.odrivers/staging/iio/adc/ad7291.c new file +1039
-0@@ -0,0 +1,1039 @@ +/* +* AD7291 digital temperature sensor driver supporting AD7291 +* +* Copyright 2010 Analog Devices Inc. +* +* Licensed under the GPL-2 or later. +*/ + +#include <linux/interrupt.h> +#include <linux/gpio.h> +#include <linux/workqueue.h> +#include <linux/device.h> +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/sysfs.h> +#include <linux/list.h> +#include <linux/i2c.h> +#include <linux/rtc.h> + +#include "../iio.h" +#include "../sysfs.h" + +/* +* AD7291 registers definition +*/ +#define AD7291_COMMAND 0 +#define AD7291_VOLTAGE 1 +#define AD7291_T_SENSE 2 +#define AD7291_T_AVERAGE 3 +#define AD7291_VOLTAGE_LIMIT_BASE 4 +#define AD7291_VOLTAGE_LIMIT_COUNT 8 +#define AD7291_T_SENSE_HIGH 0x1c +#define AD7291_T_SENSE_LOW 0x1d +#define AD7291_T_SENSE_HYST 0x1e +#define AD7291_VOLTAGE_ALERT_STATUS 0x1f +#define AD7291_T_ALERT_STATUS 0x20 + +/* +* AD7291 command +*/ +#define AD7291_AUTOCYCLE 0x1 +#define AD7291_RESET 0x2 +#define AD7291_ALART_CLEAR 0x4 +#define AD7291_ALART_POLARITY 0x8 +#define AD7291_EXT_REF 0x10 +#define AD7291_NOISE_DELAY 0x20 +#define AD7291_T_SENSE_MASK 0x40 +#define AD7291_VOLTAGE_MASK 0xff00 +#define AD7291_VOLTAGE_OFFSET 0x8 + +/* +* AD7291 value masks +*/ +#define AD7291_CHANNEL_MASK 0xf000 +#define AD7291_VALUE_MASK 0xfff +#define AD7291_T_VALUE_SIGN 0x400 +#define AD7291_T_VALUE_FLOAT_OFFSET 2 +#define AD7291_T_VALUE_FLOAT_MASK 0x2 + +/* +* struct ad7291_chip_info - chip specifc information +*/ + +struct ad7291_chip_info { +const char *name; +struct i2c_client *client; +struct iio_dev *indio_dev; +struct work_struct thresh_work; +s64 last_timestamp; +u16 command; +u8 channels;/* Active voltage channels */ +}; + +/* +* struct ad7291_chip_info - chip specifc information +*/ + +struct ad7291_limit_regs { +u16 data_high; +u16 data_low; +u16 hysteresis; +}; + +/* +* ad7291 register access by I2C +*/ +static int ad7291_i2c_read (struct ad7291_chip_info *chip,u8 reg,u16 *data) +{ +struct i2c_client *client = chip->client; +int ret =0 ; + + ret =i2c_smbus_read_word_data (client, reg); +if (ret <0 ) { +dev_err (&client->dev,"I2C read error\n" ); +return ret; + } + + *data =swab16 ((u16 )ret); + +return 0 ; +} + +static int ad7291_i2c_write (struct ad7291_chip_info *chip,u8 reg,u16 data) +{ +struct i2c_client *client = chip->client; +int ret =0 ; + + ret =i2c_smbus_write_word_data (client, reg,swab16 (data)); +if (ret <0 ) +dev_err (&client->dev,"I2C write error\n" ); + +return ret; +} + +/* Returns negative errno, or else the number of words read. */ +static int ad7291_i2c_read_data (struct ad7291_chip_info *chip,u8 reg,u16 *data) +{ +struct i2c_client *client = chip->client; +u8 commands[4 ]; +int ret =0 ; +int i, count; + +if (reg ==AD7291_T_SENSE || reg ==AD7291_T_AVERAGE ) + count =2 ; +else if (reg ==AD7291_VOLTAGE ) { +if (!chip->channels) { +dev_err (&client->dev,"No voltage channel is selected.\n" ); +return -EINVAL ; + } + count =2 + chip->channels *2 ; + }else { +dev_err (&client->dev,"I2C wrong data register\n" ); +return -EINVAL ; + } + + commands[0 ] =0 ; + commands[1 ] = (chip->command >>8 ) &0xff ; + commands[2 ] = chip->command &0xff ; + commands[3 ] = reg; + + ret =i2c_master_send (client, commands,4 ); +if (ret <0 ) { +dev_err (&client->dev,"I2C master send error\n" ); +return ret; + } + + ret =i2c_master_recv (client, (u8 *)data, count); +if (ret <0 ) { +dev_err (&client->dev,"I2C master receive error\n" ); +return ret; + } + ret >>=2 ; + +for (i =0 ; i < ret; i++) + data[i] =swab16 (data[i]); + +return ret; +} + +static ssize_t ad7291_show_mode (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; + +if (chip->command &AD7291_AUTOCYCLE ) +return sprintf (buf,"autocycle\n" ); +else +return sprintf (buf,"command\n" ); +} + +static ssize_t ad7291_store_mode (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 command; +int ret; + + command = chip->command & (~AD7291_AUTOCYCLE ); +if (strcmp (buf,"autocycle" )) + command |=AD7291_AUTOCYCLE ; + + ret =ad7291_i2c_write (chip,AD7291_COMMAND , command); +if (ret) +return -EIO ; + + chip->command = command; + +return ret; +} + +static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, + ad7291_show_mode, + ad7291_store_mode, + 0); + +static ssize_t ad7291_show_available_modes (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return sprintf (buf,"command\nautocycle\n" ); +} + +static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7291_show_available_modes, NULL, 0); + +static ssize_t ad7291_store_reset (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 command; +int ret; + + command = chip->command |AD7291_RESET ; + + ret =ad7291_i2c_write (chip,AD7291_COMMAND , command); +if (ret) +return -EIO ; + +return ret; +} + +static IIO_DEVICE_ATTR(reset, S_IWUSR, + NULL, + ad7291_store_reset, + 0); + +static ssize_t ad7291_show_ext_ref (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; + +return sprintf (buf,"%d\n" , !!(chip->command &AD7291_EXT_REF )); +} + +static ssize_t ad7291_store_ext_ref (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 command; +int ret; + + command = chip->command & (~AD7291_EXT_REF ); +if (strcmp (buf,"1" )) + command |=AD7291_EXT_REF ; + + ret =ad7291_i2c_write (chip,AD7291_COMMAND , command); +if (ret) +return -EIO ; + + chip->command = command; + +return ret; +} + +static IIO_DEVICE_ATTR(ext_ref, S_IRUGO | S_IWUSR, + ad7291_show_ext_ref, + ad7291_store_ext_ref, + 0); + +static ssize_t ad7291_show_noise_delay (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; + +return sprintf (buf,"%d\n" , !!(chip->command &AD7291_NOISE_DELAY )); +} + +static ssize_t ad7291_store_noise_delay (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 command; +int ret; + + command = chip->command & (~AD7291_NOISE_DELAY ); +if (strcmp (buf,"1" )) + command |=AD7291_NOISE_DELAY ; + + ret =ad7291_i2c_write (chip,AD7291_COMMAND , command); +if (ret) +return -EIO ; + + chip->command = command; + +return ret; +} + +static IIO_DEVICE_ATTR(noise_delay, S_IRUGO | S_IWUSR, + ad7291_show_noise_delay, + ad7291_store_noise_delay, + 0); + +static ssize_t ad7291_show_t_sense (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 data; +char sign =' ' ; +int ret; + + ret =ad7291_i2c_read_data (chip,AD7291_T_SENSE , &data); +if (ret) +return -EIO ; + +if (data &AD7291_T_VALUE_SIGN ) { +/* convert supplement to positive value */ + data = (AD7291_T_VALUE_SIGN <<1 ) - data; + sign ='-' ; + } + +return sprintf (buf,"%c%d.%.2d\n" , sign, + (data >>AD7291_T_VALUE_FLOAT_OFFSET ), + (data &AD7291_T_VALUE_FLOAT_MASK ) *25 ); +} + +static IIO_DEVICE_ATTR(t_sense, S_IRUGO, ad7291_show_t_sense, NULL, 0); + +static ssize_t ad7291_show_t_average (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 data; +char sign =' ' ; +int ret; + + ret =ad7291_i2c_read_data (chip,AD7291_T_AVERAGE , &data); +if (ret) +return -EIO ; + +if (data &AD7291_T_VALUE_SIGN ) { +/* convert supplement to positive value */ + data = (AD7291_T_VALUE_SIGN <<1 ) - data; + sign ='-' ; + } + +return sprintf (buf,"%c%d.%.2d\n" , sign, + (data >>AD7291_T_VALUE_FLOAT_OFFSET ), + (data &AD7291_T_VALUE_FLOAT_MASK ) *25 ); +} + +static IIO_DEVICE_ATTR(t_average, S_IRUGO, ad7291_show_t_average, NULL, 0); + +static ssize_t ad7291_show_voltage (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 data[AD7291_VOLTAGE_LIMIT_COUNT ]; +int i, size, ret; + + ret =ad7291_i2c_read_data (chip,AD7291_VOLTAGE , data); +if (ret) +return -EIO ; + +for (i =0 ; i <AD7291_VOLTAGE_LIMIT_COUNT ; i++) { +if (chip->command & (AD7291_T_SENSE_MASK << i)) { + ret =sprintf (buf,"channel[%d]=%d\n" , i, + data[i] &AD7291_VALUE_MASK ); +if (ret <0 ) +break ; + buf += ret; + size += ret; + } + } + +return size; +} + +static IIO_DEVICE_ATTR(voltage, S_IRUGO, ad7291_show_voltage, NULL, 0); + +static ssize_t ad7291_show_channel_mask (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; + +return sprintf (buf,"0x%x\n" , (chip->command &AD7291_VOLTAGE_MASK ) >> +AD7291_VOLTAGE_OFFSET ); +} + +static ssize_t ad7291_store_channel_mask (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 command; +unsigned long data; +int i, ret; + + ret =strict_strtoul (buf,16 , &data); +if (ret || data >0xff ) +return -EINVAL ; + + command = chip->command & (~AD7291_VOLTAGE_MASK ); + command |= data <<AD7291_VOLTAGE_OFFSET ; + + ret =ad7291_i2c_write (chip,AD7291_COMMAND , command); +if (ret) +return -EIO ; + + chip->command = command; + +for (i =0 , chip->channels =0 ; i <AD7291_VOLTAGE_LIMIT_COUNT ; i++) { +if (chip->command & (AD7291_T_SENSE_MASK << i)) + chip->channels++; + } + +return ret; +} + +static IIO_DEVICE_ATTR(channel_mask, S_IRUGO | S_IWUSR, + ad7291_show_channel_mask, + ad7291_store_channel_mask, + 0); + +static ssize_t ad7291_show_name (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +return sprintf (buf,"%s\n" , chip->name); +} + +static IIO_DEVICE_ATTR(name, S_IRUGO, ad7291_show_name, NULL, 0); + +static struct attribute *ad7291_attributes[] = { + &iio_dev_attr_available_modes.dev_attr.attr, + &iio_dev_attr_mode.dev_attr.attr, + &iio_dev_attr_reset.dev_attr.attr, + &iio_dev_attr_ext_ref.dev_attr.attr, + &iio_dev_attr_noise_delay.dev_attr.attr, + &iio_dev_attr_t_sense.dev_attr.attr, + &iio_dev_attr_t_average.dev_attr.attr, + &iio_dev_attr_voltage.dev_attr.attr, + &iio_dev_attr_channel_mask.dev_attr.attr, + &iio_dev_attr_name.dev_attr.attr, +NULL , +}; + +static const struct attribute_group ad7291_attribute_group = { + .attrs = ad7291_attributes, +}; + +/* +* temperature bound events +*/ + +#define IIO_EVENT_CODE_AD7291_T_SENSE_HIGH IIO_BUFFER_EVENT_CODE(0) +#define IIO_EVENT_CODE_AD7291_T_SENSE_LOW IIO_BUFFER_EVENT_CODE(1) +#define IIO_EVENT_CODE_AD7291_T_AVG_HIGH IIO_BUFFER_EVENT_CODE(2) +#define IIO_EVENT_CODE_AD7291_T_AVG_LOW IIO_BUFFER_EVENT_CODE(3) +#define IIO_EVENT_CODE_AD7291_VOLTAGE_BASE IIO_BUFFER_EVENT_CODE(4) + +static void ad7291_interrupt_bh (struct work_struct *work_s) +{ +struct ad7291_chip_info *chip = + container_of(work_s, struct ad7291_chip_info, thresh_work); +u16 t_status, v_status; +u16 command; +int i; + +if (ad7291_i2c_read (chip,AD7291_T_ALERT_STATUS , &t_status)) +return ; + +if (ad7291_i2c_read (chip,AD7291_VOLTAGE_ALERT_STATUS , &v_status)) +return ; + +if (!(t_status || v_status)) +return ; + + command = chip->command |AD7291_ALART_CLEAR ; +ad7291_i2c_write (chip,AD7291_COMMAND , command); + + command = chip->command & ~AD7291_ALART_CLEAR ; +ad7291_i2c_write (chip,AD7291_COMMAND , command); + +enable_irq (chip->client->irq); + +for (i =0 ; i <4 ; i++) { +if (t_status & (1 << i)) +iio_push_event (chip->indio_dev,0 , +IIO_EVENT_CODE_AD7291_T_SENSE_HIGH + i, + chip->last_timestamp); + } + +for (i =0 ; i <AD7291_VOLTAGE_LIMIT_COUNT *2 ; i++) { +if (v_status & (1 << i)) +iio_push_event (chip->indio_dev,0 , +IIO_EVENT_CODE_AD7291_VOLTAGE_BASE + i, + chip->last_timestamp); + } +} + +static int ad7291_interrupt (struct iio_dev *dev_info, +int index, +s64 timestamp, +int no_test) +{ +struct ad7291_chip_info *chip = dev_info->dev_data; + + chip->last_timestamp = timestamp; +schedule_work (&chip->thresh_work); + +return 0 ; +} + +IIO_EVENT_SH (ad7291, &ad7291_interrupt); + +static inline ssize_t ad7291_show_t_bound (struct device *dev, +struct device_attribute *attr, +u8 bound_reg, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 data; +char sign =' ' ; +int ret; + + ret =ad7291_i2c_read (chip, bound_reg, &data); +if (ret) +return -EIO ; + + data &=AD7291_VALUE_MASK ; +if (data &AD7291_T_VALUE_SIGN ) { +/* convert supplement to positive value */ + data = (AD7291_T_VALUE_SIGN <<1 ) - data; + sign ='-' ; + } + +return sprintf (buf,"%c%d.%.2d\n" , sign, + data >>AD7291_T_VALUE_FLOAT_OFFSET , + (data &AD7291_T_VALUE_FLOAT_MASK ) *25 ); +} + +static inline ssize_t ad7291_set_t_bound (struct device *dev, +struct device_attribute *attr, +u8 bound_reg, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +long tmp1, tmp2; +u16 data; +char *pos; +int ret; + + pos =strchr (buf,'.' ); + + ret =strict_strtol (buf,10 , &tmp1); + +if (ret || tmp1 >127 || tmp1 <-128 ) +return -EINVAL ; + +if (pos) { + len =strlen (pos); +if (len >AD7291_T_VALUE_FLOAT_OFFSET ) + len =AD7291_T_VALUE_FLOAT_OFFSET ; + pos[len] =0 ; + ret =strict_strtol (pos,10 , &tmp2); + +if (!ret) + tmp2 = (tmp2 /25 ) *25 ; + } + +if (tmp1 <0 ) + data = (u16)(-tmp1); +else + data = (u16 )tmp1; + data = (data <<AD7291_T_VALUE_FLOAT_OFFSET ) | + (tmp2 &AD7291_T_VALUE_FLOAT_MASK ); +if (tmp1 <0 ) +/* convert positive value to supplyment */ + data = (AD7291_T_VALUE_SIGN <<1 ) - data; + + ret =ad7291_i2c_write (chip, bound_reg, data); +if (ret) +return -EIO ; + +return ret; +} + +static ssize_t ad7291_show_t_sense_high (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return ad7291_show_t_bound (dev, attr, +AD7291_T_SENSE_HIGH , buf); +} + +static inline ssize_t ad7291_set_t_sense_high (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +return ad7291_set_t_bound (dev, attr, +AD7291_T_SENSE_HIGH , buf, len); +} + +static ssize_t ad7291_show_t_sense_low (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return ad7291_show_t_bound (dev, attr, +AD7291_T_SENSE_LOW , buf); +} + +static inline ssize_t ad7291_set_t_sense_low (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +return ad7291_set_t_bound (dev, attr, +AD7291_T_SENSE_LOW , buf, len); +} + +static ssize_t ad7291_show_t_sense_hyst (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return ad7291_show_t_bound (dev, attr, +AD7291_T_SENSE_HYST , buf); +} + +static inline ssize_t ad7291_set_t_sense_hyst (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +return ad7291_set_t_bound (dev, attr, +AD7291_T_SENSE_HYST , buf, len); +} + +static inline ssize_t ad7291_show_v_bound (struct device *dev, +struct device_attribute *attr, +u8 bound_reg, +char *buf) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +u16 data; +int ret; + +if (bound_reg <AD7291_VOLTAGE_LIMIT_BASE || + bound_reg >=AD7291_VOLTAGE_LIMIT_BASE + +AD7291_VOLTAGE_LIMIT_COUNT ) +return -EINVAL ; + + ret =ad7291_i2c_read (chip, bound_reg, &data); +if (ret) +return -EIO ; + + data &=AD7291_VALUE_MASK ; + +return sprintf (buf,"%d\n" , data); +} + +static inline ssize_t ad7291_set_v_bound (struct device *dev, +struct device_attribute *attr, +u8 bound_reg, +const char *buf, +size_t len) +{ +struct iio_dev *dev_info =dev_get_drvdata (dev); +struct ad7291_chip_info *chip = dev_info->dev_data; +unsigned long value; +u16 data; +int ret; + +if (bound_reg <AD7291_VOLTAGE_LIMIT_BASE || + bound_reg >=AD7291_VOLTAGE_LIMIT_BASE + +AD7291_VOLTAGE_LIMIT_COUNT ) +return -EINVAL ; + + ret =strict_strtoul (buf,10 , &value); + +if (ret || value >=4096 ) +return -EINVAL ; + + data = (u16 )value; + ret =ad7291_i2c_write (chip, bound_reg, data); +if (ret) +return -EIO ; + +return ret; +} + +static int ad7291_get_voltage_limit_regs (const char *channel) +{ +int index; + +if (strlen (channel) <3 && channel[0 ] !='v' ) +return -EINVAL ; + + index = channel[1 ] -'0' ; +if (index >=AD7291_VOLTAGE_LIMIT_COUNT ) +return -EINVAL ; + +return index; +} + +static ssize_t ad7291_show_voltage_high (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +int regs; + + regs =ad7291_get_voltage_limit_regs (attr->attr.name); + +if (regs <0 ) +return regs; + +return ad7291_show_t_bound (dev, attr, regs, buf); +} + +static inline ssize_t ad7291_set_voltage_high (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +int regs; + + regs =ad7291_get_voltage_limit_regs (attr->attr.name); + +if (regs <0 ) +return regs; + +return ad7291_set_t_bound (dev, attr, regs, buf, len); +} + +static ssize_t ad7291_show_voltage_low (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +int regs; + + regs =ad7291_get_voltage_limit_regs (attr->attr.name); + +if (regs <0 ) +return regs; + +return ad7291_show_t_bound (dev, attr, regs+1 , buf); +} + +static inline ssize_t ad7291_set_voltage_low (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +int regs; + + regs =ad7291_get_voltage_limit_regs (attr->attr.name); + +if (regs <0 ) +return regs; + +return ad7291_set_t_bound (dev, attr, regs+1 , buf, len); +} + +static ssize_t ad7291_show_voltage_hyst (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +int regs; + + regs =ad7291_get_voltage_limit_regs (attr->attr.name); + +if (regs <0 ) +return regs; + +return ad7291_show_t_bound (dev, attr, regs+2 , buf); +} + +static inline ssize_t ad7291_set_voltage_hyst (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) +{ +int regs; + + regs =ad7291_get_voltage_limit_regs (attr->attr.name); + +if (regs <0 ) +return regs; + +return ad7291_set_t_bound (dev, attr, regs+2 , buf, len); +} + +IIO_EVENT_ATTR_SH (t_sense_high, iio_event_ad7291, + ad7291_show_t_sense_high, ad7291_set_t_sense_high,0 ); +IIO_EVENT_ATTR_SH (t_sense_low, iio_event_ad7291, + ad7291_show_t_sense_low, ad7291_set_t_sense_low,0 ); +IIO_EVENT_ATTR_SH (t_sense_hyst, iio_event_ad7291, + ad7291_show_t_sense_hyst, ad7291_set_t_sense_hyst,0 ); + +IIO_EVENT_ATTR_SH (v0_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v0_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v0_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v1_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v1_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v1_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v2_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v2_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v2_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v3_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v3_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v3_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v4_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v4_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v4_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v5_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v5_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v5_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v6_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v6_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v6_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); +IIO_EVENT_ATTR_SH (v7_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high,0 ); +IIO_EVENT_ATTR_SH (v7_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low,0 ); +IIO_EVENT_ATTR_SH (v7_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst,0 ); + +static struct attribute *ad7291_event_attributes[] = { + &iio_event_attr_t_sense_high.dev_attr.attr, + &iio_event_attr_t_sense_low.dev_attr.attr, + &iio_event_attr_t_sense_hyst.dev_attr.attr, + &iio_event_attr_v0_high.dev_attr.attr, + &iio_event_attr_v0_low.dev_attr.attr, + &iio_event_attr_v0_hyst.dev_attr.attr, + &iio_event_attr_v1_high.dev_attr.attr, + &iio_event_attr_v1_low.dev_attr.attr, + &iio_event_attr_v1_hyst.dev_attr.attr, + &iio_event_attr_v2_high.dev_attr.attr, + &iio_event_attr_v2_low.dev_attr.attr, + &iio_event_attr_v2_hyst.dev_attr.attr, + &iio_event_attr_v3_high.dev_attr.attr, + &iio_event_attr_v3_low.dev_attr.attr, + &iio_event_attr_v3_hyst.dev_attr.attr, + &iio_event_attr_v4_high.dev_attr.attr, + &iio_event_attr_v4_low.dev_attr.attr, + &iio_event_attr_v4_hyst.dev_attr.attr, + &iio_event_attr_v5_high.dev_attr.attr, + &iio_event_attr_v5_low.dev_attr.attr, + &iio_event_attr_v5_hyst.dev_attr.attr, + &iio_event_attr_v6_high.dev_attr.attr, + &iio_event_attr_v6_low.dev_attr.attr, + &iio_event_attr_v6_hyst.dev_attr.attr, + &iio_event_attr_v7_high.dev_attr.attr, + &iio_event_attr_v7_low.dev_attr.attr, + &iio_event_attr_v7_hyst.dev_attr.attr, +NULL , +}; + +static struct attribute_group ad7291_event_attribute_group = { + .attrs = ad7291_event_attributes, +}; + +/* +* device probe and remove +*/ + +static int __devinit ad7291_probe (struct i2c_client *client, +const struct i2c_device_id *id) +{ +struct ad7291_chip_info *chip; +int ret =0 ; + + chip =kzalloc (sizeof (struct ad7291_chip_info ),GFP_KERNEL ); + +if (chip ==NULL ) +return -ENOMEM ; + +/* this is only used for device removal purposes */ +i2c_set_clientdata (client, chip); + + chip->client = client; + chip->name = id->name; + chip->command =AD7291_NOISE_DELAY |AD7291_T_SENSE_MASK ; + + chip->indio_dev =iio_allocate_device (); +if (chip->indio_dev ==NULL ) { + ret = -ENOMEM ; + goto error_free_chip; + } + + chip->indio_dev->dev.parent = &client->dev; + chip->indio_dev->attrs = &ad7291_attribute_group; + chip->indio_dev->event_attrs = &ad7291_event_attribute_group; + chip->indio_dev->dev_data = (void *)chip; + chip->indio_dev->driver_module =THIS_MODULE ; + chip->indio_dev->num_interrupt_lines =1 ; + chip->indio_dev->modes =INDIO_DIRECT_MODE ; + + ret =iio_device_register (chip->indio_dev); +if (ret) + goto error_free_dev; + +if (client->irq >0 ) { + ret =iio_register_interrupt_line (client->irq, + chip->indio_dev, +0 , + client->irq_flags, + chip->name); +if (ret) + goto error_unreg_dev; + +/* +* The event handler list element refer to iio_event_ad7291. +* All event attributes bind to the same event handler. +* So, only register event handler once. +*/ +iio_add_event_to_list (&iio_event_ad7291, + &chip->indio_dev->interrupts[0 ]->ev_list); + +INIT_WORK (&chip->thresh_work, ad7291_interrupt_bh); + +if (client->irq_flags &IRQF_TRIGGER_LOW ) + chip->command |=AD7291_ALART_POLARITY ; + } + + ret =ad7291_i2c_write (chip,AD7291_COMMAND , chip->command); +if (ret) { + ret = -EIO ; + goto error_unreg_irq; + } + +dev_info (&client->dev,"%s temperature sensor registered.\n" , + id->name); + +return 0 ; + +error_unreg_irq: +iio_unregister_interrupt_line (chip->indio_dev,0 ); +error_unreg_dev: +iio_device_unregister (chip->indio_dev); +error_free_dev: +iio_free_device (chip->indio_dev); +error_free_chip: +kfree (chip); + +return ret; +} + +static int __devexit ad7291_remove(struct i2c_client *client) +{ +struct ad7291_chip_info *chip =i2c_get_clientdata (client); +struct iio_dev *indio_dev = chip->indio_dev; + +if (client->irq) +iio_unregister_interrupt_line (indio_dev,0 ); +iio_device_unregister (indio_dev); +iio_free_device (chip->indio_dev); +kfree (chip); + +return 0 ; +} + +static const struct i2c_device_id ad7291_id[] = { + {"ad7291" ,0 }, + {} +}; + +MODULE_DEVICE_TABLE (i2c, ad7291_id); + +static struct i2c_driver ad7291_driver = { + .driver = { + .name ="ad7291" , + }, + .probe = ad7291_probe, + .remove =__devexit_p (ad7291_remove), + .id_table = ad7291_id, +}; + +static __init int ad7291_init (void ) +{ +return i2c_add_driver (&ad7291_driver); +} + +static __exit void ad7291_exit(void) +{ +i2c_del_driver (&ad7291_driver); +} + +MODULE_AUTHOR ("Sonic Zhang <[email protected]>" ); +MODULE_DESCRIPTION ("Analog Devices AD7291 digital" +" temperature sensor driver" ); +MODULE_LICENSE ("GPL v2" ); + +module_init (ad7291_init); +module_exit (ad7291_exit);
Hennerich, Michael
maintainerRE: BUILD ISSUE: Re: [PATCH 07/36] staging: iio: adc: new driver for AD7291 devices
Jonathan Cameron wrote on 2010-10-25:
Quoted 10 lines · Mike Frysinger
Quoted 1 line
From: Sonic Zhang <[email protected]>
Build test results (cross compiled for arm) on top of staging-next
drivers/staging/iio/adc/ad7291.c: In function 'ad7291_probe':drivers/staging/iio/adc/ad7291.c:951: error: 'structi2c_client' has no member named 'irq_flags'drivers/staging/iio/adc/ad7291.c:966: error: 'structi2c_client' has no member named 'irq_flags'
Quoted 8 lines
Google tells me you guys have posted a patch adding this a couple of weeks back. Doesn't
look like Jean liked it... If it is merging you need to tell Greg
that there is a dependency
on it when you send him the merge request. Otherwise just remove the usage and rely on it happening in board setup code. Personally I agree with what the patch was trying to do, but if it isn't merging we don't want to hold this driver up waiting for it.
Ok - I remove it for now.
Actually we've added irq_flags to both i2c and spi board info. There were a few people who commented positively on both patches. Feel free to send your cents as well.
-Michael
Quoted 35 lines
Quoted 35 lines
Signed-off-by Sonic Zhang <[email protected]>Signed-off-by Mike Frysinger <[email protected]>--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7291.c | 1039++++++++++++++++++++++++++++++++++++++ 3 files changed, 1047 insertions(+), 0 deletions(-) create mode
100644drivers/staging/iio/adc/ad7291.c(quoted diff) +0
-0b/drivers/staging/iio/adc/Kconfig index 7f03571..fa78413 100644
drivers/staging/iio/adc/Kconfig +7
-0@@ -41,6 +41,13 @@ config AD7152 Say yes here to build support for Analog Devices capacitive sensors. (ad7152, ad7153) Provides direct access via sysfs. +config AD7291 + tristate "Analog Devices AD7291 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices AD7291 + temperature sensors. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2Cdrivers/staging/iio/adc/Makefile +0
-0@@ -17,3 +17,4 @@ obj-$(CONFIG_AD7476) +=3D ad7476.o
Quoted 14 lines
Quoted 6 lines
drivers/staging/iio/adc/Makefile +1
-0obj-$(CONFIG_AD7150) +=3D ad7150.o obj-$(CONFIG_AD7152) +=3D ad7152.o +obj-$(CONFIG_AD7291) +=3D ad7291.o diff --git
a/drivers/staging/iio/adc/ad7291.cb/drivers/staging/iio/adc/ad7291.cnew file mode 100644 index 0000000..a9d3756 ---/dev/null+++b/drivers/staging/iio/adc/ad7291.c@@ -0,0 +1,1039 @@ +/* + * AD7291Quoted 8 lines
digital temperature sensor driver supporting AD7291 + * + * Copyright 2010 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include <
linux/interrupt.h> +#include <linux/gpio.h> +#include <linux/workqueue.h> +#include <linux/device.h> +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/sysfs.h> +#include <linux/list.h> +#include <linux/i2c.h> +#include <linux/rtc.h> + +#include "../iio.h" +#include "../sysfs.h" + +/* + *
AD7291 registers definition + */ +#defineAD7291_COMMAND=
0 +#define
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE1 +#defineAD7291_T_SENSE=
2 +#define
Quoted 1 line
Quoted 1 line
AD7291_T_AVERAGE3 +#defineAD7291_VOLTAGE_LIMIT_BASE4 +=
#define
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_LIMIT_COUNT8 +#defineAD7291_T_SENSE_HIGH0x1=
c
Quoted 1 line
Quoted 1 line
+#define
AD7291_T_SENSE_LOW0x1d+#defineAD7291_T_SENSE_HYST=
0x1e
Quoted 2 lines
Quoted 2 lines
+#define
AD7291_VOLTAGE_ALERT_STATUS0x1f+#defineAD7291_T_ALERT_STATUS0x20+ +/* + * AD7291 command + */ =
+#define
Quoted 1 line
Quoted 1 line
AD7291_AUTOCYCLE0x1+#defineAD7291_RESET=
0x2 +#define
Quoted 1 line
Quoted 1 line
AD7291_ALART_CLEAR0x4+#defineAD7291_ALART_POLARITY=
0x8 +#define
Quoted 1 line
Quoted 1 line
AD7291_EXT_REF0x10+#defineAD7291_NOISE_DELAY=
0x20 +#define
Quoted 1 line
Quoted 1 line
AD7291_T_SENSE_MASK0x40+#defineAD7291_VOLTAGE_MASK=
0xff00 +#define
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_OFFSET0x8+ +/* + * AD7291 value masks + =
*/ +#define
Quoted 1 line
Quoted 1 line
AD7291_CHANNEL_MASK0xf000+#defineAD7291_VALUE_MASK=
0xfff +#define
Quoted 1 line
Quoted 1 line
AD7291_T_VALUE_SIGN0x400+#defineAD7291_T_VALUE_FLOAT_OFFSET=
2
Quoted 4 lines
Quoted 4 lines
+#define
AD7291_T_VALUE_FLOAT_MASK0x2+ +/* + * structad7291_chip_info- chip specifc information */ + +structad7291_chip_info{ + const char *name; + structi2c_client*client;
+ structiio_dev*indio_dev; + structwork_structthresh_work; + =
s64
Quoted 4 lines
Quoted 4 lines
last_timestamp; + u16 command; + u8 channels; /* Active voltage
channels */ +}; + +/* + * structad7291_chip_info- chip specifc
information */ + +structad7291_limit_regs{ + u16data_high;
+ u16data_low; + u16 hysteresis; +}; + +/* + * ad7291 re=
gister access
Quoted 2 lines
Quoted 2 lines
by I2C + */ +static int ad7291_i2c_read(struct
ad7291_chip_info*chip,
u8 reg, u16 +*data) { + structi2c_client*client =3D chip->client;=
+ int
Quoted 1 line
Quoted 1 line
ret =3D 0; + + ret =3D
i2c_smbus_read_word_data(client, reg); + if (ret=
<
Quoted 1 line
Quoted 1 line
0) { +
dev_err(&client->dev, "I2C read error\n"); + =
return ret; + } +
Quoted 3 lines
Quoted 3 lines
+ *data =3D swab16((u16)ret); + + return 0; +} + +static int
ad7291_i2c_write(struct ad7291_chip_info *chip, u8 reg, +u16 data){
+ structi2c_client*client =3Dchip->client; + int ret =3D 0; + =
+ ret =3D
Quoted 1 line
Quoted 1 line
i2c_smbus_write_word_data(client, reg, swab16(data)); + if (ret < 0=
)
Quoted 1 line
Quoted 1 line
+
dev_err(&client->dev, "I2C write error\n"); + + return ret;=
+} + +/*
Quoted 3 lines
Quoted 3 lines
Returns negative errno, or else the number of words read. */ +static int ad7291_i2c_read_data(struct
ad7291_chip_info*chip, u8 +reg, u16
*data) { + structi2c_client*client =3Dchip->client; + u8 comman=
ds[4];
Quoted 1 line
Quoted 1 line
+ int ret =3D 0; + int i, count; + + if (reg =3D=3D AD7291_T_S=
ENSE || reg =3D=3D
Quoted 1 line
Quoted 1 line
AD7291_T_AVERAGE) + count =3D 2; + else if (reg =3D=3D AD729=
1_VOLTAGE) {
Quoted 1 line
Quoted 1 line
+ if (!chip->channels) { + dev_err(&cl=
ient->dev, "No voltage channel
Quoted 1 line
Quoted 1 line
is selected.\n"); + return
-EINVAL; + } +=
count =3D 2 +
Quoted 1 line
Quoted 1 line
chip->channels* 2; + } else { + dev_err(&client->de=
v, "I2C wrong data
Quoted 1 line
Quoted 1 line
register\n"); + return
-EINVAL; + } + + commands[0]=
=3D 0; + commands[1]
Quoted 1 line
Quoted 1 line
=3D (
chip->command>> 8) &0xff; + commands[2] =3Dchip->command& 0=
xff;
Quoted 1 line
Quoted 1 line
+ commands[3] =3D reg; + + ret =3D i2c_master_send(client, commands,=
4);
Quoted 1 line
Quoted 1 line
+ if (ret < 0) { + dev_err(&client->dev, "I2C master s=
end error\n");
Quoted 1 line
Quoted 1 line
+ return ret; + } + + ret =3D i2c_master_recv(client, (u8=
*)data,
Quoted 1 line
Quoted 1 line
count); + if (ret < 0) { + dev_err(&client->dev, "I2C =
master receive
Quoted 1 line
Quoted 1 line
error\n"); + return ret; + } + ret >>=3D 2; + + for (i =
=3D 0; i < ret;
Quoted 1 line
Quoted 1 line
i++) + data[i] =3D
swab16(data[i]); + + return ret; +} + =
+static ssize_t
Quoted 1 line
Quoted 1 line
ad7291_show_mode(struct device *dev, + struct device_attri=
bute *attr,
Quoted 1 line
Quoted 1 line
+ char *buf) +{ + struct
iio_dev*dev_info=3D dev_get_drvdat=
a(dev);
Quoted 3 lines
Quoted 3 lines
+ struct
ad7291_chip_info*chip =3Ddev_info->dev_data; + + if
(chip->command&AD7291_AUTOCYCLE) + return sprintf(buf,
"autocycle\n"); + else + returnsprintf(buf, "command\n"); }=
+ +static
Quoted 2 lines
Quoted 2 lines
ssize_tad7291_store_mode(struct device *dev, + structdevice_attribute*attr, + const char *buf, + siz=
e_t len) +{ + struct
Quoted 2 lines
Quoted 2 lines
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info
*chip =3Ddev_info->dev_data; + u16 command; + int ret; + + c=
ommand =3D
Quoted 1 line
Quoted 1 line
chip->command& (~AD7291_AUTOCYCLE); + if (strcmp(buf, "autocycle"=
))
Quoted 1 line
Quoted 1 line
+ command |=3D
AD7291_AUTOCYCLE; + + ret =3D ad7291_i2=
c_write(chip,
Quoted 1 line
Quoted 1 line
AD7291_COMMAND, command); + if (ret) + return-EIO; + + =
chip->command
Quoted 1 line
Quoted 1 line
=3D command; + + return ret; +} + +static IIO_DEVICE_ATTR(mode, S_=
IRUGO |
Quoted 1 line
Quoted 1 line
S_IWUSR, +ad7291_show_mode, +ad7291_store_mode, =
+ 0); + +static
Quoted 1 line
Quoted 1 line
ssize_tad7291_show_available_modes(struct device *dev, + str=
uct
Quoted 4 lines
Quoted 4 lines
device_attribute*attr, + char *buf) +{ + return sprintf(buf,
"command\nautocycle\n"); } + +staticIIO_DEVICE_ATTR(available_modes, S_IRUGO, +ad7291_show_available_modes, NULL, 0); + +staticssize_t
ad7291_store_reset(struct device *dev, + struct device_attri=
bute
Quoted 1 line
Quoted 1 line
*attr, + const char *buf, +
size_tlen) +{ + =
struct iio_dev *dev_info
Quoted 4 lines
Quoted 4 lines
=3D
dev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 command; + int ret; + + command =3Dchip->command|AD7291_RESET; + + ret =3D ad7291_i2c_write(chip,AD7291_COMMAND, command); + if (ret) + return-EIO; + + =
return ret; +}
Quoted 3 lines
Quoted 3 lines
+ +static IIO_DEVICE_ATTR(reset,
S_IWUSR, + NULL,
+ad7291_store_reset, + 0); + +staticssize_t
ad7291_show_ext_ref(struct device *dev, + struct device_attri=
bute
Quoted 3 lines
Quoted 3 lines
*attr, + char *buf) +{ + struct
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + + return sprintf(buf, "%d\n", !!(chip->comman=
d &
Quoted 2 lines
Quoted 2 lines
AD7291_EXT_REF)); } + +staticssize_tad7291_store_ext_ref(struct
device *dev, + structdevice_attribute*attr, + =
const char *buf,
Quoted 1 line
Quoted 1 line
+
size_tlen) +{ + structiio_dev*dev_info=3D dev_ge=
t_drvdata(dev);
Quoted 1 line
Quoted 1 line
+ struct
ad7291_chip_info*chip =3Ddev_info->dev_data; + u16 comma=
nd;
Quoted 1 line
Quoted 1 line
+ int ret; + + command =3D
chip->command& (~AD7291_EXT_REF); + i=
f
Quoted 2 lines
Quoted 2 lines
(
strcmp(buf, "1")) + command |=3DAD7291_EXT_REF; + + ret =3Dad7291_i2c_write(chip, AD7291_COMMAND, command); + if (ret) + =
return
Quoted 2 lines
Quoted 2 lines
-EIO; + +chip->command=3D command; + + return ret; +} + +static
IIO_DEVICE_ATTR(ext_ref,S_IRUGO|S_IWUSR, + ad7291_show=
_ext_ref,
Quoted 2 lines
Quoted 2 lines
+
ad7291_store_ext_ref, + 0); + +staticssize_t
ad7291_show_noise_delay(struct device *dev, + struct devi=
ce_attribute
Quoted 3 lines
Quoted 3 lines
*attr, + char *buf) +{ + struct
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + + return sprintf(buf, "%d\n", !!(chip->comman=
d &
Quoted 2 lines
Quoted 2 lines
AD7291_NOISE_DELAY)); +} + +staticssize_t
ad7291_store_noise_delay(struct device *dev, + struct devi=
ce_attribute
Quoted 1 line
Quoted 1 line
*attr, + const char *buf, +
size_tlen) +{ + =
struct iio_dev *dev_info
Quoted 4 lines
Quoted 4 lines
=3D
dev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 command; + int ret; + + command =3Dchip->command& (~AD7291_NOISE_DELAY); + if (strcmp(buf, "1"))
+ command |=3DAD7291_NOISE_DELAY; + + ret =3D ad7291_i2=
c_write(chip,
Quoted 1 line
Quoted 1 line
AD7291_COMMAND, command); + if (ret) + return-EIO; + + =
chip->command
Quoted 1 line
Quoted 1 line
=3D command; + + return ret; +} + +static IIO_DEVICE_ATTR(noise_de=
lay,
Quoted 2 lines
Quoted 2 lines
S_IRUGO|S_IWUSR, +ad7291_show_noise_delay,
+ad7291_store_noise_delay, + 0); + +static ssize=
_t
Quoted 1 line
Quoted 1 line
ad7291_show_t_sense(struct device *dev, + struct device_attri=
bute
Quoted 3 lines
Quoted 3 lines
*attr, + char *buf) +{ + struct
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 data; + char sign =3D ' '; + i=
nt ret; + + ret =3D
Quoted 1 line
Quoted 1 line
ad7291_i2c_read_data(chip, AD7291_T_SENSE, &data); + if (ret) + =
return
Quoted 1 line
Quoted 1 line
-EIO; + + if (data &AD7291_T_VALUE_SIGN) { + /* convert =
supplement to
Quoted 1 line
Quoted 1 line
positive value */ + data =3D (
AD7291_T_VALUE_SIGN<< 1) - data;=
+ sign
Quoted 1 line
Quoted 1 line
=3D '-'; + } + + return sprintf(buf, "%c%d.%.2d\n", sign, + =
(data >>
Quoted 1 line
Quoted 1 line
AD7291_T_VALUE_FLOAT_OFFSET), + (data & AD7291_T_VALUE_FLOA=
T_MASK) *
Quoted 3 lines
Quoted 3 lines
25); } + +static
IIO_DEVICE_ATTR(t_sense, S_IRUGO, ad7291_show_t_sense, NULL, +0); + +staticssize_tad7291_show_t_average(struct device *dev,
+ structdevice_attribute*attr, + char *buf) =
+{ + struct iio_dev
Quoted 2 lines
Quoted 2 lines
*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 data; + char sign =3D ' '; + i=
nt ret; + + ret =3D
Quoted 2 lines
Quoted 2 lines
ad7291_i2c_read_data(chip, AD7291_T_AVERAGE, &data); + if (ret)
+ return-EIO; + + if (data &AD7291_T_VALUE_SIGN) { +=
/* convert
Quoted 1 line
Quoted 1 line
supplement to positive value */ + data =3D (AD7291_T_VALUE_SI=
GN << 1) -
Quoted 1 line
Quoted 1 line
data; + sign =3D '-'; + } + + return sprintf(buf, "%c%d=
.%.2d\n", sign,
Quoted 1 line
Quoted 1 line
+ (data >>
AD7291_T_VALUE_FLOAT_OFFSET), + (da=
ta &
Quoted 3 lines
Quoted 3 lines
AD7291_T_VALUE_FLOAT_MASK) * 25); } + +staticIIO_DEVICE_ATTR(t_average, S_IRUGO, ad7291_show_t_average, +NULL, 0); +
+staticssize_tad7291_show_voltage(struct device *dev, + str=
uct
Quoted 1 line
Quoted 1 line
device_attribute*attr, + char *buf) +{ + structiio_dev*dev=
_info =3D
Quoted 2 lines
Quoted 2 lines
dev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 data[AD7291_VOLTAGE_LIMIT_COUNT]; + int=
i,
Quoted 1 line
Quoted 1 line
size, ret; + + ret =3D ad7291_i2c_read_data(chip,
AD7291_VOLTAGE, =
data);
Quoted 3 lines
Quoted 3 lines
+ if (ret) + return
-EIO; + + for (i =3D 0; i <AD7291_VOLTAGE_LIMIT_COUNT; i++) { + if (chip->command&
(AD7291_T_SENSE_MASK<< i)) { + ret =3D sprintf(buf=
,
Quoted 1 line
Quoted 1 line
"channel[%d]=3D%d\n", i, + data[i] &=
AD7291_VALUE_MASK); + if (ret
Quoted 1 line
Quoted 1 line
< 0) + break; + buf=
+=3D ret; + size +=3D ret; + } + } + + re=
turn
Quoted 3 lines
Quoted 3 lines
size; +} + +static
IIO_DEVICE_ATTR(voltage, S_IRUGO, ad7291_show_voltage, NULL, +0); + +staticssize_t
ad7291_show_channel_mask(struct device *dev, + struct devi=
ce_attribute
Quoted 3 lines
Quoted 3 lines
*attr, + char *buf) +{ + struct
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + + return sprintf(buf, "0x%x\n", (chip->comman=
d &
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_MASK) >> +AD7291_VOLTAGE_OFFSET); +} =
+ +static
Quoted 1 line
Quoted 1 line
ssize_tad7291_store_channel_mask(struct device *dev, + str=
uct
Quoted 1 line
Quoted 1 line
device_attribute*attr, + const char *buf, + siz=
e_t len) +{ + struct
Quoted 2 lines
Quoted 2 lines
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info
*chip =3Ddev_info->dev_data; + u16 command; + unsigned long dat=
a; + int
Quoted 3 lines
Quoted 3 lines
i, ret; + + ret =3D
strict_strtoul(buf, 16, &data); + if (ret || data >0xff) + return-EINVAL; + + command =3Dchip->command&
(~AD7291_VOLTAGE_MASK); + command |=3D data << AD7291_VOLTAGE_OFFSET;=
+
Quoted 1 line
Quoted 1 line
+ ret =3D
ad7291_i2c_write(chip, AD7291_COMMAND, command); + i=
f (ret)
Quoted 1 line
Quoted 1 line
+ return
-EIO; + +chip->command=3D command; + + f=
or (i =3D 0,
Quoted 1 line
Quoted 1 line
chip->channels=3D 0; i <AD7291_VOLTAGE_LIMIT_COUNT; i++) { + i=
f
Quoted 1 line
Quoted 1 line
(
chip->command& (AD7291_T_SENSE_MASK<< i)) + chi=
p->channels++; + }
Quoted 2 lines
Quoted 2 lines
+ + return ret; +} + +static IIO_DEVICE_ATTR(channel_mask,
S_IRUGO|S_IWUSR, +ad7291_show_channel_mask, + ad7291_stor=
e_channel_mask,
Quoted 1 line
Quoted 1 line
+ 0); + +static
ssize_tad7291_show_name(struct device *dev, =
+ struct
Quoted 1 line
Quoted 1 line
device_attribute*attr, + char *buf) +{ + structiio_dev*dev=
_info =3D
Quoted 2 lines
Quoted 2 lines
dev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + returnsprintf(buf, "%s\n", chip->name); } =
+
Quoted 4 lines
Quoted 4 lines
drivers/staging/iio/adc/Makefile +4
-0+static IIO_DEVICE_ATTR(name, S_IRUGO, ad7291_show_name, NULL, 0); + +static struct attribute *ad7291_attributes[] =3D { + &iio_dev_attr_available_modes.dev_attr.attr, + &iio_dev_attr_mode.dev_attr.attr,
Quoted 8 lines
drivers/staging/iio/adc/Makefile
Quoted 8 lines
drivers/staging/iio/adc/Makefile +8
-0+ &iio_dev_attr_reset.dev_attr.attr, + &iio_dev_attr_ext_ref.dev_attr.attr, + &iio_dev_attr_noise_delay.dev_attr.attr, + &iio_dev_attr_t_sense.dev_attr.attr, + &iio_dev_attr_t_average.dev_attr.attr, + &iio_dev_attr_voltage.dev_attr.attr, + &iio_dev_attr_channel_mask.dev_attr.attr, + &iio_dev_attr_name.dev_attr.attr, + NULL, +}; + +static const s=
truct
Quoted 8 lines
drivers/staging/iio/adc/Makefile
Quoted 8 lines
attribute_groupad7291_attribute_group=3D { + .attrs =3Dad7291_attributes, +}; + +/* + * temperature bound events + */ +drivers/staging/iio/adc/Makefile +6
-0+#define IIO_EVENT_CODE_AD7291_T_SENSE_HIGH IIO_BUFFER_EVENT_CODE(0) +#define IIO_EVENT_CODE_AD7291_T_SENSE_LOW IIO_BUFFER_EVENT_CODE(1) +#define IIO_EVENT_CODE_AD7291_T_AVG_HIGH IIO_BUFFER_EVENT_CODE(2) +#define IIO_EVENT_CODE_AD7291_T_AVG_LOW IIO_BUFFER_EVENT_CODE(3) +#define IIO_EVENT_CODE_AD7291_VOLTAGE_BASE +IIO_BUFFER_EVENT_CODE(4) + +static void ad7291_interrupt_bh(struct work_struct *work_s) { + str=
uct
Quoted 3 lines
Quoted 3 lines
ad7291_chip_info*chip =3D + container_of(work_s, structad7291_chip_info,thresh_work); + u16t_status,v_status; + u16
command; + int i; + + if (ad7291_i2c_read(chip, AD7291_T_ALERT_ST=
ATUS,
Quoted 2 lines
Quoted 2 lines
&t_status)) + return; + + if (ad7291_i2c_read(chip,AD7291_VOLTAGE_ALERT_STATUS,&v_status)) + return; + + if =
(!(t_status
Quoted 2 lines
Quoted 2 lines
|| v_status)) + return; + + command =3D chip->command | AD7291_ALART_CLEAR; + ad7291_i2c_write(chip, AD7291_COMMAND, comm=
and);
Quoted 3 lines
drivers/staging/iio/adc/Makefile
Quoted 3 lines
+ + command =3D
chip->command& ~AD7291_ALART_CLEAR;drivers/staging/iio/adc/Makefile +2
-0+ ad7291_i2c_write(chip, AD7291_COMMAND, command); + + enable_irq(chip->client->irq); + + for (i =3D 0; i < 4; i++) {=
+ if
Quoted 1 line
Quoted 1 line
(
t_status& (1 << i)) + iio_push_event(chip->indio_=
dev, 0,
Quoted 2 lines
drivers/staging/iio/adc/Makefile
Quoted 2 lines
drivers/staging/iio/adc/Makefile +2
-0+ IIO_EVENT_CODE_AD7291_T_SENSE_HIGH + i, + chip->last_timestamp); + } + + for=
(i =3D 0; i <
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_LIMIT_COUNT*2; i++) { + if (
v_status& (1 <=
< i))
Quoted 3 lines
drivers/staging/iio/adc/Makefile
Quoted 3 lines
drivers/staging/iio/adc/Makefile +3
-0+ iio_push_event(chip->indio_dev, 0, + IIO_EVENT_CODE_AD7291_VOLTAGE_BASE + i, + chip->last_timestamp); + } +} + +sta=
tic int
Quoted 1 line
Quoted 1 line
ad7291_interrupt(struct
iio_dev*dev_info, + int index, + =
s64
Quoted 1 line
Quoted 1 line
timestamp, + int
no_test) +{ + structad7291_chip_info*ch=
ip =3D
Quoted 4 lines
Quoted 4 lines
dev_info->dev_data; + +chip->last_timestamp=3D timestamp;drivers/staging/iio/adc/Makefile +2
-0+ schedule_work(&chip->thresh_work); + + return 0; +} + +IIO_EVENT_SH(ad7291, &ad7291_interrupt); + +static inline ssize_tad7291_show_t_bound(struct device *dev, + struct device_attri=
bute
Quoted 1 line
Quoted 1 line
*attr, + u8
bound_reg, + char *buf) +{ + struct iio_=
dev *dev_info =3D
Quoted 2 lines
Quoted 2 lines
dev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 data; + char sign =3D ' '; + i=
nt ret; + + ret =3D
Quoted 1 line
Quoted 1 line
ad7291_i2c_read(chip, bound_reg, &data); + if (ret) + ret=
urn -EIO; +
Quoted 1 line
Quoted 1 line
+ data &=3D
AD7291_VALUE_MASK; + if (data &AD7291_T_VALUE_SIGN) {=
+ /*
Quoted 1 line
Quoted 1 line
convert supplement to positive value */ + data =3D (AD7291_T_=
VALUE_SIGN
Quoted 1 line
Quoted 1 line
<< 1) - data; + sign =3D '-'; + } + + return sprintf(bu=
f, "%c%d.%.2d\n",
Quoted 1 line
Quoted 1 line
sign, + data >>
AD7291_T_VALUE_FLOAT_OFFSET, + =
(data &
Quoted 2 lines
Quoted 2 lines
AD7291_T_VALUE_FLOAT_MASK) * 25); } + +static inlinessize_t
ad7291_set_t_bound(struct device *dev, + struct device_attri=
bute
Quoted 1 line
Quoted 1 line
*attr, + u8
bound_reg, + const char *buf, + =
size_t len) +{ + struct
Quoted 2 lines
Quoted 2 lines
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info
*chip =3Ddev_info->dev_data; + long tmp1, tmp2; + u16 data;=
+ char *pos;
Quoted 1 line
Quoted 1 line
+ int ret; + + pos =3D
strchr(buf, '.'); + + ret =3D strict_st=
rtol(buf, 10,
Quoted 1 line
Quoted 1 line
&tmp1); + + if (ret || tmp1 > 127 || tmp1 < -128) + return -EIN=
VAL; +
Quoted 2 lines
Quoted 2 lines
+ if (pos) { + len =3D strlen(pos); + if (len >
AD7291_T_VALUE_FLOAT_OFFSET) + len =3D AD7291_T_VA=
LUE_FLOAT_OFFSET;
Quoted 1 line
Quoted 1 line
+ pos[len] =3D 0; + ret =3D strict_strtol(pos, 10, &t=
mp2); + + if (!ret)
Quoted 1 line
Quoted 1 line
+ tmp2 =3D (tmp2 / 25) * 25; + } + + if (tmp1 =
< 0) + data =3D
Quoted 1 line
Quoted 1 line
(u16)(-tmp1); + else + data =3D (u16)tmp1; + data =3D =
(data <<
Quoted 1 line
Quoted 1 line
AD7291_T_VALUE_FLOAT_OFFSET) | + (tmp2 & AD7291_T_VALUE_FLOA=
T_MASK);
Quoted 1 line
Quoted 1 line
+ if (tmp1 < 0) + /* convert positive value to supplyment */ =
+ data =3D
Quoted 1 line
Quoted 1 line
(
AD7291_T_VALUE_SIGN<< 1) - data; + + ret =3D ad7291_i2c_write(ch=
ip,
Quoted 1 line
Quoted 1 line
bound_reg, data); + if (ret) + return-EIO; + + ret=
urn ret; +} +
Quoted 1 line
Quoted 1 line
+static
ssize_tad7291_show_t_sense_high(struct device *dev, + =
struct
Quoted 2 lines
Quoted 2 lines
device_attribute*attr, + char *buf) +{ + return
ad7291_show_t_bound(dev, attr, + AD7291_T_SENSE_HIGH=
, buf); +} +
Quoted 2 lines
drivers/staging/iio/adc/Makefile
Quoted 2 lines
drivers/staging/iio/adc/Makefile +2
-0+static inline ssize_t ad7291_set_t_sense_high(struct device *dev, + struct device_attribute *attr, + const char =
*buf, + size_t len) +{
Quoted 1 line
Quoted 1 line
+ return ad7291_set_t_bound(dev, attr, + AD7291_T_SE=
NSE_HIGH, buf,
Quoted 2 lines
Quoted 2 lines
len); +} + +static
ssize_tad7291_show_t_sense_low(struct device *dev,
+ structdevice_attribute*attr, + char *buf) =
+{ + return
Quoted 1 line
Quoted 1 line
ad7291_show_t_bound(dev, attr, + AD7291_T_SENSE_LOW,=
buf); +} +
Quoted 2 lines
drivers/staging/iio/adc/Makefile
Quoted 2 lines
drivers/staging/iio/adc/Makefile +2
-0+static inline ssize_t ad7291_set_t_sense_low(struct device *dev, + struct device_attribute *attr, + const char =
*buf, + size_t len) +{
Quoted 1 line
Quoted 1 line
+ return ad7291_set_t_bound(dev, attr, + AD7291_T_SE=
NSE_LOW, buf,
Quoted 2 lines
Quoted 2 lines
len); +} + +static
ssize_tad7291_show_t_sense_hyst(struct device *dev,
+ structdevice_attribute*attr, + char *buf) =
+{ + return
Quoted 1 line
Quoted 1 line
ad7291_show_t_bound(dev, attr, + AD7291_T_SENSE_HYST=
, buf); +} +
Quoted 2 lines
drivers/staging/iio/adc/Makefile
Quoted 2 lines
drivers/staging/iio/adc/Makefile +2
-0+static inline ssize_t ad7291_set_t_sense_hyst(struct device *dev, + struct device_attribute *attr, + const char =
*buf, + size_t len) +{
Quoted 1 line
Quoted 1 line
+ return ad7291_set_t_bound(dev, attr, + AD7291_T_SE=
NSE_HYST, buf,
Quoted 2 lines
Quoted 2 lines
len); +} + +static inline
ssize_tad7291_show_v_bound(struct device
*dev, + structdevice_attribute*attr, + u8 =
bound_reg, + char *buf)
Quoted 2 lines
Quoted 2 lines
+{ + struct
iio_dev*dev_info=3Ddev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + u16 data; + i=
nt ret; +
Quoted 1 line
Quoted 1 line
+ if (
bound_reg<AD7291_VOLTAGE_LIMIT_BASE|| +bound_reg>=
=3D
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_LIMIT_BASE+ + AD7291_VOLTAGE_LIMIT_COUNT)=
+ return
Quoted 1 line
Quoted 1 line
-EINVAL; + + ret =3Dad7291_i2c_read(chip, bound_reg, &data); + i=
f (ret)
Quoted 1 line
Quoted 1 line
+ return
-EIO; + + data &=3DAD7291_VALUE_MASK; + + r=
eturn sprintf(buf,
Quoted 2 lines
Quoted 2 lines
"%d\n", data); } + +static inline
ssize_tad7291_set_v_bound(struct
device *dev, + structdevice_attribute*attr, + =
u8 bound_reg,
Quoted 1 line
Quoted 1 line
+ const char *buf, +
size_tlen) +{ + str=
uct iio_dev *dev_info =3D
Quoted 2 lines
Quoted 2 lines
dev_get_drvdata(dev); + structad7291_chip_info*chip =3Ddev_info->dev_data; + unsigned long value; + u16 data; + int=
ret; +
Quoted 1 line
Quoted 1 line
+ if (
bound_reg<AD7291_VOLTAGE_LIMIT_BASE|| +bound_reg>=
=3D
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_LIMIT_BASE+ + AD7291_VOLTAGE_LIMIT_COUNT)=
+ return
Quoted 1 line
Quoted 1 line
-EINVAL; + + ret =3Dstrict_strtoul(buf, 10, &value); + + if (ret |=
|
Quoted 1 line
Quoted 1 line
value >=3D 4096) + return
-EINVAL; + + data =3D (u16)val=
ue; + ret =3D
Quoted 1 line
Quoted 1 line
ad7291_i2c_write(chip, bound_reg, data); + if (ret) + ret=
urn -EIO; +
Quoted 1 line
Quoted 1 line
+ return ret; +} + +static int ad7291_get_voltage_limit_regs(const ch=
ar
Quoted 1 line
Quoted 1 line
*channel) { + int index; + + if (strlen(channel) < 3 && channel[=
0] !=3D
Quoted 1 line
Quoted 1 line
'v') + return
-EINVAL; + + index =3D channel[1] - '0';=
+ if (index >=3D
Quoted 1 line
Quoted 1 line
AD7291_VOLTAGE_LIMIT_COUNT) + return-EINVAL; + + ret=
urn index; +} +
Quoted 1 line
Quoted 1 line
+static
ssize_tad7291_show_voltage_high(struct device *dev, + =
struct
Quoted 1 line
Quoted 1 line
device_attribute*attr, + char *buf) +{ + int regs; + + reg=
s =3D
Quoted 2 lines
Quoted 2 lines
ad7291_get_voltage_limit_regs(attr->attr.name); + + if (regs < 0)
+ return regs; + + return ad7291_show_t_bound(dev, att=
r, regs, buf); }
Quoted 2 lines
Quoted 2 lines
+ +static inline
ssize_tad7291_set_voltage_high(struct device *dev,
+ structdevice_attribute*attr, + const char =
*buf, + size_t len) +{
Quoted 1 line
Quoted 1 line
+ int regs; + + regs =3D ad7291_get_voltage_limit_regs(attr->attr.n=
ame);
Quoted 1 line
Quoted 1 line
+ + if (regs < 0) + return regs; + + return ad7291_set_t=
_bound(dev,
Quoted 2 lines
Quoted 2 lines
attr, regs, buf, len); } + +static
ssize_t
ad7291_show_voltage_low(struct device *dev, + struct devi=
ce_attribute
Quoted 3 lines
Quoted 3 lines
*attr, + char *buf) +{ + int regs; + + regs =3D
ad7291_get_voltage_limit_regs(attr->attr.name); + + if (regs < 0)
+ return regs; + + return ad7291_show_t_bound(dev, att=
r, regs+1, buf);
Quoted 2 lines
Quoted 2 lines
} + +static inline
ssize_tad7291_set_voltage_low(struct device *dev,
+ structdevice_attribute*attr, + const char =
*buf, + size_t len) +{
Quoted 1 line
Quoted 1 line
+ int regs; + + regs =3D ad7291_get_voltage_limit_regs(attr->attr.n=
ame);
Quoted 1 line
Quoted 1 line
+ + if (regs < 0) + return regs; + + return ad7291_set_t=
_bound(dev,
Quoted 2 lines
Quoted 2 lines
attr, regs+1, buf, len); } + +static
ssize_t
ad7291_show_voltage_hyst(struct device *dev, + struct devi=
ce_attribute
Quoted 3 lines
Quoted 3 lines
*attr, + char *buf) +{ + int regs; + + regs =3D
ad7291_get_voltage_limit_regs(attr->attr.name); + + if (regs < 0)
+ return regs; + + return ad7291_show_t_bound(dev, att=
r, regs+2, buf);
Quoted 2 lines
Quoted 2 lines
} + +static inline
ssize_tad7291_set_voltage_hyst(struct device *dev,
+ structdevice_attribute*attr, + const char =
*buf, + size_t len) +{
Quoted 1 line
Quoted 1 line
+ int regs; + + regs =3D ad7291_get_voltage_limit_regs(attr->attr.n=
ame);
Quoted 1 line
Quoted 1 line
+ + if (regs < 0) + return regs; + + return ad7291_set_t=
_bound(dev,
Quoted 2 lines
Quoted 2 lines
attr, regs+2, buf, len); } + +IIO_EVENT_ATTR_SH(t_sense_high,
iio_event_ad7291, +ad7291_show_t_sense_high, ad7291_set_t_sens=
e_high,
Quoted 44 lines
Quoted 44 lines
0); +IIO_EVENT_ATTR_SH(t_sense_low,
iio_event_ad7291,drivers/staging/iio/adc/Makefile +43
-0+ ad7291_show_t_sense_low, ad7291_set_t_sense_low, 0); +IIO_EVENT_ATTR_SH(t_sense_hyst, iio_event_ad7291, + ad7291_show_t_sense_hyst, ad7291_set_t_sense_hyst, 0); + +IIO_EVENT_ATTR_SH(v0_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v0_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v0_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v1_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v1_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v1_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v2_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v2_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v2_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v3_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v3_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v3_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v4_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v4_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v4_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v5_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v5_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v5_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v6_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v6_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0);
Quoted 8 lines
drivers/staging/iio/adc/Makefile
Quoted 8 lines
drivers/staging/iio/adc/Makefile +8
-0+IIO_EVENT_ATTR_SH(v6_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); +IIO_EVENT_ATTR_SH(v7_high, iio_event_ad7291, + ad7291_show_voltage_high, ad7291_set_voltage_high, 0); +IIO_EVENT_ATTR_SH(v7_low, iio_event_ad7291, + ad7291_show_voltage_low, ad7291_set_voltage_low, 0); +IIO_EVENT_ATTR_SH(v7_hyst, iio_event_ad7291, + ad7291_show_voltage_hyst, ad7291_set_voltage_hyst, 0); + +s=
tatic
Quoted 20 lines
Quoted 20 lines
struct attribute *ad7291_event_attributes[] =3D {
drivers/staging/iio/adc/Makefile +19
-0+ &iio_event_attr_t_sense_high.dev_attr.attr, + &iio_event_attr_t_sense_low.dev_attr.attr, + &iio_event_attr_t_sense_hyst.dev_attr.attr, + &iio_event_attr_v0_high.dev_attr.attr, + &iio_event_attr_v0_low.dev_attr.attr, + &iio_event_attr_v0_hyst.dev_attr.attr, + &iio_event_attr_v1_high.dev_attr.attr, + &iio_event_attr_v1_low.dev_attr.attr, + &iio_event_attr_v1_hyst.dev_attr.attr, + &iio_event_attr_v2_high.dev_attr.attr, + &iio_event_attr_v2_low.dev_attr.attr, + &iio_event_attr_v2_hyst.dev_attr.attr, + &iio_event_attr_v3_high.dev_attr.attr, + &iio_event_attr_v3_low.dev_attr.attr, + &iio_event_attr_v3_hyst.dev_attr.attr, + &iio_event_attr_v4_high.dev_attr.attr, + &iio_event_attr_v4_low.dev_attr.attr, + &iio_event_attr_v4_hyst.dev_attr.attr, + &iio_event_attr_v5_high.dev_attr.attr,
Quoted 8 lines
drivers/staging/iio/adc/Makefile
Quoted 8 lines
drivers/staging/iio/adc/Makefile +8
-0+ &iio_event_attr_v5_low.dev_attr.attr, + &iio_event_attr_v5_hyst.dev_attr.attr, + &iio_event_attr_v6_high.dev_attr.attr, + &iio_event_attr_v6_low.dev_attr.attr, + &iio_event_attr_v6_hyst.dev_attr.attr, + &iio_event_attr_v7_high.dev_attr.attr, + &iio_event_attr_v7_low.dev_attr.attr, + &iio_event_attr_v7_hyst.dev_attr.attr, + NULL, +}; + +static=
struct
Quoted 3 lines
Quoted 3 lines
attribute_groupad7291_event_attribute_group=3D { + .attrs =3Dad7291_event_attributes, +}; + +/* + * device probe and remove + */ +
+static int__devinitad7291_probe(structi2c_client*client, + =
const
Quoted 1 line
Quoted 1 line
struct
i2c_device_id*id) +{ + structad7291_chip_info*chip; + =
int ret
Quoted 1 line
Quoted 1 line
=3D 0; + + chip =3D kzalloc(sizeof(struct
ad7291_chip_info), GFP_KER=
NEL); +
Quoted 1 line
Quoted 1 line
+ if (chip =3D=3D NULL) + return
-ENOMEM; + + /* this=
is only used for
Quoted 2 lines
Quoted 2 lines
device removal purposes */ +
i2c_set_clientdata(client, chip); +
+chip->client=3D client; +chip->name=3Did->name; + =
chip->command =3D
Quoted 2 lines
Quoted 2 lines
AD7291_NOISE_DELAY|AD7291_T_SENSE_MASK; + +chip->indio_dev=3Diio_allocate_device(); + if (chip->indio_dev=3D=3D NULL) { + =
ret =3D
Quoted 1 line
Quoted 1 line
-ENOMEM; + gotoerror_free_chip; + } + + chip->indio_dev->de=
v.parent =3D
Quoted 5 lines
drivers/staging/iio/adc/Makefile
Quoted 5 lines
&client->dev; +chip->indio_dev->attrs=3D&ad7291_attribute_group;drivers/staging/iio/adc/Makefile +4
-0+ chip->indio_dev->event_attrs =3D &ad7291_event_attribute_group; + chip->indio_dev->dev_data =3D (void *)chip; + chip->indio_dev->driver_module =3D THIS_MODULE; + chip->indio_dev->num_interrupt_lines =3D 1; + chip->indio_dev->=
modes =3D
Quoted 1 line
Quoted 1 line
INDIO_DIRECT_MODE; + + ret =3D iio_device_register(chip->indio_dev=
); + if
Quoted 1 line
Quoted 1 line
(ret) + goto
error_free_dev; + + if (client->irq> 0=
) { + ret =3D
Quoted 1 line
Quoted 1 line
iio_register_interrupt_line(client->irq, + chi=
p->indio_dev, + 0,
Quoted 1 line
Quoted 1 line
+
client->irq_flags, + =
chip->name); + if (ret) + goto
Quoted 1 line
Quoted 1 line
error_unreg_dev; + + /* + * The event handler list e=
lement refer to
Quoted 1 line
Quoted 1 line
iio_event_ad7291. + * All event attributes bind to the same ev=
ent
Quoted 1 line
Quoted 1 line
handler. + * So, only register event handler once. + =
*/
Quoted 2 lines
drivers/staging/iio/adc/Makefile
Quoted 2 lines
drivers/staging/iio/adc/Makefile +2
-0+ iio_add_event_to_list(&iio_event_ad7291, + &chip->indio_dev->interrupts[0]->ev_list); =
+
Quoted 1 line
Quoted 1 line
+
INIT_WORK(&chip->thresh_work, ad7291_interrupt_bh); + + =
if
Quoted 1 line
Quoted 1 line
(
client->irq_flags&IRQF_TRIGGER_LOW) + chip->comma=
nd |=3D
Quoted 2 lines
Quoted 2 lines
AD7291_ALART_POLARITY; + } + + ret =3D ad7291_i2c_write(chip,AD7291_COMMAND,chip->command); + if (ret) { + ret =3D -EI=
O; + goto
Quoted 1 line
Quoted 1 line
error_unreg_irq; + } + + dev_info(&client->dev, "%s temperature sens=
or
Quoted 1 line
Quoted 1 line
registered.\n", +
id->name); + + return 0; + +error_=
unreg_irq:
Quoted 1 line
Quoted 1 line
+
iio_unregister_interrupt_line(chip->indio_dev, 0); +error_unreg_dev=
:
Quoted 2 lines
drivers/staging/iio/adc/Makefile
Quoted 2 lines
drivers/staging/iio/adc/Makefile +2
-0+ iio_device_unregister(chip->indio_dev); +error_free_dev: + iio_free_device(chip->indio_dev); +error_free_chip: + kfree(chip)=
; +
Quoted 6 lines
drivers/staging/iio/adc/Makefile
Quoted 6 lines
+ return ret; +} + +static int
__devexitad7291_remove(structi2c_client*client) { + structad7291_chip_info*chip =3Di2c_get_clientdata(client); + structiio_dev*indio_dev=3Dchip->indio_dev; + + if (client->irq)drivers/staging/iio/adc/Makefile +2
-0+ iio_unregister_interrupt_line(indio_dev, 0); + iio_device_unregister(indio_dev); + iio_free_device(chip->indio=
_dev);
Quoted 1 line
Quoted 1 line
+ kfree(chip); + + return 0; +} + +static const struct i2c_dev=
ice_id
Quoted 1 line
Quoted 1 line
ad7291_id[] =3D { + { "ad7291", 0 }, + {} +}; + +MODULE_DEVICE_T=
ABLE(i2c,
Quoted 1 line
Quoted 1 line
ad7291_id); + +static structi2c_driverad7291_driver=3D { + .driver =
=3D {
Quoted 1 line
Quoted 1 line
+ .name =3D "ad7291", + }, + .probe =3D
ad7291_probe, =
+ .remove =3D
Quoted 1 line
Quoted 1 line
__devexit_p(ad7291_remove), + .id_table =3Dad7291_id, +}; + +sta=
tic
Quoted 1 line
Quoted 1 line
__initintad7291_init(void){ + return i2c_add_driver(&ad7291_drive=
r);
Quoted 4 lines
Quoted 4 lines
} + +static
__exitvoidad7291_exit(void){
+i2c_del_driver(&ad7291_driver); +} + +MODULE_AUTHOR("Sonic Zhang
<[email protected]>"); +MODULE_DESCRIPTION("Analog Devices AD7291
digital" + " temperature sensor driver"); +MODULE_LICE=
NSE("GPL v2");
Quoted 2 lines
Quoted 1 line
+ +module_init(ad7291_init); +module_exit(ad7291_exit);
Greetings,
Michael
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeft= sfuehrer Thomas Wessel, William A. Martin, Margaret Seif
Re: BUILD ISSUE: Re: [PATCH 07/36] staging: iio: adc: new driver for AD7291 devices
Quoted 20 lines · Michael
Jonathan Cameron wrote on 2010-10-25:
Quoted 10 lines · Mike Frysinger
Quoted 1 line
From: Sonic Zhang <[email protected]>
Build test results (cross compiled for arm) on top of staging-next
drivers/staging/iio/adc/ad7291.c: In function 'ad7291_probe':drivers/staging/iio/adc/ad7291.c:951: error: 'structi2c_client' has no member named 'irq_flags'drivers/staging/iio/adc/ad7291.c:966: error: 'structi2c_client' has no member named 'irq_flags'Quoted 8 lines
Google tells me you guys have posted a patch adding this a couple of weeks back. Doesn't
look like Jean liked it... If it is merging you need to tell Greg
that there is a dependency
on it when you send him the merge request. Otherwise just remove the usage and rely on it happening in board setup code. Personally I agree with what the patch was trying to do, but if it isn't merging we don't want to hold this driver up waiting for it.
Quoted 5 lines
Ok - I remove it for now.
Actually we've added
irq_flagsto both i2c and spi board info. There were a few people who commented positively on both patches. Feel free to send your cents as well.
Grep the whole set. There are quite a few users.
Jonathan
Quoted 3 lines
-Michael
PATCH 8/36 staging: iio: adc: new driver for AD7298 devices
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7298.c | 501 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 509 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7298.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -48,6 +48,13 @@ config AD7291 Say yes here to build support for Analog Devices AD7291 temperature sensors. +config AD7298 + tristate "Analog Devices AD7298 temperature sensor and ADC driver" + depends on SPI + help + Say yes here to build support for Analog Devices AD7298 + temperature sensors and ADC. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
@@ -18,3 +18,4 @@ obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD7150) += ad7150.o obj-$(CONFIG_AD7152) += ad7152.o obj-$(CONFIG_AD7291) += ad7291.o +obj-$(CONFIG_AD7298) += ad7298.o
drivers/staging/iio/adc/ad7298.c new file +501 -0
501 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 9/36 staging: iio: adc: new driver for AD7314 devices
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7314.c | 308 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 316 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7314.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -55,6 +55,13 @@ config AD7298 Say yes here to build support for Analog Devices AD7298 temperature sensors and ADC. +config AD7314 + tristate "Analog Devices AD7314 temperature sensor driver" + depends on SPI + help + Say yes here to build support for Analog Devices AD7314 + temperature sensors. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
@@ -19,3 +19,4 @@ obj-$(CONFIG_AD7150) += ad7150.o obj-$(CONFIG_AD7152) += ad7152.o obj-$(CONFIG_AD7291) += ad7291.o obj-$(CONFIG_AD7298) += ad7298.o +obj-$(CONFIG_AD7314) += ad7314.o
drivers/staging/iio/adc/ad7314.c new file +308 -0
308 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 10/36 staging: iio: adc: new driver for AD7414/5 devices
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7414.c | 573 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 581 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7414.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -62,6 +62,13 @@ config AD7314 Say yes here to build support for Analog Devices AD7314 temperature sensors. +config AD7414 + tristate "Analog Devices AD7414 and AD7415 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices AD7414 and AD7415 + temperature sensors. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
@@ -20,3 +20,4 @@ obj-$(CONFIG_AD7152) += ad7152.o obj-$(CONFIG_AD7291) += ad7291.o obj-$(CONFIG_AD7298) += ad7298.o obj-$(CONFIG_AD7314) += ad7314.o +obj-$(CONFIG_AD7414) += ad7414.o
drivers/staging/iio/adc/ad7414.c new file +573 -0
573 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 11/36 staging: iio: adc: new driver for AD7416/7/8 devices
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7416.c | 777 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 785 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7416.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -69,6 +69,13 @@ config AD7414 Say yes here to build support for Analog Devices AD7414 and AD7415 temperature sensors. +config AD7416 + tristate "Analog Devices AD7416/7/8 temperature sensor and ADC driver" + depends on I2C + help + Say yes here to build support for Analog Devices AD74167/8 + temperature sensors and ADC. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
@@ -21,3 +21,4 @@ obj-$(CONFIG_AD7291) += ad7291.o obj-$(CONFIG_AD7298) += ad7298.o obj-$(CONFIG_AD7314) += ad7314.o obj-$(CONFIG_AD7414) += ad7414.o +obj-$(CONFIG_AD7416) += ad7416.o
drivers/staging/iio/adc/ad7416.c new file +777 -0
777 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 12/36 staging: iio: adc: new driver for AD7745/6/7 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 2 + drivers/staging/iio/adc/ad774x.c | 719 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 728 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad774x.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -110,3 +110,10 @@ config AD7476 To compile this driver as a module, choose M here: the module will be called ad7476. + +config AD774X + tristate "Analog Devices ad7745/6/7 capacitive sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices capacitive sensors. + (ad7745, ad7746, ad7747) Provides direct access via sysfs.
drivers/staging/iio/adc/Makefile +2 -0
@@ -22,3 +22,5 @@ obj-$(CONFIG_AD7298) += ad7298.o obj-$(CONFIG_AD7314) += ad7314.o obj-$(CONFIG_AD7414) += ad7414.o obj-$(CONFIG_AD7416) += ad7416.o +obj-$(CONFIG_AD7476) += ad7476.o +obj-$(CONFIG_AD774X) += ad774x.o
drivers/staging/iio/adc/ad774x.c new file +719 -0
719 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 13/36 staging: iio: adc: new driver for AD7816 devices
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/ad7816.c | 538 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7816.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -117,3 +117,10 @@ config AD774X help Say yes here to build support for Analog Devices capacitive sensors. (ad7745, ad7746, ad7747) Provides direct access via sysfs. + +config AD7816 + tristate "Analog Devices AD7816/7/8 temperature sensor and ADC driver" + depends on SPI + help + Say yes here to build support for Analog Devices AD7816/7/8 + temperature sensors and ADC.
drivers/staging/iio/adc/Makefile +1 -0
@@ -24,3 +24,4 @@ obj-$(CONFIG_AD7414) += ad7414.o obj-$(CONFIG_AD7416) += ad7416.o obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD774X) += ad774x.o +obj-$(CONFIG_AD7816) += ad7816.o
drivers/staging/iio/adc/ad7816.c new file +538 -0
538 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 14/36 staging: iio: adc: new driver for ADT75 temperature sensors
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/adt75.c | 734 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 742 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/adt75.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -124,3 +124,10 @@ config AD7816 help Say yes here to build support for Analog Devices AD7816/7/8 temperature sensors and ADC. + +config ADT75 + tristate "Analog Devices ADT75 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices ADT75 + temperature sensors.
drivers/staging/iio/adc/Makefile +1 -0
@@ -25,3 +25,4 @@ obj-$(CONFIG_AD7416) += ad7416.o obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD774X) += ad774x.o obj-$(CONFIG_AD7816) += ad7816.o +obj-$(CONFIG_ADT75) += adt75.o
drivers/staging/iio/adc/adt75.c new file +734 -0
734 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 15/36 staging: iio: adc: new driver for ADT7310 temperature sensors
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/adt7310.c | 951 +++++++++++++++++++++++++++++++++++++ 3 files changed, 959 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/adt7310.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -131,3 +131,10 @@ config ADT75 help Say yes here to build support for Analog Devices ADT75 temperature sensors. + +config ADT7408 + tristate "Analog Devices ADT7408 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices ADT7408 + temperature sensors.
drivers/staging/iio/adc/Makefile +1 -0
@@ -26,3 +26,4 @@ obj-$(CONFIG_AD7476) += ad7476.o obj-$(CONFIG_AD774X) += ad774x.o obj-$(CONFIG_AD7816) += ad7816.o obj-$(CONFIG_ADT75) += adt75.o +obj-$(CONFIG_ADT7310) += adt7310.o
drivers/staging/iio/adc/adt7310.c new file +951 -0
951 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 16/36 staging: iio: adc: new driver for ADT7408 temperature sensors
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/adt7408.c | 1006 +++++++++++++++++++++++++++++++++++++ 3 files changed, 1014 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/adt7408.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -138,3 +138,10 @@ config ADT7408 help Say yes here to build support for Analog Devices ADT7408 temperature sensors. + +config ADT7410 + tristate "Analog Devices ADT7410 temperature sensor driver" + depends on I2C + help + Say yes here to build support for Analog Devices ADT7410 + temperature sensors.
drivers/staging/iio/adc/Makefile +1 -0
@@ -27,3 +27,4 @@ obj-$(CONFIG_AD774X) += ad774x.o obj-$(CONFIG_AD7816) += ad7816.o obj-$(CONFIG_ADT75) += adt75.o obj-$(CONFIG_ADT7310) += adt7310.o +obj-$(CONFIG_ADT7408) += adt7408.o
drivers/staging/iio/adc/adt7408.c new file +1006 -0
1,006 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 17/36 staging: iio: adc: new driver for ADT7410 temperature sensors
In reply to Mike FrysingerFrom: Sonic Zhang <[email protected]>
--- drivers/staging/iio/adc/Kconfig | 7 + drivers/staging/iio/adc/Makefile | 1 + drivers/staging/iio/adc/adt7410.c | 917 +++++++++++++++++++++++++++++++++++++ 3 files changed, 925 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/adt7410.c
drivers/staging/iio/adc/Kconfig +7 -0
@@ -145,3 +145,10 @@ config ADT7410 help Say yes here to build support for Analog Devices ADT7410 temperature sensors. + +config ADT7310 + tristate "Analog Devices ADT7310 temperature sensor driver" + depends on SPI + help + Say yes here to build support for Analog Devices ADT7310 + temperature sensors.
drivers/staging/iio/adc/Makefile +1 -0
@@ -28,3 +28,4 @@ obj-$(CONFIG_AD7816) += ad7816.o obj-$(CONFIG_ADT75) += adt75.o obj-$(CONFIG_ADT7310) += adt7310.o obj-$(CONFIG_ADT7408) += adt7408.o +obj-$(CONFIG_ADT7410) += adt7410.o
drivers/staging/iio/adc/adt7410.c new file +917 -0
917 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 18/36 staging: iio: gyro: new driver for ADIS16261 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/gyro/Kconfig | 7 + drivers/staging/iio/gyro/Makefile | 3 + drivers/staging/iio/gyro/adis16261.h | 176 +++++++ drivers/staging/iio/gyro/adis16261_core.c | 770 +++++++++++++++++++++++++++++ drivers/staging/iio/sysfs.h | 6 + 5 files changed, 962 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/gyro/adis16261.h create mode 100644 drivers/staging/iio/gyro/adis16261_core.c
drivers/staging/iio/gyro/Kconfig +7 -0
@@ -11,3 +11,10 @@ config ADIS16260 help Say yes here to build support for Analog Devices adis16260/5 programmable digital gyroscope sensor. + +config ADIS16261 + tristate "Analog Devices ADIS16261 Digital Gyroscope Sensor SPI driver" + depends on SPI + help + Say yes here to build support for Analog Devices adis16261 programmable + digital gyroscope sensor.
drivers/staging/iio/gyro/Makefile +3 -0
@@ -5,3 +5,6 @@ adis16260-y := adis16260_core.o adis16260-$(CONFIG_IIO_RING_BUFFER) += adis16260_ring.o adis16260_trigger.o obj-$(CONFIG_ADIS16260) += adis16260.o + +adis16261-y := adis16261_core.o +obj-$(CONFIG_ADIS16261) += adis16261.o
drivers/staging/iio/gyro/adis16261.h new file +176 -0
176 lines not on this page · raw message
drivers/staging/iio/gyro/adis16261_core.c new file +770 -0
770 lines not on this page · raw message
drivers/staging/iio/sysfs.h +6 -0
@@ -108,6 +108,12 @@ struct iio_const_attr {IIO_DEVICE_ATTR (name,S_IRUGO , _show,NULL ,0 )/** +* IIO_DEV_ATTR_RESET: resets the device + **/ +#define IIO_DEV_ATTR_RESET (_store) \ + IIO_DEVICE_ATTR(reset, S_IWUGO, NULL, _store, 0) + +/** * IIO_CONST_ATTR_NAME - constant identifier * @_string: the name **/
Signature · 1 line
1.7.3.2
PATCH 19/36 staging: iio: gyro: new driver for ADIS16060 digital output gyros
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/gyro/Kconfig | 7 + drivers/staging/iio/gyro/Makefile | 3 + drivers/staging/iio/gyro/adis16060.h | 101 +++++++++ drivers/staging/iio/gyro/adis16060_core.c | 319 +++++++++++++++++++++++++++++ 4 files changed, 430 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/gyro/adis16060.h create mode 100644 drivers/staging/iio/gyro/adis16060_core.c
drivers/staging/iio/gyro/Kconfig +7 -0
@@ -3,6 +3,13 @@ # comment "Digital gyroscope sensors" +config ADIS16060 + tristate "Analog Devices ADIS16060 Yaw Rate Gyroscope with SPI driver" + depends on SPI + help + Say yes here to build support for Analog Devices adis16060 wide bandwidth + yaw rate gyroscope with SPI. + config ADIS16260 tristate "Analog Devices ADIS16260/5 Digital Gyroscope Sensor SPI driver" depends on SPI
drivers/staging/iio/gyro/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for digital gyroscope sensor drivers # +adis16060-y := adis16060_core.o +obj-$(CONFIG_ADIS16060) += adis16060.o + adis16260-y := adis16260_core.o adis16260-$(CONFIG_IIO_RING_BUFFER) += adis16260_ring.o adis16260_trigger.o obj-$(CONFIG_ADIS16260) += adis16260.o
drivers/staging/iio/gyro/adis16060.h new file +101 -0
101 lines not on this page · raw message
drivers/staging/iio/gyro/adis16060_core.c new file +319 -0
319 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 20/36 staging: iio: gyro: new driver for ADIS16080 digital output gyros
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/gyro/Kconfig | 7 + drivers/staging/iio/gyro/Makefile | 3 + drivers/staging/iio/gyro/adis16080.h | 102 +++++++++++ drivers/staging/iio/gyro/adis16080_core.c | 271 +++++++++++++++++++++++++++++ 4 files changed, 383 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/gyro/adis16080.h create mode 100644 drivers/staging/iio/gyro/adis16080_core.c
drivers/staging/iio/gyro/Kconfig +7 -0
@@ -10,6 +10,13 @@ config ADIS16060 Say yes here to build support for Analog Devices adis16060 wide bandwidth yaw rate gyroscope with SPI. +config ADIS16080 + tristate "Analog Devices ADIS16080/100 Yaw Rate Gyroscope with SPI driver" + depends on SPI + help + Say yes here to build support for Analog Devices adis16080/100 Yaw Rate + Gyroscope with SPI. + config ADIS16260 tristate "Analog Devices ADIS16260/5 Digital Gyroscope Sensor SPI driver" depends on SPI
drivers/staging/iio/gyro/Makefile +3 -0
@@ -5,6 +5,9 @@ adis16060-y := adis16060_core.o obj-$(CONFIG_ADIS16060) += adis16060.o +adis16080-y := adis16080_core.o +obj-$(CONFIG_ADIS16080) += adis16080.o + adis16260-y := adis16260_core.o adis16260-$(CONFIG_IIO_RING_BUFFER) += adis16260_ring.o adis16260_trigger.o obj-$(CONFIG_ADIS16260) += adis16260.o
drivers/staging/iio/gyro/adis16080.h new file +102 -0
102 lines not on this page · raw message
drivers/staging/iio/gyro/adis16080_core.c new file +271 -0
271 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 21/36 staging: iio: gyro: new driver for ADIS16130 digital output gyros
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/gyro/Kconfig | 7 + drivers/staging/iio/gyro/Makefile | 3 + drivers/staging/iio/gyro/adis16130.h | 108 ++++++++++ drivers/staging/iio/gyro/adis16130_core.c | 313 +++++++++++++++++++++++++++++ 4 files changed, 431 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/gyro/adis16130.h create mode 100644 drivers/staging/iio/gyro/adis16130_core.c
drivers/staging/iio/gyro/Kconfig +7 -0
@@ -17,6 +17,13 @@ config ADIS16080 Say yes here to build support for Analog Devices adis16080/100 Yaw Rate Gyroscope with SPI. +config ADIS16130 + tristate "Analog Devices ADIS16130 High Precision Angular Rate Sensor driver" + depends on SPI + help + Say yes here to build support for Analog Devices ADIS16130 High Precision + Angular Rate Sensor driver. + config ADIS16260 tristate "Analog Devices ADIS16260/5 Digital Gyroscope Sensor SPI driver" depends on SPI
drivers/staging/iio/gyro/Makefile +3 -0
@@ -8,6 +8,9 @@ obj-$(CONFIG_ADIS16060) += adis16060.o adis16080-y := adis16080_core.o obj-$(CONFIG_ADIS16080) += adis16080.o +adis16130-y := adis16130_core.o +obj-$(CONFIG_ADIS16130) += adis16130.o + adis16260-y := adis16260_core.o adis16260-$(CONFIG_IIO_RING_BUFFER) += adis16260_ring.o adis16260_trigger.o obj-$(CONFIG_ADIS16260) += adis16260.o
drivers/staging/iio/gyro/adis16130.h new file +108 -0
108 lines not on this page · raw message
drivers/staging/iio/gyro/adis16130_core.c new file +313 -0
313 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 22/36 staging: iio: dac: new driver for AD5624R devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
This is used to convert digital streams into voltages.
--- drivers/staging/iio/Kconfig | 1 + drivers/staging/iio/Makefile | 1 + drivers/staging/iio/dac/Kconfig | 11 ++ drivers/staging/iio/dac/Makefile | 5 + drivers/staging/iio/dac/ad5624r.h | 21 +++ drivers/staging/iio/dac/ad5624r_spi.c | 313 +++++++++++++++++++++++++++++++++ drivers/staging/iio/dac/dac.h | 6 + 7 files changed, 358 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dac/Kconfig create mode 100644 drivers/staging/iio/dac/Makefile create mode 100644 drivers/staging/iio/dac/ad5624r.h create mode 100644 drivers/staging/iio/dac/ad5624r_spi.c create mode 100644 drivers/staging/iio/dac/dac.h
drivers/staging/iio/Kconfig +1 -0
@@ -43,6 +43,7 @@ config IIO_TRIGGER source "drivers/staging/iio/accel/Kconfig" source "drivers/staging/iio/adc/Kconfig" source "drivers/staging/iio/addac/Kconfig" +source "drivers/staging/iio/dac/Kconfig" source "drivers/staging/iio/gyro/Kconfig" source "drivers/staging/iio/imu/Kconfig" source "drivers/staging/iio/light/Kconfig"
drivers/staging/iio/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_IIO_SW_RING) += ring_sw.o obj-y += accel/ obj-y += adc/ obj-y += addac/ +obj-y += dac/ obj-y += gyro/ obj-y += imu/ obj-y += light/
drivers/staging/iio/dac/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +# +# DAC drivers +# +comment "Digital to analog convertors" + +config AD5624R_SPI + tristate "Analog Devices AD5624/44/64R DAC spi driver" + depends on SPI + help + Say yes here to build support for Analog Devices AD5624R, AD5644R and + AD5664R convertors (DAC). This driver uses the common SPI interface.
drivers/staging/iio/dac/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for industrial I/O DAC drivers +# + +obj-$(CONFIG_AD5624R_SPI) += ad5624r_spi.o
drivers/staging/iio/dac/ad5624r.h new file +21 -0
@@ -0,0 +1,21 @@ +#ifndef SPI_AD5624R_H_ +#define SPI_AD5624R_H_ + +#define AD5624R_DAC_CHANNELS 4 + +#define AD5624R_ADDR_DAC0 0x0 +#define AD5624R_ADDR_DAC1 0x1 +#define AD5624R_ADDR_DAC2 0x2 +#define AD5624R_ADDR_DAC3 0x3 +#define AD5624R_ADDR_ALL_DAC 0x7 + +#define AD5624R_CMD_WRITE_INPUT_N 0x0 +#define AD5624R_CMD_UPDATE_DAC_N 0x1 +#define AD5624R_CMD_WRITE_INPUT_N_UPDATE_ALL 0x2 +#define AD5624R_CMD_WRITE_INPUT_N_UPDATE_N 0x3 +#define AD5624R_CMD_POWERDOWN_DAC 0x4 +#define AD5624R_CMD_RESET 0x5 +#define AD5624R_CMD_LDAC_SETUP 0x6 +#define AD5624R_CMD_INTERNAL_REFER_SETUP 0x7 + +#endif
drivers/staging/iio/dac/ad5624r_spi.c new file +313 -0
313 lines not on this page · raw message
drivers/staging/iio/dac/dac.h new file +6 -0
@@ -0,0 +1,6 @@ +/* +* dac.h - sysfs attributes associated with DACs +*/ + +#define IIO_DEV_ATTR_DAC (_num, _store, _addr) \ + IIO_DEVICE_ATTR(dac_##_num, S_IWUSR, NULL, _store, _addr)
Signature · 1 line
1.7.3.2
PATCH 23/36 staging: iio: dds: new driver for AD5930/2 devices
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
This is the initial driver in the new Direct Digital Synthesis section.
--- drivers/staging/iio/Kconfig | 1 + drivers/staging/iio/Makefile | 1 + drivers/staging/iio/dds/Kconfig | 11 +++ drivers/staging/iio/dds/Makefile | 5 + drivers/staging/iio/dds/ad5930.c | 170 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dds/Kconfig create mode 100644 drivers/staging/iio/dds/Makefile create mode 100644 drivers/staging/iio/dds/ad5930.c
drivers/staging/iio/Kconfig +1 -0
@@ -44,6 +44,7 @@ source "drivers/staging/iio/accel/Kconfig" source "drivers/staging/iio/adc/Kconfig" source "drivers/staging/iio/addac/Kconfig" source "drivers/staging/iio/dac/Kconfig" +source "drivers/staging/iio/dds/Kconfig" source "drivers/staging/iio/gyro/Kconfig" source "drivers/staging/iio/imu/Kconfig" source "drivers/staging/iio/light/Kconfig"
drivers/staging/iio/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-y += accel/ obj-y += adc/ obj-y += addac/ obj-y += dac/ +obj-y += dds/ obj-y += gyro/ obj-y += imu/ obj-y += light/
drivers/staging/iio/dds/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +# +# Direct Digital Synthesis drivers +# +comment "Direct Digital Synthesis" + +config AD5930 + tristate "Analog Devices ad5930/5932 driver" + depends on SPI + help + Say yes here to build support for Analog Devices DDS chip + ad5930/ad5932, provides direct access via sysfs.
drivers/staging/iio/dds/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for Direct Digital Synthesis drivers +# + +obj-$(CONFIG_AD5930) += ad5930.o
drivers/staging/iio/dds/ad5930.c new file +170 -0
170 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 24/36 staging: iio: dds: new driver for AD9832/3/4/5 devices
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
--- drivers/staging/iio/dds/Kconfig | 7 + drivers/staging/iio/dds/Makefile | 1 + drivers/staging/iio/dds/ad9832.c | 266 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 274 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dds/ad9832.c
drivers/staging/iio/dds/Kconfig +7 -0
@@ -9,3 +9,10 @@ config AD5930 help Say yes here to build support for Analog Devices DDS chip ad5930/ad5932, provides direct access via sysfs. + +config AD9832 + tristate "Analog Devices ad9832/3/4/5 driver" + depends on SPI + help + Say yes here to build support for Analog Devices DDS chip + ad9832/3/4/5, provides direct access via sysfs.
drivers/staging/iio/dds/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-$(CONFIG_AD5930) += ad5930.o +obj-$(CONFIG_AD9832) += ad9832.o
drivers/staging/iio/dds/ad9832.c new file +266 -0
266 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 25/36 staging: iio: dds: new driver for AD9850/1 devices
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
--- drivers/staging/iio/dds/Kconfig | 7 ++ drivers/staging/iio/dds/Makefile | 1 + drivers/staging/iio/dds/ad9850.c | 156 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dds/ad9850.c
drivers/staging/iio/dds/Kconfig +7 -0
@@ -16,3 +16,10 @@ config AD9832 help Say yes here to build support for Analog Devices DDS chip ad9832/3/4/5, provides direct access via sysfs. + +config AD9850 + tristate "Analog Devices ad9850/1 driver" + depends on SPI + help + Say yes here to build support for Analog Devices DDS chip + ad9850/1, provides direct access via sysfs.
drivers/staging/iio/dds/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_AD5930) += ad5930.o obj-$(CONFIG_AD9832) += ad9832.o +obj-$(CONFIG_AD9850) += ad9850.o
drivers/staging/iio/dds/ad9850.c new file +156 -0
156 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 26/36 staging: iio: dds: new driver for AD9852/4 devices
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
--- drivers/staging/iio/dds/Kconfig | 7 + drivers/staging/iio/dds/Makefile | 1 + drivers/staging/iio/dds/ad9852.c | 314 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 322 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dds/ad9852.c
drivers/staging/iio/dds/Kconfig +7 -0
@@ -23,3 +23,10 @@ config AD9850 help Say yes here to build support for Analog Devices DDS chip ad9850/1, provides direct access via sysfs. + +config AD9852 + tristate "Analog Devices ad9852/4 driver" + depends on SPI + help + Say yes here to build support for Analog Devices DDS chip + ad9852/4, provides direct access via sysfs.
drivers/staging/iio/dds/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-$(CONFIG_AD5930) += ad5930.o obj-$(CONFIG_AD9832) += ad9832.o obj-$(CONFIG_AD9850) += ad9850.o +obj-$(CONFIG_AD9852) += ad9852.o
drivers/staging/iio/dds/ad9852.c new file +314 -0
314 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 27/36 staging: iio: dds: new driver for AD9910 devices
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
--- drivers/staging/iio/dds/Kconfig | 7 + drivers/staging/iio/dds/Makefile | 1 + drivers/staging/iio/dds/ad9910.c | 454 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 462 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dds/ad9910.c
drivers/staging/iio/dds/Kconfig +7 -0
@@ -30,3 +30,10 @@ config AD9852 help Say yes here to build support for Analog Devices DDS chip ad9852/4, provides direct access via sysfs. + +config AD9910 + tristate "Analog Devices ad9910 driver" + depends on SPI + help + Say yes here to build support for Analog Devices DDS chip + ad9910, provides direct access via sysfs.
drivers/staging/iio/dds/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_AD5930) += ad5930.o obj-$(CONFIG_AD9832) += ad9832.o obj-$(CONFIG_AD9850) += ad9850.o obj-$(CONFIG_AD9852) += ad9852.o +obj-$(CONFIG_AD9910) += ad9910.o
drivers/staging/iio/dds/ad9910.c new file +454 -0
454 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 28/36 staging: iio: dds: new driver for AD9951 devices
In reply to Mike FrysingerFrom: Cliff Cai <[email protected]>
--- drivers/staging/iio/dds/Kconfig | 7 + drivers/staging/iio/dds/Makefile | 1 + drivers/staging/iio/dds/ad9951.c | 254 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/dds/ad9951.c
drivers/staging/iio/dds/Kconfig +7 -0
@@ -37,3 +37,10 @@ config AD9910 help Say yes here to build support for Analog Devices DDS chip ad9910, provides direct access via sysfs. + +config AD9951 + tristate "Analog Devices ad9951 driver" + depends on SPI + help + Say yes here to build support for Analog Devices DDS chip + ad9951, provides direct access via sysfs.
drivers/staging/iio/dds/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-$(CONFIG_AD9832) += ad9832.o obj-$(CONFIG_AD9850) += ad9850.o obj-$(CONFIG_AD9852) += ad9852.o obj-$(CONFIG_AD9910) += ad9910.o +obj-$(CONFIG_AD9951) += ad9951.o
drivers/staging/iio/dds/ad9951.c new file +254 -0
254 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 29/36 staging: iio: meter: new driver for ADE7753/6 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
This also kicks off the new meter subsection.
--- drivers/staging/iio/Kconfig | 2 +- drivers/staging/iio/Makefile | 3 +- drivers/staging/iio/meter/Kconfig | 11 + drivers/staging/iio/meter/Makefile | 5 + drivers/staging/iio/meter/ade7753.c | 730 +++++++++++++++++++++++++++++++++++ drivers/staging/iio/meter/ade7753.h | 140 +++++++ drivers/staging/iio/meter/meter.h | 396 +++++++++++++++++++ 7 files changed, 1285 insertions(+), 2 deletions(-) create mode 100644 drivers/staging/iio/meter/Kconfig create mode 100644 drivers/staging/iio/meter/Makefile create mode 100644 drivers/staging/iio/meter/ade7753.c create mode 100644 drivers/staging/iio/meter/ade7753.h create mode 100644 drivers/staging/iio/meter/meter.h
drivers/staging/iio/Kconfig +1 -1
@@ -49,7 +49,7 @@ source "drivers/staging/iio/gyro/Kconfig" source "drivers/staging/iio/imu/Kconfig" source "drivers/staging/iio/light/Kconfig" source "drivers/staging/iio/magnetometer/Kconfig" - +source "drivers/staging/iio/meter/Kconfig" source "drivers/staging/iio/trigger/Kconfig" endif # IIO
drivers/staging/iio/Makefile +2 -1
@@ -17,5 +17,6 @@ obj-y += dds/ obj-y += gyro/ obj-y += imu/ obj-y += light/ -obj-y += trigger/ obj-y += magnetometer/ +obj-y += meter/ +obj-y += trigger/
drivers/staging/iio/meter/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +# +# IIO meter drivers configuration +# +comment "Active energy metering IC" + +config ADE7753 + tristate "Analog Devices ADE7753/6 Single-Phase Multifunction Metering IC Driver" + depends on SPI + help + Say yes here to build support for Analog Devices ADE7753 Single-Phase Multifunction + Metering IC with di/dt Sensor Interface.
drivers/staging/iio/meter/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for metering ic drivers +# + +obj-$(CONFIG_ADE7753) += ade7753.o
drivers/staging/iio/meter/ade7753.c new file +730 -0
730 lines not on this page · raw message
drivers/staging/iio/meter/ade7753.h new file +140 -0
140 lines not on this page · raw message
drivers/staging/iio/meter/meter.h new file +396 -0
396 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 30/36 staging: iio: meter: new driver for ADE7754 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/meter/Kconfig | 7 + drivers/staging/iio/meter/Makefile | 1 + drivers/staging/iio/meter/ade7754.c | 756 +++++++++++++++++++++++++++++++++++ drivers/staging/iio/meter/ade7754.h | 161 ++++++++ 4 files changed, 925 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/meter/ade7754.c create mode 100644 drivers/staging/iio/meter/ade7754.h
drivers/staging/iio/meter/Kconfig +7 -0
@@ -9,3 +9,10 @@ config ADE7753 help Say yes here to build support for Analog Devices ADE7753 Single-Phase Multifunction Metering IC with di/dt Sensor Interface. + +config ADE7754 + tristate "Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver" + depends on SPI + help + Say yes here to build support for Analog Devices ADE7754 Polyphase + Multifunction Energy Metering IC Driver.
drivers/staging/iio/meter/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-$(CONFIG_ADE7753) += ade7753.o +obj-$(CONFIG_ADE7754) += ade7754.o
drivers/staging/iio/meter/ade7754.c new file +756 -0
756 lines not on this page · raw message
drivers/staging/iio/meter/ade7754.h new file +161 -0
161 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 31/36 staging: iio: meter: new driver for ADE7758 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/meter/Kconfig | 9 + drivers/staging/iio/meter/Makefile | 4 + drivers/staging/iio/meter/ade7758.h | 171 ++++++ drivers/staging/iio/meter/ade7758_core.c | 866 +++++++++++++++++++++++++++ drivers/staging/iio/meter/ade7758_ring.c | 212 +++++++ drivers/staging/iio/meter/ade7758_trigger.c | 125 ++++ 6 files changed, 1387 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/meter/ade7758.h create mode 100644 drivers/staging/iio/meter/ade7758_core.c create mode 100644 drivers/staging/iio/meter/ade7758_ring.c create mode 100644 drivers/staging/iio/meter/ade7758_trigger.c
drivers/staging/iio/meter/Kconfig +9 -0
@@ -16,3 +16,12 @@ config ADE7754 help Say yes here to build support for Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver. + +config ADE7758 + tristate "Analog Devices ADE7758 Poly Phase Multifunction Energy Metering IC Driver" + depends on SPI + select IIO_TRIGGER if IIO_RING_BUFFER + select IIO_SW_RING if IIO_RING_BUFFER + help + Say yes here to build support for Analog Devices ADE7758 Polyphase + Multifunction Energy Metering IC with Per Phase Information Driver.
drivers/staging/iio/meter/Makefile +4 -0
@@ -4,3 +4,7 @@ obj-$(CONFIG_ADE7753) += ade7753.o obj-$(CONFIG_ADE7754) += ade7754.o + +ade7758-y := ade7758_core.o +ade7758-$(CONFIG_IIO_RING_BUFFER) += ade7758_ring.o ade7758_trigger.o +obj-$(CONFIG_ADE7758) += ade7758.o
drivers/staging/iio/meter/ade7758.h new file +171 -0
171 lines not on this page · raw message
drivers/staging/iio/meter/ade7758_core.c new file +866 -0
866 lines not on this page · raw message
drivers/staging/iio/meter/ade7758_ring.c new file +212 -0
212 lines not on this page · raw message
drivers/staging/iio/meter/ade7758_trigger.c new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 32/36 staging: iio: meter: new driver for ADE7759 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/meter/Kconfig | 7 + drivers/staging/iio/meter/Makefile | 2 + drivers/staging/iio/meter/ade7759.c | 670 +++++++++++++++++++++++++++++++++++ drivers/staging/iio/meter/ade7759.h | 122 +++++++ 4 files changed, 801 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/meter/ade7759.c create mode 100644 drivers/staging/iio/meter/ade7759.h
drivers/staging/iio/meter/Kconfig +7 -0
@@ -25,3 +25,10 @@ config ADE7758 help Say yes here to build support for Analog Devices ADE7758 Polyphase Multifunction Energy Metering IC with Per Phase Information Driver. + +config ADE7759 + tristate "Analog Devices ADE7759 Active Energy Metering IC Driver" + depends on SPI + help + Say yes here to build support for Analog Devices ADE7758 Active Energy + Metering IC with di/dt Sensor Interface.
drivers/staging/iio/meter/Makefile +2 -0
@@ -8,3 +8,5 @@ obj-$(CONFIG_ADE7754) += ade7754.o ade7758-y := ade7758_core.o ade7758-$(CONFIG_IIO_RING_BUFFER) += ade7758_ring.o ade7758_trigger.o obj-$(CONFIG_ADE7758) += ade7758.o + +obj-$(CONFIG_ADE7759) += ade7759.o
drivers/staging/iio/meter/ade7759.c new file +670 -0
670 lines not on this page · raw message
drivers/staging/iio/meter/ade7759.h new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 33/36 staging: iio: meter: new driver for ADE7854/58/68/78 devices
In reply to Mike FrysingerFrom: Barry Song <[email protected]>
--- drivers/staging/iio/meter/Kconfig | 27 ++ drivers/staging/iio/meter/Makefile | 3 + drivers/staging/iio/meter/ade7854-i2c.c | 272 ++++++++++++ drivers/staging/iio/meter/ade7854-spi.c | 360 ++++++++++++++++ drivers/staging/iio/meter/ade7854.c | 680 +++++++++++++++++++++++++++++++ drivers/staging/iio/meter/ade7854.h | 244 +++++++++++ 6 files changed, 1586 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/meter/ade7854-i2c.c create mode 100644 drivers/staging/iio/meter/ade7854-spi.c create mode 100644 drivers/staging/iio/meter/ade7854.c create mode 100644 drivers/staging/iio/meter/ade7854.h
drivers/staging/iio/meter/Kconfig +27 -0
@@ -32,3 +32,30 @@ config ADE7759 help Say yes here to build support for Analog Devices ADE7758 Active Energy Metering IC with di/dt Sensor Interface. + +config ADE7854 + tristate "Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC Driver" + depends on SPI || I2C + help + Say yes here to build support for Analog Devices ADE7854/58/68/78 Polyphase + Multifunction Energy Metering IC Driver. + +config ADE7854_I2C + tristate "support I2C bus connection" + depends on ADE7854 && I2C + default y + help + Say Y here if you have ADE7854/58/68/78 hooked to an I2C bus. + + To compile this driver as a module, choose M here: the + module will be called ade7854-i2c. + +config ADE7854_SPI + tristate "support SPI bus connection" + depends on ADE7854 && SPI + default y + help + Say Y here if you have ADE7854/58/68/78 hooked to a SPI bus. + + To compile this driver as a module, choose M here: the + module will be called ade7854-spi.
drivers/staging/iio/meter/Makefile +3 -0
@@ -10,3 +10,6 @@ ade7758-$(CONFIG_IIO_RING_BUFFER) += ade7758_ring.o ade7758_trigger.o obj-$(CONFIG_ADE7758) += ade7758.o obj-$(CONFIG_ADE7759) += ade7759.o +obj-$(CONFIG_ADE7854) += ade7854.o +obj-$(CONFIG_ADE7854_I2C) += ade7854-i2c.o +obj-$(CONFIG_ADE7854_SPI) += ade7854-spi.o
drivers/staging/iio/meter/ade7854-i2c.c new file +272 -0
272 lines not on this page · raw message
drivers/staging/iio/meter/ade7854-spi.c new file +360 -0
360 lines not on this page · raw message
drivers/staging/iio/meter/ade7854.c new file +680 -0
680 lines not on this page · raw message
drivers/staging/iio/meter/ade7854.h new file +244 -0
244 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 34/36 staging: iio: resolver: new driver for AD2S90 devices
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
This also kicks off the new resolver subsection.
--- drivers/staging/iio/Kconfig | 1 + drivers/staging/iio/Makefile | 1 + drivers/staging/iio/resolver/Kconfig | 11 +++ drivers/staging/iio/resolver/Makefile | 5 + drivers/staging/iio/resolver/ad2s90.c | 159 +++++++++++++++++++++++++++++++++ 5 files changed, 177 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/resolver/Kconfig create mode 100644 drivers/staging/iio/resolver/Makefile create mode 100644 drivers/staging/iio/resolver/ad2s90.c
drivers/staging/iio/Kconfig +1 -0
@@ -50,6 +50,7 @@ source "drivers/staging/iio/imu/Kconfig" source "drivers/staging/iio/light/Kconfig" source "drivers/staging/iio/magnetometer/Kconfig" source "drivers/staging/iio/meter/Kconfig" +source "drivers/staging/iio/resolver/Kconfig" source "drivers/staging/iio/trigger/Kconfig" endif # IIO
drivers/staging/iio/Makefile +1 -0
@@ -19,4 +19,5 @@ obj-y += imu/ obj-y += light/ obj-y += magnetometer/ obj-y += meter/ +obj-y += resolver/ obj-y += trigger/
drivers/staging/iio/resolver/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +# +# Resolver/Synchro drivers +# +comment "Resolver to digital converters" + +config AD2S90 + tristate "Analog Devices ad2s90 driver" + depends on SPI + help + Say yes here to build support for Analog Devices spi resolver + to digital converters, ad2s90, provides direct access via sysfs.
drivers/staging/iio/resolver/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for Resolver/Synchro drivers +# + +obj-$(CONFIG_AD2S90) += ad2s90.o
drivers/staging/iio/resolver/ad2s90.c new file +159 -0
159 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 35/36 staging: iio: resolver: new driver for AD2S1200/1205 devices
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
--- drivers/staging/iio/resolver/Kconfig | 8 + drivers/staging/iio/resolver/Makefile | 1 + drivers/staging/iio/resolver/ad2s120x.c | 310 +++++++++++++++++++++++++++++++ 3 files changed, 319 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/resolver/ad2s120x.c
drivers/staging/iio/resolver/Kconfig +8 -0
@@ -9,3 +9,11 @@ config AD2S90 help Say yes here to build support for Analog Devices spi resolver to digital converters, ad2s90, provides direct access via sysfs. + +config AD2S120X + tristate "Analog Devices ad2s120x driver" + depends on SPI + help + Say yes here to build support for Analog Devices spi resolver + to digital converters, ad2s1200 and ad2s1205, provides direct access + via sysfs.
drivers/staging/iio/resolver/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-$(CONFIG_AD2S90) += ad2s90.o +obj-$(CONFIG_AD2S120X) += ad2s120x.o
drivers/staging/iio/resolver/ad2s120x.c new file +310 -0
310 lines not on this page · raw message
Signature · 1 line
1.7.3.2
PATCH 36/36 staging: iio: resolver: new driver for AD2S1210 devices
In reply to Mike FrysingerFrom: Graf Yang <[email protected]>
--- drivers/staging/iio/resolver/Kconfig | 35 ++ drivers/staging/iio/resolver/Makefile | 1 + drivers/staging/iio/resolver/ad2s1210.c | 872 +++++++++++++++++++++++++++++++ 3 files changed, 908 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/resolver/ad2s1210.c
drivers/staging/iio/resolver/Kconfig +35 -0
@@ -17,3 +17,38 @@ config AD2S120X Say yes here to build support for Analog Devices spi resolver to digital converters, ad2s1200 and ad2s1205, provides direct access via sysfs. + +config AD2S1210 + tristate "Analog Devices ad2s1210 driver" + depends on SPI + help + Say yes here to build support for Analog Devices spi resolver + to digital converters, ad2s1210, provides direct access via sysfs. + +choice + prompt "Resolution Control" + depends on AD2S1210 + default AD2S1210_GPIO_NONE + help + In normal mode, the resolution of the digital output is selected + using the RES0 and RES1 input pins. In configuration mode, the + resolution is selected by setting the RES0 and RES1 bits in the + control regsiter. When switching between normal mode and configuration + mode, there are some schemes to keep them matchs. + +config AD2S1210_GPIO_INPUT + bool "read resolution from gpio pins" + help + GPIO pins are sampling RES0 and RES1 pins, read the resolution + settings from the GPIO pins. + +config AD2S1210_GPIO_OUTPUT + bool "set gpio pins to set resolution" + help + RES0 and RES1 pins are controlled by GPIOs, setting GPIO pins to + set the resolution. + +config AD2S1210_GPIO_NONE + bool "take the responsibility by user" + +endchoice
drivers/staging/iio/resolver/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_AD2S90) += ad2s90.o obj-$(CONFIG_AD2S120X) += ad2s120x.o +obj-$(CONFIG_AD2S1210) += ad2s1210.o
drivers/staging/iio/resolver/ad2s1210.c new file +872 -0
872 lines not on this page · raw message
Signature · 1 line
1.7.3.2
Quoted 1 line · Mike Frysinger
I've rebased all the drivers onto staging-next. =C2=A0I've only fixed the=
API
Quoted 5 lines
breakage due to the changes made after 2.6.36 (and fixed a few warnings). I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided with regards to driver correctness or direction. =C2=A0That stuff I'm leaving =
up to
Quoted 4 lines
Michael Hennerich since it's his job and he actually understands this.
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". =C2=A0We will still look =
into
Quoted 2 lines
feedback given, but we'd like to focus on that rather than random
sedchanges as API names change.
btw, how does the merging with IIO occur ? do you take care of bouncing them to gregkh ? or does he watch this list ? or do i have to cc him too ?
my assumption is that i send IIO patches to you and then you get them into the staging tree ...
-mike
Quoted 9 lines · Mike Frysinger
Quoted 8 lines · Mike Frysinger
I've rebased all the drivers onto staging-next. I've only fixed the API breakage due to the changes made after 2.6.36 (and fixed a few warnings). I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided with regards to driver correctness or direction. That stuff I'm leaving up to Michael Hennerich since it's his job and he actually understands this.
Quoted 8 lines
Quoted 4 lines
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". We will still look into feedback given, but we'd like to focus on that rather than random
sedchanges as API names change.btw, how does the merging with IIO occur ? do you take care of bouncing them to gregkh ? or does he watch this list ? or do i have to cc him too ?
CC Greg, or if the set has been on list then send them to him directly and just post on the list that they have gone to Greg.
Quoted 3 lines
my assumption is that i send IIO patches to you and then you get them into the staging tree ...
Normally I just suggest people send them to Greg. That is definitely the case with this set as I'm off on holiday tomorrow evening and hence won't be able to respond to any queries that come up and might block the merge.
Hence over to you. Perhaps hold off until everyone has gotten to their email tomorrow just in case....
Jonathan
Quoted 8 lines · Mike Frysinger
I've rebased all the drivers onto staging-next. I've only fixed the API breakage due to the changes made after 2.6.36 (and fixed a few warnings). I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided with regards to driver correctness or direction. That stuff I'm leaving up to Michael Hennerich since it's his job and he actually understands this.
Quoted 8 lines
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". We will still look into feedback given, but we'd like to focus on that rather than random
sedchanges as API names change.This patchset supersedes all other "new driver" patches I've posted in the last 48 hours.
As we are still in staging, I'm happy to see these merge into IIO with some provisos (this wouldn't be acceptable anywhere else in the kernel tree).
* We will be breaking abi's and probably even config symbol names cleaning these up. So if your customers start complaining you get to explain why to them :)
* We sought out some test coverage for these. I want someone I can poke if we get a bug report, happy to use a generic address as long as someone is able to respond in reasonable time! (no complaints so far with Analog, but this is a lot of new devices for someone to have wired up somewhere)
* If Randy or any one else reports build issues with weird combinations, someone other than me quickly fixes them.
* I want some proper proposals of abi's for the new classes of device. Lets debate these on list. I would probably get round to doing this myself eventually, but if someone who knows the device class does it, things will proceed much faster. I've never used a resolver and had to google what they were ;) Having poorly defined abi's has bitten us a few times in the past and tends to put others off using the subsystem. So lets at least bash out what they should be even if it takes a little while to bring the drivers up to date.
* As per standard staging rules, I will ask Greg to drop any driver that no one is willing to support. I will give plenty of warning of course!
* Some of the temp chips might want to be in hwmon. I would like to see an open discussion across both lists of whether then should be in IIO or there (or both).
The negatives of merging this set as is are that people might copy code with issues we haven't fixed yet. Such is life I guess. We could put a big note in the TODO file, but then, who reads that?
So if there are no other issues raised send them on to Greg KH (feel free to say I ack the merging of the set if not individual drivers as haven't looked at them all yet, and it will be about a month before I have enough time).
Mike, thanks for all your work on this.
Jonathan
Quoted 204 lines
Barry Song (16):
staging: iio: new adis16201 driver
staging: iio: new adis16203 driver
staging: iio: new adis16204 driver
staging: iio: adc: new driver for AD7150/1/6 devices
staging: iio: adc: new driver for AD7152/3 devices
staging: iio: adc: new driver for AD7745/6/7 devices
staging: iio: gyro: new driver for ADIS16261 devices
staging: iio: gyro: new driver for ADIS16060 digital output gyros
staging: iio: gyro: new driver for ADIS16080 digital output gyros
staging: iio: gyro: new driver for ADIS16130 digital output gyros
staging: iio: dac: new driver for AD5624R devices
staging: iio: meter: new driver for ADE7753/6 devices
staging: iio: meter: new driver for ADE7754 devices
staging: iio: meter: new driver for ADE7758 devices
staging: iio: meter: new driver for ADE7759 devices
staging: iio: meter: new driver for ADE7854/58/68/78 devicesCliff Cai (6):
staging: iio: dds: new driver for AD5930/2 devices
staging: iio: dds: new driver for AD9832/3/4/5 devices
staging: iio: dds: new driver for AD9850/1 devices
staging: iio: dds: new driver for AD9852/4 devices
staging: iio: dds: new driver for AD9910 devices
staging: iio: dds: new driver for AD9951 devicesGraf Yang (3):
staging: iio: resolver: new driver for AD2S90 devices
staging: iio: resolver: new driver for AD2S1200/1205 devices
staging: iio: resolver: new driver for AD2S1210 devicesSonic Zhang (11):
staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver
staging: iio: adc: new driver for AD7291 devices
staging: iio: adc: new driver for AD7298 devices
staging: iio: adc: new driver for AD7314 devices
staging: iio: adc: new driver for AD7414/5 devices
staging: iio: adc: new driver for AD7416/7/8 devices
staging: iio: adc: new driver for AD7816 devices
staging: iio: adc: new driver for ADT75 temperature sensors
staging: iio: adc: new driver for ADT7310 temperature sensors
staging: iio: adc: new driver for ADT7408 temperature sensors
staging: iio: adc: new driver for ADT7410 temperature sensorsdrivers/staging/iio/Kconfig | 6 +- drivers/staging/iio/Makefile | 7 +- drivers/staging/iio/accel/Kconfig | 27 + drivers/staging/iio/accel/Makefile | 12 + drivers/staging/iio/accel/accel.h | 20 + drivers/staging/iio/accel/adis16201.h | 150 ++ drivers/staging/iio/accel/adis16201_core.c | 640 +++++++ drivers/staging/iio/accel/adis16201_ring.c | 218 +++ drivers/staging/iio/accel/adis16201_trigger.c | 122 ++ drivers/staging/iio/accel/adis16203.h | 143 ++ drivers/staging/iio/accel/adis16203_core.c | 568 ++++++ drivers/staging/iio/accel/adis16203_ring.c | 211 +++ drivers/staging/iio/accel/adis16203_trigger.c | 122 ++ drivers/staging/iio/accel/adis16204.h | 151 ++ drivers/staging/iio/accel/adis16204_core.c | 613 +++++++ drivers/staging/iio/accel/adis16204_ring.c | 206 +++ drivers/staging/iio/accel/adis16204_trigger.c | 122 ++ drivers/staging/iio/adc/Kconfig | 91 + drivers/staging/iio/adc/Makefile | 15 + drivers/staging/iio/adc/ad7150.c | 877 +++++++++ drivers/staging/iio/adc/ad7152.c | 610 +++++++ drivers/staging/iio/adc/ad7291.c | 1039 +++++++++++ drivers/staging/iio/adc/ad7298.c | 501 +++++ drivers/staging/iio/adc/ad7314.c | 308 ++++ drivers/staging/iio/adc/ad7414.c | 573 ++++++ drivers/staging/iio/adc/ad7416.c | 777 ++++++++ drivers/staging/iio/adc/ad774x.c | 719 ++++++++ drivers/staging/iio/adc/ad7816.c | 538 ++++++ drivers/staging/iio/adc/adt7310.c | 951 ++++++++++ drivers/staging/iio/adc/adt7408.c | 1006 +++++++++++ drivers/staging/iio/adc/adt7410.c | 917 ++++++++++ drivers/staging/iio/adc/adt75.c | 734 ++++++++ drivers/staging/iio/addac/Kconfig | 25 + drivers/staging/iio/addac/Makefile | 7 + drivers/staging/iio/addac/adt7316-i2c.c | 169 ++ drivers/staging/iio/addac/adt7316-spi.c | 179 ++ drivers/staging/iio/addac/adt7316.c | 2402 +++++++++++++++++++++++++ drivers/staging/iio/addac/adt7316.h | 33 + drivers/staging/iio/dac/Kconfig | 11 + drivers/staging/iio/dac/Makefile | 5 + drivers/staging/iio/dac/ad5624r.h | 21 + drivers/staging/iio/dac/ad5624r_spi.c | 313 ++++ drivers/staging/iio/dac/dac.h | 6 + drivers/staging/iio/dds/Kconfig | 46 + drivers/staging/iio/dds/Makefile | 10 + drivers/staging/iio/dds/ad5930.c | 170 ++ drivers/staging/iio/dds/ad9832.c | 266 +++ drivers/staging/iio/dds/ad9850.c | 156 ++ drivers/staging/iio/dds/ad9852.c | 314 ++++ drivers/staging/iio/dds/ad9910.c | 454 +++++ drivers/staging/iio/dds/ad9951.c | 254 +++ drivers/staging/iio/gyro/Kconfig | 28 + drivers/staging/iio/gyro/Makefile | 12 + drivers/staging/iio/gyro/adis16060.h | 101 + drivers/staging/iio/gyro/adis16060_core.c | 319 ++++ drivers/staging/iio/gyro/adis16080.h | 102 ++ drivers/staging/iio/gyro/adis16080_core.c | 271 +++ drivers/staging/iio/gyro/adis16130.h | 108 ++ drivers/staging/iio/gyro/adis16130_core.c | 313 ++++ drivers/staging/iio/gyro/adis16261.h | 176 ++ drivers/staging/iio/gyro/adis16261_core.c | 770 ++++++++ drivers/staging/iio/meter/Kconfig | 61 + drivers/staging/iio/meter/Makefile | 15 + drivers/staging/iio/meter/ade7753.c | 730 ++++++++ drivers/staging/iio/meter/ade7753.h | 140 ++ drivers/staging/iio/meter/ade7754.c | 756 ++++++++ drivers/staging/iio/meter/ade7754.h | 161 ++ drivers/staging/iio/meter/ade7758.h | 171 ++ drivers/staging/iio/meter/ade7758_core.c | 866 +++++++++ drivers/staging/iio/meter/ade7758_ring.c | 212 +++ drivers/staging/iio/meter/ade7758_trigger.c | 125 ++ drivers/staging/iio/meter/ade7759.c | 670 +++++++ drivers/staging/iio/meter/ade7759.h | 122 ++ drivers/staging/iio/meter/ade7854-i2c.c | 272 +++ drivers/staging/iio/meter/ade7854-spi.c | 360 ++++ drivers/staging/iio/meter/ade7854.c | 680 +++++++ drivers/staging/iio/meter/ade7854.h | 244 +++ drivers/staging/iio/meter/meter.h | 396 ++++ drivers/staging/iio/resolver/Kconfig | 54 + drivers/staging/iio/resolver/Makefile | 7 + drivers/staging/iio/resolver/ad2s120x.c | 310 ++++ drivers/staging/iio/resolver/ad2s1210.c | 872 +++++++++ drivers/staging/iio/resolver/ad2s90.c | 159 ++ drivers/staging/iio/sysfs.h | 6 + 84 files changed, 27422 insertions(+), 2 deletions(-) create mode 100644 drivers/staging/iio/accel/adis16201.h create mode 100644 drivers/staging/iio/accel/adis16201_core.c create mode 100644 drivers/staging/iio/accel/adis16201_ring.c create mode 100644 drivers/staging/iio/accel/adis16201_trigger.c create mode 100644 drivers/staging/iio/accel/adis16203.h create mode 100644 drivers/staging/iio/accel/adis16203_core.c create mode 100644 drivers/staging/iio/accel/adis16203_ring.c create mode 100644 drivers/staging/iio/accel/adis16203_trigger.c create mode 100644 drivers/staging/iio/accel/adis16204.h create mode 100644 drivers/staging/iio/accel/adis16204_core.c create mode 100644 drivers/staging/iio/accel/adis16204_ring.c create mode 100644 drivers/staging/iio/accel/adis16204_trigger.c create mode 100644 drivers/staging/iio/adc/ad7150.c create mode 100644 drivers/staging/iio/adc/ad7152.c create mode 100644 drivers/staging/iio/adc/ad7291.c create mode 100644 drivers/staging/iio/adc/ad7298.c create mode 100644 drivers/staging/iio/adc/ad7314.c create mode 100644 drivers/staging/iio/adc/ad7414.c create mode 100644 drivers/staging/iio/adc/ad7416.c create mode 100644 drivers/staging/iio/adc/ad774x.c create mode 100644 drivers/staging/iio/adc/ad7816.c create mode 100644 drivers/staging/iio/adc/adt7310.c create mode 100644 drivers/staging/iio/adc/adt7408.c create mode 100644 drivers/staging/iio/adc/adt7410.c create mode 100644 drivers/staging/iio/adc/adt75.c create mode 100644 drivers/staging/iio/addac/Kconfig create mode 100644 drivers/staging/iio/addac/Makefile create mode 100644 drivers/staging/iio/addac/adt7316-i2c.c create mode 100644 drivers/staging/iio/addac/adt7316-spi.c create mode 100644 drivers/staging/iio/addac/adt7316.c create mode 100644 drivers/staging/iio/addac/adt7316.h create mode 100644 drivers/staging/iio/dac/Kconfig create mode 100644 drivers/staging/iio/dac/Makefile create mode 100644 drivers/staging/iio/dac/ad5624r.h create mode 100644 drivers/staging/iio/dac/ad5624r_spi.c create mode 100644 drivers/staging/iio/dac/dac.h create mode 100644 drivers/staging/iio/dds/Kconfig create mode 100644 drivers/staging/iio/dds/Makefile create mode 100644 drivers/staging/iio/dds/ad5930.c create mode 100644 drivers/staging/iio/dds/ad9832.c create mode 100644 drivers/staging/iio/dds/ad9850.c create mode 100644 drivers/staging/iio/dds/ad9852.c create mode 100644 drivers/staging/iio/dds/ad9910.c create mode 100644 drivers/staging/iio/dds/ad9951.c create mode 100644 drivers/staging/iio/gyro/adis16060.h create mode 100644 drivers/staging/iio/gyro/adis16060_core.c create mode 100644 drivers/staging/iio/gyro/adis16080.h create mode 100644 drivers/staging/iio/gyro/adis16080_core.c create mode 100644 drivers/staging/iio/gyro/adis16130.h create mode 100644 drivers/staging/iio/gyro/adis16130_core.c create mode 100644 drivers/staging/iio/gyro/adis16261.h create mode 100644 drivers/staging/iio/gyro/adis16261_core.c create mode 100644 drivers/staging/iio/meter/Kconfig create mode 100644 drivers/staging/iio/meter/Makefile create mode 100644 drivers/staging/iio/meter/ade7753.c create mode 100644 drivers/staging/iio/meter/ade7753.h create mode 100644 drivers/staging/iio/meter/ade7754.c create mode 100644 drivers/staging/iio/meter/ade7754.h create mode 100644 drivers/staging/iio/meter/ade7758.h create mode 100644 drivers/staging/iio/meter/ade7758_core.c create mode 100644 drivers/staging/iio/meter/ade7758_ring.c create mode 100644 drivers/staging/iio/meter/ade7758_trigger.c create mode 100644 drivers/staging/iio/meter/ade7759.c create mode 100644 drivers/staging/iio/meter/ade7759.h create mode 100644 drivers/staging/iio/meter/ade7854-i2c.c create mode 100644 drivers/staging/iio/meter/ade7854-spi.c create mode 100644 drivers/staging/iio/meter/ade7854.c create mode 100644 drivers/staging/iio/meter/ade7854.h create mode 100644 drivers/staging/iio/meter/meter.h create mode 100644 drivers/staging/iio/resolver/Kconfig create mode 100644 drivers/staging/iio/resolver/Makefile create mode 100644 drivers/staging/iio/resolver/ad2s120x.c create mode 100644 drivers/staging/iio/resolver/ad2s1210.c create mode 100644 drivers/staging/iio/resolver/ad2s90.c
Quoted 2 lines · Jonathan Cameron
Quoted 1 line · Mike Frysinger
I've rebased all the drivers onto staging-next. =C2=A0I've only fixed th=
e API
Quoted 1 line
Quoted 1 line
breakage due to the changes made after 2.6.36 (and fixed a few warnings)=
.
Quoted 3 lines
Quoted 3 lines
I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided wit=
h
Quoted 1 line
Quoted 1 line
regards to driver correctness or direction. =C2=A0That stuff I'm leaving=
up to
Quoted 4 lines
Quoted 4 lines
Michael Hennerich since it's his job and he actually understands this.
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". =C2=A0We will still look=
into
Quoted 4 lines
Quoted 4 lines
feedback given, but we'd like to focus on that rather than random
sedchanges as API names change.This patchset supersedes all other "new driver" patches I've posted in t=
he
Quoted 3 lines
Quoted 1 line
last 48 hours.
As we are still in staging, I'm happy to see these merge into IIO with so=
me provisos
Quoted 3 lines
(this wouldn't be acceptable anywhere else in the kernel tree).
* We will be breaking abi's and probably even config symbol names cleanin=
g these up.
Quoted 1 line
=C2=A0So if your customers start complaining you get to explain why to th=
em :)
it wont be an issue. we make it clear to people who use the IIO stuff that this is in heavy development and people have been OK with that.
Quoted 1 line
* We sought out some test coverage for these. I want someone I can poke i=
f we
Quoted 1 line
=C2=A0get a bug report, happy to use a generic address as long as someone=
is able
Quoted 1 line
=C2=A0to respond in reasonable time! (no complaints so far with Analog, b=
ut this is
Quoted 1 line
=C2=A0a lot of new devices for someone to have wired up somewhere)
i can add a MAINTAINERS entry for all ADI IIO drivers if that's sufficient. any question about using Linux and an ADI part we are happy to answer.
Quoted 1 line
* If Randy or any one else reports build issues with weird combinations, =
someone
Quoted 1 line
=C2=A0other than me quickly fixes them.
i think the MAINTAINERS would cover this too
Quoted 1 line
* I want some proper proposals of abi's for the new classes of device. Le=
ts debate
Quoted 1 line
=C2=A0these on list. I would probably get round to doing this myself even=
tually, but
Quoted 1 line
=C2=A0if someone who knows the device class does it, things will proceed =
much faster.
Quoted 2 lines
=C2=A0I've never used a resolver and had to google what they were ;) =C2=A0Having poorly defined abi's has bitten us a few times in the past a=
nd tends to
Quoted 1 line
=C2=A0put others off using the subsystem. =C2=A0So lets at least bash out=
what they should
Quoted 1 line
=C2=A0be even if it takes a little while to bring the drivers up to date.
that'd be for Michael Hennerich
Quoted 1 line
* As per standard staging rules, I will ask Greg to drop any driver that =
no one is
Quoted 1 line
=C2=A0willing to support. =C2=A0I will give plenty of warning of course!
np
Quoted 1 line
* Some of the temp chips might want to be in hwmon. I would like to see a=
n open
Quoted 1 line
=C2=A0discussion across both lists of whether then should be in IIO or th=
ere (or both).
there has been discussion in the past in this regard. but i dont recall where it occurred.
Quoted 1 line
The negatives of merging this set as is are that people might copy code w=
ith issues
Quoted 1 line
we haven't fixed yet. =C2=A0Such is life I guess. We could put a big note=
in the TODO
Quoted 1 line
file, but then, who reads that?
we have a tracker where we log all device driver feedback and assign to developers:
https://blackfin.uclinux.org/gf/project/device-drivers/tracker/
-mike
Hennerich, Michael
maintainerTWlrZSBGcnlzaW5nZXIgd3JvdGUgb24gMjAxMC0xMC0yNToNCj4gT24gU3VuLCBPY3QgMjQsIDIw MTAgYXQgMTk6MzUsIEpvbmF0aGFuIENhbWVyb24gd3JvdGU6DQo+PiBPbiAxMC8yNC8xMCAyMjoy MiwgTWlrZSBGcnlzaW5nZXIgd3JvdGU6DQo+Pj4gSSd2ZSByZWJhc2VkIGFsbCB0aGUgZHJpdmVy cyBvbnRvIHN0YWdpbmctbmV4dC4gIEkndmUgb25se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IEdlc2NoYWVmdHNmdWVocmVyIFRob21hcyBXZXNzZWwsIFdpbGxpYW0gQS4gTWFy dGluLCBNYXJnYXJldCBTZWlmDQoNCg0K
Quoted 37 lines · Michael
Mike Frysinger wrote on 2010-10-25:
Quoted 36 lines · Jonathan Cameron
Quoted 18 lines · Mike Frysinger
Quoted 9 lines
I've rebased all the drivers onto staging-next. I've only fixed the API breakage due to the changes made after 2.6.36 (and fixed a few warnings). I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided with regards to driver correctness or direction. That stuff I'm leaving up to Michael Hennerich since it's his job and he actually understands this.
Quoted 7 lines
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". We will still look into feedback given, but we'd like to focus on that rather than random
sedchanges as API names change.This patchset supersedes all other "new driver" patches I've posted in the last 48 hours.
Quoted 7 lines
As we are still in staging, I'm happy to see these merge into IIO with some provisos (this wouldn't be acceptable anywhere else in the kernel tree).
* We will be breaking abi's and probably even config symbol names cleaning these up. So if your customers start complaining you get to explain why to them :)
it wont be an issue. we make it clear to people who use the IIO stuff that this is in heavy development and people have been OK with that.
Quoted 5 lines
* We sought out some test coverage for these. I want someone I can poke if we get a bug report, happy to use a generic address as long as someone is able to respond in reasonable time! (no complaints so far with Analog, but this is a lot of new devices for someone to have wired up somewhere)
Quoted 6 lines
Quoted 3 lines
i can add a
MAINTAINERSentry for all ADI IIO drivers if that's sufficient. any question about using Linux and an ADI part we are happy to answer.We will actively support these drivers. I'm currently in progress building up a team, which will ensure that these drivers are tested and maintained over time.
Excellent news. There is a pretty strong feeling (from Greg KH) that MAINTAINERS entries don't exist for stuff in staging.
However, adding something like
Contact: [email protected] for ADI drivers
to the main TODO file would probably be a good idea. Not necessary if Analog people monitor linux-iio though as every driver problem should also be copied to there.
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
* If Randy or any one else reports build issues with weird combinations, someone
other than me quickly fixes them.i think the
MAINTAINERSwould cover this tooQuoted 8 lines
* I want some proper proposals of abi's for the new classes of device. Lets debate these on list. I would probably get round to doing this myself eventually, but if someone who knows the device class does it, things will proceed much faster. I've never used a resolver and had to google what they were ;) Having poorly defined abi's has bitten us a few times in the past and tends to put others off using the subsystem. So lets at least bash out what they should be even if it takes a
little while to bring the drivers up to date.
Quoted 4 lines
Quoted 1 line
that'd be for Michael Hennerich
We can start debating and refining on the exact API, to use. However I like to do so once these drivers have merged.
Agreed. Now you have confirmed the follow up support will be there, I'm happy to see them merged now and fixed later.
Quoted 2 lines
The ones likely subject to change we can mark as EXPERIMENTAL. Or even print a warning using
dev_warn()on probe.
Either works for me.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
* As per standard staging rules, I will ask Greg to drop any driver that no one is
willing to support. I will give plenty of warning of course!np
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
* Some of the temp chips might want to be in hwmon. I would like to see an open
discussion across both lists of whether then should be in IIO orthere (or both).
there has been discussion in the past in this regard. but i dont recall where it occurred.
Sure. Now Hwmon is again under active maintenance it's probably time to reopen the discussion.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
The negatives of merging this set as is are that people might copy code with issues we haven't fixed yet. Such is life I guess. We could put a big note in the TODO file, but then, who reads that?
we have a tracker where we log all device driver feedback and assign to developers:
https://blackfin.uclinux.org/gf/project/device-drivers/tracker/
Cool. That works fine. Perhaps we can put that in the headers of the drivers or mention it in TODO in the top level directory.
There's also a rather under advertised equivalent at:
http://sourceforge.net/apps/trac/iioutils/
that I've been most using to remind myself of changes that need doing rather than as a formal system. Note this tracker covers userspace tools as well (those few that exist) I'll talk to you guys first before adding any specific ADI driver related ones to there. The current ADI related ones are event support for the adis16350 and merging adis16300 and adis16400 drivers into that one. There is a bug somewhere in my changes to the burst mode (reported by Manuel). Unfortunately I can't test as my part for that one is an adis16350 which doesn't do burst reads. The other is addition of adis16250 and similar support into the adis16260 driver which is dependent on testing from the author of the existing adis16250 driver that is in staging but outside IIO.
I'm looking forward to seeing the nice large section you guys will have in LWN's kernel section under new drivers. Not often people merge 36 in one go.
Jonathan
Quoted 117 lines · Jonathan Cameron
Quoted 37 lines · Michael
Mike Frysinger wrote on 2010-10-25:
Quoted 36 lines · Jonathan Cameron
Quoted 18 lines · Mike Frysinger
Quoted 9 lines
I've rebased all the drivers onto staging-next. I've only fixed the API breakage due to the changes made after 2.6.36 (and fixed a few warnings). I've also run checkpatch across these.
I have not however addressed any real feedback Jonathan has provided with regards to driver correctness or direction. That stuff I'm leaving up to Michael Hennerich since it's his job and he actually understands this.
Quoted 7 lines
Where possible, I'd like to have drivers merged so as to avoid another round of "new API just broke all your drivers". We will still look into feedback given, but we'd like to focus on that rather than random
sedchanges as API names change.This patchset supersedes all other "new driver" patches I've posted in the last 48 hours.
Quoted 7 lines
As we are still in staging, I'm happy to see these merge into IIO with some provisos (this wouldn't be acceptable anywhere else in the kernel tree).
* We will be breaking abi's and probably even config symbol names cleaning these up. So if your customers start complaining you get to explain why to them :)
it wont be an issue. we make it clear to people who use the IIO stuff that this is in heavy development and people have been OK with that.
Quoted 5 lines
* We sought out some test coverage for these. I want someone I can poke if we get a bug report, happy to use a generic address as long as someone is able to respond in reasonable time! (no complaints so far with Analog, but this is a lot of new devices for someone to have wired up somewhere)
Quoted 6 lines
Quoted 3 lines
i can add a
MAINTAINERSentry for all ADI IIO drivers if that's sufficient. any question about using Linux and an ADI part we are happy to answer.We will actively support these drivers. I'm currently in progress building up a team, which will ensure that these drivers are tested and maintained over time.
Excellent news. There is a pretty strong feeling (from Greg KH) that
MAINTAINERSentries don't exist for stuff in staging.However, adding something like
Contact: [email protected] for ADI drivers
to the main TODO file would probably be a good idea. Not necessary if Analog people monitor linux-iio though as every driver problem should also be copied to there.
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
* If Randy or any one else reports build issues with weird combinations, someone
other than me quickly fixes them.i think the
MAINTAINERSwould cover this tooQuoted 8 lines
* I want some proper proposals of abi's for the new classes of device. Lets debate these on list. I would probably get round to doing this myself eventually, but if someone who knows the device class does it, things will proceed much faster. I've never used a resolver and had to google what they were ;) Having poorly defined abi's has bitten us a few times in the past and tends to put others off using the subsystem. So lets at least bash out what they should be even if it takes a
little while to bring the drivers up to date.Quoted 4 lines
Quoted 1 line
that'd be for Michael Hennerich
We can start debating and refining on the exact API, to use. However I like to do so once these drivers have merged.
Agreed. Now you have confirmed the follow up support will be there, I'm happy to see them merged now and fixed later.
Quoted 2 lines
The ones likely subject to change we can mark as EXPERIMENTAL. Or even print a warning using
dev_warn()on probe.Either works for me.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
* As per standard staging rules, I will ask Greg to drop any driver that no one is
willing to support. I will give plenty of warning of course!np
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
* Some of the temp chips might want to be in hwmon. I would like to see an open
discussion across both lists of whether then should be in IIO orthere (or both).
there has been discussion in the past in this regard. but i dont recall where it occurred.
Sure. Now Hwmon is again under active maintenance it's probably time to reopen the discussion.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
The negatives of merging this set as is are that people might copy code with issues we haven't fixed yet. Such is life I guess. We could put a big note in the TODO file, but then, who reads that?
we have a tracker where we log all device driver feedback and assign to developers:
https://blackfin.uclinux.org/gf/project/device-drivers/tracker/Cool. That works fine. Perhaps we can put that in the headers of the drivers or mention it in TODO in the top level directory.
There's also a rather under advertised equivalent at:
http://sourceforge.net/apps/trac/iioutils/
that I've been most using to remind myself of changes that need doing rather than as a formal system. Note this tracker covers userspace tools as well (those few that exist) I'll talk to you guys first before adding any specific ADI driver related ones to there. The current ADI related ones are event support for the adis16350 and merging adis16300 and adis16400 drivers into that one. There is a bug somewhere in my changes to the burst mode (reported by Manuel). Unfortunately I can't test as my part for that one is an adis16350 which doesn't do burst reads. The other is addition of adis16250 and similar support into the adis16260 driver which is dependent on testing from the author of the existing adis16250 driver that is in staging but outside IIO.
Quoted 3 lines
I'm looking forward to seeing the nice large section you guys will have in LWN's kernel section under new drivers. Not often people merge 36 in one go.
Looks like my quick cc'ing of Guenter has already started the question of boundaries between us and hwmon. If you want the controversial drivers in IIO rather than hwmon you'll need to justify it and soon.
Hennerich, Michael
maintainerSm9uYXRoYW4gQ2FtZXJvbiB3cm90ZSBvbiAyMDEwLTEwLTI1Og0KPiBPbiAxMC8yNS8xMCAwOToz OSwgSGVubmVyaWNoLCBNaWNoYWVsIHdyb3RlOg0KPj4gTWlrZSBGcnlzaW5nZXIgd3JvdGUgb24g MjAxMC0xMC0yNToNCj4+PiBPbiBTdW4sIE9jdCAyNCwgMjAxMCBhdCAxOTozNSwgSm9uYXRoYW4g Q2FtZXJvbiB3cm90ZToNCj4+Pj4gT24gMTAvMjQvMTAgMjI6MjIsIE1pa2UgRnJ5c2luZ2VyIHdy b3RlOg0KPj4+Pj4gSSd2ZSByZWJhc2VkIGFsbCB0aGUgZHJpdmVycyBvbnRvIHN0YWdpbmctbmV4 dC4gIEkndmUgb25seSBmaXhlZA0KPj4+Pj4gdGhlIEFQSSBicmVha2FnZSBkdWUgdG8gdGhlIGNo YW5nZXMgbWFkZSBhZnRlciAyLjYuMzYgKGFuZCBmaXhlZA0KPj4+Pj4gYSBmZXcgd2FybmluZ3Mp LiBJJ3ZlIGFsc28gcnVuIGNoZWNrcGF0Y2ggYWNyb3NzIHRoZXNlLg0KPj4+Pj4NCj4+Pj4+IEkg aGF2ZSBub3QgaG93ZXZlciBhZGRyZXNzZWQgYW55IHJlYWwgZmVlZGJhY2sgSm9uYXRoYW4gaGFz IHByb3ZpZGVkDQo+Pj4+PiB3aXRoIHJlZ2FyZHMgdG8gZHJpdmVyIGNvcnJlY3RuZXNzIG9yIGRp cmVjdGlvbi4gIFRoYXQgc3R1ZmYgSSdtDQo+Pj4+PiBsZWF2aW5nIHVwIHRvIE1pY2hhZWwgSGVu bmVyaWNoIHNpbmNlIGl0J3MgaGlzIGpvYiBhbmQgaGUgYWN0dWFsbHkNCj4+Pj4+IHVuZGVyc3Rh bmRzIHRoaXMuDQo+Pj4+Pg0KPj4+Pj4gV2hlcmUgcG9zc2libGUsIE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pcyBhZGRpdGlvbiBvZg0KPiBhZGlzMTYyNTAg YW5kIHNpbWlsYXIgc3VwcG9ydCBpbnRvIHRoZSBhZGlzMTYyNjAgZHJpdmVyIHdoaWNoIGlzDQo+ IGRlcGVuZGVudCBvbiB0ZXN0aW5nIGZyb20gdGhlIGF1dGhvciBvZiB0aGUgZXhpc3RpbmcgYWRp czE2MjUwIGRyaXZlcg0KPiB0aGF0IGlzIGluIHN0YWdpbmcgYnV0IG91dHNpZGUgSUlPLg0KPg0K PiBJJ20gbG9va2luZyBmb3J3YXJkIHRvIHNlZWluZyB0aGUgbmljZSBsYXJnZSBzZWN0aW9uIHlv dSBndXlzIHdpbGwNCj4gaGF2ZSBpbiBMV04ncyBrZXJuZWwgc2VjdGlvbiB1bmRlciBuZXcgZHJp dmVycy4gTm90IG9mdGVuIHBlb3BsZSBtZXJnZQ0KPiAzNiBpbiBvbmUgZ28uDQo+DQo+IEpvbmF0 aGFuDQoNCkdyZWV0aW5ncywNCk1pY2hhZWwNCg0KQW5hbG9nIERldmljZXMgR21iSCAgICAgIFdp bGhlbG0tV2FnZW5mZWxkLVN0ci4gNiAgICAgIDgwODA3IE11ZW5jaGVuDQpTaXR6IGRlciBHZXNl bGxzY2hhZnQgTXVlbmNoZW4sIFJlZ2lzdGVyZ2VyaWNodCBNdWVuY2hlbiBIUkIgNDAzNiBHZXNj aGFlZnRzZnVlaHJlciBUaG9tYXMgV2Vzc2VsLCBXaWxsaWFtIEEuIE1hcnRpbiwgTWFyZ2FyZXQg U2VpZg0KDQoNCg==
Quoted 4 lines · Michael
Mike Frysinger wrote on 2010-10-25:
Quoted 3 lines · Jonathan Cameron
Quoted 2 lines
* I want some proper proposals of abi's for the new classes of device. Lets debate =C2=A0these on list. I would probably get round to doing th=
is
Quoted 1 line
Quoted 1 line
Quoted 1 line
myself eventually, but =C2=A0if someone who knows the device class does=
it,
Quoted 1 line
Quoted 1 line
Quoted 1 line
things will proceed much faster. =C2=A0I've never used a resolver and h=
ad to
Quoted 1 line
Quoted 1 line
Quoted 1 line
google what they were ;) =C2=A0Having poorly defined abi's has bitten u=
s a
Quoted 1 line
Quoted 1 line
Quoted 1 line
few times in the past and tends to =C2=A0put others off using the subsy=
stem.
Quoted 1 line
Quoted 1 line
Quoted 1 line
=C2=A0So lets at least bash out what they should =C2=A0be even if it ta=
kes a
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
little while to bring the drivers up to date.
that'd be for Michael Hennerich
We can start debating and refining on the exact API, to use. However I like to do so once these drivers have merged. The ones likely subject to change we can mark as EXPERIMENTAL. Or even print a warning using
dev_warn()on probe.
i dont think that's necessary. we're already in the staging area which is labeled as "worse" than EXPERIMENTAL.
-mike