]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pinctrl: k210: Fix inverted IE and OE for I2C
authorSean Anderson <seanga2@gmail.com>
Fri, 13 Nov 2020 13:43:39 +0000 (08:43 -0500)
committerAndes <uboot@andestech.com>
Tue, 17 Nov 2020 07:09:28 +0000 (15:09 +0800)
I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and
IE_INV set, but I2C cannot have those bits set. This adds a separate
default for SCCB.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
drivers/pinctrl/pinctrl-kendryte.c

index 5ad049d9555f8d74f303fd936aea319569dadbd3..dac3800cab7b9f4b4f43df8719ea75007e6dabf7 100644 (file)
@@ -55,8 +55,9 @@
 
 #define K210_PC_MODE_IN   (K210_PC_IE | K210_PC_ST)
 #define K210_PC_MODE_OUT  (K210_PC_DRIVE_7 | K210_PC_OE)
-#define K210_PC_MODE_I2C  (K210_PC_MODE_IN | K210_PC_IE_INV | K210_PC_SL | \
-                          K210_PC_OE | K210_PC_OE_INV | K210_PC_PU)
+#define K210_PC_MODE_I2C  (K210_PC_MODE_IN | K210_PC_SL | K210_PC_OE | \
+                          K210_PC_PU)
+#define K210_PC_MODE_SCCB (K210_PC_MODE_I2C | K210_PC_OE_INV | K210_PC_IE_INV)
 #define K210_PC_MODE_SPI  (K210_PC_MODE_IN | K210_PC_IE_INV | \
                           K210_PC_MODE_OUT | K210_PC_OE_INV)
 #define K210_PC_MODE_GPIO (K210_PC_MODE_IN | K210_PC_MODE_OUT)
@@ -176,6 +177,7 @@ enum k210_pc_mode_id {
        K210_PC_DEFAULT_IN_TIE,
        K210_PC_DEFAULT_OUT,
        K210_PC_DEFAULT_I2C,
+       K210_PC_DEFAULT_SCCB,
        K210_PC_DEFAULT_SPI,
        K210_PC_DEFAULT_GPIO,
        K210_PC_DEFAULT_INT13,
@@ -189,6 +191,7 @@ static const u32 k210_pc_mode_id_to_mode[] = {
        [K210_PC_DEFAULT_IN_TIE] = K210_PC_MODE_IN,
        DEFAULT(OUT),
        DEFAULT(I2C),
+       DEFAULT(SCCB),
        DEFAULT(SPI),
        DEFAULT(GPIO),
        [K210_PC_DEFAULT_INT13] = K210_PC_MODE_IN | K210_PC_PU,
@@ -362,8 +365,8 @@ static const struct k210_pcf_info k210_pcf_infos[] = {
        FUNC(DVP_D5,         IN),
        FUNC(DVP_D6,         IN),
        FUNC(DVP_D7,         IN),
-       FUNC(SCCB_SCLK,      I2C),
-       FUNC(SCCB_SDA,       I2C),
+       FUNC(SCCB_SCLK,      SCCB),
+       FUNC(SCCB_SDA,       SCCB),
        FUNC(UART1_CTS,      IN),
        FUNC(UART1_DSR,      IN),
        FUNC(UART1_DCD,      IN),