Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jerome Brunet and committed by
Linus Walleij
70e5ecb1 634e40b0

+13 -25
-2
drivers/pinctrl/meson/pinctrl-meson-gxbb.c
··· 820 820 821 821 struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { 822 822 .name = "periphs-banks", 823 - .pin_base = 0, 824 823 .pins = meson_gxbb_periphs_pins, 825 824 .groups = meson_gxbb_periphs_groups, 826 825 .funcs = meson_gxbb_periphs_functions, ··· 832 833 833 834 struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { 834 835 .name = "aobus-banks", 835 - .pin_base = 0, 836 836 .pins = meson_gxbb_aobus_pins, 837 837 .groups = meson_gxbb_aobus_groups, 838 838 .funcs = meson_gxbb_aobus_functions,
-2
drivers/pinctrl/meson/pinctrl-meson-gxl.c
··· 807 807 808 808 struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { 809 809 .name = "periphs-banks", 810 - .pin_base = 0, 811 810 .pins = meson_gxl_periphs_pins, 812 811 .groups = meson_gxl_periphs_groups, 813 812 .funcs = meson_gxl_periphs_functions, ··· 819 820 820 821 struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { 821 822 .name = "aobus-banks", 822 - .pin_base = 0, 823 823 .pins = meson_gxl_aobus_pins, 824 824 .groups = meson_gxl_aobus_groups, 825 825 .funcs = meson_gxl_aobus_functions,
+13 -17
drivers/pinctrl/meson/pinctrl-meson.c
··· 413 413 static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 414 414 { 415 415 struct meson_pinctrl *pc = gpiochip_get_data(chip); 416 - unsigned int reg, bit, pin; 416 + unsigned int reg, bit; 417 417 struct meson_bank *bank; 418 418 int ret; 419 419 420 - pin = pc->data->pin_base + gpio; 421 - ret = meson_get_bank(pc, pin, &bank); 420 + ret = meson_get_bank(pc, gpio, &bank); 422 421 if (ret) 423 422 return ret; 424 423 425 - meson_calc_reg_and_bit(bank, pin, REG_DIR, &reg, &bit); 424 + meson_calc_reg_and_bit(bank, gpio, REG_DIR, &reg, &bit); 426 425 427 426 return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), BIT(bit)); 428 427 } ··· 430 431 int value) 431 432 { 432 433 struct meson_pinctrl *pc = gpiochip_get_data(chip); 433 - unsigned int reg, bit, pin; 434 + unsigned int reg, bit; 434 435 struct meson_bank *bank; 435 436 int ret; 436 437 437 - pin = pc->data->pin_base + gpio; 438 - ret = meson_get_bank(pc, pin, &bank); 438 + ret = meson_get_bank(pc, gpio, &bank); 439 439 if (ret) 440 440 return ret; 441 441 442 - meson_calc_reg_and_bit(bank, pin, REG_DIR, &reg, &bit); 442 + meson_calc_reg_and_bit(bank, gpio, REG_DIR, &reg, &bit); 443 443 ret = regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 0); 444 444 if (ret) 445 445 return ret; 446 446 447 - meson_calc_reg_and_bit(bank, pin, REG_OUT, &reg, &bit); 447 + meson_calc_reg_and_bit(bank, gpio, REG_OUT, &reg, &bit); 448 448 return regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 449 449 value ? BIT(bit) : 0); 450 450 } ··· 451 453 static void meson_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) 452 454 { 453 455 struct meson_pinctrl *pc = gpiochip_get_data(chip); 454 - unsigned int reg, bit, pin; 456 + unsigned int reg, bit; 455 457 struct meson_bank *bank; 456 458 int ret; 457 459 458 - pin = pc->data->pin_base + gpio; 459 - ret = meson_get_bank(pc, pin, &bank); 460 + ret = meson_get_bank(pc, gpio, &bank); 460 461 if (ret) 461 462 return; 462 463 463 - meson_calc_reg_and_bit(bank, pin, REG_OUT, &reg, &bit); 464 + meson_calc_reg_and_bit(bank, gpio, REG_OUT, &reg, &bit); 464 465 regmap_update_bits(pc->reg_gpio, reg, BIT(bit), 465 466 value ? BIT(bit) : 0); 466 467 } ··· 467 470 static int meson_gpio_get(struct gpio_chip *chip, unsigned gpio) 468 471 { 469 472 struct meson_pinctrl *pc = gpiochip_get_data(chip); 470 - unsigned int reg, bit, val, pin; 473 + unsigned int reg, bit, val; 471 474 struct meson_bank *bank; 472 475 int ret; 473 476 474 - pin = pc->data->pin_base + gpio; 475 - ret = meson_get_bank(pc, pin, &bank); 477 + ret = meson_get_bank(pc, gpio, &bank); 476 478 if (ret) 477 479 return ret; 478 480 479 - meson_calc_reg_and_bit(bank, pin, REG_IN, &reg, &bit); 481 + meson_calc_reg_and_bit(bank, gpio, REG_IN, &reg, &bit); 480 482 regmap_read(pc->reg_gpio, reg, &val); 481 483 482 484 return !!(val & BIT(bit));
-2
drivers/pinctrl/meson/pinctrl-meson8.c
··· 1046 1046 1047 1047 struct meson_pinctrl_data meson8_cbus_pinctrl_data = { 1048 1048 .name = "cbus-banks", 1049 - .pin_base = 0, 1050 1049 .pins = meson8_cbus_pins, 1051 1050 .groups = meson8_cbus_groups, 1052 1051 .funcs = meson8_cbus_functions, ··· 1058 1059 1059 1060 struct meson_pinctrl_data meson8_aobus_pinctrl_data = { 1060 1061 .name = "ao-bank", 1061 - .pin_base = 0, 1062 1062 .pins = meson8_aobus_pins, 1063 1063 .groups = meson8_aobus_groups, 1064 1064 .funcs = meson8_aobus_functions,
-2
drivers/pinctrl/meson/pinctrl-meson8b.c
··· 906 906 907 907 struct meson_pinctrl_data meson8b_cbus_pinctrl_data = { 908 908 .name = "cbus-banks", 909 - .pin_base = 0, 910 909 .pins = meson8b_cbus_pins, 911 910 .groups = meson8b_cbus_groups, 912 911 .funcs = meson8b_cbus_functions, ··· 918 919 919 920 struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { 920 921 .name = "aobus-banks", 921 - .pin_base = 0, 922 922 .pins = meson8b_aobus_pins, 923 923 .groups = meson8b_aobus_groups, 924 924 .funcs = meson8b_aobus_functions,