diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-29 19:34:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-29 19:34:50 -0500 |
commit | d6a3bf93d69aefa2d81b64ece799799f44acd925 (patch) | |
tree | 6deafbcc84d53a0cc73fa77b6029fdaf4aabe746 | |
parent | 6abb7c25775b7fb2225ad0508236d63ca710e65f (diff) | |
parent | 0fafd50e4b41c06bf6be8dead87075e88ef25303 (diff) |
Merge tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pinctrl fixes from Linus Walleij:
"This is a late pinctrl fix pull request, we had to revert out the
pinctrl-single GPIO backend, because of, well, design issues. We're
cooking a better thing for the next cycle.
- Revert gpio request/free backend, new patch set in the works, will
be for v3.9. Get this old cruft out before anyone hurts himself on
it.
- Kconfig buzz
- Various compile warnings
- MPP6 value for the Kirkwood"
* tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: nomadik: nmk_prcm_gpiocr_get_mode may be unused
pinctrl: exynos: don't mark probing functions as __init
Revert "pinctrl: single: support gpio request and free"
pinctrl: mvebu: fix MPP6 value for kirkwood driver
pinctrl: mvebu: Fix compiler warnings
pinctrl: pinctrl-mxs: Fix variables' definition type
pinctrl: samsung: removing duplicated condition for PINCTRL_SAMSUNG
-rw-r--r-- | drivers/pinctrl/Kconfig | 1 | ||||
-rw-r--r-- | drivers/pinctrl/mvebu/pinctrl-dove.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/mvebu/pinctrl-kirkwood.c | 8 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-exynos5440.c | 10 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-mxs.c | 9 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-single.c | 79 |
7 files changed, 17 insertions, 94 deletions
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index c31aeb01bb00..efaecefe3f8c 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig | |||
@@ -181,7 +181,6 @@ config PINCTRL_COH901 | |||
181 | 181 | ||
182 | config PINCTRL_SAMSUNG | 182 | config PINCTRL_SAMSUNG |
183 | bool | 183 | bool |
184 | depends on OF && GPIOLIB | ||
185 | select PINMUX | 184 | select PINMUX |
186 | select PINCONF | 185 | select PINCONF |
187 | 186 | ||
diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c index 69aba3697287..428ea96a94d3 100644 --- a/drivers/pinctrl/mvebu/pinctrl-dove.c +++ b/drivers/pinctrl/mvebu/pinctrl-dove.c | |||
@@ -588,7 +588,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev) | |||
588 | { | 588 | { |
589 | const struct of_device_id *match = | 589 | const struct of_device_id *match = |
590 | of_match_device(dove_pinctrl_of_match, &pdev->dev); | 590 | of_match_device(dove_pinctrl_of_match, &pdev->dev); |
591 | pdev->dev.platform_data = match->data; | 591 | pdev->dev.platform_data = (void *)match->data; |
592 | 592 | ||
593 | /* | 593 | /* |
594 | * General MPP Configuration Register is part of pdma registers. | 594 | * General MPP Configuration Register is part of pdma registers. |
diff --git a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c index f12084e18057..cdd483df673e 100644 --- a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c +++ b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c | |||
@@ -66,9 +66,9 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = { | |||
66 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), | 66 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), |
67 | MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), | 67 | MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), |
68 | MPP_MODE(6, | 68 | MPP_MODE(6, |
69 | MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), | 69 | MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), |
70 | MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), | 70 | MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), |
71 | MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), | 71 | MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), |
72 | MPP_MODE(7, | 72 | MPP_MODE(7, |
73 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), | 73 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), |
74 | MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)), | 74 | MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)), |
@@ -458,7 +458,7 @@ static int kirkwood_pinctrl_probe(struct platform_device *pdev) | |||
458 | { | 458 | { |
459 | const struct of_device_id *match = | 459 | const struct of_device_id *match = |
460 | of_match_device(kirkwood_pinctrl_of_match, &pdev->dev); | 460 | of_match_device(kirkwood_pinctrl_of_match, &pdev->dev); |
461 | pdev->dev.platform_data = match->data; | 461 | pdev->dev.platform_data = (void *)match->data; |
462 | return mvebu_pinctrl_probe(pdev); | 462 | return mvebu_pinctrl_probe(pdev); |
463 | } | 463 | } |
464 | 464 | ||
diff --git a/drivers/pinctrl/pinctrl-exynos5440.c b/drivers/pinctrl/pinctrl-exynos5440.c index de05b64f0da6..142729914c34 100644 --- a/drivers/pinctrl/pinctrl-exynos5440.c +++ b/drivers/pinctrl/pinctrl-exynos5440.c | |||
@@ -599,7 +599,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse | |||
599 | } | 599 | } |
600 | 600 | ||
601 | /* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */ | 601 | /* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */ |
602 | static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, | 602 | static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, |
603 | struct device_node *cfg_np, unsigned int **pin_list, | 603 | struct device_node *cfg_np, unsigned int **pin_list, |
604 | unsigned int *npins) | 604 | unsigned int *npins) |
605 | { | 605 | { |
@@ -630,7 +630,7 @@ static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, | |||
630 | * Parse the information about all the available pin groups and pin functions | 630 | * Parse the information about all the available pin groups and pin functions |
631 | * from device node of the pin-controller. | 631 | * from device node of the pin-controller. |
632 | */ | 632 | */ |
633 | static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, | 633 | static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev, |
634 | struct exynos5440_pinctrl_priv_data *priv) | 634 | struct exynos5440_pinctrl_priv_data *priv) |
635 | { | 635 | { |
636 | struct device *dev = &pdev->dev; | 636 | struct device *dev = &pdev->dev; |
@@ -723,7 +723,7 @@ static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, | |||
723 | } | 723 | } |
724 | 724 | ||
725 | /* register the pinctrl interface with the pinctrl subsystem */ | 725 | /* register the pinctrl interface with the pinctrl subsystem */ |
726 | static int __init exynos5440_pinctrl_register(struct platform_device *pdev, | 726 | static int exynos5440_pinctrl_register(struct platform_device *pdev, |
727 | struct exynos5440_pinctrl_priv_data *priv) | 727 | struct exynos5440_pinctrl_priv_data *priv) |
728 | { | 728 | { |
729 | struct device *dev = &pdev->dev; | 729 | struct device *dev = &pdev->dev; |
@@ -798,7 +798,7 @@ static int __init exynos5440_pinctrl_register(struct platform_device *pdev, | |||
798 | } | 798 | } |
799 | 799 | ||
800 | /* register the gpiolib interface with the gpiolib subsystem */ | 800 | /* register the gpiolib interface with the gpiolib subsystem */ |
801 | static int __init exynos5440_gpiolib_register(struct platform_device *pdev, | 801 | static int exynos5440_gpiolib_register(struct platform_device *pdev, |
802 | struct exynos5440_pinctrl_priv_data *priv) | 802 | struct exynos5440_pinctrl_priv_data *priv) |
803 | { | 803 | { |
804 | struct gpio_chip *gc; | 804 | struct gpio_chip *gc; |
@@ -831,7 +831,7 @@ static int __init exynos5440_gpiolib_register(struct platform_device *pdev, | |||
831 | } | 831 | } |
832 | 832 | ||
833 | /* unregister the gpiolib interface with the gpiolib subsystem */ | 833 | /* unregister the gpiolib interface with the gpiolib subsystem */ |
834 | static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev, | 834 | static int exynos5440_gpiolib_unregister(struct platform_device *pdev, |
835 | struct exynos5440_pinctrl_priv_data *priv) | 835 | struct exynos5440_pinctrl_priv_data *priv) |
836 | { | 836 | { |
837 | int ret = gpiochip_remove(priv->gc); | 837 | int ret = gpiochip_remove(priv->gc); |
diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c index dd227d21dcf2..23af9f1f9c35 100644 --- a/drivers/pinctrl/pinctrl-mxs.c +++ b/drivers/pinctrl/pinctrl-mxs.c | |||
@@ -146,7 +146,7 @@ free: | |||
146 | static void mxs_dt_free_map(struct pinctrl_dev *pctldev, | 146 | static void mxs_dt_free_map(struct pinctrl_dev *pctldev, |
147 | struct pinctrl_map *map, unsigned num_maps) | 147 | struct pinctrl_map *map, unsigned num_maps) |
148 | { | 148 | { |
149 | int i; | 149 | u32 i; |
150 | 150 | ||
151 | for (i = 0; i < num_maps; i++) { | 151 | for (i = 0; i < num_maps; i++) { |
152 | if (map[i].type == PIN_MAP_TYPE_MUX_GROUP) | 152 | if (map[i].type == PIN_MAP_TYPE_MUX_GROUP) |
@@ -203,7 +203,7 @@ static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector, | |||
203 | void __iomem *reg; | 203 | void __iomem *reg; |
204 | u8 bank, shift; | 204 | u8 bank, shift; |
205 | u16 pin; | 205 | u16 pin; |
206 | int i; | 206 | u32 i; |
207 | 207 | ||
208 | for (i = 0; i < g->npins; i++) { | 208 | for (i = 0; i < g->npins; i++) { |
209 | bank = PINID_TO_BANK(g->pins[i]); | 209 | bank = PINID_TO_BANK(g->pins[i]); |
@@ -256,7 +256,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev, | |||
256 | void __iomem *reg; | 256 | void __iomem *reg; |
257 | u8 ma, vol, pull, bank, shift; | 257 | u8 ma, vol, pull, bank, shift; |
258 | u16 pin; | 258 | u16 pin; |
259 | int i; | 259 | u32 i; |
260 | 260 | ||
261 | ma = CONFIG_TO_MA(config); | 261 | ma = CONFIG_TO_MA(config); |
262 | vol = CONFIG_TO_VOL(config); | 262 | vol = CONFIG_TO_VOL(config); |
@@ -345,8 +345,7 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev, | |||
345 | const char *propname = "fsl,pinmux-ids"; | 345 | const char *propname = "fsl,pinmux-ids"; |
346 | char *group; | 346 | char *group; |
347 | int length = strlen(np->name) + SUFFIX_LEN; | 347 | int length = strlen(np->name) + SUFFIX_LEN; |
348 | int i; | 348 | u32 val, i; |
349 | u32 val; | ||
350 | 349 | ||
351 | group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL); | 350 | group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL); |
352 | if (!group) | 351 | if (!group) |
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 1bb16ffb4e41..5767b18ebdff 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -676,7 +676,7 @@ int nmk_gpio_set_mode(int gpio, int gpio_mode) | |||
676 | } | 676 | } |
677 | EXPORT_SYMBOL(nmk_gpio_set_mode); | 677 | EXPORT_SYMBOL(nmk_gpio_set_mode); |
678 | 678 | ||
679 | static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio) | 679 | static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio) |
680 | { | 680 | { |
681 | int i; | 681 | int i; |
682 | u16 reg; | 682 | u16 reg; |
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index f6a360b86eb6..5c32e880bcb2 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #define PCS_MUX_BITS_NAME "pinctrl-single,bits" | 30 | #define PCS_MUX_BITS_NAME "pinctrl-single,bits" |
31 | #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1) | 31 | #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1) |
32 | #define PCS_OFF_DISABLED ~0U | 32 | #define PCS_OFF_DISABLED ~0U |
33 | #define PCS_MAX_GPIO_VALUES 2 | ||
34 | 33 | ||
35 | /** | 34 | /** |
36 | * struct pcs_pingroup - pingroups for a function | 35 | * struct pcs_pingroup - pingroups for a function |
@@ -78,16 +77,6 @@ struct pcs_function { | |||
78 | }; | 77 | }; |
79 | 78 | ||
80 | /** | 79 | /** |
81 | * struct pcs_gpio_range - pinctrl gpio range | ||
82 | * @range: subrange of the GPIO number space | ||
83 | * @gpio_func: gpio function value in the pinmux register | ||
84 | */ | ||
85 | struct pcs_gpio_range { | ||
86 | struct pinctrl_gpio_range range; | ||
87 | int gpio_func; | ||
88 | }; | ||
89 | |||
90 | /** | ||
91 | * struct pcs_data - wrapper for data needed by pinctrl framework | 80 | * struct pcs_data - wrapper for data needed by pinctrl framework |
92 | * @pa: pindesc array | 81 | * @pa: pindesc array |
93 | * @cur: index to current element | 82 | * @cur: index to current element |
@@ -414,26 +403,9 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector, | |||
414 | } | 403 | } |
415 | 404 | ||
416 | static int pcs_request_gpio(struct pinctrl_dev *pctldev, | 405 | static int pcs_request_gpio(struct pinctrl_dev *pctldev, |
417 | struct pinctrl_gpio_range *range, unsigned pin) | 406 | struct pinctrl_gpio_range *range, unsigned offset) |
418 | { | 407 | { |
419 | struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); | 408 | return -ENOTSUPP; |
420 | struct pcs_gpio_range *gpio = NULL; | ||
421 | int end, mux_bytes; | ||
422 | unsigned data; | ||
423 | |||
424 | gpio = container_of(range, struct pcs_gpio_range, range); | ||
425 | end = range->pin_base + range->npins - 1; | ||
426 | if (pin < range->pin_base || pin > end) { | ||
427 | dev_err(pctldev->dev, | ||
428 | "pin %d isn't in the range of %d to %d\n", | ||
429 | pin, range->pin_base, end); | ||
430 | return -EINVAL; | ||
431 | } | ||
432 | mux_bytes = pcs->width / BITS_PER_BYTE; | ||
433 | data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask; | ||
434 | data |= gpio->gpio_func; | ||
435 | pcs->write(data, pcs->base + pin * mux_bytes); | ||
436 | return 0; | ||
437 | } | 409 | } |
438 | 410 | ||
439 | static struct pinmux_ops pcs_pinmux_ops = { | 411 | static struct pinmux_ops pcs_pinmux_ops = { |
@@ -907,49 +879,6 @@ static void pcs_free_resources(struct pcs_device *pcs) | |||
907 | 879 | ||
908 | static struct of_device_id pcs_of_match[]; | 880 | static struct of_device_id pcs_of_match[]; |
909 | 881 | ||
910 | static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs) | ||
911 | { | ||
912 | struct pcs_gpio_range *gpio; | ||
913 | struct device_node *child; | ||
914 | struct resource r; | ||
915 | const char name[] = "pinctrl-single"; | ||
916 | u32 gpiores[PCS_MAX_GPIO_VALUES]; | ||
917 | int ret, i = 0, mux_bytes = 0; | ||
918 | |||
919 | for_each_child_of_node(node, child) { | ||
920 | ret = of_address_to_resource(child, 0, &r); | ||
921 | if (ret < 0) | ||
922 | continue; | ||
923 | memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES); | ||
924 | ret = of_property_read_u32_array(child, "pinctrl-single,gpio", | ||
925 | gpiores, PCS_MAX_GPIO_VALUES); | ||
926 | if (ret < 0) | ||
927 | continue; | ||
928 | gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL); | ||
929 | if (!gpio) { | ||
930 | dev_err(pcs->dev, "failed to allocate pcs gpio\n"); | ||
931 | return -ENOMEM; | ||
932 | } | ||
933 | gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name), | ||
934 | GFP_KERNEL); | ||
935 | if (!gpio->range.name) { | ||
936 | dev_err(pcs->dev, "failed to allocate range name\n"); | ||
937 | return -ENOMEM; | ||
938 | } | ||
939 | memcpy((char *)gpio->range.name, name, sizeof(name)); | ||
940 | |||
941 | gpio->range.id = i++; | ||
942 | gpio->range.base = gpiores[0]; | ||
943 | gpio->gpio_func = gpiores[1]; | ||
944 | mux_bytes = pcs->width / BITS_PER_BYTE; | ||
945 | gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes; | ||
946 | gpio->range.npins = (r.end - r.start) / mux_bytes + 1; | ||
947 | |||
948 | pinctrl_add_gpio_range(pcs->pctl, &gpio->range); | ||
949 | } | ||
950 | return 0; | ||
951 | } | ||
952 | |||
953 | static int pcs_probe(struct platform_device *pdev) | 882 | static int pcs_probe(struct platform_device *pdev) |
954 | { | 883 | { |
955 | struct device_node *np = pdev->dev.of_node; | 884 | struct device_node *np = pdev->dev.of_node; |
@@ -1046,10 +975,6 @@ static int pcs_probe(struct platform_device *pdev) | |||
1046 | goto free; | 975 | goto free; |
1047 | } | 976 | } |
1048 | 977 | ||
1049 | ret = pcs_add_gpio_range(np, pcs); | ||
1050 | if (ret < 0) | ||
1051 | goto free; | ||
1052 | |||
1053 | dev_info(pcs->dev, "%i pins at pa %p size %u\n", | 978 | dev_info(pcs->dev, "%i pins at pa %p size %u\n", |
1054 | pcs->desc.npins, pcs->base, pcs->size); | 979 | pcs->desc.npins, pcs->base, pcs->size); |
1055 | 980 | ||