mirror of https://gitee.com/openkylin/linux.git
pinctrl: sh-pfc: r8a7790: Use new macros for non-GPIO pins
Update the R-Car H2 pin control driver to use the new macros for describing pins without GPIO functionality. This replaces the use of physical pin numbers on the R-Car H2 SoC (in 31x31 FCBGA package) by symbolic enum values, referring to signal names. Note that the user-visible names of these pins are still based on pin numbers instead of signal names, to preserve DT backwards compatibility. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
This commit is contained in:
parent
8eba07d3d9
commit
2404187c84
|
@ -28,6 +28,12 @@
|
||||||
PORT_GP_32(4, fn, sfx), \
|
PORT_GP_32(4, fn, sfx), \
|
||||||
PORT_GP_32(5, fn, sfx)
|
PORT_GP_32(5, fn, sfx)
|
||||||
|
|
||||||
|
#define CPU_ALL_NOGP(fn) \
|
||||||
|
PIN_NOGP(IIC0_SDA, "AF15", fn), \
|
||||||
|
PIN_NOGP(IIC0_SCL, "AG15", fn), \
|
||||||
|
PIN_NOGP(IIC3_SDA, "AH15", fn), \
|
||||||
|
PIN_NOGP(IIC3_SCL, "AJ15", fn)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PINMUX_RESERVED = 0,
|
PINMUX_RESERVED = 0,
|
||||||
|
|
||||||
|
@ -1727,19 +1733,17 @@ static const u16 pinmux_data[] = {
|
||||||
PINMUX_DATA(I2C3_SDA_MARK, FN_SEL_IICDVFS_1),
|
PINMUX_DATA(I2C3_SDA_MARK, FN_SEL_IICDVFS_1),
|
||||||
};
|
};
|
||||||
|
|
||||||
/* R8A7790 has 6 banks with 32 GPIOs in each = 192 GPIOs */
|
/*
|
||||||
#define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r))
|
* Pins not associated with a GPIO port.
|
||||||
#define PIN_NUMBER(r, c) (((r) - 'A') * 31 + (c) + 200)
|
*/
|
||||||
#define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c)
|
enum {
|
||||||
|
GP_ASSIGN_LAST(),
|
||||||
|
NOGP_ALL(),
|
||||||
|
};
|
||||||
|
|
||||||
static const struct sh_pfc_pin pinmux_pins[] = {
|
static const struct sh_pfc_pin pinmux_pins[] = {
|
||||||
PINMUX_GPIO_GP_ALL(),
|
PINMUX_GPIO_GP_ALL(),
|
||||||
|
PINMUX_NOGP_ALL(),
|
||||||
/* Pins not associated with a GPIO port */
|
|
||||||
SH_PFC_PIN_NAMED(ROW_GROUP_A('F'), 15, AF15),
|
|
||||||
SH_PFC_PIN_NAMED(ROW_GROUP_A('G'), 15, AG15),
|
|
||||||
SH_PFC_PIN_NAMED(ROW_GROUP_A('H'), 15, AH15),
|
|
||||||
SH_PFC_PIN_NAMED(ROW_GROUP_A('J'), 15, AJ15),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* - AUDIO CLOCK ------------------------------------------------------------ */
|
/* - AUDIO CLOCK ------------------------------------------------------------ */
|
||||||
|
@ -2135,7 +2139,7 @@ static const unsigned int hscif1_ctrl_b_mux[] = {
|
||||||
/* - I2C0 ------------------------------------------------------------------- */
|
/* - I2C0 ------------------------------------------------------------------- */
|
||||||
static const unsigned int i2c0_pins[] = {
|
static const unsigned int i2c0_pins[] = {
|
||||||
/* SCL, SDA */
|
/* SCL, SDA */
|
||||||
PIN_A_NUMBER('G', 15), PIN_A_NUMBER('F', 15),
|
PIN_IIC0_SCL, PIN_IIC0_SDA,
|
||||||
};
|
};
|
||||||
static const unsigned int i2c0_mux[] = {
|
static const unsigned int i2c0_mux[] = {
|
||||||
I2C0_SCL_MARK, I2C0_SDA_MARK,
|
I2C0_SCL_MARK, I2C0_SDA_MARK,
|
||||||
|
@ -2201,7 +2205,7 @@ static const unsigned int i2c2_e_mux[] = {
|
||||||
/* - I2C3 ------------------------------------------------------------------- */
|
/* - I2C3 ------------------------------------------------------------------- */
|
||||||
static const unsigned int i2c3_pins[] = {
|
static const unsigned int i2c3_pins[] = {
|
||||||
/* SCL, SDA */
|
/* SCL, SDA */
|
||||||
PIN_A_NUMBER('J', 15), PIN_A_NUMBER('H', 15),
|
PIN_IIC3_SCL, PIN_IIC3_SDA,
|
||||||
};
|
};
|
||||||
static const unsigned int i2c3_mux[] = {
|
static const unsigned int i2c3_mux[] = {
|
||||||
I2C3_SCL_MARK, I2C3_SDA_MARK,
|
I2C3_SCL_MARK, I2C3_SDA_MARK,
|
||||||
|
@ -2209,7 +2213,7 @@ static const unsigned int i2c3_mux[] = {
|
||||||
/* - IIC0 (I2C4) ------------------------------------------------------------ */
|
/* - IIC0 (I2C4) ------------------------------------------------------------ */
|
||||||
static const unsigned int iic0_pins[] = {
|
static const unsigned int iic0_pins[] = {
|
||||||
/* SCL, SDA */
|
/* SCL, SDA */
|
||||||
PIN_A_NUMBER('G', 15), PIN_A_NUMBER('F', 15),
|
PIN_IIC0_SCL, PIN_IIC0_SDA,
|
||||||
};
|
};
|
||||||
static const unsigned int iic0_mux[] = {
|
static const unsigned int iic0_mux[] = {
|
||||||
IIC0_SCL_MARK, IIC0_SDA_MARK,
|
IIC0_SCL_MARK, IIC0_SDA_MARK,
|
||||||
|
@ -2274,8 +2278,8 @@ static const unsigned int iic2_e_mux[] = {
|
||||||
};
|
};
|
||||||
/* - IIC3 (I2C7) ------------------------------------------------------------ */
|
/* - IIC3 (I2C7) ------------------------------------------------------------ */
|
||||||
static const unsigned int iic3_pins[] = {
|
static const unsigned int iic3_pins[] = {
|
||||||
/* SCL, SDA */
|
/* SCL, SDA */
|
||||||
PIN_A_NUMBER('J', 15), PIN_A_NUMBER('H', 15),
|
PIN_IIC3_SCL, PIN_IIC3_SDA,
|
||||||
};
|
};
|
||||||
static const unsigned int iic3_mux[] = {
|
static const unsigned int iic3_mux[] = {
|
||||||
IIC3_SCL_MARK, IIC3_SDA_MARK,
|
IIC3_SCL_MARK, IIC3_SDA_MARK,
|
||||||
|
|
Loading…
Reference in New Issue