All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180"
@ 2017-04-01 14:44 H. Nikolaus Schaller
  2017-04-01 14:59 ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: H. Nikolaus Schaller @ 2017-04-01 14:44 UTC (permalink / raw)
  To: Dmitry Torokhov, H. Nikolaus Schaller, Hans de Goede, Aniroop Mathur
  Cc: linux-input, linux-kernel, letux-kernel

This reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present")
and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180")

Rationale: initially (2012) the GTA04 device using a bma180 chip simply refereced
the bma150 platform driver in its board file [1] which happened to work in all
scenarios that were tested.

When conversion to DT started (2014), we needed to make the driver be still
recognised. Hence we introduced the compatibility to the bma180 chip in
Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This
worked flawlessly for years with the GTA04 device.

Recently (2016), Hans de Goede pointed out that the chips are not as similar
as they appeared and the driver works with the bma180 for the GTA04 only
by good luck. He proposed to remove the bma180 support completely [3], but
we still did need it until we have a replacement. Thus, a condifional compile
was added.

We have now developed a generic iio-input-bridge which works with any 2 or
3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and
works as expected. Therefore we can remove the bma180 support from this
driver completely. User-space API compatibility can be restored by using the
iio-input-bridge.

Maybe it is time to convert the bma150 driver to iio as well and retire the
accelerometer input drivers completely but this is a different story and task.

