diff mbox series

[B,1/1] iio: st_sensors: remap SMO8840 to LIS2DH12

Message ID 20200330104948.29679-2-jesse.sung@canonical.com
State New
Headers show
Series Support SMO8840 as LIS2DH12 | expand

Commit Message

Jesse Sung March 30, 2020, 10:49 a.m. UTC
BugLink: https://launchpad.net/bugs/1869694

According to ST, the HID is for LIS2DH12.

Fixes: 3d56e19815b3 ("iio: accel: st_accel: Add support for the SMO8840 ACPI id")
Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
(backported from commit e43d110cdc206b6df4dd438cd10c81d1da910aad)
Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/iio/accel/st_accel_i2c.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kleber Souza March 31, 2020, 2:26 p.m. UTC | #1
On 30.03.20 12:49, Wen-chien Jesse Sung wrote:
> BugLink: https://launchpad.net/bugs/1869694
> 
> According to ST, the HID is for LIS2DH12.
> 
> Fixes: 3d56e19815b3 ("iio: accel: st_accel: Add support for the SMO8840 ACPI id")
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> Tested-by: Hans de Goede <hdegoede@redhat.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> Cc: <Stable@vger.kernel.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> (backported from commit e43d110cdc206b6df4dd438cd10c81d1da910aad)
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>

Hi Jesse,

The backport looks good to me. However, as the code in Bionic is very
different from the newer series, could you please provide a small
explanation about the backport?

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  drivers/iio/accel/st_accel_i2c.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
> index 363429b5686c..90d7b4bebb74 100644
> --- a/drivers/iio/accel/st_accel_i2c.c
> +++ b/drivers/iio/accel/st_accel_i2c.c
> @@ -107,6 +107,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match);
>  
>  #ifdef CONFIG_ACPI
>  static const struct acpi_device_id st_accel_acpi_match[] = {
> +	{"SMO8840", LIS2DH12},
>  	{"SMO8A90", LNG2DM},
>  	{ },
>  };
>
Jesse Sung April 1, 2020, 11:38 a.m. UTC | #2
On Tue, Mar 31, 2020 at 10:26 PM Kleber Souza
<kleber.souza@canonical.com> wrote:
>
> On 30.03.20 12:49, Wen-chien Jesse Sung wrote:
> > BugLink: https://launchpad.net/bugs/1869694
> >
> > According to ST, the HID is for LIS2DH12.
> >
> > Fixes: 3d56e19815b3 ("iio: accel: st_accel: Add support for the SMO8840 ACPI id")
> > Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> > Tested-by: Hans de Goede <hdegoede@redhat.com>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > Cc: <Stable@vger.kernel.org>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > (backported from commit e43d110cdc206b6df4dd438cd10c81d1da910aad)
> > Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
>
> Hi Jesse,
>
> The backport looks good to me. However, as the code in Bionic is very
> different from the newer series, could you please provide a small
> explanation about the backport?

In Bionic, the driver finds the matched entry in
st_accel_acpi_match[], then uses the .driver_data in that entry as an
index to find the name string in st_accel_id_table[]. In D/E/F, after
commit 19868faa .driver_data in st_accel_acpi_match[] points to the
string directly, hence the difference between Bionic and others.

Thanks,
Jesse


>
> Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
>
> > ---
> >  drivers/iio/accel/st_accel_i2c.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
> > index 363429b5686c..90d7b4bebb74 100644
> > --- a/drivers/iio/accel/st_accel_i2c.c
> > +++ b/drivers/iio/accel/st_accel_i2c.c
> > @@ -107,6 +107,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match);
> >
> >  #ifdef CONFIG_ACPI
> >  static const struct acpi_device_id st_accel_acpi_match[] = {
> > +     {"SMO8840", LIS2DH12},
> >       {"SMO8A90", LNG2DM},
> >       { },
> >  };
> >
>
Kleber Souza April 1, 2020, 12:48 p.m. UTC | #3
On 01.04.20 13:38, Jesse Sung wrote:
> On Tue, Mar 31, 2020 at 10:26 PM Kleber Souza
> <kleber.souza@canonical.com> wrote:
>>
>> On 30.03.20 12:49, Wen-chien Jesse Sung wrote:
>>> BugLink: https://launchpad.net/bugs/1869694
>>>
>>> According to ST, the HID is for LIS2DH12.
>>>
>>> Fixes: 3d56e19815b3 ("iio: accel: st_accel: Add support for the SMO8840 ACPI id")
>>> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
>>> Tested-by: Hans de Goede <hdegoede@redhat.com>
>>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>> Cc: <Stable@vger.kernel.org>
>>> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>>> (backported from commit e43d110cdc206b6df4dd438cd10c81d1da910aad)
>>> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
>>
>> Hi Jesse,
>>
>> The backport looks good to me. However, as the code in Bionic is very
>> different from the newer series, could you please provide a small
>> explanation about the backport?
> 
> In Bionic, the driver finds the matched entry in
> st_accel_acpi_match[], then uses the .driver_data in that entry as an
> index to find the name string in st_accel_id_table[]. In D/E/F, after
> commit 19868faa .driver_data in st_accel_acpi_match[] points to the
> string directly, hence the difference between Bionic and others.

Thanks, Jesse.

We can add this explanation to the commit when applying it.


Kleber


> 
> Thanks,
> Jesse
> 
> 
>>
>> Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
>>
>>> ---
>>>  drivers/iio/accel/st_accel_i2c.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
>>> index 363429b5686c..90d7b4bebb74 100644
>>> --- a/drivers/iio/accel/st_accel_i2c.c
>>> +++ b/drivers/iio/accel/st_accel_i2c.c
>>> @@ -107,6 +107,7 @@ MODULE_DEVICE_TABLE(of, st_accel_of_match);
>>>
>>>  #ifdef CONFIG_ACPI
>>>  static const struct acpi_device_id st_accel_acpi_match[] = {
>>> +     {"SMO8840", LIS2DH12},
>>>       {"SMO8A90", LNG2DM},
>>>       { },
>>>  };
>>>
>>
diff mbox series

Patch

diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index 363429b5686c..90d7b4bebb74 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -107,6 +107,7 @@  MODULE_DEVICE_TABLE(of, st_accel_of_match);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id st_accel_acpi_match[] = {
+	{"SMO8840", LIS2DH12},
 	{"SMO8A90", LNG2DM},
 	{ },
 };