All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-07 17:00 ` Leonard Crestez
  0 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-07 17:00 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam, Fugang Duan
  Cc: Dong Aisheng, Steve Longerbeam, linux-imx, kernel,
	linux-arm-kernel, devicetree, linux-kernel

The following sensors are on I2C3 on the baseboard:
* isil,isl29023 light sensor
* fsl,mag3110 magnetometer
* fsl,mma8451 accelerometer

Added under i2cmux/i2c@1 because they're not otherwise accessible.

These are all supported by iio with following configs:
* CONFIG_SENSORS_ISL29018
* CONFIG_MAG3110
* CONFIG_MMA8452

Tested with raw reads from iio sysfs.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 54b0139e978d..a6193240259d 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -160,10 +160,31 @@
 				compatible = "maxim,max7310";
 				reg = <0x34>;
 				gpio-controller;
 				#gpio-cells = <2>;
 			};
+
+			isl29023@44 {
+				compatible = "isil,isl29023";
+				reg = <0x44>;
+				interrupt-parent = <&gpio5>;
+				interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
+			};
+
+			mag3110@0e {
+				compatible = "fsl,mag3110";
+				reg = <0x0e>;
+				interrupt-parent = <&gpio2>;
+				interrupts = <29 IRQ_TYPE_EDGE_RISING>;
+			};
+
+			mma8451@1c {
+				compatible = "fsl,mma8451";
+				reg = <0x1c>;
+				interrupt-parent = <&gpio6>;
+				interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
+			};
 		};
 	};
 };
 
 &ipu1_csi0_from_ipu1_csi0_mux {
-- 
2.17.1

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

* [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-07 17:00 ` Leonard Crestez
  0 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-07 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

The following sensors are on I2C3 on the baseboard:
* isil,isl29023 light sensor
* fsl,mag3110 magnetometer
* fsl,mma8451 accelerometer

Added under i2cmux/i2c at 1 because they're not otherwise accessible.

These are all supported by iio with following configs:
* CONFIG_SENSORS_ISL29018
* CONFIG_MAG3110
* CONFIG_MMA8452

Tested with raw reads from iio sysfs.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 54b0139e978d..a6193240259d 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -160,10 +160,31 @@
 				compatible = "maxim,max7310";
 				reg = <0x34>;
 				gpio-controller;
 				#gpio-cells = <2>;
 			};
