Commit 728d3f5a authored by david.wu's avatar david.wu Committed by Linus Walleij

pinctrl: rockchip: Add input schmitt support for rk3328

Signed-off-by: default avatarDavid Wu <david.wu@rock-chips.com>
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e3b357d7
...@@ -1358,6 +1358,28 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, ...@@ -1358,6 +1358,28 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
return ret; return ret;
} }
#define RK3328_SCHMITT_BITS_PER_PIN 1
#define RK3328_SCHMITT_PINS_PER_REG 16
#define RK3328_SCHMITT_BANK_STRIDE 8
#define RK3328_SCHMITT_GRF_OFFSET 0x380
static int rk3328_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
int pin_num,
struct regmap **regmap,
int *reg, u8 *bit)
{
struct rockchip_pinctrl *info = bank->drvdata;
*regmap = info->regmap_base;
*reg = RK3328_SCHMITT_GRF_OFFSET;
*reg += bank->bank_num * RK3328_SCHMITT_BANK_STRIDE;
*reg += ((pin_num / RK3328_SCHMITT_PINS_PER_REG) * 4);
*bit = pin_num % RK3328_SCHMITT_PINS_PER_REG;
return 0;
}
static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int pin_num) static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int pin_num)
{ {
struct rockchip_pinctrl *info = bank->drvdata; struct rockchip_pinctrl *info = bank->drvdata;
...@@ -2861,6 +2883,7 @@ static struct rockchip_pin_ctrl rk3328_pin_ctrl = { ...@@ -2861,6 +2883,7 @@ static struct rockchip_pin_ctrl rk3328_pin_ctrl = {
.pull_calc_reg = rk3228_calc_pull_reg_and_bit, .pull_calc_reg = rk3228_calc_pull_reg_and_bit,
.drv_calc_reg = rk3228_calc_drv_reg_and_bit, .drv_calc_reg = rk3228_calc_drv_reg_and_bit,
.iomux_recalc = rk3328_recalc_mux, .iomux_recalc = rk3328_recalc_mux,
.schmitt_calc_reg = rk3328_calc_schmitt_reg_and_bit,
}; };
static struct rockchip_pin_bank rk3368_pin_banks[] = { static struct rockchip_pin_bank rk3368_pin_banks[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment