ARM: dts: at91-sama5d27_som1_ek: Added I2C bus recovery support
authorDurai Manickam KR <durai.manickamkr@microchip.com>
Tue, 14 Sep 2021 05:21:13 +0000 (10:51 +0530)
committerNicolas Ferre <nicolas.ferre@microchip.com>
Wed, 15 Sep 2021 09:01:06 +0000 (11:01 +0200)
SDA and SCL is configured as GPIO for I2C bus to recover during
I2C bus malfunction.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20210914052113.85695-1-durai.manickamkr@microchip.com
arch/arm/boot/dts/at91-sama5d27_som1.dtsi
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts

index b48ac3b..a4623cc 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include "sama5d2.dtsi"
 #include "sama5d2-pinfunc.h"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "Atmel SAMA5D27 SoM1";
 
                        i2c0: i2c@f8028000 {
                                dmas = <0>, <0>;
-                               pinctrl-names = "default";
+                               pinctrl-names = "default", "gpio";
                                pinctrl-0 = <&pinctrl_i2c0_default>;
+                               pinctrl-1 = <&pinctrl_i2c0_gpio>;
+                               sda-gpios = <&pioA PIN_PD21 GPIO_ACTIVE_HIGH>;
+                               scl-gpios = <&pioA PIN_PD22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                                status = "okay";
 
                                at24@50 {
                                        bias-disable;
                                };
 
+                               pinctrl_i2c0_gpio: i2c0_gpio {
+                                       pinmux = <PIN_PD21__GPIO>,
+                                                <PIN_PD22__GPIO>;
+                                       bias-disable;
+                               };
+
                                pinctrl_qspi1_default: qspi1_default {
                                        sck_cs {
                                                pinmux = <PIN_PB5__QSPI1_SCK>,
index 614999d..0f10e05 100644 (file)
                                        i2c-analog-filter;
                                        i2c-digital-filter;
                                        i2c-digital-filter-width-ns = <35>;
-                                       pinctrl-names = "default";
+                                       pinctrl-names = "default", "gpio";
                                        pinctrl-0 = <&pinctrl_mikrobus_i2c>;
+                                       pinctrl-1 = <&pinctrl_i2c3_gpio>;
+                                       sda-gpios = <&pioA PIN_PA24 GPIO_ACTIVE_HIGH>;
+                                       scl-gpios = <&pioA PIN_PA23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                                        status = "okay";
                                };
                        };
                                i2c-analog-filter;
                                i2c-digital-filter;
                                i2c-digital-filter-width-ns = <35>;
-                               pinctrl-names = "default";
+                               pinctrl-names = "default", "gpio";
                                pinctrl-0 = <&pinctrl_i2c1_default>;
+                               pinctrl-1 = <&pinctrl_i2c1_gpio>;
+                               sda-gpios = <&pioA PIN_PD4 GPIO_ACTIVE_HIGH>;
+                               scl-gpios = <&pioA PIN_PD5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                                status = "okay";
                        };
 
                                        bias-disable;
                                };
 
+                               pinctrl_i2c1_gpio: i2c1_gpio {
+                                        pinmux = <PIN_PD4__GPIO>,
+                                                 <PIN_PD5__GPIO>;
+                                        bias-disable;
+                                };
+
+
                                pinctrl_isc_base: isc_base {
                                        pinmux = <PIN_PC21__ISC_PCK>,
                                                 <PIN_PC22__ISC_VSYNC>,
                                        bias-disable;
                                };
 
+                               pinctrl_i2c3_gpio: i2c3_gpio {
+                                       pinmux = <PIN_PA24__GPIO>,
+                                                <PIN_PA23__GPIO>;
+                                       bias-disable;
+                               };
+
                                pinctrl_flx4_default: flx4_uart_default {
                                        pinmux = <PIN_PC28__FLEXCOM4_IO0>,
                                                 <PIN_PC29__FLEXCOM4_IO1>,