+
+			isl29023 at 44 {
+				compatible = "isil,isl29023";
+				reg = <0x44>;
+				interrupt-parent = <&gpio5>;
+				interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
+			};
+
+			mag3110 at 0e {
+				compatible = "fsl,mag3110";
+				reg = <0x0e>;
+				interrupt-parent = <&gpio2>;
+				interrupts = <29 IRQ_TYPE_EDGE_RISING>;
+			};
+
+			mma8451 at 1c {
+				compatible = "fsl,mma8451";
+				reg = <0x1c>;
+				interrupt-parent = <&gpio6>;
+				interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
+			};
 		};
 	};
 };
 
 &ipu1_csi0_from_ipu1_csi0_mux {
-- 
2.17.1

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

* [PATCH 2/2] imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors
  2018-06-07 17:00 ` Leonard Crestez
@ 2018-06-07 17:00   ` Leonard Crestez
  -1 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-07 17:00 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam, Fugang Duan
  Cc: Dong Aisheng, Steve Longerbeam, linux-imx, kernel,
	linux-arm-kernel, devicetree, linux-kernel

CONFIG_SENSORS_ISL29018 supports isil,il29023 light sensor
CONFIG_MMA8452 supports fsl,mma8451 accelerometer

CONFIG_MAG3110 for fsl,mag3110 is already enabled

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 arch/arm/configs/imx_v6_v7_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 3a308437b088..7efcce8083d2 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -364,12 +364,14 @@ CONFIG_MXS_DMA=y
 CONFIG_STAGING=y
 CONFIG_STAGING_MEDIA=y
 CONFIG_VIDEO_IMX_MEDIA=y
 CONFIG_COMMON_CLK_PWM=y
 CONFIG_IIO=y
+CONFIG_MMA8452=y
 CONFIG_IMX7D_ADC=y
 CONFIG_VF610_ADC=y
+CONFIG_SENSORS_ISL29018=y
 CONFIG_MAG3110=y
 CONFIG_MPL3115=y
 CONFIG_PWM=y
 CONFIG_PWM_FSL_FTM=y
 CONFIG_PWM_IMX=y
-- 
2.17.1

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

* [PATCH 2/2] imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors
@ 2018-06-07 17:00   ` Leonard Crestez
  0 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-07 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

CONFIG_SENSORS_ISL29018 supports isil,il29023 light sensor
CONFIG_MMA8452 supports fsl,mma8451 accelerometer

CONFIG_MAG3110 for fsl,mag3110 is already enabled

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 arch/arm/configs/imx_v6_v7_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 3a308437b088..7efcce8083d2 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -364,12 +364,14 @@ CONFIG_MXS_DMA=y
 CONFIG_STAGING=y
 CONFIG_STAGING_MEDIA=y
 CONFIG_VIDEO_IMX_MEDIA=y
 CONFIG_COMMON_CLK_PWM=y
 CONFIG_IIO=y
+CONFIG_MMA8452=y
 CONFIG_IMX7D_ADC=y
 CONFIG_VF610_ADC=y
+CONFIG_SENSORS_ISL29018=y
 CONFIG_MAG3110=y
 CONFIG_MPL3115=y
 CONFIG_PWM=y
 CONFIG_PWM_FSL_FTM=y
 CONFIG_PWM_IMX=y
-- 
2.17.1

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

* Re: [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
  2018-06-07 17:00 ` Leonard Crestez
@ 2018-06-07 17:07   ` Fabio Estevam
  -1 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-07 17:07 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Shawn Guo, Fabio Estevam, Fugang Duan, Dong Aisheng,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, NXP Linux Team, Sascha Hauer, Steve Longerbeam,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Leonard,

On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:

> +
> +                       isl29023@44 {

According to Devicetree Specification v0.2 document:

"The name of a node should be somewhat generic, reflecting the function
of the device and not its precise programming model."

So you could write:

light-sensor@44


> +                               compatible = "isil,isl29023";
> +                               reg = <0x44>;
> +                               interrupt-parent = <&gpio5>;
> +                               interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
> +                       };
> +
> +                       mag3110@0e {

No leading zero in unit address, please.

Building with W=1 will give you warnings about it.

magnetometer@e

> +                               compatible = "fsl,mag3110";
> +                               reg = <0x0e>;
> +                               interrupt-parent = <&gpio2>;
> +                               interrupts = <29 IRQ_TYPE_EDGE_RISING>;
> +                       };
> +
> +                       mma8451@1c {

accelerometer@1c

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

* [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-07 17:07   ` Fabio Estevam
  0 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-07 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Leonard,

On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:

> +
> +                       isl29023 at 44 {

According to Devicetree Specification v0.2 document:

"The name of a node should be somewhat generic, reflecting the function
of the device and not its precise programming model."

So you could write:

light-sensor at 44


> +                               compatible = "isil,isl29023";
> +                               reg = <0x44>;
> +                               interrupt-parent = <&gpio5>;
> +                               interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
> +                       };
> +
> +                       mag3110 at 0e {

No leading zero in unit address, please.

Building with W=1 will give you warnings about it.

magnetometer at e

> +                               compatible = "fsl,mag3110";
> +                               reg = <0x0e>;
> +                               interrupt-parent = <&gpio2>;
> +                               interrupts = <29 IRQ_TYPE_EDGE_RISING>;
> +                       };
> +
> +                       mma8451 at 1c {

accelerometer at 1c

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

* Re: [PATCH 2/2] imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors
  2018-06-07 17:00   ` Leonard Crestez
@ 2018-06-08 17:28     ` Fabio Estevam
  -1 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-08 17:28 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Shawn Guo, Fabio Estevam, Fugang Duan, Dong Aisheng,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, NXP Linux Team, Sascha Hauer, Steve Longerbeam,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:
> CONFIG_SENSORS_ISL29018 supports isil,il29023 light sensor
> CONFIG_MMA8452 supports fsl,mma8451 accelerometer
>
> CONFIG_MAG3110 for fsl,mag3110 is already enabled
>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

Just a minor nit in the Subject. The "ARM" prefix is missing.

Maybe Shawn can adjust it when applying the patch.

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

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

* [PATCH 2/2] imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors
@ 2018-06-08 17:28     ` Fabio Estevam
  0 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-08 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:
> CONFIG_SENSORS_ISL29018 supports isil,il29023 light sensor
> CONFIG_MMA8452 supports fsl,mma8451 accelerometer
>
> CONFIG_MAG3110 for fsl,mag3110 is already enabled
>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

Just a minor nit in the Subject. The "ARM" prefix is missing.

Maybe Shawn can adjust it when applying the patch.

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

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

* Re: [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
  2018-06-07 17:07   ` Fabio Estevam
  (?)
@ 2018-06-14 10:17     ` Leonard Crestez
  -1 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-14 10:17 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: dl-linux-imx, linux-kernel, Andy Duan, A.s. Dong, devicetree,
	slongerbeam, shawnguo, linux-arm-kernel, kernel

On Thu, 2018-06-07 at 14:07 -0300, Fabio Estevam wrote:
> Hi Leonard,
> 
> On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:
> 
> > +
> > +                       isl29023@44 {
> 
> According to Devicetree Specification v0.2 document:
> 
> "The name of a node should be somewhat generic, reflecting the function
> of the device and not its precise programming model."
> 
> So you could write:
> 
> light-sensor@44

Ok, will fix in v2.

Should I also assign a label, like "isl29023: light-sensor@44"? I
couldn't find any recommendation on this.

There are no immediate uses for a label but this practice is very
common. Having labels allows creating minor board variants with reduced
churn in the base dts so it seems good.

--
Regards,
Leonard

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

* Re: [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-14 10:17     ` Leonard Crestez
  0 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-14 10:17 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: dl-linux-imx, linux-kernel, Andy Duan, A.s. Dong, devicetree,
	slongerbeam, shawnguo, linux-arm-kernel, kernel

On Thu, 2018-06-07 at 14:07 -0300, Fabio Estevam wrote:
> Hi Leonard,
> 
> On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:
> 
> > +
> > +                       isl29023@44 {
> 
> According to Devicetree Specification v0.2 document:
> 
> "The name of a node should be somewhat generic, reflecting the function
> of the device and not its precise programming model."
> 
> So you could write:
> 
> light-sensor@44

Ok, will fix in v2.

Should I also assign a label, like "isl29023: light-sensor@44"? I
couldn't find any recommendation on this.

There are no immediate uses for a label but this practice is very
common. Having labels allows creating minor board variants with reduced
churn in the base dts so it seems good.

--
Regards,
Leonard

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

* [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-14 10:17     ` Leonard Crestez
  0 siblings, 0 replies; 14+ messages in thread
From: Leonard Crestez @ 2018-06-14 10:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2018-06-07 at 14:07 -0300, Fabio Estevam wrote:
> Hi Leonard,
> 
> On Thu, Jun 7, 2018 at 2:00 PM, Leonard Crestez <leonard.crestez@nxp.com> wrote:
> 
> > +
> > +                       isl29023 at 44 {
> 
> According to Devicetree Specification v0.2 document:
> 
> "The name of a node should be somewhat generic, reflecting the function
> of the device and not its precise programming model."
> 
> So you could write:
> 
> light-sensor at 44

Ok, will fix in v2.

Should I also assign a label, like "isl29023: light-sensor at 44"? I
couldn't find any recommendation on this.

There are no immediate uses for a label but this practice is very
common. Having labels allows creating minor board variants with reduced
churn in the base dts so it seems good.

--
Regards,
Leonard

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

* Re: [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
  2018-06-14 10:17     ` Leonard Crestez
  (?)
@ 2018-06-15 20:16       ` Fabio Estevam
  -1 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-15 20:16 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Fabio Estevam, dl-linux-imx, linux-kernel, Andy Duan, A.s. Dong,
	devicetree, slongerbeam, shawnguo, linux-arm-kernel, kernel

On Thu, Jun 14, 2018 at 7:17 AM, Leonard Crestez
<leonard.crestez@nxp.com> wrote:

> Should I also assign a label, like "isl29023: light-sensor@44"? I
> couldn't find any recommendation on this.
>
> There are no immediate uses for a label but this practice is very
> common. Having labels allows creating minor board variants with reduced
> churn in the base dts so it seems good.

In the case of this specific board we don't have board variants, so no
need to add a label.

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

* Re: [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-15 20:16       ` Fabio Estevam
  0 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-15 20:16 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Fabio Estevam, dl-linux-imx, linux-kernel, Andy Duan, A.s. Dong,
	devicetree, slongerbeam, shawnguo, linux-arm-kernel, kernel

On Thu, Jun 14, 2018 at 7:17 AM, Leonard Crestez
<leonard.crestez@nxp.com> wrote:

> Should I also assign a label, like "isl29023: light-sensor@44"? I
> couldn't find any recommendation on this.
>
> There are no immediate uses for a label but this practice is very
> common. Having labels allows creating minor board variants with reduced
> churn in the base dts so it seems good.

In the case of this specific board we don't have board variants, so no
need to add a label.

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

* [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors
@ 2018-06-15 20:16       ` Fabio Estevam
  0 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2018-06-15 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 14, 2018 at 7:17 AM, Leonard Crestez
<leonard.crestez@nxp.com> wrote:

> Should I also assign a label, like "isl29023: light-sensor at 44"? I
> couldn't find any recommendation on this.
>
> There are no immediate uses for a label but this practice is very
> common. Having labels allows creating minor board variants with reduced
> churn in the base dts so it seems good.

In the case of this specific board we don't have board variants, so no
need to add a label.

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

end of thread, other threads:[~2018-06-15 20:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 17:00 [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors Leonard Crestez
2018-06-07 17:00 ` Leonard Crestez
2018-06-07 17:00 ` [PATCH 2/2] imx_v6_v7_defconfig: Enable imx6qdl-sabreauto sensors Leonard Crestez
2018-06-07 17:00   ` Leonard Crestez
2018-06-08 17:28   ` Fabio Estevam
2018-06-08 17:28     ` Fabio Estevam
2018-06-07 17:07 ` [PATCH 1/2] ARM: dts: imx6qdl-sabreauto: Add sensors Fabio Estevam
2018-06-07 17:07   ` Fabio Estevam
2018-06-14 10:17   ` Leonard Crestez
2018-06-14 10:17     ` Leonard Crestez
2018-06-14 10:17     ` Leonard Crestez
2018-06-15 20:16     ` Fabio Estevam
2018-06-15 20:16       ` Fabio Estevam
2018-06-15 20:16       ` Fabio Estevam

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.