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
Unified · Split
| @@ -181,7 +181,6 @@ config PINCTRL_COH901 · 180 unmodified lines | ||
| 181 | 181 | |
| 182 | 182 | config PINCTRL_SAMSUNG |
| 183 | 183 | bool |
| 184 | − depends on OF && GPIOLIB | |
| 185 | 184 | select PINMUX |
| 186 | 185 | select PINCONF |
| 187 | 186 | |
| @@ -588,7 +588,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev) · 587 unmodified lines | ||
| 588 | 588 | { |
| 589 | 589 | const struct of_device_id *match = |
| 590 | 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 | 594 | * General MPP Configuration Register is part of pdma registers. |
| @@ -66,9 +66,9 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = { · 65 unmodified lines | ||
| 66 | 66 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), |
| 67 | 67 | MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), |
| 68 | 68 | MPP_MODE(6, |
| 69 | − MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), | |
| 70 | − MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), | |
| 71 | − MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), | |
| 69 | + MPP_VAR_FUNCTION(0x1, "sysrst", "out", 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(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), | |
| 72 | 72 | MPP_MODE(7, |
| 73 | 73 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), |
| 74 | 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) · 383 unmodified lines | ||
| 458 | 458 | { |
| 459 | 459 | const struct of_device_id *match = |
| 460 | 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 | 462 | return mvebu_pinctrl_probe(pdev); |
| 463 | 463 | } |
| 464 | 464 | |
| @@ -599,7 +599,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse · 598 unmodified lines | ||
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 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 | 603 | struct device_node *cfg_np, unsigned int **pin_list, |
| 604 | 604 | unsigned int *npins) |
| 605 | 605 | { |
| @@ -630,7 +630,7 @@ static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, · 24 unmodified lines | ||
| 630 | 630 | * Parse the information about all the available pin groups and pin functions |
| 631 | 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 | 634 | struct exynos5440_pinctrl_priv_data *priv) |
| 635 | 635 | { |
| 636 | 636 | struct device *dev = &pdev->dev; |
| @@ -723,7 +723,7 @@ static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, · 86 unmodified lines | ||
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 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 | 727 | struct exynos5440_pinctrl_priv_data *priv) |
| 728 | 728 | { |
| 729 | 729 | struct device *dev = &pdev->dev; |
| @@ -798,7 +798,7 @@ static int __init exynos5440_pinctrl_register(struct platform_device *pdev, · 68 unmodified lines | ||
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 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 | 802 | struct exynos5440_pinctrl_priv_data *priv) |
| 803 | 803 | { |
| 804 | 804 | struct gpio_chip *gc; |
| @@ -831,7 +831,7 @@ static int __init exynos5440_gpiolib_register(struct platform_device *pdev, · 26 unmodified lines | ||
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 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 | 835 | struct exynos5440_pinctrl_priv_data *priv) |
| 836 | 836 | { |
| 837 | 837 | int ret = gpiochip_remove(priv->gc); |
| @@ -146,7 +146,7 @@ free: · 145 unmodified lines | ||
| 146 | 146 | static void mxs_dt_free_map(struct pinctrl_dev *pctldev, |
| 147 | 147 | struct pinctrl_map *map, unsigned num_maps) |
| 148 | 148 | { |
| 149 | − int i; | |
| 149 | + u32 i; | |
| 150 | 150 | |
| 151 | 151 | for (i = 0; i < num_maps; i++) { |
| 152 | 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, · 50 unmodified lines | ||
| 203 | 203 | void __iomem *reg; |
| 204 | 204 | u8 bank, shift; |
| 205 | 205 | u16 pin; |
| 206 | − int i; | |
| 206 | + u32 i; | |
| 207 | 207 | |
| 208 | 208 | for (i = 0; i < g->npins; i++) { |
| 209 | 209 | bank = PINID_TO_BANK(g->pins[i]); |
| @@ -256,7 +256,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev, · 46 unmodified lines | ||
| 256 | 256 | void __iomem *reg; |
| 257 | 257 | u8 ma, vol, pull, bank, shift; |
| 258 | 258 | u16 pin; |
| 259 | − int i; | |
| 259 | + u32 i; | |
| 260 | 260 | |
| 261 | 261 | ma = CONFIG_TO_MA(config); |
| 262 | 262 | vol = CONFIG_TO_VOL(config); |
| @@ -345,8 +345,7 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev, · 82 unmodified lines | ||
| 345 | 345 | const char *propname = "fsl,pinmux-ids"; |
| 346 | 346 | char *group; |
| 347 | 347 | int length = strlen(np->name) + SUFFIX_LEN; |
| 348 | − int i; | |
| 349 | − u32 val; | |
| 348 | + u32 val, i; | |
| 350 | 349 | |
| 351 | 350 | group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL); |
| 352 | 351 | if (!group) |
| @@ -676,7 +676,7 @@ int nmk_gpio_set_mode(int gpio, int gpio_mode) · 675 unmodified lines | ||
| 676 | 676 | } |
| 677 | 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 | 681 | int i; |
| 682 | 682 | u16 reg; |
| @@ -30,7 +30,6 @@ · 29 unmodified lines | ||
| 30 | 30 | #define PCS_MUX_BITS_NAME "pinctrl-single,bits" |
| 31 | 31 | #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1) |
| 32 | 32 | #define PCS_OFF_DISABLED ~0U |
| 33 | −#define PCS_MAX_GPIO_VALUES 2 | |
| 34 | 33 | |
| 35 | 34 | /** |
| 36 | 35 | * struct pcs_pingroup - pingroups for a function |
| @@ -77,16 +76,6 @@ struct pcs_function { · 40 unmodified lines | ||
| 77 | 76 | struct list_head node; |
| 78 | 77 | }; |
| 79 | 78 | |
| 80 | −/** | |
| 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 | 79 | /** |
| 91 | 80 | * struct pcs_data - wrapper for data needed by pinctrl framework |
| 92 | 81 | * @pa: pindesc array |
| @@ -414,26 +403,9 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector, · 321 unmodified lines | ||
| 414 | 403 | } |
| 415 | 404 | |
| 416 | 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); | |
| 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; | |
| 408 | + return -ENOTSUPP; | |
| 437 | 409 | } |
| 438 | 410 | |
| 439 | 411 | static struct pinmux_ops pcs_pinmux_ops = { |
| @@ -907,49 +879,6 @@ static void pcs_free_resources(struct pcs_device *pcs) · 467 unmodified lines | ||
| 907 | 879 | |
| 908 | 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 | 882 | static int pcs_probe(struct platform_device *pdev) |
| 954 | 883 | { |
| 955 | 884 | struct device_node *np = pdev->dev.of_node; |
| @@ -1046,10 +975,6 @@ static int pcs_probe(struct platform_device *pdev) · 90 unmodified lines | ||
| 1046 | 975 | goto free; |
| 1047 | 976 | } |
| 1048 | 977 | |
| 1049 | − ret = pcs_add_gpio_range(np, pcs); | |
| 1050 | − if (ret < 0) | |
| 1051 | − goto free; | |
| 1052 | − | |
| 1053 | 978 | dev_info(pcs->dev, "%i pins at pa %p size %u\n", |
| 1054 | 979 | pcs->desc.npins, pcs->base, pcs->size); |
| 1055 | 980 | |