pinctrl: meson: get rid of pin_base
pin_base was used with the manually set pin offset in meson pinctrl. This is no longer the case, pin_base is 0 on every meson pinctrl controllers and should go away. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Родитель
634e40b0c2
Коммит
70e5ecb1b9
|
@ -820,7 +820,6 @@ static struct meson_bank meson_gxbb_aobus_banks[] = {
|
|||
|
||||
struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
|
||||
.name = "periphs-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson_gxbb_periphs_pins,
|
||||
.groups = meson_gxbb_periphs_groups,
|
||||
.funcs = meson_gxbb_periphs_functions,
|
||||
|
@ -833,7 +832,6 @@ struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
|
|||
|
||||
struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
|
||||
.name = "aobus-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson_gxbb_aobus_pins,
|
||||
.groups = meson_gxbb_aobus_groups,
|
||||
.funcs = meson_gxbb_aobus_functions,
|
||||
|
|
|
@ -807,7 +807,6 @@ static struct meson_bank meson_gxl_aobus_banks[] = {
|
|||
|
||||
struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
|
||||
.name = "periphs-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson_gxl_periphs_pins,
|
||||
.groups = meson_gxl_periphs_groups,
|
||||
.funcs = meson_gxl_periphs_functions,
|
||||
|
@ -820,7 +819,6 @@ struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
|
|||
|
||||
struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = {
|
||||
.name = "aobus-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson_gxl_aobus_pins,
|
||||
.groups = meson_gxl_aobus_groups,
|
||||
.funcs = meson_gxl_aobus_functions,
|
||||
|
|
|
@ -413,16 +413,15 @@ static const struct pinconf_ops meson_pinconf_ops = {
|
|||
static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
|
||||
{
|
||||
struct meson_pinctrl *pc = gpiochip_get_data(chip);
|
||||
unsigned int reg, bit, pin;
|
||||
unsigned int reg, bit;
|
||||
struct meson_bank *bank;
|
||||
int ret;
|
||||
|
||||
pin = pc->data->pin_base + gpio;
|
||||
ret = meson_get_bank(pc, pin, &bank);
|
||||
ret = meson_get_bank(pc, gpio, &bank);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
meson_calc_reg_and_bit(bank, pin, REG_DIR, ®, &bit);
|
||||
meson_calc_reg_and_bit(bank, gpio, REG_DIR, ®, &bit);
|
||||
|
||||
return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), BIT(bit));
|
||||
}
|
||||
|
@ -431,21 +430,20 @@ static int meson_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
|
|||
int value)
|
||||
{
|
||||
struct meson_pinctrl *pc = gpiochip_get_data(chip);
|
||||
unsigned int reg, bit, pin;
|
||||
unsigned int reg, bit;
|
||||
struct meson_bank *bank;
|
||||
int ret;
|
||||
|
||||
pin = pc->data->pin_base + gpio;
|
||||
ret = meson_get_bank(pc, pin, &bank);
|
||||
ret = meson_get_bank(pc, gpio, &bank);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
meson_calc_reg_and_bit(bank, pin, REG_DIR, ®, &bit);
|
||||
meson_calc_reg_and_bit(bank, gpio, REG_DIR, ®, &bit);
|
||||
ret = regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
meson_calc_reg_and_bit(bank, pin, REG_OUT, ®, &bit);
|
||||
meson_calc_reg_and_bit(bank, gpio, REG_OUT, ®, &bit);
|
||||
return regmap_update_bits(pc->reg_gpio, reg, BIT(bit),
|
||||
value ? BIT(bit) : 0);
|
||||
}
|
||||
|
@ -453,16 +451,15 @@ static int meson_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
|
|||
static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value)
|
||||
{
|
||||
struct meson_pinctrl *pc = gpiochip_get_data(chip);
|
||||
unsigned int reg, bit, pin;
|
||||
unsigned int reg, bit;
|
||||
struct meson_bank *bank;
|
||||
int ret;
|
||||
|
||||
pin = pc->data->pin_base + gpio;
|
||||
ret = meson_get_bank(pc, pin, &bank);
|
||||
ret = meson_get_bank(pc, gpio, &bank);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
meson_calc_reg_and_bit(bank, pin, REG_OUT, ®, &bit);
|
||||
meson_calc_reg_and_bit(bank, gpio, REG_OUT, ®, &bit);
|
||||
regmap_update_bits(pc->reg_gpio, reg, BIT(bit),
|
||||
value ? BIT(bit) : 0);
|
||||
}
|
||||
|
@ -470,16 +467,15 @@ static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value)
|
|||
static int meson_gpio_get(struct gpio_chip *chip, unsigned gpio)
|
||||
{
|
||||
struct meson_pinctrl *pc = gpiochip_get_data(chip);
|
||||
unsigned int reg, bit, val, pin;
|
||||
unsigned int reg, bit, val;
|
||||
struct meson_bank *bank;
|
||||
int ret;
|
||||
|
||||
pin = pc->data->pin_base + gpio;
|
||||
ret = meson_get_bank(pc, pin, &bank);
|
||||
ret = meson_get_bank(pc, gpio, &bank);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
meson_calc_reg_and_bit(bank, pin, REG_IN, ®, &bit);
|
||||
meson_calc_reg_and_bit(bank, gpio, REG_IN, ®, &bit);
|
||||
regmap_read(pc->reg_gpio, reg, &val);
|
||||
|
||||
return !!(val & BIT(bit));
|
||||
|
|
|
@ -1046,7 +1046,6 @@ static struct meson_bank meson8_aobus_banks[] = {
|
|||
|
||||
struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
|
||||
.name = "cbus-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson8_cbus_pins,
|
||||
.groups = meson8_cbus_groups,
|
||||
.funcs = meson8_cbus_functions,
|
||||
|
@ -1059,7 +1058,6 @@ struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
|
|||
|
||||
struct meson_pinctrl_data meson8_aobus_pinctrl_data = {
|
||||
.name = "ao-bank",
|
||||
.pin_base = 0,
|
||||
.pins = meson8_aobus_pins,
|
||||
.groups = meson8_aobus_groups,
|
||||
.funcs = meson8_aobus_functions,
|
||||
|
|
|
@ -906,7 +906,6 @@ static struct meson_bank meson8b_aobus_banks[] = {
|
|||
|
||||
struct meson_pinctrl_data meson8b_cbus_pinctrl_data = {
|
||||
.name = "cbus-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson8b_cbus_pins,
|
||||
.groups = meson8b_cbus_groups,
|
||||
.funcs = meson8b_cbus_functions,
|
||||
|
@ -919,7 +918,6 @@ struct meson_pinctrl_data meson8b_cbus_pinctrl_data = {
|
|||
|
||||
struct meson_pinctrl_data meson8b_aobus_pinctrl_data = {
|
||||
.name = "aobus-banks",
|
||||
.pin_base = 0,
|
||||
.pins = meson8b_aobus_pins,
|
||||
.groups = meson8b_aobus_groups,
|
||||
.funcs = meson8b_aobus_functions,
|
||||
|
|
Загрузка…
Ссылка в новой задаче