| From 213f4ddc0bdd5ad207bc2e2137918799756d9687 Mon Sep 17 00:00:00 2001 |
| From: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Date: Wed, 4 Oct 2017 17:52:52 +0200 |
| Subject: [PATCH 0197/1795] pinctrl: sh-pfc: r8a7795: Add I2C pin support |
| |
| Since pinmuxing for I2C is equal on H3 ES1.0 and later versions, copy |
| the I2C settings from ES1.0. Fixes this error in upstream for |
| Salvator-XS: |
| |
| sh-pfc e6060000.pin-controller: function 'i2c2' not supported |
| sh-pfc e6060000.pin-controller: invalid function i2c2 in map table |
| i2c-rcar: probe of e6510000.i2c failed with error -22 |
| |
| Now, the bus works the same as with other Salvator boards. |
| |
| Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| (cherry picked from commit f62d4c9efd809b9eff28fb755d7249716d98a7af) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/pinctrl/sh-pfc/pfc-r8a7795.c | 77 ++++++++++++++++++++++++++++ |
| 1 file changed, 77 insertions(+) |
| |
| diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c |
| index 3712b9187c61..df6a95bce4f8 100644 |
| --- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c |
| +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c |
| @@ -2076,6 +2076,57 @@ static const unsigned int du_disp_mux[] = { |
| DU_DISP_MARK, |
| }; |
| |
| +/* - I2C -------------------------------------------------------------------- */ |
| +static const unsigned int i2c1_a_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10), |
| +}; |
| +static const unsigned int i2c1_a_mux[] = { |
| + SDA1_A_MARK, SCL1_A_MARK, |
| +}; |
| +static const unsigned int i2c1_b_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 23), |
| +}; |
| +static const unsigned int i2c1_b_mux[] = { |
| + SDA1_B_MARK, SCL1_B_MARK, |
| +}; |
| +static const unsigned int i2c2_a_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4), |
| +}; |
| +static const unsigned int i2c2_a_mux[] = { |
| + SDA2_A_MARK, SCL2_A_MARK, |
| +}; |
| +static const unsigned int i2c2_b_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12), |
| +}; |
| +static const unsigned int i2c2_b_mux[] = { |
| + SDA2_B_MARK, SCL2_B_MARK, |
| +}; |
| +static const unsigned int i2c6_a_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11), |
| +}; |
| +static const unsigned int i2c6_a_mux[] = { |
| + SDA6_A_MARK, SCL6_A_MARK, |
| +}; |
| +static const unsigned int i2c6_b_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25), |
| +}; |
| +static const unsigned int i2c6_b_mux[] = { |
| + SDA6_B_MARK, SCL6_B_MARK, |
| +}; |
| +static const unsigned int i2c6_c_pins[] = { |
| + /* SDA, SCL */ |
| + RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), |
| +}; |
| +static const unsigned int i2c6_c_mux[] = { |
| + SDA6_C_MARK, SCL6_C_MARK, |
| +}; |
| + |
| /* - MSIOF0 ----------------------------------------------------------------- */ |
| static const unsigned int msiof0_clk_pins[] = { |
| /* SCK */ |
| @@ -3578,6 +3629,13 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { |
| SH_PFC_PIN_GROUP(du_oddf), |
| SH_PFC_PIN_GROUP(du_cde), |
| SH_PFC_PIN_GROUP(du_disp), |
| + SH_PFC_PIN_GROUP(i2c1_a), |
| + SH_PFC_PIN_GROUP(i2c1_b), |
| + SH_PFC_PIN_GROUP(i2c2_a), |
| + SH_PFC_PIN_GROUP(i2c2_b), |
| + SH_PFC_PIN_GROUP(i2c6_a), |
| + SH_PFC_PIN_GROUP(i2c6_b), |
| + SH_PFC_PIN_GROUP(i2c6_c), |
| SH_PFC_PIN_GROUP(msiof0_clk), |
| SH_PFC_PIN_GROUP(msiof0_sync), |
| SH_PFC_PIN_GROUP(msiof0_ss1), |
| @@ -3863,6 +3921,22 @@ static const char * const du_groups[] = { |
| "du_disp", |
| }; |
| |
| +static const char * const i2c1_groups[] = { |
| + "i2c1_a", |
| + "i2c1_b", |
| +}; |
| + |
| +static const char * const i2c2_groups[] = { |
| + "i2c2_a", |
| + "i2c2_b", |
| +}; |
| + |
| +static const char * const i2c6_groups[] = { |
| + "i2c6_a", |
| + "i2c6_b", |
| + "i2c6_c", |
| +}; |
| + |
| static const char * const msiof0_groups[] = { |
| "msiof0_clk", |
| "msiof0_sync", |
| @@ -4152,6 +4226,9 @@ static const struct sh_pfc_function pinmux_functions[] = { |
| SH_PFC_FUNCTION(drif2), |
| SH_PFC_FUNCTION(drif3), |
| SH_PFC_FUNCTION(du), |
| + SH_PFC_FUNCTION(i2c1), |
| + SH_PFC_FUNCTION(i2c2), |
| + SH_PFC_FUNCTION(i2c6), |
| SH_PFC_FUNCTION(msiof0), |
| SH_PFC_FUNCTION(msiof1), |
| SH_PFC_FUNCTION(msiof2), |
| -- |
| 2.19.0 |
| |