aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Yan <andy.yan@rock-chips.com>2017-03-17 13:18:36 -0400
committerLinus Walleij <linus.walleij@linaro.org>2017-03-23 05:17:38 -0400
commitb9c6dcab265e93c47bdcd99ab7c6acda90ed669b (patch)
treee5cc5cae1e78807ef0a3018a7c935ae8476487f6
parentab714cfb4e773f083a15a20b6d7ec22eef542409 (diff)
pinctrl: rockchip: rename RK1108 to RV1108
Rockchip finally named the SOC as RV1108, so change it. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> [adapted rk1108 dtsi to keep bisectability] Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/boot/dts/rk1108.dtsi2
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c76
2 files changed, 39 insertions, 39 deletions
diff --git a/arch/arm/boot/dts/rk1108.dtsi b/arch/arm/boot/dts/rk1108.dtsi
index d6194bff7afe..6c8fc19d0ecd 100644
--- a/arch/arm/boot/dts/rk1108.dtsi
+++ b/arch/arm/boot/dts/rk1108.dtsi
@@ -222,7 +222,7 @@
222 }; 222 };
223 223
224 pinctrl: pinctrl { 224 pinctrl: pinctrl {
225 compatible = "rockchip,rk1108-pinctrl"; 225 compatible = "rockchip,rv1108-pinctrl";
226 rockchip,grf = <&grf>; 226 rockchip,grf = <&grf>;
227 rockchip,pmu = <&pmugrf>; 227 rockchip,pmu = <&pmugrf>;
228 #address-cells = <1>; 228 #address-cells = <1>;
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index d98a1afec9a7..bd4b63f66220 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -59,7 +59,7 @@
59#define GPIO_LS_SYNC 0x60 59#define GPIO_LS_SYNC 0x60
60 60
61enum rockchip_pinctrl_type { 61enum rockchip_pinctrl_type {
62 RK1108, 62 RV1108,
63 RK2928, 63 RK2928,
64 RK3066B, 64 RK3066B,
65 RK3188, 65 RK3188,
@@ -713,13 +713,13 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)
713 return ret; 713 return ret;
714} 714}
715 715
716#define RK1108_PULL_PMU_OFFSET 0x10 716#define RV1108_PULL_PMU_OFFSET 0x10
717#define RK1108_PULL_OFFSET 0x110 717#define RV1108_PULL_OFFSET 0x110
718#define RK1108_PULL_PINS_PER_REG 8 718#define RV1108_PULL_PINS_PER_REG 8
719#define RK1108_PULL_BITS_PER_PIN 2 719#define RV1108_PULL_BITS_PER_PIN 2
720#define RK1108_PULL_BANK_STRIDE 16 720#define RV1108_PULL_BANK_STRIDE 16
721 721
722static void rk1108_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, 722static void rv1108_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank,
723 int pin_num, struct regmap **regmap, 723 int pin_num, struct regmap **regmap,
724 int *reg, u8 *bit) 724 int *reg, u8 *bit)
725{ 725{
@@ -728,27 +728,27 @@ static void rk1108_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank,
728 /* The first 24 pins of the first bank are located in PMU */ 728 /* The first 24 pins of the first bank are located in PMU */
729 if (bank->bank_num == 0) { 729 if (bank->bank_num == 0) {
730 *regmap = info->regmap_pmu; 730 *regmap = info->regmap_pmu;
731 *reg = RK1108_PULL_PMU_OFFSET; 731 *reg = RV1108_PULL_PMU_OFFSET;
732 } else { 732 } else {
733 *reg = RK1108_PULL_OFFSET; 733 *reg = RV1108_PULL_OFFSET;
734 *regmap = info->regmap_base; 734 *regmap = info->regmap_base;
735 /* correct the offset, as we're starting with the 2nd bank */ 735 /* correct the offset, as we're starting with the 2nd bank */
736 *reg -= 0x10; 736 *reg -= 0x10;
737 *reg += bank->bank_num * RK1108_PULL_BANK_STRIDE; 737 *reg += bank->bank_num * RV1108_PULL_BANK_STRIDE;
738 } 738 }
739 739
740 *reg += ((pin_num / RK1108_PULL_PINS_PER_REG) * 4); 740 *reg += ((pin_num / RV1108_PULL_PINS_PER_REG) * 4);
741 *bit = (pin_num % RK1108_PULL_PINS_PER_REG); 741 *bit = (pin_num % RV1108_PULL_PINS_PER_REG);
742 *bit *= RK1108_PULL_BITS_PER_PIN; 742 *bit *= RV1108_PULL_BITS_PER_PIN;
743} 743}
744 744
745#define RK1108_DRV_PMU_OFFSET 0x20 745#define RV1108_DRV_PMU_OFFSET 0x20
746#define RK1108_DRV_GRF_OFFSET 0x210 746#define RV1108_DRV_GRF_OFFSET 0x210
747#define RK1108_DRV_BITS_PER_PIN 2 747#define RV1108_DRV_BITS_PER_PIN 2
748#define RK1108_DRV_PINS_PER_REG 8 748#define RV1108_DRV_PINS_PER_REG 8
749#define RK1108_DRV_BANK_STRIDE 16 749#define RV1108_DRV_BANK_STRIDE 16
750 750
751static void rk1108_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, 751static void rv1108_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank,
752 int pin_num, struct regmap **regmap, 752 int pin_num, struct regmap **regmap,
753 int *reg, u8 *bit) 753 int *reg, u8 *bit)
754{ 754{
@@ -757,19 +757,19 @@ static void rk1108_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank,
757 /* The first 24 pins of the first bank are located in PMU */ 757 /* The first 24 pins of the first bank are located in PMU */
758 if (bank->bank_num == 0) { 758 if (bank->bank_num == 0) {
759 *regmap = info->regmap_pmu; 759 *regmap = info->regmap_pmu;
760 *reg = RK1108_DRV_PMU_OFFSET; 760 *reg = RV1108_DRV_PMU_OFFSET;
761 } else { 761 } else {
762 *regmap = info->regmap_base; 762 *regmap = info->regmap_base;
763 *reg = RK1108_DRV_GRF_OFFSET; 763 *reg = RV1108_DRV_GRF_OFFSET;
764 764
765 /* correct the offset, as we're starting with the 2nd bank */ 765 /* correct the offset, as we're starting with the 2nd bank */
766 *reg -= 0x10; 766 *reg -= 0x10;
767 *reg += bank->bank_num * RK1108_DRV_BANK_STRIDE; 767 *reg += bank->bank_num * RV1108_DRV_BANK_STRIDE;
768 } 768 }
769 769
770 *reg += ((pin_num / RK1108_DRV_PINS_PER_REG) * 4); 770 *reg += ((pin_num / RV1108_DRV_PINS_PER_REG) * 4);
771 *bit = pin_num % RK1108_DRV_PINS_PER_REG; 771 *bit = pin_num % RV1108_DRV_PINS_PER_REG;
772 *bit *= RK1108_DRV_BITS_PER_PIN; 772 *bit *= RV1108_DRV_BITS_PER_PIN;
773} 773}
774 774
775#define RK2928_PULL_OFFSET 0x118 775#define RK2928_PULL_OFFSET 0x118
@@ -1271,7 +1271,7 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
1271 return !(data & BIT(bit)) 1271 return !(data & BIT(bit))
1272 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT 1272 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT
1273 : PIN_CONFIG_BIAS_DISABLE; 1273 : PIN_CONFIG_BIAS_DISABLE;
1274 case RK1108: 1274 case RV1108:
1275 case RK3188: 1275 case RK3188:
1276 case RK3288: 1276 case RK3288:
1277 case RK3368: 1277 case RK3368:
@@ -1318,7 +1318,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
1318 1318
1319 spin_unlock_irqrestore(&bank->slock, flags); 1319 spin_unlock_irqrestore(&bank->slock, flags);
1320 break; 1320 break;
1321 case RK1108: 1321 case RV1108:
1322 case RK3188: 1322 case RK3188:
1323 case RK3288: 1323 case RK3288:
1324 case RK3368: 1324 case RK3368:
@@ -1581,7 +1581,7 @@ static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl,
1581 pull == PIN_CONFIG_BIAS_DISABLE); 1581 pull == PIN_CONFIG_BIAS_DISABLE);
1582 case RK3066B: 1582 case RK3066B:
1583 return pull ? false : true; 1583 return pull ? false : true;
1584 case RK1108: 1584 case RV1108:
1585 case RK3188: 1585 case RK3188:
1586 case RK3288: 1586 case RK3288:
1587 case RK3368: 1587 case RK3368:
@@ -2700,7 +2700,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
2700 return 0; 2700 return 0;
2701} 2701}
2702 2702
2703static struct rockchip_pin_bank rk1108_pin_banks[] = { 2703static struct rockchip_pin_bank rv1108_pin_banks[] = {
2704 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU, 2704 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU,
2705 IOMUX_SOURCE_PMU, 2705 IOMUX_SOURCE_PMU,
2706 IOMUX_SOURCE_PMU, 2706 IOMUX_SOURCE_PMU,
@@ -2710,15 +2710,15 @@ static struct rockchip_pin_bank rk1108_pin_banks[] = {
2710 PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3", 0, 0, 0, 0), 2710 PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3", 0, 0, 0, 0),
2711}; 2711};
2712 2712
2713static struct rockchip_pin_ctrl rk1108_pin_ctrl = { 2713static struct rockchip_pin_ctrl rv1108_pin_ctrl = {
2714 .pin_banks = rk1108_pin_banks, 2714 .pin_banks = rv1108_pin_banks,
2715 .nr_banks = ARRAY_SIZE(rk1108_pin_banks), 2715 .nr_banks = ARRAY_SIZE(rv1108_pin_banks),
2716 .label = "RK1108-GPIO", 2716 .label = "RV1108-GPIO",
2717 .type = RK1108, 2717 .type = RV1108,
2718 .grf_mux_offset = 0x10, 2718 .grf_mux_offset = 0x10,
2719 .pmu_mux_offset = 0x0, 2719 .pmu_mux_offset = 0x0,
2720 .pull_calc_reg = rk1108_calc_pull_reg_and_bit, 2720 .pull_calc_reg = rv1108_calc_pull_reg_and_bit,
2721 .drv_calc_reg = rk1108_calc_drv_reg_and_bit, 2721 .drv_calc_reg = rv1108_calc_drv_reg_and_bit,
2722}; 2722};
2723 2723
2724static struct rockchip_pin_bank rk2928_pin_banks[] = { 2724static struct rockchip_pin_bank rk2928_pin_banks[] = {
@@ -2976,8 +2976,8 @@ static struct rockchip_pin_ctrl rk3399_pin_ctrl = {
2976}; 2976};
2977 2977
2978static const struct of_device_id rockchip_pinctrl_dt_match[] = { 2978static const struct of_device_id rockchip_pinctrl_dt_match[] = {
2979 { .compatible = "rockchip,rk1108-pinctrl", 2979 { .compatible = "rockchip,rv1108-pinctrl",
2980 .data = (void *)&rk1108_pin_ctrl }, 2980 .data = (void *)&rv1108_pin_ctrl },
2981 { .compatible = "rockchip,rk2928-pinctrl", 2981 { .compatible = "rockchip,rk2928-pinctrl",
2982 .data = (void *)&rk2928_pin_ctrl }, 2982 .data = (void *)&rk2928_pin_ctrl },
2983 { .compatible = "rockchip,rk3036-pinctrl", 2983 { .compatible = "rockchip,rk3036-pinctrl",