Skip to content

Commit

Permalink
iio: afe: rescale: new driver
Browse files Browse the repository at this point in the history
If an ADC channel measures the midpoint of a voltage divider, the
interesting voltage is often the voltage over the full resistance.
E.g. if the full voltage is too big for the ADC to handle.
Likewise, if an ADC channel measures the voltage across a shunt
resistor, with or without amplification, the interesting value is
often the current through the resistor.

This driver solves these problems by allowing to linearly scale a channel
and/or by allowing changes to the type of the channel.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Peter Rosin authored and Jonathan Cameron committed Apr 28, 2018
1 parent 2e9a128 commit 8b74816
Show file tree
Hide file tree
Showing 6 changed files with 387 additions and 0 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6905,6 +6905,7 @@ S: Maintained
F: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.txt
F: Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt
F: Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
F: drivers/iio/afe/iio-rescale.c

IKANOS/ADI EAGLE ADSL USB DRIVER
M: Matthieu Castet <castet.matthieu@free.fr>
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ config IIO_TRIGGERED_EVENT

source "drivers/iio/accel/Kconfig"
source "drivers/iio/adc/Kconfig"
source "drivers/iio/afe/Kconfig"
source "drivers/iio/amplifiers/Kconfig"
source "drivers/iio/chemical/Kconfig"
source "drivers/iio/common/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ obj-$(CONFIG_IIO_TRIGGERED_EVENT) += industrialio-triggered-event.o

obj-y += accel/
obj-y += adc/
obj-y += afe/
obj-y += amplifiers/
obj-y += buffer/
obj-y += chemical/
Expand Down
19 changes: 19 additions & 0 deletions drivers/iio/afe/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Analog Front End drivers
#
# When adding new entries keep the list in alphabetical order

menu "Analog Front Ends"

config IIO_RESCALE
tristate "IIO rescale"
depends on OF || COMPILE_TEST
help
Say yes here to build support for the IIO rescaling
that handles voltage dividers, current sense shunts and
current sense amplifiers.

To compile this driver as a module, choose M here: the
module will be called iio-rescale.

endmenu
6 changes: 6 additions & 0 deletions drivers/iio/afe/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Makefile for industrial I/O Analog Front Ends (AFE)
#

# When adding new entries keep the list in alphabetical order
obj-$(CONFIG_IIO_RESCALE) += iio-rescale.o
Loading

0 comments on commit 8b74816

Please sign in to comment.