summaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/bma150.c
Commit message (Collapse)AuthorAgeFilesLines
* Input: bma150 - switch to using usleep_range instead of msleepAniroop Mathur2016-12-271-2/+2
| | | | | | | | | | | | msleep (1~20) may not do what the caller intends, and will often sleep longer. (~20 ms actual sleep for any value given in the 1~20ms range) This is not the desired behaviour for many cases like device resume time, device suspend time, device enable time, etc. Thus, change msleep to usleep_range for precise wakeups. Signed-off-by: Aniroop Mathur <a.mathur@samsung.com> Acked by: Albert Zhang <xu.zhang@bosch-sensortec.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: bma150 - avoid binding to bma180 if IIO bma180 driver presentHans de Goede2016-11-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180"), adds bma180 chip-ids to the input bma150 driver, assuming that they are 100% compatible, but the bma180 is not compatible with the bma150 at all, it has 14 bits resolution instead of 10, and it has quite different control registers too. Treating the bma180 as a bma150 wrt its data registers will just result in throwing away the lowest 4 bits, which is not too bad. But the ctrl registers are a different story. Things happen to just work but supporting that certainly does not make treating the bma180 the same as the bma150 right. Since some setups depend on the evdev interface the bma150 driver offers on top of the bma180, we cannot simply remove the bma180 ids. So this commit only removes the bma180 id when the bma180 iio driver, which does treat the bma180 properly, is enabled. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: bma150 - constify bma150_cfg structureJulia Lawall2016-01-021-1/+1
| | | | | | | | The bma150_cfg structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-171-1/+0
| | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: bma150 - use sign_extend32() for sign extendingMartin Kepplinger2015-07-071-4/+3
| | | | | | Despite it's name, sign_extend32() is used for 16 bit values aswell. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: bma150 - extend chip detection for bma180Dr. H. Nikolaus Schaller2014-04-241-1/+3
| | | | | | | This driver has been used while on the OpenPhoenux GTA04 with a BMA180. Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: use dev_get_platdata()Jingoo Han2013-12-061-1/+2
| | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: bma150 - make some defines public and fix some commentsMichael Trimarchi2013-02-151-12/+0
| | | | | | | | | | | | | | | Make the constants referring to range and bandwidth public so they can be used when initializing the platform data fields in the platform code. Fix also some comments regarding the unit of measurement to use for the range and bandwidth fields, the values are not actually expected to be in G or HZ, the code in bma150.c just uses the BMA150_RANGE_xxx and BMA150_BW_xxx constants like they are with no translation from actual values in G or HZ. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: bma150 - fix checking pm_runtime_get_sync() return valueMichael Trimarchi2013-02-151-1/+1
| | | | | | | | | | | | | | | | | When PM_RUNTIME is not defined, pm_runtime_get_sync() returns 1, see include/linux/pm_runtime.c::__pm_runtime_resume(), and the check of the return value was overlooking this, in this case bma150_open() would return 1 which is not expected by upper layers. Maybe the check for != -ENOSYS (Function not implemented) was meant to cover this, but pm_runtime_get_sync() does not return this value. For now fix the issue locally by checking explicitly for negative return values. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: remove use of __devexitBill Pemberton2012-11-241-1/+1
| | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: remove use of __devinitBill Pemberton2012-11-241-11/+11
| | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: remove use of __devinitdataBill Pemberton2012-11-241-1/+1
| | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinitdata is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: remove use of __devexit_pBill Pemberton2012-11-241-1/+1
| | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: convert I2C drivers to use module_i2c_driver()Axel Lin2012-03-161-12/+1
| | | | | | | | | This patch converts the drivers in drivers/input/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: add driver for Bosch Sensortec's BMA150 accelerometerEric Andersson2011-08-091-0/+691
Signed-off-by: Albert Zhang <xu.zhang@bosch-sensortec.com> Signed-off-by: Eric Andersson <eric.andersson@unixphere.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>