aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFan Wu <fwu@marvell.com>2014-06-08 21:37:56 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-07-11 08:08:26 -0400
commit2243a87d90b42eb38bc281957df3e57c712b5e56 (patch)
tree8083e8a008c65b667de08e2603032e80516f4ecb /drivers
parent607af165c0470e7297e1a04f528176222849b5a9 (diff)
pinctrl: avoid duplicated calling enable_pinmux_setting for a pin
What the patch does: 1. Call pinmux_disable_setting ahead of pinmux_enable_setting each time pinctrl_select_state is called 2. Remove the HW disable operation in pinmux_disable_setting function. 3. Remove the disable ops in struct pinmux_ops 4. Remove all the disable ops users in current code base. Notes: 1. Great thanks for the suggestion from Linus, Tony Lindgren and Stephen Warren and Everyone that shared comments on this patch. 2. The patch also includes comment fixes from Stephen Warren. The reason why we do this: 1. To avoid duplicated calling of the enable_setting operation without disabling operation inbetween which will let the pin descriptor desc->mux_usecount increase monotonously. 2. The HW pin disable operation is not useful for any of the existing platforms. And this can be used to avoid the HW glitch after using the item #1 modification. In the following case, the issue can be reproduced: 1. There is a driver that need to switch pin state dynamically, e.g. between "sleep" and "default" state 2. The pin setting configuration in a DTS node may be like this: component a { pinctrl-names = "default", "sleep"; pinctrl-0 = <&a_grp_setting &c_grp_setting>; pinctrl-1 = <&b_grp_setting &c_grp_setting>; } The "c_grp_setting" config node is totally identical, maybe like following one: c_grp_setting: c_grp_setting { pinctrl-single,pins = <GPIO48 AF6>; } 3. When switching the pin state in the following official pinctrl sequence: pin = pinctrl_get(); state = pinctrl_lookup_state(wanted_state); pinctrl_select_state(state); pinctrl_put(); Test Result: 1. The switch is completed as expected, that is: the device's pin configuration is changed according to the description in the "wanted_state" group setting 2. The "desc->mux_usecount" of the corresponding pins in "c_group" is increased without being decreased, because the "desc" is for each physical pin while the setting is for each setting node in the DTS. Thus, if the "c_grp_setting" in pinctrl-0 is not disabled ahead of enabling "c_grp_setting" in pinctrl-1, the desc->mux_usecount will keep increasing without any chance to be decreased. According to the comments in the original code, only the setting, in old state but not in new state, will be "disabled" (calling pinmux_disable_setting), which is correct logic but not intact. We still need consider case that the setting is in both old state and new state. We can do this in the following two ways: 1. Avoid to "enable"(calling pinmux_enable_setting) the "same pin setting" repeatedly 2. "Disable"(calling pinmux_disable_setting) the "same pin setting", actually two setting instances, ahead of enabling them. Analysis: 1. The solution #2 is better because it can avoid too much iteration. 2. If we disable all of the settings in the old state and one of the setting(s) exist in the new state, the pins mux function change may happen when some SoC vendors defined the "pinctrl-single,function-off" in their DTS file. old_setting => disabled_setting => new_setting. 3. In the pinmux framework, when a pin state is switched, the setting in the old state should be marked as "disabled". Conclusion: 1. To Remove the HW disabling operation to above the glitch mentioned above. 2. Handle the issue mentioned above by disabling all of the settings in old state and then enable the all of the settings in new state. Signed-off-by: Fan Wu <fwu@marvell.com> Acked-by: Stephen Warren <swarren@nvidia.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/core.c24
-rw-r--r--drivers/pinctrl/pinctrl-abx500.c15
-rw-r--r--drivers/pinctrl/pinctrl-adi2.c30
-rw-r--r--drivers/pinctrl/pinctrl-at91.c21
-rw-r--r--drivers/pinctrl/pinctrl-bcm2835.c11
-rw-r--r--drivers/pinctrl/pinctrl-exynos5440.c8
-rw-r--r--drivers/pinctrl/pinctrl-msm.c25
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.c16
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c18
-rw-r--r--drivers/pinctrl/pinctrl-samsung.c8
-rw-r--r--drivers/pinctrl/pinctrl-single.c56
-rw-r--r--drivers/pinctrl/pinctrl-st.c6
-rw-r--r--drivers/pinctrl/pinctrl-tb10x.c17
-rw-r--r--drivers/pinctrl/pinctrl-tegra.c13
-rw-r--r--drivers/pinctrl/pinctrl-tz1090-pdc.c28
-rw-r--r--drivers/pinctrl/pinctrl-tz1090.c58
-rw-r--r--drivers/pinctrl/pinctrl-u300.c14
-rw-r--r--drivers/pinctrl/pinmux.c4
-rw-r--r--drivers/pinctrl/sh-pfc/pinctrl.c22
-rw-r--r--drivers/pinctrl/sirf/pinctrl-sirf.c10
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.c7
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c12
22 files changed, 5 insertions, 418 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index e09474ecde23..e4f65510c87e 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -992,29 +992,15 @@ int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *state)
992 992
993 if (p->state) { 993 if (p->state) {
994 /* 994 /*
995 * The set of groups with a mux configuration in the old state 995 * For each pinmux setting in the old state, forget SW's record
996 * may not be identical to the set of groups with a mux setting 996 * of mux owner for that pingroup. Any pingroups which are
997 * in the new state. While this might be unusual, it's entirely 997 * still owned by the new state will be re-acquired by the call
998 * possible for the "user"-supplied mapping table to be written 998 * to pinmux_enable_setting() in the loop below.
999 * that way. For each group that was configured in the old state
1000 * but not in the new state, this code puts that group into a
1001 * safe/disabled state.
1002 */ 999 */
1003 list_for_each_entry(setting, &p->state->settings, node) { 1000 list_for_each_entry(setting, &p->state->settings, node) {
1004 bool found = false;
1005 if (setting->type != PIN_MAP_TYPE_MUX_GROUP) 1001 if (setting->type != PIN_MAP_TYPE_MUX_GROUP)
1006 continue; 1002 continue;
1007 list_for_each_entry(setting2, &state->settings, node) { 1003 pinmux_disable_setting(setting);
1008 if (setting2->type != PIN_MAP_TYPE_MUX_GROUP)
1009 continue;
1010 if (setting2->data.mux.group ==
1011 setting->data.mux.group) {
1012 found = true;
1013 break;
1014 }
1015 }
1016 if (!found)
1017 pinmux_disable_setting(setting);
1018 } 1004 }
1019 } 1005 }
1020 1006
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index 163da9c3ea0e..f3f8b24efe54 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -737,20 +737,6 @@ static int abx500_pmx_enable(struct pinctrl_dev *pctldev, unsigned function,
737 return ret; 737 return ret;
738} 738}
739 739
740static void abx500_pmx_disable(struct pinctrl_dev *pctldev,
741 unsigned function, unsigned group)
742{
743 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev);
744 const struct abx500_pingroup *g;
745
746 g = &pct->soc->groups[group];
747 if (g->altsetting < 0)
748 return;
749
750 /* FIXME: poke out the mux, set the pin to some default state? */
751 dev_dbg(pct->dev, "disable group %s, %u pins\n", g->name, g->npins);
752}
753
754static int abx500_gpio_request_enable(struct pinctrl_dev *pctldev, 740static int abx500_gpio_request_enable(struct pinctrl_dev *pctldev,
755 struct pinctrl_gpio_range *range, 741 struct pinctrl_gpio_range *range,
756 unsigned offset) 742 unsigned offset)
@@ -799,7 +785,6 @@ static const struct pinmux_ops abx500_pinmux_ops = {
799 .get_function_name = abx500_pmx_get_func_name, 785 .get_function_name = abx500_pmx_get_func_name,
800 .get_function_groups = abx500_pmx_get_func_groups, 786 .get_function_groups = abx500_pmx_get_func_groups,
801 .enable = abx500_pmx_enable, 787 .enable = abx500_pmx_enable,
802 .disable = abx500_pmx_disable,
803 .gpio_request_enable = abx500_gpio_request_enable, 788 .gpio_request_enable = abx500_gpio_request_enable,
804 .gpio_disable_free = abx500_gpio_disable_free, 789 .gpio_disable_free = abx500_gpio_disable_free,
805}; 790};
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index 5c44feb54ebb..b02ee4f882c0 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -652,35 +652,6 @@ static int adi_pinmux_enable(struct pinctrl_dev *pctldev, unsigned func_id,
652 return 0; 652 return 0;
653} 653}
654 654
655static void adi_pinmux_disable(struct pinctrl_dev *pctldev, unsigned func_id,
656 unsigned group_id)
657{
658 struct adi_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev);
659 struct gpio_port *port;
660 struct pinctrl_gpio_range *range;
661 unsigned long flags;
662 unsigned short *mux, pin;
663
664 mux = (unsigned short *)pinctrl->soc->groups[group_id].mux;
665
666 while (*mux) {
667 pin = P_IDENT(*mux);
668
669 range = pinctrl_find_gpio_range_from_pin(pctldev, pin);
670 if (range == NULL) /* should not happen */
671 return;
672
673 port = container_of(range->gc, struct gpio_port, chip);
674
675 spin_lock_irqsave(&port->lock, flags);
676
677 port_setup(port, pin_to_offset(range, pin), true);
678 mux++;
679
680 spin_unlock_irqrestore(&port->lock, flags);
681 }
682}
683
684static int adi_pinmux_get_funcs_count(struct pinctrl_dev *pctldev) 655static int adi_pinmux_get_funcs_count(struct pinctrl_dev *pctldev)
685{ 656{
686 struct adi_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev); 657 struct adi_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctldev);
@@ -728,7 +699,6 @@ static int adi_pinmux_request_gpio(struct pinctrl_dev *pctldev,
728 699
729static struct pinmux_ops adi_pinmux_ops = { 700static struct pinmux_ops adi_pinmux_ops = {
730 .enable = adi_pinmux_enable, 701 .enable = adi_pinmux_enable,
731 .disable = adi_pinmux_disable,
732 .get_functions_count = adi_pinmux_get_funcs_count, 702 .get_functions_count = adi_pinmux_get_funcs_count,
733 .get_function_name = adi_pinmux_get_func_name, 703 .get_function_name = adi_pinmux_get_func_name,
734 .get_function_groups = adi_pinmux_get_groups, 704 .get_function_groups = adi_pinmux_get_groups,
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 421493cb490c..bd57ab514aa4 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -611,26 +611,6 @@ static int at91_pmx_enable(struct pinctrl_dev *pctldev, unsigned selector,
611 return 0; 611 return 0;
612} 612}
613 613
614static void at91_pmx_disable(struct pinctrl_dev *pctldev, unsigned selector,
615 unsigned group)
616{
617 struct at91_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
618 const struct at91_pmx_pin *pins_conf = info->groups[group].pins_conf;
619 const struct at91_pmx_pin *pin;
620 uint32_t npins = info->groups[group].npins;
621 int i;
622 unsigned mask;
623 void __iomem *pio;
624
625 for (i = 0; i < npins; i++) {
626 pin = &pins_conf[i];
627 at91_pin_dbg(info->dev, pin);
628 pio = pin_to_controller(info, pin->bank);
629 mask = pin_to_mask(pin->pin);
630 at91_mux_gpio_enable(pio, mask, 1);
631 }
632}
633
634static int at91_pmx_get_funcs_count(struct pinctrl_dev *pctldev) 614static int at91_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
635{ 615{
636 struct at91_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 616 struct at91_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
@@ -705,7 +685,6 @@ static const struct pinmux_ops at91_pmx_ops = {
705 .get_function_name = at91_pmx_get_func_name, 685 .get_function_name = at91_pmx_get_func_name,
706 .get_function_groups = at91_pmx_get_groups, 686 .get_function_groups = at91_pmx_get_groups,
707 .enable = at91_pmx_enable, 687 .enable = at91_pmx_enable,
708 .disable = at91_pmx_disable,
709 .gpio_request_enable = at91_gpio_request_enable, 688 .gpio_request_enable = at91_gpio_request_enable,
710 .gpio_disable_free = at91_gpio_disable_free, 689 .gpio_disable_free = at91_gpio_disable_free,
711}; 690};
diff --git a/drivers/pinctrl/pinctrl-bcm2835.c b/drivers/pinctrl/pinctrl-bcm2835.c
index 3d907de9bc91..5bcfd7ace0cd 100644
--- a/drivers/pinctrl/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/pinctrl-bcm2835.c
@@ -841,16 +841,6 @@ static int bcm2835_pmx_enable(struct pinctrl_dev *pctldev,
841 return 0; 841 return 0;
842} 842}
843 843
844static void bcm2835_pmx_disable(struct pinctrl_dev *pctldev,
845 unsigned func_selector,
846 unsigned group_selector)
847{
848 struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
849
850 /* disable by setting to GPIO_IN */
851 bcm2835_pinctrl_fsel_set(pc, group_selector, BCM2835_FSEL_GPIO_IN);
852}
853
854static void bcm2835_pmx_gpio_disable_free(struct pinctrl_dev *pctldev, 844static void bcm2835_pmx_gpio_disable_free(struct pinctrl_dev *pctldev,
855 struct pinctrl_gpio_range *range, 845 struct pinctrl_gpio_range *range,
856 unsigned offset) 846 unsigned offset)
@@ -880,7 +870,6 @@ static const struct pinmux_ops bcm2835_pmx_ops = {
880 .get_function_name = bcm2835_pmx_get_function_name, 870 .get_function_name = bcm2835_pmx_get_function_name,
881 .get_function_groups = bcm2835_pmx_get_function_groups, 871 .get_function_groups = bcm2835_pmx_get_function_groups,
882 .enable = bcm2835_pmx_enable, 872 .enable = bcm2835_pmx_enable,
883 .disable = bcm2835_pmx_disable,
884 .gpio_disable_free = bcm2835_pmx_gpio_disable_free, 873 .gpio_disable_free = bcm2835_pmx_gpio_disable_free,
885 .gpio_set_direction = bcm2835_pmx_gpio_set_direction, 874 .gpio_set_direction = bcm2835_pmx_gpio_set_direction,
886}; 875};
diff --git a/drivers/pinctrl/pinctrl-exynos5440.c b/drivers/pinctrl/pinctrl-exynos5440.c
index 8fe2ab0a7698..4b145b5db7a6 100644
--- a/drivers/pinctrl/pinctrl-exynos5440.c
+++ b/drivers/pinctrl/pinctrl-exynos5440.c
@@ -371,13 +371,6 @@ static int exynos5440_pinmux_enable(struct pinctrl_dev *pctldev, unsigned select
371 return 0; 371 return 0;
372} 372}
373 373
374/* disable a specified pinmux by writing to registers */
375static void exynos5440_pinmux_disable(struct pinctrl_dev *pctldev,
376 unsigned selector, unsigned group)
377{
378 exynos5440_pinmux_setup(pctldev, selector, group, false);
379}
380
381/* 374/*
382 * The calls to gpio_direction_output() and gpio_direction_input() 375 * The calls to gpio_direction_output() and gpio_direction_input()
383 * leads to this function call (via the pinctrl_gpio_direction_{input|output}() 376 * leads to this function call (via the pinctrl_gpio_direction_{input|output}()
@@ -395,7 +388,6 @@ static const struct pinmux_ops exynos5440_pinmux_ops = {
395 .get_function_name = exynos5440_pinmux_get_fname, 388 .get_function_name = exynos5440_pinmux_get_fname,
396 .get_function_groups = exynos5440_pinmux_get_groups, 389 .get_function_groups = exynos5440_pinmux_get_groups,
397 .enable = exynos5440_pinmux_enable, 390 .enable = exynos5440_pinmux_enable,
398 .disable = exynos5440_pinmux_disable,
399 .gpio_set_direction = exynos5440_pinmux_gpio_set_direction, 391 .gpio_set_direction = exynos5440_pinmux_gpio_set_direction,
400}; 392};
401 393
diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c
index df6dda4ce803..bdfaba4430f2 100644
--- a/drivers/pinctrl/pinctrl-msm.c
+++ b/drivers/pinctrl/pinctrl-msm.c
@@ -165,36 +165,11 @@ static int msm_pinmux_enable(struct pinctrl_dev *pctldev,
165 return 0; 165 return 0;
166} 166}
167 167
168static void msm_pinmux_disable(struct pinctrl_dev *pctldev,
169 unsigned function,
170 unsigned group)
171{
172 struct msm_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
173 const struct msm_pingroup *g;
174 unsigned long flags;
175 u32 val;
176
177 g = &pctrl->soc->groups[group];
178
179 if (WARN_ON(g->mux_bit < 0))
180 return;
181
182 spin_lock_irqsave(&pctrl->lock, flags);
183
184 /* Clear the mux bits to select gpio mode */
185 val = readl(pctrl->regs + g->ctl_reg);
186 val &= ~(0x7 << g->mux_bit);
187 writel(val, pctrl->regs + g->ctl_reg);
188
189 spin_unlock_irqrestore(&pctrl->lock, flags);
190}
191
192static const struct pinmux_ops msm_pinmux_ops = { 168static const struct pinmux_ops msm_pinmux_ops = {
193 .get_functions_count = msm_get_functions_count, 169 .get_functions_count = msm_get_functions_count,
194 .get_function_name = msm_get_function_name, 170 .get_function_name = msm_get_function_name,
195 .get_function_groups = msm_get_function_groups, 171 .get_function_groups = msm_get_function_groups,
196 .enable = msm_pinmux_enable, 172 .enable = msm_pinmux_enable,
197 .disable = msm_pinmux_disable,
198}; 173};
199 174
200static int msm_config_reg(struct msm_pinctrl *pctrl, 175static int msm_config_reg(struct msm_pinctrl *pctrl,
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index 8f6f16ef73f3..a564251fe093 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1765,21 +1765,6 @@ out_glitch:
1765 return ret; 1765 return ret;
1766} 1766}
1767 1767
1768static void nmk_pmx_disable(struct pinctrl_dev *pctldev,
1769 unsigned function, unsigned group)
1770{
1771 struct nmk_pinctrl *npct = pinctrl_dev_get_drvdata(pctldev);
1772 const struct nmk_pingroup *g;
1773
1774 g = &npct->soc->groups[group];
1775
1776 if (g->altsetting < 0)
1777 return;
1778
1779 /* Poke out the mux, set the pin to some default state? */
1780 dev_dbg(npct->dev, "disable group %s, %u pins\n", g->name, g->npins);
1781}
1782
1783static int nmk_gpio_request_enable(struct pinctrl_dev *pctldev, 1768static int nmk_gpio_request_enable(struct pinctrl_dev *pctldev,
1784 struct pinctrl_gpio_range *range, 1769 struct pinctrl_gpio_range *range,
1785 unsigned offset) 1770 unsigned offset)
@@ -1826,7 +1811,6 @@ static const struct pinmux_ops nmk_pinmux_ops = {
1826 .get_function_name = nmk_pmx_get_func_name, 1811 .get_function_name = nmk_pmx_get_func_name,
1827 .get_function_groups = nmk_pmx_get_func_groups, 1812 .get_function_groups = nmk_pmx_get_func_groups,
1828 .enable = nmk_pmx_enable, 1813 .enable = nmk_pmx_enable,
1829 .disable = nmk_pmx_disable,
1830 .gpio_request_enable = nmk_gpio_request_enable, 1814 .gpio_request_enable = nmk_gpio_request_enable,
1831 .gpio_disable_free = nmk_gpio_disable_free, 1815 .gpio_disable_free = nmk_gpio_disable_free,
1832}; 1816};
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index bb805d5e9ff0..51f67a6eadcb 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -657,23 +657,6 @@ static int rockchip_pmx_enable(struct pinctrl_dev *pctldev, unsigned selector,
657 return 0; 657 return 0;
658} 658}
659 659
660static void rockchip_pmx_disable(struct pinctrl_dev *pctldev,
661 unsigned selector, unsigned group)
662{
663 struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
664 const unsigned int *pins = info->groups[group].pins;
665 struct rockchip_pin_bank *bank;
666 int cnt;
667
668 dev_dbg(info->dev, "disable function %s group %s\n",
669 info->functions[selector].name, info->groups[group].name);
670
671 for (cnt = 0; cnt < info->groups[group].npins; cnt++) {
672 bank = pin_to_bank(info, pins[cnt]);
673 rockchip_set_mux(bank, pins[cnt] - bank->pin_base, 0);
674 }
675}
676
677/* 660/*
678 * The calls to gpio_direction_output() and gpio_direction_input() 661 * The calls to gpio_direction_output() and gpio_direction_input()
679 * leads to this function call (via the pinctrl_gpio_direction_{input|output}() 662 * leads to this function call (via the pinctrl_gpio_direction_{input|output}()
@@ -716,7 +699,6 @@ static const struct pinmux_ops rockchip_pmx_ops = {
716 .get_function_name = rockchip_pmx_get_func_name, 699 .get_function_name = rockchip_pmx_get_func_name,
717 .get_function_groups = rockchip_pmx_get_groups, 700 .get_function_groups = rockchip_pmx_get_groups,
718 .enable = rockchip_pmx_enable, 701 .enable = rockchip_pmx_enable,
719 .disable = rockchip_pmx_disable,
720 .gpio_set_direction = rockchip_pmx_gpio_set_direction, 702 .gpio_set_direction = rockchip_pmx_gpio_set_direction,
721}; 703};
722 704
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index 3e61d0f8f146..089abde35d44 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -333,13 +333,6 @@ static int samsung_pinmux_enable(struct pinctrl_dev *pctldev, unsigned selector,
333 return 0; 333 return 0;
334} 334}
335 335
336/* disable a specified pinmux by writing to registers */
337static void samsung_pinmux_disable(struct pinctrl_dev *pctldev,
338 unsigned selector, unsigned group)
339{
340 samsung_pinmux_setup(pctldev, selector, group, false);
341}
342
343/* 336/*
344 * The calls to gpio_direction_output() and gpio_direction_input() 337 * The calls to gpio_direction_output() and gpio_direction_input()
345 * leads to this function call (via the pinctrl_gpio_direction_{input|output}() 338 * leads to this function call (via the pinctrl_gpio_direction_{input|output}()
@@ -390,7 +383,6 @@ static const struct pinmux_ops samsung_pinmux_ops = {
390 .get_function_name = samsung_pinmux_get_fname, 383 .get_function_name = samsung_pinmux_get_fname,
391 .get_function_groups = samsung_pinmux_get_groups, 384 .get_function_groups = samsung_pinmux_get_groups,
392 .enable = samsung_pinmux_enable, 385 .enable = samsung_pinmux_enable,
393 .disable = samsung_pinmux_disable,
394 .gpio_set_direction = samsung_pinmux_gpio_set_direction, 386 .gpio_set_direction = samsung_pinmux_gpio_set_direction,
395}; 387};
396 388
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 2960557bfed9..ff6a2bda52e5 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -488,61 +488,6 @@ static int pcs_enable(struct pinctrl_dev *pctldev, unsigned fselector,
488 return 0; 488 return 0;
489} 489}
490 490
491static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector,
492 unsigned group)
493{
494 struct pcs_device *pcs;
495 struct pcs_function *func;
496 int i;
497
498 pcs = pinctrl_dev_get_drvdata(pctldev);
499 /* If function mask is null, needn't disable it. */
500 if (!pcs->fmask)
501 return;
502
503 func = radix_tree_lookup(&pcs->ftree, fselector);
504 if (!func) {
505 dev_err(pcs->dev, "%s could not find function%i\n",
506 __func__, fselector);
507 return;
508 }
509
510 /*
511 * Ignore disable if function-off is not specified. Some hardware
512 * does not have clearly defined disable function. For pin specific
513 * off modes, you can use alternate named states as described in
514 * pinctrl-bindings.txt.
515 */
516 if (pcs->foff == PCS_OFF_DISABLED) {
517 dev_dbg(pcs->dev, "ignoring disable for %s function%i\n",
518 func->name, fselector);
519 return;
520 }
521
522 dev_dbg(pcs->dev, "disabling function%i %s\n",
523 fselector, func->name);
524
525 for (i = 0; i < func->nvals; i++) {
526 struct pcs_func_vals *vals;
527 unsigned long flags;
528 unsigned val, mask;
529
530 vals = &func->vals[i];
531 raw_spin_lock_irqsave(&pcs->lock, flags);
532 val = pcs->read(vals->reg);
533
534 if (pcs->bits_per_mux)
535 mask = vals->mask;
536 else
537 mask = pcs->fmask;
538
539 val &= ~mask;
540 val |= pcs->foff << pcs->fshift;
541 pcs->write(val, vals->reg);
542 raw_spin_unlock_irqrestore(&pcs->lock, flags);
543 }
544}
545
546static int pcs_request_gpio(struct pinctrl_dev *pctldev, 491static int pcs_request_gpio(struct pinctrl_dev *pctldev,
547 struct pinctrl_gpio_range *range, unsigned pin) 492 struct pinctrl_gpio_range *range, unsigned pin)
548{ 493{
@@ -575,7 +520,6 @@ static const struct pinmux_ops pcs_pinmux_ops = {
575 .get_function_name = pcs_get_function_name, 520 .get_function_name = pcs_get_function_name,
576 .get_function_groups = pcs_get_function_groups, 521 .get_function_groups = pcs_get_function_groups,
577 .enable = pcs_enable, 522 .enable = pcs_enable,
578 .disable = pcs_disable,
579 .gpio_request_enable = pcs_request_gpio, 523 .gpio_request_enable = pcs_request_gpio,
580}; 524};
581 525
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 1bd6363bc95e..e1919cd43117 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -930,11 +930,6 @@ static int st_pmx_enable(struct pinctrl_dev *pctldev, unsigned fselector,
930 return 0; 930 return 0;
931} 931}
932 932
933static void st_pmx_disable(struct pinctrl_dev *pctldev, unsigned selector,
934 unsigned group)
935{
936}
937
938static int st_pmx_set_gpio_direction(struct pinctrl_dev *pctldev, 933static int st_pmx_set_gpio_direction(struct pinctrl_dev *pctldev,
939 struct pinctrl_gpio_range *range, unsigned gpio, 934 struct pinctrl_gpio_range *range, unsigned gpio,
940 bool input) 935 bool input)
@@ -957,7 +952,6 @@ static struct pinmux_ops st_pmxops = {
957 .get_function_name = st_pmx_get_fname, 952 .get_function_name = st_pmx_get_fname,
958 .get_function_groups = st_pmx_get_groups, 953 .get_function_groups = st_pmx_get_groups,
959 .enable = st_pmx_enable, 954 .enable = st_pmx_enable,
960 .disable = st_pmx_disable,
961 .gpio_set_direction = st_pmx_set_gpio_direction, 955 .gpio_set_direction = st_pmx_set_gpio_direction,
962}; 956};
963 957
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c
index 26ca6855f478..71c5d4f0c538 100644
--- a/drivers/pinctrl/pinctrl-tb10x.c
+++ b/drivers/pinctrl/pinctrl-tb10x.c
@@ -738,22 +738,6 @@ static int tb10x_pctl_enable(struct pinctrl_dev *pctl,
738 return 0; 738 return 0;
739} 739}
740 740
741static void tb10x_pctl_disable(struct pinctrl_dev *pctl,
742 unsigned func_selector, unsigned group_selector)
743{
744 struct tb10x_pinctrl *state = pinctrl_dev_get_drvdata(pctl);
745 const struct tb10x_pinfuncgrp *grp = &state->pingroups[group_selector];
746
747 if (grp->port < 0)
748 return;
749
750 mutex_lock(&state->mutex);
751
752 state->ports[grp->port].count--;
753
754 mutex_unlock(&state->mutex);
755}
756
757static struct pinmux_ops tb10x_pinmux_ops = { 741static struct pinmux_ops tb10x_pinmux_ops = {
758 .get_functions_count = tb10x_get_functions_count, 742 .get_functions_count = tb10x_get_functions_count,
759 .get_function_name = tb10x_get_function_name, 743 .get_function_name = tb10x_get_function_name,
@@ -761,7 +745,6 @@ static struct pinmux_ops tb10x_pinmux_ops = {
761 .gpio_request_enable = tb10x_gpio_request_enable, 745 .gpio_request_enable = tb10x_gpio_request_enable,
762 .gpio_disable_free = tb10x_gpio_disable_free, 746 .gpio_disable_free = tb10x_gpio_disable_free,
763 .enable = tb10x_pctl_enable, 747 .enable = tb10x_pctl_enable,
764 .disable = tb10x_pctl_disable,
765}; 748};
766 749
767static struct pinctrl_desc tb10x_pindesc = { 750static struct pinctrl_desc tb10x_pindesc = {
diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c
index 2d43bff74f59..150af5503c09 100644
--- a/drivers/pinctrl/pinctrl-tegra.c
+++ b/drivers/pinctrl/pinctrl-tegra.c
@@ -290,24 +290,11 @@ static int tegra_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned function,
290 return 0; 290 return 0;
291} 291}
292 292
293static void tegra_pinctrl_disable(struct pinctrl_dev *pctldev,
294 unsigned function, unsigned group)
295{
296 struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
297 const struct tegra_pingroup *g;
298
299 g = &pmx->soc->groups[group];
300
301 if (WARN_ON(g->mux_reg < 0))
302 return;
303}
304
305static const struct pinmux_ops tegra_pinmux_ops = { 293static const struct pinmux_ops tegra_pinmux_ops = {
306 .get_functions_count = tegra_pinctrl_get_funcs_count, 294 .get_functions_count = tegra_pinctrl_get_funcs_count,
307 .get_function_name = tegra_pinctrl_get_func_name, 295 .get_function_name = tegra_pinctrl_get_func_name,
308 .get_function_groups = tegra_pinctrl_get_func_groups, 296 .get_function_groups = tegra_pinctrl_get_func_groups,
309 .enable = tegra_pinctrl_enable, 297 .enable = tegra_pinctrl_enable,
310 .disable = tegra_pinctrl_disable,
311}; 298};
312 299
313static int tegra_pinconf_reg(struct tegra_pmx *pmx, 300static int tegra_pinconf_reg(struct tegra_pmx *pmx,
diff --git a/drivers/pinctrl/pinctrl-tz1090-pdc.c b/drivers/pinctrl/pinctrl-tz1090-pdc.c
index 5bf01c28925e..41e81a35cabb 100644
--- a/drivers/pinctrl/pinctrl-tz1090-pdc.c
+++ b/drivers/pinctrl/pinctrl-tz1090-pdc.c
@@ -574,33 +574,6 @@ static int tz1090_pdc_pinctrl_enable(struct pinctrl_dev *pctldev,
574 return 0; 574 return 0;
575} 575}
576 576
577static void tz1090_pdc_pinctrl_disable(struct pinctrl_dev *pctldev,
578 unsigned int function,
579 unsigned int group)
580{
581 struct tz1090_pdc_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
582 const struct tz1090_pdc_pingroup *grp = &tz1090_pdc_groups[group];
583
584 dev_dbg(pctldev->dev, "%s(func=%u (%s), group=%u (%s))\n",
585 __func__,
586 function, tz1090_pdc_functions[function].name,
587 group, tz1090_pdc_groups[group].name);
588
589 /* is it even a mux? */
590 if (grp->drv)
591 return;
592
593 /* does this group even control the function? */
594 if (function != grp->func)
595 return;
596
597 /* record the pin being unmuxed and update mux bit */
598 spin_lock(&pmx->lock);
599 pmx->mux_en &= ~BIT(grp->pins[0]);
600 tz1090_pdc_pinctrl_mux(pmx, grp);
601 spin_unlock(&pmx->lock);
602}
603
604static const struct tz1090_pdc_pingroup *find_mux_group( 577static const struct tz1090_pdc_pingroup *find_mux_group(
605 struct tz1090_pdc_pmx *pmx, 578 struct tz1090_pdc_pmx *pmx,
606 unsigned int pin) 579 unsigned int pin)
@@ -662,7 +635,6 @@ static struct pinmux_ops tz1090_pdc_pinmux_ops = {
662 .get_function_name = tz1090_pdc_pinctrl_get_func_name, 635 .get_function_name = tz1090_pdc_pinctrl_get_func_name,
663 .get_function_groups = tz1090_pdc_pinctrl_get_func_groups, 636 .get_function_groups = tz1090_pdc_pinctrl_get_func_groups,
664 .enable = tz1090_pdc_pinctrl_enable, 637 .enable = tz1090_pdc_pinctrl_enable,
665 .disable = tz1090_pdc_pinctrl_disable,
666 .gpio_request_enable = tz1090_pdc_pinctrl_gpio_request_enable, 638 .gpio_request_enable = tz1090_pdc_pinctrl_gpio_request_enable,
667 .gpio_disable_free = tz1090_pdc_pinctrl_gpio_disable_free, 639 .gpio_disable_free = tz1090_pdc_pinctrl_gpio_disable_free,
668}; 640};
diff --git a/drivers/pinctrl/pinctrl-tz1090.c b/drivers/pinctrl/pinctrl-tz1090.c
index bc9cd7a7602e..24082216842e 100644
--- a/drivers/pinctrl/pinctrl-tz1090.c
+++ b/drivers/pinctrl/pinctrl-tz1090.c
@@ -1479,63 +1479,6 @@ mux_pins:
1479} 1479}
1480 1480
1481/** 1481/**
1482 * tz1090_pinctrl_disable() - Disable a function on a pin group.
1483 * @pctldev: Pin control data
1484 * @function: Function index to disable
1485 * @group: Group index to disable
1486 *
1487 * Disable a particular function on a group of pins. The per GPIO pin pseudo pin
1488 * groups can be used (in which case the pin will be taken out of peripheral
1489 * mode. Some convenience pin groups can also be used in which case the effect
1490 * is the same as enabling the function on each individual pin in the group.
1491 */
1492static void tz1090_pinctrl_disable(struct pinctrl_dev *pctldev,
1493 unsigned int function, unsigned int group)
1494{
1495 struct tz1090_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
1496 struct tz1090_pingroup *grp;
1497 unsigned int pin_num, mux_group, i, npins;
1498 const unsigned int *pins;
1499
1500 /* group of pins? */
1501 if (group < ARRAY_SIZE(tz1090_groups)) {
1502 grp = &tz1090_groups[group];
1503 npins = grp->npins;
1504 pins = grp->pins;
1505 /*
1506 * All pins in the group must belong to the same mux group,
1507 * which allows us to just use the mux group of the first pin.
1508 * By explicitly listing permitted pingroups for each function
1509 * the pinmux core should ensure this is always the case.
1510 */
1511 } else {
1512 pin_num = group - ARRAY_SIZE(tz1090_groups);
1513 npins = 1;
1514 pins = &pin_num;
1515 }
1516 mux_group = tz1090_mux_pins[*pins];
1517
1518 /* no mux group, but can still be individually muxed to peripheral */
1519 if (mux_group >= TZ1090_MUX_GROUP_MAX) {
1520 if (function == TZ1090_MUX_PERIP)
1521 goto unmux_pins;
1522 return;
1523 }
1524
1525 /* mux group already set to a different function? */
1526 grp = &tz1090_mux_groups[mux_group];
1527 dev_dbg(pctldev->dev, "%s: unmuxing %u pin(s) in '%s' from '%s'\n",
1528 __func__, npins, grp->name, tz1090_functions[function].name);
1529
1530 /* subtract pins from ref count and unmux individually */
1531 WARN_ON(grp->func_count < npins);
1532 grp->func_count -= npins;
1533unmux_pins:
1534 for (i = 0; i < npins; ++i)
1535 tz1090_pinctrl_perip_select(pmx, pins[i], false);
1536}
1537
1538/**
1539 * tz1090_pinctrl_gpio_request_enable() - Put pin in GPIO mode. 1482 * tz1090_pinctrl_gpio_request_enable() - Put pin in GPIO mode.
1540 * @pctldev: Pin control data 1483 * @pctldev: Pin control data
1541 * @range: GPIO range 1484 * @range: GPIO range
@@ -1575,7 +1518,6 @@ static struct pinmux_ops tz1090_pinmux_ops = {
1575 .get_function_name = tz1090_pinctrl_get_func_name, 1518 .get_function_name = tz1090_pinctrl_get_func_name,
1576 .get_function_groups = tz1090_pinctrl_get_func_groups, 1519 .get_function_groups = tz1090_pinctrl_get_func_groups,
1577 .enable = tz1090_pinctrl_enable, 1520 .enable = tz1090_pinctrl_enable,
1578 .disable = tz1090_pinctrl_disable,
1579 .gpio_request_enable = tz1090_pinctrl_gpio_request_enable, 1521 .gpio_request_enable = tz1090_pinctrl_gpio_request_enable,
1580 .gpio_disable_free = tz1090_pinctrl_gpio_disable_free, 1522 .gpio_disable_free = tz1090_pinctrl_gpio_disable_free,
1581}; 1523};
diff --git a/drivers/pinctrl/pinctrl-u300.c b/drivers/pinctrl/pinctrl-u300.c
index 209a01b8bd3b..0959bb36450f 100644
--- a/drivers/pinctrl/pinctrl-u300.c
+++ b/drivers/pinctrl/pinctrl-u300.c
@@ -970,19 +970,6 @@ static int u300_pmx_enable(struct pinctrl_dev *pctldev, unsigned selector,
970 return 0; 970 return 0;
971} 971}
972 972
973static void u300_pmx_disable(struct pinctrl_dev *pctldev, unsigned selector,
974 unsigned group)
975{
976 struct u300_pmx *upmx;
977
978 /* There is nothing to do with the power pins */
979 if (selector == 0)
980 return;
981
982 upmx = pinctrl_dev_get_drvdata(pctldev);
983 u300_pmx_endisable(upmx, selector, false);
984}
985
986static int u300_pmx_get_funcs_count(struct pinctrl_dev *pctldev) 973static int u300_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
987{ 974{
988 return ARRAY_SIZE(u300_pmx_functions); 975 return ARRAY_SIZE(u300_pmx_functions);
@@ -1008,7 +995,6 @@ static const struct pinmux_ops u300_pmx_ops = {
1008 .get_function_name = u300_pmx_get_func_name, 995 .get_function_name = u300_pmx_get_func_name,
1009 .get_function_groups = u300_pmx_get_groups, 996 .get_function_groups = u300_pmx_get_groups,
1010 .enable = u300_pmx_enable, 997 .enable = u300_pmx_enable,
1011 .disable = u300_pmx_disable,
1012}; 998};
1013 999
1014static int u300_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin, 1000static int u300_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin,
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 051e8592990e..c055daf9a80f 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -471,7 +471,6 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
471{ 471{
472 struct pinctrl_dev *pctldev = setting->pctldev; 472 struct pinctrl_dev *pctldev = setting->pctldev;
473 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; 473 const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
474 const struct pinmux_ops *ops = pctldev->desc->pmxops;
475 int ret = 0; 474 int ret = 0;
476 const unsigned *pins = NULL; 475 const unsigned *pins = NULL;
477 unsigned num_pins = 0; 476 unsigned num_pins = 0;
@@ -518,9 +517,6 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
518 pins[i], desc->name, gname); 517 pins[i], desc->name, gname);
519 } 518 }
520 } 519 }
521
522 if (ops->disable)
523 ops->disable(pctldev, setting->data.mux.func, setting->data.mux.group);
524} 520}
525 521
526#ifdef CONFIG_DEBUG_FS 522#ifdef CONFIG_DEBUG_FS
diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index e758af95c209..11db3ee39d40 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -345,27 +345,6 @@ done:
345 return ret; 345 return ret;
346} 346}
347 347
348static void sh_pfc_func_disable(struct pinctrl_dev *pctldev, unsigned selector,
349 unsigned group)
350{
351 struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
352 struct sh_pfc *pfc = pmx->pfc;
353 const struct sh_pfc_pin_group *grp = &pfc->info->groups[group];
354 unsigned long flags;
355 unsigned int i;
356
357 spin_lock_irqsave(&pfc->lock, flags);
358
359 for (i = 0; i < grp->nr_pins; ++i) {
360 int idx = sh_pfc_get_pin_index(pfc, grp->pins[i]);
361 struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
362
363 cfg->type = PINMUX_TYPE_NONE;
364 }
365
366 spin_unlock_irqrestore(&pfc->lock, flags);
367}
368
369static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev, 348static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev,
370 struct pinctrl_gpio_range *range, 349 struct pinctrl_gpio_range *range,
371 unsigned offset) 350 unsigned offset)
@@ -464,7 +443,6 @@ static const struct pinmux_ops sh_pfc_pinmux_ops = {
464 .get_function_name = sh_pfc_get_function_name, 443 .get_function_name = sh_pfc_get_function_name,
465 .get_function_groups = sh_pfc_get_function_groups, 444 .get_function_groups = sh_pfc_get_function_groups,
466 .enable = sh_pfc_func_enable, 445 .enable = sh_pfc_func_enable,
467 .disable = sh_pfc_func_disable,
468 .gpio_request_enable = sh_pfc_gpio_request_enable, 446 .gpio_request_enable = sh_pfc_gpio_request_enable,
469 .gpio_disable_free = sh_pfc_gpio_disable_free, 447 .gpio_disable_free = sh_pfc_gpio_disable_free,
470 .gpio_set_direction = sh_pfc_gpio_set_direction, 448 .gpio_set_direction = sh_pfc_gpio_set_direction,
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 014f5b1fee55..4c1d7c68666d 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -186,15 +186,6 @@ static int sirfsoc_pinmux_enable(struct pinctrl_dev *pmxdev, unsigned selector,
186 return 0; 186 return 0;
187} 187}
188 188
189static void sirfsoc_pinmux_disable(struct pinctrl_dev *pmxdev, unsigned selector,
190 unsigned group)
191{
192 struct sirfsoc_pmx *spmx;
193
194 spmx = pinctrl_dev_get_drvdata(pmxdev);
195 sirfsoc_pinmux_endisable(spmx, selector, false);
196}
197
198static int sirfsoc_pinmux_get_funcs_count(struct pinctrl_dev *pmxdev) 189static int sirfsoc_pinmux_get_funcs_count(struct pinctrl_dev *pmxdev)
199{ 190{
200 return sirfsoc_pmxfunc_cnt; 191 return sirfsoc_pmxfunc_cnt;
@@ -240,7 +231,6 @@ static int sirfsoc_pinmux_request_gpio(struct pinctrl_dev *pmxdev,
240 231
241static struct pinmux_ops sirfsoc_pinmux_ops = { 232static struct pinmux_ops sirfsoc_pinmux_ops = {
242 .enable = sirfsoc_pinmux_enable, 233 .enable = sirfsoc_pinmux_enable,
243 .disable = sirfsoc_pinmux_disable,
244 .get_functions_count = sirfsoc_pinmux_get_funcs_count, 234 .get_functions_count = sirfsoc_pinmux_get_funcs_count,
245 .get_function_name = sirfsoc_pinmux_get_func_name, 235 .get_function_name = sirfsoc_pinmux_get_func_name,
246 .get_function_groups = sirfsoc_pinmux_get_groups, 236 .get_function_groups = sirfsoc_pinmux_get_groups,
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c
index 58bf6867aa17..f72cc4e192bd 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.c
+++ b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -274,12 +274,6 @@ static int spear_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned function,
274 return spear_pinctrl_endisable(pctldev, function, group, true); 274 return spear_pinctrl_endisable(pctldev, function, group, true);
275} 275}
276 276
277static void spear_pinctrl_disable(struct pinctrl_dev *pctldev,
278 unsigned function, unsigned group)
279{
280 spear_pinctrl_endisable(pctldev, function, group, false);
281}
282
283/* gpio with pinmux */ 277/* gpio with pinmux */
284static struct spear_gpio_pingroup *get_gpio_pingroup(struct spear_pmx *pmx, 278static struct spear_gpio_pingroup *get_gpio_pingroup(struct spear_pmx *pmx,
285 unsigned pin) 279 unsigned pin)
@@ -345,7 +339,6 @@ static const struct pinmux_ops spear_pinmux_ops = {
345 .get_function_name = spear_pinctrl_get_func_name, 339 .get_function_name = spear_pinctrl_get_func_name,
346 .get_function_groups = spear_pinctrl_get_func_groups, 340 .get_function_groups = spear_pinctrl_get_func_groups,
347 .enable = spear_pinctrl_enable, 341 .enable = spear_pinctrl_enable,
348 .disable = spear_pinctrl_disable,
349 .gpio_request_enable = gpio_request_enable, 342 .gpio_request_enable = gpio_request_enable,
350 .gpio_disable_free = gpio_disable_free, 343 .gpio_disable_free = gpio_disable_free,
351}; 344};
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index 2c61281bebd7..8c976c21eeee 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -141,17 +141,6 @@ static int wmt_pmx_enable(struct pinctrl_dev *pctldev,
141 return wmt_set_pinmux(data, func_selector, pinnum); 141 return wmt_set_pinmux(data, func_selector, pinnum);
142} 142}
143 143
144static void wmt_pmx_disable(struct pinctrl_dev *pctldev,
145 unsigned func_selector,
146 unsigned group_selector)
147{
148 struct wmt_pinctrl_data *data = pinctrl_dev_get_drvdata(pctldev);
149 u32 pinnum = data->pins[group_selector].number;
150
151 /* disable by setting GPIO_IN */
152 wmt_set_pinmux(data, WMT_FSEL_GPIO_IN, pinnum);
153}
154
155static void wmt_pmx_gpio_disable_free(struct pinctrl_dev *pctldev, 144static void wmt_pmx_gpio_disable_free(struct pinctrl_dev *pctldev,
156 struct pinctrl_gpio_range *range, 145 struct pinctrl_gpio_range *range,
157 unsigned offset) 146 unsigned offset)
@@ -180,7 +169,6 @@ static struct pinmux_ops wmt_pinmux_ops = {
180 .get_function_name = wmt_pmx_get_function_name, 169 .get_function_name = wmt_pmx_get_function_name,
181 .get_function_groups = wmt_pmx_get_function_groups, 170 .get_function_groups = wmt_pmx_get_function_groups,
182 .enable = wmt_pmx_enable, 171 .enable = wmt_pmx_enable,
183 .disable = wmt_pmx_disable,
184 .gpio_disable_free = wmt_pmx_gpio_disable_free, 172 .gpio_disable_free = wmt_pmx_gpio_disable_free,
185 .gpio_set_direction = wmt_pmx_gpio_set_direction, 173 .gpio_set_direction = wmt_pmx_gpio_set_direction,
186}; 174};