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

Configure Feed

Select the types of activity you want to include in your feed.

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

+17 -94
-1
drivers/pinctrl/Kconfig
··· 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
+1 -1
drivers/pinctrl/mvebu/pinctrl-dove.c
··· 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.
+4 -4
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
··· 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 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
+5 -5
drivers/pinctrl/pinctrl-exynos5440.c
··· 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 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 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 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 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);
+4 -5
drivers/pinctrl/pinctrl-mxs.c
··· 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 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 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 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)
+1 -1
drivers/pinctrl/pinctrl-nomadik.c
··· 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;
+2 -77
drivers/pinctrl/pinctrl-single.c
··· 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 ··· 74 75 const char **pgnames; 75 76 int npgnames; 76 77 struct list_head node; 77 - }; 78 - 79 - /** 80 - * struct pcs_gpio_range - pinctrl gpio range 81 - * @range: subrange of the GPIO number space 82 - * @gpio_func: gpio function value in the pinmux register 83 - */ 84 - struct pcs_gpio_range { 85 - struct pinctrl_gpio_range range; 86 - int gpio_func; 87 78 }; 88 79 89 80 /** ··· 403 414 } 404 415 405 416 static int pcs_request_gpio(struct pinctrl_dev *pctldev, 406 - struct pinctrl_gpio_range *range, unsigned pin) 417 + struct pinctrl_gpio_range *range, unsigned offset) 407 418 { 408 - struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); 409 - struct pcs_gpio_range *gpio = NULL; 410 - int end, mux_bytes; 411 - unsigned data; 412 - 413 - gpio = container_of(range, struct pcs_gpio_range, range); 414 - end = range->pin_base + range->npins - 1; 415 - if (pin < range->pin_base || pin > end) { 416 - dev_err(pctldev->dev, 417 - "pin %d isn't in the range of %d to %d\n", 418 - pin, range->pin_base, end); 419 - return -EINVAL; 420 - } 421 - mux_bytes = pcs->width / BITS_PER_BYTE; 422 - data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask; 423 - data |= gpio->gpio_func; 424 - pcs->write(data, pcs->base + pin * mux_bytes); 425 - return 0; 419 + return -ENOTSUPP; 426 420 } 427 421 428 422 static struct pinmux_ops pcs_pinmux_ops = { ··· 879 907 880 908 static struct of_device_id pcs_of_match[]; 881 909 882 - static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs) 883 - { 884 - struct pcs_gpio_range *gpio; 885 - struct device_node *child; 886 - struct resource r; 887 - const char name[] = "pinctrl-single"; 888 - u32 gpiores[PCS_MAX_GPIO_VALUES]; 889 - int ret, i = 0, mux_bytes = 0; 890 - 891 - for_each_child_of_node(node, child) { 892 - ret = of_address_to_resource(child, 0, &r); 893 - if (ret < 0) 894 - continue; 895 - memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES); 896 - ret = of_property_read_u32_array(child, "pinctrl-single,gpio", 897 - gpiores, PCS_MAX_GPIO_VALUES); 898 - if (ret < 0) 899 - continue; 900 - gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL); 901 - if (!gpio) { 902 - dev_err(pcs->dev, "failed to allocate pcs gpio\n"); 903 - return -ENOMEM; 904 - } 905 - gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name), 906 - GFP_KERNEL); 907 - if (!gpio->range.name) { 908 - dev_err(pcs->dev, "failed to allocate range name\n"); 909 - return -ENOMEM; 910 - } 911 - memcpy((char *)gpio->range.name, name, sizeof(name)); 912 - 913 - gpio->range.id = i++; 914 - gpio->range.base = gpiores[0]; 915 - gpio->gpio_func = gpiores[1]; 916 - mux_bytes = pcs->width / BITS_PER_BYTE; 917 - gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes; 918 - gpio->range.npins = (r.end - r.start) / mux_bytes + 1; 919 - 920 - pinctrl_add_gpio_range(pcs->pctl, &gpio->range); 921 - } 922 - return 0; 923 - } 924 - 925 910 static int pcs_probe(struct platform_device *pdev) 926 911 { 927 912 struct device_node *np = pdev->dev.of_node; ··· 974 1045 ret = -EINVAL; 975 1046 goto free; 976 1047 } 977 - 978 - ret = pcs_add_gpio_range(np, pcs); 979 - if (ret < 0) 980 - goto free; 981 1048 982 1049 dev_info(pcs->dev, "%i pins at pa %p size %u\n", 983 1050 pcs->desc.npins, pcs->base, pcs->size);