summaryrefslogtreecommitdiffstats
path: root/drivers/iio/health/max30102.c
Commit message (Collapse)AuthorAgeFilesLines
* iio: health: max30102: Mark expected switch fall-throughsGustavo A. R. Silva2018-08-191-2/+4
| | | | | | | | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I placed the "fall through" annotation at the bottom of the case, which is what GCC is expecting to find. Addresses-Coverity-ID: 1458342 ("Missing break in switch") Addresses-Coverity-ID: 1458345 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Merge Linus's staging merge point into staging-nextGreg Kroah-Hartman2017-12-061-1/+1
|\ | | | | | | | | | | | | | | This resolves the merge issue pointed out by Stephen in drivers/iio/adc/meson_saradc.c. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * iio: health: max30102: Temperature should be in milli CelsiusPeter Meerwald-Stadler2017-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | As per ABI temperature should be in milli Celsius after scaling, not Celsius Note on stable cc. This driver is breaking the standard IIO ABI. (JC) Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Add MAX30105 supportPeter Meerwald-Stadler2017-12-021-14/+130
| | | | | | | | | | | | | | | | | | The Maxim MAX30105 part adds a third LED (green) and uses a multi-LED measuring mode producing three measurements Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Prepare for copying varying number of measurementsPeter Meerwald-Stadler2017-12-021-5/+10
| | | | | | | | | | | | | | | | | | Current code assumes always 2 measurements (6 bytes) have to be copied, prepare for more flexibility Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Move mode setting to buffer_postenablePeter Meerwald-Stadler2017-12-021-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the programming of the mode setting from init() to buffer_postenable() Split out a separate function to only update the power/shutdown bit This changes permits to more easily implement different modes of measurements in further patches Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Introduce indices for LED channelsPeter Meerwald-Stadler2017-12-021-3/+11
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Add power enable parameter to get_temp functionPeter Meerwald-Stadler2017-12-021-13/+23
| | | | | | | | | | | | | | | | | | Chip must not be in shutdown for reading temperature, so briefly leave shutdown if buffer is not already running Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Introduce intensity channel macroPeter Meerwald-Stadler2017-12-021-28/+16
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stalder <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Add check for part IDPeter Meerwald-Stadler2017-12-021-0/+18
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Check retval of powermode functionPeter Meerwald-Stadler2017-12-021-1/+4
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Fix mode config valuesPeter Meerwald-Stadler2017-12-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | Table 4 of the datasheet specifies the mode control, these are not individual bits; add multi LED mode Add multi-LED mode and fix MODE_MASK (3 bits wide, not 2) Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Remove inconsistent full stop in error messagePeter Meerwald-Stadler2017-12-021-1/+1
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Fix missing newline in dev_errPeter Meerwald-Stadler2017-12-021-1/+1
|/ | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:health: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron2017-08-221-1/+0
| | | | | | | | | The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* iio: max30102: Set parent deviceLars-Peter Clausen2017-02-191-0/+1
| | | | | | | | | Initialize the parent of the IIO device to the device that registered it. This makes sure that the IIO device appears the right level in the device hierarchy. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: health: add MAX30102 oximeter driver supportMatt Ranostay2017-02-051-0/+485
MAX30102 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. The MAX30102 part isn't completely register and functional compatible with the existing MAX30100 driver. Signed-off-by: Matt Ranostay <matt@ranostay.consulting> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
OpenPOWER on IntegriCloud