All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver
@ 2020-04-06 10:52 Lorenzo Bianconi
  2020-04-06 11:00 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Lorenzo Bianconi @ 2020-04-06 10:52 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, lorenzo.bianconi, jimmyassarsson, andy.shevchenko

st_sensors.h contains common stm sensor definitions but in
st_lsm6dsx_shub driver it is used just to introduce the default
wai address for LIS3MDL sensor.
Drop this largely unconnected include and introduce the default wai
address in st_lsm6dsx_ext_dev_settings register map

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
Changes since v1:
- improve commit message
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
index 280925dd8edb..947ca3a7dcaf 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
@@ -28,7 +28,6 @@
 #include <linux/iio/sysfs.h>
 #include <linux/bitfield.h>
 
-#include <linux/iio/common/st_sensors.h>
 #include "st_lsm6dsx.h"
 
 #define ST_LSM6DSX_SLV_ADDR(n, base)		((base) + (n) * 3)
@@ -93,7 +92,7 @@ static const struct st_lsm6dsx_ext_dev_settings st_lsm6dsx_ext_dev_table[] = {
 	{
 		.i2c_addr = { 0x1e },
 		.wai = {
-			.addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+			.addr = 0x0f,
 			.val = 0x3d,
 		},
 		.id = ST_LSM6DSX_ID_MAGN,
-- 
2.25.1


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

* Re: [PATCH v2] iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver
  2020-04-06 10:52 [PATCH v2] iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver Lorenzo Bianconi
@ 2020-04-06 11:00 ` Andy Shevchenko
  2020-04-06 11:20   ` Lorenzo Bianconi
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-04-06 11:00 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: Jonathan Cameron, linux-iio, lorenzo.bianconi, Jimmy Assarsson

On Mon, Apr 6, 2020 at 1:52 PM Lorenzo Bianconi <lorenzo@kernel.org> wrote:
>
> st_sensors.h contains common stm sensor definitions but in

> st_lsm6dsx_shub driver it is used just to introduce the default

Still doesn't fully clear why only this part of the st_lsm6dsx is not
okay with the header.
You need to explain that common/st_sensors is for separate ST sensor
drivers, while LSM6DSx is a driver for certain IMU which *does not*
use ST common infrastructure.

> wai address for LIS3MDL sensor.
> Drop this largely unconnected include and introduce the default wai
> address in st_lsm6dsx_ext_dev_settings register map
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Changes since v1:
> - improve commit message
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> index 280925dd8edb..947ca3a7dcaf 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> @@ -28,7 +28,6 @@
>  #include <linux/iio/sysfs.h>
>  #include <linux/bitfield.h>
>
> -#include <linux/iio/common/st_sensors.h>
>  #include "st_lsm6dsx.h"
>
>  #define ST_LSM6DSX_SLV_ADDR(n, base)           ((base) + (n) * 3)
> @@ -93,7 +92,7 @@ static const struct st_lsm6dsx_ext_dev_settings st_lsm6dsx_ext_dev_table[] = {
>         {
>                 .i2c_addr = { 0x1e },
>                 .wai = {
> -                       .addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
> +                       .addr = 0x0f,
>                         .val = 0x3d,
>                 },
>                 .id = ST_LSM6DSX_ID_MAGN,
> --
> 2.25.1
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2] iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver
  2020-04-06 11:00 ` Andy Shevchenko
@ 2020-04-06 11:20   ` Lorenzo Bianconi
  2020-04-06 12:58     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Lorenzo Bianconi @ 2020-04-06 11:20 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, linux-iio, lorenzo.bianconi, Jimmy Assarsson

[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]

> On Mon, Apr 6, 2020 at 1:52 PM Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> >
> > st_sensors.h contains common stm sensor definitions but in
> 
> > st_lsm6dsx_shub driver it is used just to introduce the default
> 
> Still doesn't fully clear why only this part of the st_lsm6dsx is not
> okay with the header.
> You need to explain that common/st_sensors is for separate ST sensor
> drivers, while LSM6DSx is a driver for certain IMU which *does not*
> use ST common infrastructure.

I guess it is pretty simple and evident: we did not use it at all before
the LISM3DL commit and at moment we need it just for ST_SENSORS_DEFAULT_WAI_ADDRESS
definition. It is better to hard code the value directly.

> 
> > wai address for LIS3MDL sensor.
> > Drop this largely unconnected include and introduce the default wai
> > address in st_lsm6dsx_ext_dev_settings register map
> >
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > Changes since v1:
> > - improve commit message
> > ---
> >  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> > index 280925dd8edb..947ca3a7dcaf 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> > @@ -28,7 +28,6 @@
> >  #include <linux/iio/sysfs.h>
> >  #include <linux/bitfield.h>
> >
> > -#include <linux/iio/common/st_sensors.h>
> >  #include "st_lsm6dsx.h"
> >
> >  #define ST_LSM6DSX_SLV_ADDR(n, base)           ((base) + (n) * 3)
> > @@ -93,7 +92,7 @@ static const struct st_lsm6dsx_ext_dev_settings st_lsm6dsx_ext_dev_table[] = {
> >         {
> >                 .i2c_addr = { 0x1e },
> >                 .wai = {
> > -                       .addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
> > +                       .addr = 0x0f,
> >                         .val = 0x3d,
> >                 },
> >                 .id = ST_LSM6DSX_ID_MAGN,
> > --
> > 2.25.1
> >
> 
> 
> -- 
> With Best Regards,
> Andy Shevchenko

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v2] iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver
  2020-04-06 11:20   ` Lorenzo Bianconi
@ 2020-04-06 12:58     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-04-06 12:58 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: Jonathan Cameron, linux-iio, lorenzo.bianconi, Jimmy Assarsson

On Mon, Apr 6, 2020 at 2:20 PM Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> > On Mon, Apr 6, 2020 at 1:52 PM Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> > >
> > > st_sensors.h contains common stm sensor definitions but in
> >
> > > st_lsm6dsx_shub driver it is used just to introduce the default
> >
> > Still doesn't fully clear why only this part of the st_lsm6dsx is not
> > okay with the header.
> > You need to explain that common/st_sensors is for separate ST sensor
> > drivers, while LSM6DSx is a driver for certain IMU which *does not*
> > use ST common infrastructure.
>
> I guess it is pretty simple and evident: we did not use it at all before
> the LISM3DL commit and at moment we need it just for ST_SENSORS_DEFAULT_WAI_ADDRESS
> definition. It is better to hard code the value directly.

Yes, my point is that for a reader (*) of this commit message is not
fully clear why on a sudden we did that.

(*) the reader may not know full history.

> > > wai address for LIS3MDL sensor.
> > > Drop this largely unconnected include and introduce the default wai
> > > address in st_lsm6dsx_ext_dev_settings register map

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2020-04-06 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 10:52 [PATCH v2] iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver Lorenzo Bianconi
2020-04-06 11:00 ` Andy Shevchenko
2020-04-06 11:20   ` Lorenzo Bianconi
2020-04-06 12:58     ` Andy Shevchenko

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.