aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-09-26 13:20:56 -0400
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-09-26 20:03:52 -0400
commitf6aaaac9995084e496d4ff800d092a8c0cb12641 (patch)
tree947da881ad4f8f69b40af851a3e7d76abe248e2c /drivers/pinctrl/sh-pfc
parent70702bfc13c4f96f2f05d4ce2eb110cd1735fef5 (diff)
sh-pfc: r8a7790: add pin definitions for the I2C3 interface
There are four I2C interfaces on r8a7790, each of them can be connected to one of the two respective I2C controllers, e.g. interface #0 can be configured to work with I2C0 or with IIC0. Additionally some of those interfaces can also use one of several pin sets. Interface #3 is special, because it can be used in automatic mode for DVFS. It only has one set of pins available and those pins cannot be used for anything else, they also lack the GPIO function. This patch uses the sh-pfc ability to configure pins, not associated with GPIOs and adds support for I2C3 to the r8a7790 PFC set up. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/pinctrl/sh-pfc')
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7790.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
index 5c2657bcc3a4..72786fc93958 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
@@ -781,6 +781,8 @@ enum {
781 ADICS_SAMP_MARK, DU2_CDE_MARK, QPOLB_MARK, SCIFA2_RXD_B_MARK, 781 ADICS_SAMP_MARK, DU2_CDE_MARK, QPOLB_MARK, SCIFA2_RXD_B_MARK,
782 USB1_PWEN_MARK, AUDIO_CLKOUT_D_MARK, USB1_OVC_MARK, 782 USB1_PWEN_MARK, AUDIO_CLKOUT_D_MARK, USB1_OVC_MARK,
783 TCLK1_B_MARK, 783 TCLK1_B_MARK,
784
785 I2C3_SCL_MARK, I2C3_SDA_MARK,
784 PINMUX_MARK_END, 786 PINMUX_MARK_END,
785}; 787};
786 788
@@ -1719,10 +1721,22 @@ static const u16 pinmux_data[] = {
1719 PINMUX_IPSR_DATA(IP16_6, AUDIO_CLKOUT_D), 1721 PINMUX_IPSR_DATA(IP16_6, AUDIO_CLKOUT_D),
1720 PINMUX_IPSR_DATA(IP16_7, USB1_OVC), 1722 PINMUX_IPSR_DATA(IP16_7, USB1_OVC),
1721 PINMUX_IPSR_MODSEL_DATA(IP16_7, TCLK1_B, SEL_TMU1_1), 1723 PINMUX_IPSR_MODSEL_DATA(IP16_7, TCLK1_B, SEL_TMU1_1),
1724
1725 PINMUX_DATA(I2C3_SCL_MARK, FN_SEL_IICDVFS_1),
1726 PINMUX_DATA(I2C3_SDA_MARK, FN_SEL_IICDVFS_1),
1722}; 1727};
1723 1728
1729/* R8A7790 has 6 banks with 32 GPIOs in each = 192 GPIOs */
1730#define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r))
1731#define PIN_NUMBER(r, c) (((r) - 'A') * 31 + (c) + 200)
1732#define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c)
1733
1724static struct sh_pfc_pin pinmux_pins[] = { 1734static struct sh_pfc_pin pinmux_pins[] = {
1725 PINMUX_GPIO_GP_ALL(), 1735 PINMUX_GPIO_GP_ALL(),
1736
1737 /* Pins not associated with a GPIO port */
1738 SH_PFC_PIN_NAMED(ROW_GROUP_A('J'), 15, AJ15),
1739 SH_PFC_PIN_NAMED(ROW_GROUP_A('H'), 15, AH15),
1726}; 1740};
1727 1741
1728/* - DU RGB ----------------------------------------------------------------- */ 1742/* - DU RGB ----------------------------------------------------------------- */
@@ -2048,6 +2062,14 @@ static const unsigned int i2c2_e_pins[] = {
2048static const unsigned int i2c2_e_mux[] = { 2062static const unsigned int i2c2_e_mux[] = {
2049 I2C2_SCL_E_MARK, I2C2_SDA_E_MARK, 2063 I2C2_SCL_E_MARK, I2C2_SDA_E_MARK,
2050}; 2064};
2065/* - I2C3 ------------------------------------------------------------------- */
2066static const unsigned int i2c3_pins[] = {
2067 /* SCL, SDA */
2068 PIN_A_NUMBER('J', 15), PIN_A_NUMBER('H', 15),
2069};
2070static const unsigned int i2c3_mux[] = {
2071 I2C3_SCL_MARK, I2C3_SDA_MARK,
2072};
2051/* - INTC ------------------------------------------------------------------- */ 2073/* - INTC ------------------------------------------------------------------- */
2052static const unsigned int intc_irq0_pins[] = { 2074static const unsigned int intc_irq0_pins[] = {
2053 /* IRQ */ 2075 /* IRQ */
@@ -3113,6 +3135,7 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
3113 SH_PFC_PIN_GROUP(i2c2_c), 3135 SH_PFC_PIN_GROUP(i2c2_c),
3114 SH_PFC_PIN_GROUP(i2c2_d), 3136 SH_PFC_PIN_GROUP(i2c2_d),
3115 SH_PFC_PIN_GROUP(i2c2_e), 3137 SH_PFC_PIN_GROUP(i2c2_e),
3138 SH_PFC_PIN_GROUP(i2c3),
3116 SH_PFC_PIN_GROUP(intc_irq0), 3139 SH_PFC_PIN_GROUP(intc_irq0),
3117 SH_PFC_PIN_GROUP(intc_irq1), 3140 SH_PFC_PIN_GROUP(intc_irq1),
3118 SH_PFC_PIN_GROUP(intc_irq2), 3141 SH_PFC_PIN_GROUP(intc_irq2),
@@ -3323,6 +3346,10 @@ static const char * const i2c2_groups[] = {
3323 "i2c2_e", 3346 "i2c2_e",
3324}; 3347};
3325 3348
3349static const char * const i2c3_groups[] = {
3350 "i2c3",
3351};
3352
3326static const char * const intc_groups[] = { 3353static const char * const intc_groups[] = {
3327 "intc_irq0", 3354 "intc_irq0",
3328 "intc_irq1", 3355 "intc_irq1",
@@ -3551,6 +3578,7 @@ static const struct sh_pfc_function pinmux_functions[] = {
3551 SH_PFC_FUNCTION(hscif1), 3578 SH_PFC_FUNCTION(hscif1),
3552 SH_PFC_FUNCTION(i2c1), 3579 SH_PFC_FUNCTION(i2c1),
3553 SH_PFC_FUNCTION(i2c2), 3580 SH_PFC_FUNCTION(i2c2),
3581 SH_PFC_FUNCTION(i2c3),
3554 SH_PFC_FUNCTION(intc), 3582 SH_PFC_FUNCTION(intc),
3555 SH_PFC_FUNCTION(mmc0), 3583 SH_PFC_FUNCTION(mmc0),
3556 SH_PFC_FUNCTION(mmc1), 3584 SH_PFC_FUNCTION(mmc1),