[1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976
[2]: https://patchwork.kernel.org/patch/3961171/
[3]: https://patchwork.kernel.org/patch/9325481/

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/input/misc/bma150.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
index 1fa8537..1efcfdf 100644
--- a/drivers/input/misc/bma150.c
+++ b/drivers/input/misc/bma150.c
@@ -70,7 +70,6 @@
 #define BMA150_CFG_5_REG	0x11
 
 #define BMA150_CHIP_ID		2
-#define BMA180_CHIP_ID		3
 #define BMA150_CHIP_ID_REG	BMA150_DATA_0_REG
 
 #define BMA150_ACC_X_LSB_REG	BMA150_DATA_2_REG
@@ -538,13 +537,8 @@ static int bma150_probe(struct i2c_client *client,
 		return -EIO;
 	}
 
-	/*
-	 * Note if the IIO CONFIG_BMA180 driver is enabled we want to fail
-	 * the probe for the bma180 as the iio driver is preferred.
-	 */
 	chip_id = i2c_smbus_read_byte_data(client, BMA150_CHIP_ID_REG);
-	if (chip_id != BMA150_CHIP_ID &&
-	    (IS_ENABLED(CONFIG_BMA180) || chip_id != BMA180_CHIP_ID)) {
+	if (chip_id != BMA150_CHIP_ID) {
 		dev_err(&client->dev, "BMA150 chip id error: %d\n", chip_id);
 		return -EINVAL;
 	}
@@ -648,9 +642,6 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);
 
 static const struct i2c_device_id bma150_id[] = {
 	{ "bma150", 0 },
-#if !IS_ENABLED(CONFIG_BMA180)
-	{ "bma180", 0 },
-#endif
 	{ "smb380", 0 },
 	{ "bma023", 0 },
 	{ }
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180"
  2017-04-01 14:44 [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180" H. Nikolaus Schaller
@ 2017-04-01 14:59 ` Hans de Goede
  2017-04-01 16:46   ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2017-04-01 14:59 UTC (permalink / raw)
  To: H. Nikolaus Schaller, Dmitry Torokhov, Aniroop Mathur
  Cc: linux-input, linux-kernel, letux-kernel

Hi,

On 01-04-17 16:44, H. Nikolaus Schaller wrote:
> This reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present")
> and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180")
>
> Rationale: initially (2012) the GTA04 device using a bma180 chip simply refereced
> the bma150 platform driver in its board file [1] which happened to work in all
> scenarios that were tested.
>
> When conversion to DT started (2014), we needed to make the driver be still
> recognised. Hence we introduced the compatibility to the bma180 chip in
> Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This
> worked flawlessly for years with the GTA04 device.
>
> Recently (2016), Hans de Goede pointed out that the chips are not as similar
> as they appeared and the driver works with the bma180 for the GTA04 only
> by good luck. He proposed to remove the bma180 support completely [3], but
> we still did need it until we have a replacement. Thus, a condifional compile
> was added.
>
> We have now developed a generic iio-input-bridge which works with any 2 or
> 3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and
> works as expected. Therefore we can remove the bma180 support from this
> driver completely. User-space API compatibility can be restored by using the
> iio-input-bridge.
>
> Maybe it is time to convert the bma150 driver to iio as well and retire the
> accelerometer input drivers completely but this is a different story and task.
>
> [1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976
> [2]: https://patchwork.kernel.org/patch/3961171/
> [3]: https://patchwork.kernel.org/patch/9325481/
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>

Looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/input/misc/bma150.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
> index 1fa8537..1efcfdf 100644
> --- a/drivers/input/misc/bma150.c
> +++ b/drivers/input/misc/bma150.c
> @@ -70,7 +70,6 @@
>  #define BMA150_CFG_5_REG	0x11
>
>  #define BMA150_CHIP_ID		2
> -#define BMA180_CHIP_ID		3
>  #define BMA150_CHIP_ID_REG	BMA150_DATA_0_REG
>
>  #define BMA150_ACC_X_LSB_REG	BMA150_DATA_2_REG
> @@ -538,13 +537,8 @@ static int bma150_probe(struct i2c_client *client,
>  		return -EIO;
>  	}
>
> -	/*
> -	 * Note if the IIO CONFIG_BMA180 driver is enabled we want to fail
> -	 * the probe for the bma180 as the iio driver is preferred.
> -	 */
>  	chip_id = i2c_smbus_read_byte_data(client, BMA150_CHIP_ID_REG);
> -	if (chip_id != BMA150_CHIP_ID &&
> -	    (IS_ENABLED(CONFIG_BMA180) || chip_id != BMA180_CHIP_ID)) {
> +	if (chip_id != BMA150_CHIP_ID) {
>  		dev_err(&client->dev, "BMA150 chip id error: %d\n", chip_id);
>  		return -EINVAL;
>  	}
> @@ -648,9 +642,6 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);
>
>  static const struct i2c_device_id bma150_id[] = {
>  	{ "bma150", 0 },
> -#if !IS_ENABLED(CONFIG_BMA180)
> -	{ "bma180", 0 },
> -#endif
>  	{ "smb380", 0 },
>  	{ "bma023", 0 },
>  	{ }
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180"
  2017-04-01 14:59 ` Hans de Goede
@ 2017-04-01 16:46   ` Dmitry Torokhov
  2017-04-05 19:16     ` H. Nikolaus Schaller
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2017-04-01 16:46 UTC (permalink / raw)
  To: Hans de Goede
  Cc: H. Nikolaus Schaller, Aniroop Mathur, linux-input, linux-kernel,
	letux-kernel

On Sat, Apr 01, 2017 at 04:59:26PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 01-04-17 16:44, H. Nikolaus Schaller wrote:
> >This reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present")
> >and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180")
> >
> >Rationale: initially (2012) the GTA04 device using a bma180 chip simply refereced
> >the bma150 platform driver in its board file [1] which happened to work in all
> >scenarios that were tested.
> >
> >When conversion to DT started (2014), we needed to make the driver be still
> >recognised. Hence we introduced the compatibility to the bma180 chip in
> >Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This
> >worked flawlessly for years with the GTA04 device.
> >
> >Recently (2016), Hans de Goede pointed out that the chips are not as similar
> >as they appeared and the driver works with the bma180 for the GTA04 only
> >by good luck. He proposed to remove the bma180 support completely [3], but
> >we still did need it until we have a replacement. Thus, a condifional compile
> >was added.
> >
> >We have now developed a generic iio-input-bridge which works with any 2 or
> >3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and
> >works as expected. Therefore we can remove the bma180 support from this
> >driver completely. User-space API compatibility can be restored by using the
> >iio-input-bridge.
> >
> >Maybe it is time to convert the bma150 driver to iio as well and retire the
> >accelerometer input drivers completely but this is a different story and task.
> >
> >[1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976
> >[2]: https://patchwork.kernel.org/patch/3961171/
> >[3]: https://patchwork.kernel.org/patch/9325481/
> >
> >Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> 
> Looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Changed subject slightly (we are not reverting because patches were
defective, we are removing support for bma180), and applied.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180"
  2017-04-01 16:46   ` Dmitry Torokhov
@ 2017-04-05 19:16     ` H. Nikolaus Schaller
  2017-04-05 21:37       ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: H. Nikolaus Schaller @ 2017-04-05 19:16 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Hans de Goede, Aniroop Mathur, linux-input, linux-kernel, letux-kernel


> Am 01.04.2017 um 18:46 schrieb Dmitry Torokhov <dmitry.torokhov@gmail.com>:
> 
> On Sat, Apr 01, 2017 at 04:59:26PM +0200, Hans de Goede wrote:
>> Hi,
>> 
>> On 01-04-17 16:44, H. Nikolaus Schaller wrote:
>>> This reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present")
>>> and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180")
>>> 
>>> Rationale: initially (2012) the GTA04 device using a bma180 chip simply refereced
>>> the bma150 platform driver in its board file [1] which happened to work in all
>>> scenarios that were tested.
>>> 
>>> When conversion to DT started (2014), we needed to make the driver be still
>>> recognised. Hence we introduced the compatibility to the bma180 chip in
>>> Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This
>>> worked flawlessly for years with the GTA04 device.
>>> 
>>> Recently (2016), Hans de Goede pointed out that the chips are not as similar
>>> as they appeared and the driver works with the bma180 for the GTA04 only
>>> by good luck. He proposed to remove the bma180 support completely [3], but
>>> we still did need it until we have a replacement. Thus, a condifional compile
>>> was added.
>>> 
>>> We have now developed a generic iio-input-bridge which works with any 2 or
>>> 3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and
>>> works as expected. Therefore we can remove the bma180 support from this
>>> driver completely. User-space API compatibility can be restored by using the
>>> iio-input-bridge.
>>> 
>>> Maybe it is time to convert the bma150 driver to iio as well and retire the
>>> accelerometer input drivers completely but this is a different story and task.
>>> 
>>> [1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976
>>> [2]: https://patchwork.kernel.org/patch/3961171/
>>> [3]: https://patchwork.kernel.org/patch/9325481/
>>> 
>>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>> 
>> Looks good to me:
>> 
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> Changed subject slightly (we are not reverting because patches were
> defective, we are removing support for bma180), and applied.

Just noticed: the subject in linux-next has a typo:
Should IMHO be "Input: bma150 - remove support for bma180"

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f069b5a0b27ad4a87e9351e54fbcab3d3f8a9fd5

thanks,
Nikolaus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180"
  2017-04-05 19:16     ` H. Nikolaus Schaller
@ 2017-04-05 21:37       ` Dmitry Torokhov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2017-04-05 21:37 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Hans de Goede, Aniroop Mathur, linux-input, linux-kernel, letux-kernel

On Wed, Apr 05, 2017 at 09:16:28PM +0200, H. Nikolaus Schaller wrote:
> 
> > Am 01.04.2017 um 18:46 schrieb Dmitry Torokhov <dmitry.torokhov@gmail.com>:
> > 
> > On Sat, Apr 01, 2017 at 04:59:26PM +0200, Hans de Goede wrote:
> >> Hi,
> >> 
> >> On 01-04-17 16:44, H. Nikolaus Schaller wrote:
> >>> This reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present")
> >>> and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180")
> >>> 
> >>> Rationale: initially (2012) the GTA04 device using a bma180 chip simply refereced
> >>> the bma150 platform driver in its board file [1] which happened to work in all
> >>> scenarios that were tested.
> >>> 
> >>> When conversion to DT started (2014), we needed to make the driver be still
> >>> recognised. Hence we introduced the compatibility to the bma180 chip in
> >>> Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This
> >>> worked flawlessly for years with the GTA04 device.
> >>> 
> >>> Recently (2016), Hans de Goede pointed out that the chips are not as similar
> >>> as they appeared and the driver works with the bma180 for the GTA04 only
> >>> by good luck. He proposed to remove the bma180 support completely [3], but
> >>> we still did need it until we have a replacement. Thus, a condifional compile
> >>> was added.
> >>> 
> >>> We have now developed a generic iio-input-bridge which works with any 2 or
> >>> 3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and
> >>> works as expected. Therefore we can remove the bma180 support from this
> >>> driver completely. User-space API compatibility can be restored by using the
> >>> iio-input-bridge.
> >>> 
> >>> Maybe it is time to convert the bma150 driver to iio as well and retire the
> >>> accelerometer input drivers completely but this is a different story and task.
> >>> 
> >>> [1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976
> >>> [2]: https://patchwork.kernel.org/patch/3961171/
> >>> [3]: https://patchwork.kernel.org/patch/9325481/
> >>> 
> >>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> >> 
> >> Looks good to me:
> >> 
> >> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > 
> > Changed subject slightly (we are not reverting because patches were
> > defective, we are removing support for bma180), and applied.
> 
> Just noticed: the subject in linux-next has a typo:
> Should IMHO be "Input: bma150 - remove support for bma180"
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f069b5a0b27ad4a87e9351e54fbcab3d3f8a9fd5

Yeah, I screwed up there. Unfortunately it is buries too deep now.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-05 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01 14:44 [PATCH] Revert "Input: bma150 - avoid binding to bma180 if IIO bma180 driver present" and "Input: bma150 - extend chip detection for bma180" H. Nikolaus Schaller
2017-04-01 14:59 ` Hans de Goede
2017-04-01 16:46   ` Dmitry Torokhov
2017-04-05 19:16     ` H. Nikolaus Schaller
2017-04-05 21:37       ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.