All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646
@ 2019-04-11 13:27 Leonard Crestez
  2019-04-11 13:27 ` [PATCH 2/2] arm64: defconfig: Enable lpi2c for imx8qxp and sensors Leonard Crestez
  2019-04-21  7:36 ` [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646 Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Leonard Crestez @ 2019-04-11 13:27 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam
  Cc: Aisheng Dong, Andy Duan, Clark Wang, dl-linux-imx, kernel,
	linux-arm-kernel

Add an initial description of the i2c1 bus with a pca9646 i2c switch and
various gpio expanders and sensors behind that. Only add the sensors
which already have upstream drivers.

According to the datasheet the pca9646 is software compatible with
pca9546 so no driver changes should be required.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
index 03aad66545c5..bfdada2db176 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
@@ -58,10 +58,86 @@
 			reg = <1>;
 		};
 	};
 };
 
+&adma_i2c1 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>;
+	status = "okay";
+
+	i2c-switch@71 {
+		compatible = "nxp,pca9646", "nxp,pca9546";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x71>;
+		reset-gpios = <&lsio_gpio1 1 GPIO_ACTIVE_LOW>;
+
+		i2c@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;
+
+			max7322: gpio@68 {
+				compatible = "maxim,max7322";
+				reg = <0x68>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+		};
+
+		i2c@1 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <1>;
+		};
+
+		i2c@2 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <2>;
+
+			pressure-sensor@60 {
+				compatible = "fsl,mpl3115";
+				reg = <0x60>;
+			};
+		};
+
+		i2c@3 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <3>;
+
+			pca9557_a: gpio@1a {
+				compatible = "nxp,pca9557";
+				reg = <0x1a>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
+			pca9557_b: gpio@1d {
+				compatible = "nxp,pca9557";
+				reg = <0x1d>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
+
+			light-sensor@44 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_isl29023>;
+				compatible = "isil,isl29023";
+				reg = <0x44>;
+				interrupt-parent = <&lsio_gpio1>;
+				interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
+			};
+		};
+	};
+};
+
 &usdhc1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usdhc1>;
 	bus-width = <8>;
 	no-sd;
@@ -98,10 +174,29 @@
 			IMX8QXP_ENET0_RGMII_RXD2_CONN_ENET0_RGMII_RXD2		0x06000020
 			IMX8QXP_ENET0_RGMII_RXD3_CONN_ENET0_RGMII_RXD3		0x06000020
 		>;
 	};
 
+	pinctrl_ioexp_rst: ioexp_rst_grp {
+		fsl,pins = <
+			IMX8QXP_SPI2_SDO_LSIO_GPIO1_IO01			0x06000021
+		>;
+	};
+
+	pinctrl_isl29023: isl29023grp {
+		fsl,pins = <
+			IMX8QXP_SPI2_SDI_LSIO_GPIO1_IO02			0x00000021
+		>;
+	};
+
+	pinctrl_lpi2c1: lpi2c1grp {
+		fsl,pins = <
+			IMX8QXP_USB_SS3_TC1_ADMA_I2C1_SCL			0x06000021
+			IMX8QXP_USB_SS3_TC3_ADMA_I2C1_SDA			0x06000021
+		>;
+	};
+
 	pinctrl_lpuart0: lpuart0grp {
 		fsl,pins = <
 			IMX8QXP_UART0_RX_ADMA_UART0_RX				0x06000020
 			IMX8QXP_UART0_TX_ADMA_UART0_TX				0x06000020
 		>;
-- 
2.17.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] arm64: defconfig: Enable lpi2c for imx8qxp and sensors
  2019-04-11 13:27 [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646 Leonard Crestez
@ 2019-04-11 13:27 ` Leonard Crestez
  2019-04-21  7:36 ` [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646 Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Leonard Crestez @ 2019-04-11 13:27 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam
  Cc: Aisheng Dong, Andy Duan, Clark Wang, dl-linux-imx, kernel,
	linux-arm-kernel

The current lpi2c driver can work on imx8 chips so lets enable it. Also
enable few i2c peripherals found on imx8qxp-mek I2C (some were already
used for other boards).

Sensors enabled as modules because not required for boot.

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

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index f206d1b834c8..5ceb3387e1d3 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -357,10 +357,11 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_I2C_BCM2835=m
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_I2C_GPIO=m
 CONFIG_I2C_IMX=y
+CONFIG_I2C_IMX_LPI2C=y
 CONFIG_I2C_MESON=y
 CONFIG_I2C_MV64XXX=y
 CONFIG_I2C_PXA=y
 CONFIG_I2C_QUP=y
 CONFIG_I2C_RK3X=y
@@ -405,10 +406,11 @@ CONFIG_GPIO_MB86S7X=y
 CONFIG_GPIO_PL061=y
 CONFIG_GPIO_RCAR=y
 CONFIG_GPIO_UNIPHIER=y
 CONFIG_GPIO_XGENE=y
 CONFIG_GPIO_XGENE_SB=y
+CONFIG_GPIO_MAX732X=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_MAX77620=y
 CONFIG_POWER_AVS=y
 CONFIG_ROCKCHIP_IODOMAIN=y
@@ -720,11 +722,13 @@ CONFIG_IIO=y
 CONFIG_EXYNOS_ADC=y
 CONFIG_ROCKCHIP_SARADC=m
 CONFIG_IIO_CROS_EC_SENSORS_CORE=m
 CONFIG_IIO_CROS_EC_SENSORS=m
 CONFIG_IIO_CROS_EC_LIGHT_PROX=m
+CONFIG_SENSORS_ISL29018=m
 CONFIG_IIO_CROS_EC_BARO=m
+CONFIG_MPL3115=m
 CONFIG_PWM=y
 CONFIG_PWM_BCM2835=m
 CONFIG_PWM_CROS_EC=m
 CONFIG_PWM_MESON=m
 CONFIG_PWM_RCAR=m
-- 
2.17.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646
  2019-04-11 13:27 [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646 Leonard Crestez
  2019-04-11 13:27 ` [PATCH 2/2] arm64: defconfig: Enable lpi2c for imx8qxp and sensors Leonard Crestez
@ 2019-04-21  7:36 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2019-04-21  7:36 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Aisheng Dong, Andy Duan, Clark Wang, dl-linux-imx, kernel,
	Fabio Estevam, linux-arm-kernel

On Thu, Apr 11, 2019 at 01:27:39PM +0000, Leonard Crestez wrote:
> Add an initial description of the i2c1 bus with a pca9646 i2c switch and
> various gpio expanders and sensors behind that. Only add the sensors
> which already have upstream drivers.
> 
> According to the datasheet the pca9646 is software compatible with
> pca9546 so no driver changes should be required.
> 
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

Applied both, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11 13:27 [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646 Leonard Crestez
2019-04-11 13:27 ` [PATCH 2/2] arm64: defconfig: Enable lpi2c for imx8qxp and sensors Leonard Crestez
2019-04-21  7:36 ` [PATCH 1/2] arm64: dts: imx8qxp-mek: Add i2c1 with pca9646 Shawn Guo

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.