summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/bma400.h
AgeCommit message (Collapse)AuthorFilesLines
2022-12-28iio: accel: bma400: Use devm_regulator_bulk_get_enable()Jonathan Cameron1-4/+0
This driver only turns the power on at probe and off via a custom devm_add_action_or_reset() callback. The new devm_regulator_bulk_get_enable() replaces this boilerplate code. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Jagath Jog J <jagathjog1996@gmail.com> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/20221016163409.320197-3-jic23@kernel.org
2022-09-05iio: accel: bma400: Add support for single and double tap eventsJagath Jog J1-0/+14
Add support for single and double tap events based on the tap threshold value, minimum quiet time before and after the tap and minimum time between the taps in the double tap. The INT1 pin is used to interrupt and the event is pushed to userspace. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Link: https://lore.kernel.org/r/20220831063117.4141-3-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-11iio: accel: bma400: Add support for activity and inactivity eventsJagath Jog J1-0/+11
Add support for activity and inactivity events for all axis based on the threshold, duration and hysteresis value set from the userspace. INT1 pin is used to interrupt and event is pushed to userspace. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Link: https://lore.kernel.org/r/20220505133021.22362-9-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-11iio: accel: bma400: Add step change eventJagath Jog J1-0/+2
Added support for event when there is a detection of step change. INT1 pin is used to interrupt and event is pushed to userspace. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Link: https://lore.kernel.org/r/20220505133021.22362-7-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-11iio: accel: bma400: Add separate channel for step counterJagath Jog J1-0/+2
Added channel for step counter which can be enable or disable through the sysfs interface. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Link: https://lore.kernel.org/r/20220505133021.22362-6-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-11iio: accel: bma400: Add triggered buffer supportJagath Jog J1-1/+9
Added trigger buffer support to read continuous acceleration and temperature data from device with data ready interrupt which is mapped to INT1 pin. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220505133021.22362-5-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-11iio: accel: bma400: conversion to device-managed functionJagath Jog J1-2/+0
This is a conversion to device-managed by using devm_iio_device_register() inside probe function. Previously the bma400 was not put into power down mode in some error paths in probe where it now is, but that should cause no harm. The dev_set_drvdata() call, bma400_remove() function and hooks in the I2C and SPI driver struct is removed as devm_iio_device_register() function is used to automatically unregister on driver detach. Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220505133021.22362-4-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-11iio: accel: bma400: Fix the scale min and max macro valuesJagath Jog J1-2/+21
Changing the scale macro values to match the bma400 sensitivity for 1 LSB of all the available ranges. Fixes: 465c811f1f20 ("iio: accel: Add driver for the BMA400") Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220505133021.22362-2-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-10-19iio: accel: bma400: Make bma400_remove() return voidUwe Kleine-König1-1/+1
When an i2c or spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead in the remove callbacks. As the return value of bma400_remove() is unused then, change the function to not yield a return value. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20211013203223.2694577-2-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-29iio: accel: bma400: basic regulator supportDan Robertson1-0/+4
Add support for the VDD and VDDIO regulators using the regulator framework. Signed-off-by: Dan Robertson <dan@dlrobertson.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-29iio: accel: Add driver for the BMA400Dan Robertson1-0/+95
Add a IIO driver for the Bosch BMA400 3-axes ultra-low power accelerometer. The driver supports reading from the acceleration and temperature registers. The driver also supports reading and configuring the output data rate, oversampling ratio, and scale. Signed-off-by: Dan Robertson <dan@dlrobertson.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>