Commit graph

66 commits

Author SHA1 Message Date
Andrew F. Davis
24b9dea764 iio: health/afe440x: Remove channel names
These AFEs have 4 ADC mesuring stages (called LED2, ALED2, LED1, and
ALED1 in the datasheet), we map these as channels, these stages can serve
different purposes depending on the application. For instance the AFE4404
has an additional LED (LED3), this LED can be timed to be active during
stage 2 (or anystage, but the datasheet describes this case and the name
of the stage reflects this use). This ability is used further in upcoming
parts that tie the front-end gain and the LED timings together. For these
reasons we remove explicit naming the channels.

Without channel names it is best that the index numbers are in order to
match the stage number, reorder the channel numbers.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 11:08:14 +01:00
Andrew F. Davis
606c7e6c1b iio: health/afe4404: Remove LED3 input channel
Input channel LED3 is only an alias for stage ALED2, this virtual channel
does nothing for us, remove this channel.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 11:04:30 +01:00
Andrew F. Davis
2e0df3a583 iio: health/afe440x: Remove unneeded offset handling
No channel in the afe4403 driver has IIO_CHAN_INFO_OFFSET set so
remove the handlers for this.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 11:03:49 +01:00
Andrew F. Davis
9d3d9a57e4 iio: health/afe440x: Fix scan_index assignment
The LED channels are not scannable and so scan_index should
be negative, fix this here.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 11:03:01 +01:00
Andrew F. Davis
81f517270d iio: health/afe440x: Always use separate gain values
Locking the two gain stages to the same setting adds no value for us,
so initialize them as unlocked and remove the sysfs for unlocking them.
This also allows us to greatly simplify showing and setting the gain
registers.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 11:02:39 +01:00
Andrew F. Davis
e85fa0338b iio: health/afe440x: Remove unneeded initializers
The drivers set some register values during initialization that can be
set at runtime, these defaults were used in testing but are not
necessary, remove these.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 10:59:47 +01:00
Andrew F. Davis
daffd7a75c iio: health/afe440x: Remove of_match_ptr and ifdefs
The drivers DT tables are not built-in when OF is not enabled, this does
not save us enough to justify ugly ifdefs. Clean this up.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 10:59:04 +01:00
Andrew F. Davis
f59e6b5ae0 iio: health/afe440x: Fix kernel-doc format
Fix kernel-doc formatting for structs, and while we are making little
fixes, clarify the module description and update the copywrite.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-04 10:57:58 +01:00
Matt Ranostay
b74fccad75 iio: health: max30100: correct FIFO check condition
Correct issue that the last entry in FIFO was being read twice due
to an incorrect decrement of entry count variable before condition
check.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-28 10:09:58 +01:00
Arnd Bergmann
0e6071ab76 iio: health/afe4404: mark suspend/resume functions __maybe_unused
The newly added afe4404 driver implements suspend/resume using the
SIMPLE_DEV_PM_OPS() macro, which leaves out references to the actual
functions when CONFIG_PM is disabled, causing a harmless warning:

health/afe4404.c:509:12: error: 'afe4404_suspend' defined but not used
health/afe4404.c:530:12: error: 'afe4404_resume' defined but not used

This marks the functions as __maybe_unused so we don't get those
warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 87aec56e27 ("iio: health: Add driver for the TI AFE4404 heart monitor")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-17 19:36:01 +00:00
Arnd Bergmann
9e8be75e27 iio: health/afe4403: mark suspend/resume functions __maybe_unused
The newly added afe4403 driver implements suspend/resume using the
SIMPLE_DEV_PM_OPS() macro, which leaves out references to the actual
functions when CONFIG_PM is disabled, causing a harmless warning:

health/afe4403.c:509:12: error: 'afe4403_suspend' defined but not used
health/afe4403.c:530:12: error: 'afe4403_resume' defined but not used

This marks the functions as __maybe_unused so we don't get those
warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: eec96d1e2d ("iio: health: Add driver for the TI AFE4403 heart monitor")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-17 19:35:28 +00:00
Arnd Bergmann
f56293c75b iio: health/afe4403: select REGMAP_SPI
The newly added afe4403 driver uses the regmap facility to abstract
the I2C and SPI access. However, it fails to ensure that regmap_spi
is actually present:

drivers/iio/built-in.o: In function `afe4403_probe':
:(.text+0x9bf8): undefined reference to `__devm_regmap_init_spi'

This adds a Kconfig select statement like the afe4404 I2C driver
has.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: eec96d1e2d ("iio: health: Add driver for the TI AFE4403 heart monitor")
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-17 19:31:06 +00:00
Andrew F. Davis
eec96d1e2d iio: health: Add driver for the TI AFE4403 heart monitor
Add driver for the TI AFE4403 heart rate monitor and pulse oximeter.
This device detects reflected LED light fluctuations and presents an ADC
value to the user space for further signal processing.

Data sheet located here:
http://www.ti.com/product/AFE4403/datasheet

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-06 21:55:32 +00:00
Andrew F. Davis
87aec56e27 iio: health: Add driver for the TI AFE4404 heart monitor
Add driver for the TI AFE4404 heart rate monitor and pulse oximeter.
This device detects reflected LED light fluctuations and presents an ADC
value to the user space for further signal processing.

Datasheet: http://www.ti.com/product/AFE4404/datasheet

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-06 18:57:09 +00:00
Matt Ranostay
b11a34607d iio: health: max30100: add config for LED current
Allow the current for both RED and IR LEDs to be set via an device tree
property setting.

This is an optional setting that is useful for applications that have a
known glass attenuation factor.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-03 17:59:49 +00:00
Matt Ranostay
4d33615df5 iio: light: add MAX30100 oximeter driver support
MAX30100 is an heart rate and pulse oximeter sensor that works using
two LEDS of different wavelengths, and detecting the light reflected
back.

This patchset adds support for both IR and RED LED channels which can
be processed in userspace to determine heart rate and blood oxygen
levels.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-12 12:14:37 +00:00