Skip to content

Commit

Permalink
ayufan: rk3399: support i2c4
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Jun 19, 2019
1 parent 4cbafce commit bb4886a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions arch/arm/include/asm/arch-rockchip/grf_rk3399.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,12 @@ enum {
PMUGRF_GPIO1B2_SEL_SHIFT = 4,
PMUGRF_GPIO1B2_SEL_MASK = 3 << PMUGRF_GPIO1B2_SEL_SHIFT,
PMUGRF_SPI1EC_CSN0 = 2,
PMUGRF_GPIO1B3_SEL_SHIFT = 6,
PMUGRF_GPIO1B3_SEL_MASK = 3 << PMUGRF_GPIO1B3_SEL_SHIFT,
PMUGRF_I2C4PMU_SDA = 1,
PMUGRF_GPIO1B4_SEL_SHIFT = 8,
PMUGRF_GPIO1B4_SEL_MASK = 3 << PMUGRF_GPIO1B4_SEL_SHIFT,
PMUGRF_I2C4PMU_SCL = 1,
PMUGRF_GPIO1B6_SEL_SHIFT = 12,
PMUGRF_GPIO1B6_SEL_MASK = 3 << PMUGRF_GPIO1B6_SEL_SHIFT,
PMUGRF_PWM_3B = 1,
Expand Down
9 changes: 8 additions & 1 deletion drivers/pinctrl/rockchip/pinctrl_rk3399.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,17 @@ static void pinctrl_rk3399_i2c_config(struct rk3399_grf_regs *grf,
PMUGRF_GPIO1C0_SEL_MASK,
PMUGRF_I2C0PMU_SCL << PMUGRF_GPIO1C0_SEL_SHIFT);
break;
case PERIPH_ID_I2C4:
rk_clrsetreg(&pmugrf->gpio1b_iomux,
PMUGRF_GPIO1B3_SEL_MASK,
PMUGRF_I2C4PMU_SDA << PMUGRF_GPIO1B3_SEL_SHIFT);
rk_clrsetreg(&pmugrf->gpio1b_iomux,
PMUGRF_GPIO1B4_SEL_MASK,
PMUGRF_I2C4PMU_SCL << PMUGRF_GPIO1B4_SEL_SHIFT);
break;
case PERIPH_ID_I2C1:
case PERIPH_ID_I2C2:
case PERIPH_ID_I2C3:
case PERIPH_ID_I2C4:
case PERIPH_ID_I2C5:
default:
debug("i2c id = %d iomux error!\n", i2c_id);
Expand Down

0 comments on commit bb4886a

Please sign in to comment.