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

pinctrl: get rid of all platform data for coh901

This deletes the dependency on any platform data for
the COH901 pin controller. There is only one user in the
kernel, and if we at some point want to support more
variants, they shall provide their variant info through
the device tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+10 -47
+1 -11
arch/arm/mach-u300/core.c
··· 12 12 #include <linux/pinctrl/machine.h> 13 13 #include <linux/pinctrl/pinconf-generic.h> 14 14 #include <linux/platform_data/clk-u300.h> 15 - #include <linux/platform_data/pinctrl-coh901.h> 16 15 #include <linux/irqchip.h> 17 16 #include <linux/of_address.h> 18 17 #include <linux/of_platform.h> ··· 193 194 iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc)); 194 195 } 195 196 196 - /* 197 - * The different variants have a few different versions of the 198 - * GPIO block, with different number of ports. 199 - */ 200 - static struct u300_gpio_platform u300_gpio_plat = { 201 - .ports = 7, 202 - .gpio_base = 0, 203 - }; 204 - 205 197 static unsigned long pin_pullup_conf[] = { 206 198 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1), 207 199 }; ··· 322 332 OF_DEV_AUXDATA("stericsson,pinctrl-u300", U300_SYSCON_BASE, 323 333 "pinctrl-u300", NULL), 324 334 OF_DEV_AUXDATA("stericsson,gpio-coh901", U300_GPIO_BASE, 325 - "u300-gpio", &u300_gpio_plat), 335 + "u300-gpio", NULL), 326 336 OF_DEV_AUXDATA("stericsson,coh901327", U300_WDOG_BASE, 327 337 "coh901327_wdog", NULL), 328 338 OF_DEV_AUXDATA("stericsson,coh901331", U300_RTC_BASE,
+9 -14
drivers/pinctrl/pinctrl-coh901.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/pinctrl/consumer.h> 24 24 #include <linux/pinctrl/pinconf-generic.h> 25 - #include <linux/platform_data/pinctrl-coh901.h> 26 25 #include "pinctrl-coh901.h" 27 26 28 27 #define U300_GPIO_PORT_STRIDE (0x30) ··· 57 58 #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) 58 59 59 60 /* 8 bits per port, no version has more than 7 ports */ 61 + #define U300_GPIO_NUM_PORTS 7 60 62 #define U300_GPIO_PINS_PER_PORT 8 61 - #define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * 7) 63 + #define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * U300_GPIO_NUM_PORTS) 62 64 63 65 struct u300_gpio { 64 66 struct gpio_chip chip; ··· 111 111 int outval; 112 112 }; 113 113 114 - /* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */ 115 - #define BS335_GPIO_NUM_PORTS 7 116 - 117 114 #define U300_FLOATING_INPUT { \ 118 115 .bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \ 119 116 .output = false, \ ··· 133 136 134 137 /* Initial configuration */ 135 138 static const struct __initconst u300_gpio_confdata 136 - bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { 139 + bs335_gpio_config[U300_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { 137 140 /* Port 0, pins 0-7 */ 138 141 { 139 142 U300_FLOATING_INPUT, ··· 627 630 } 628 631 } 629 632 630 - static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio, 631 - struct u300_gpio_platform *plat) 633 + static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio) 632 634 { 633 635 int i, j; 634 636 635 637 /* Write default config and values to all pins */ 636 - for (i = 0; i < plat->ports; i++) { 638 + for (i = 0; i < U300_GPIO_NUM_PORTS; i++) { 637 639 for (j = 0; j < 8; j++) { 638 640 const struct u300_gpio_confdata *conf; 639 641 int offset = (i*8) + j; ··· 689 693 690 694 static int __init u300_gpio_probe(struct platform_device *pdev) 691 695 { 692 - struct u300_gpio_platform *plat = dev_get_platdata(&pdev->dev); 693 696 struct u300_gpio *gpio; 694 697 struct resource *memres; 695 698 int err = 0; ··· 702 707 return -ENOMEM; 703 708 704 709 gpio->chip = u300_gpio_chip; 705 - gpio->chip.ngpio = plat->ports * U300_GPIO_PINS_PER_PORT; 710 + gpio->chip.ngpio = U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT; 706 711 gpio->chip.dev = &pdev->dev; 707 - gpio->chip.base = plat->gpio_base; 712 + gpio->chip.base = 0; 708 713 gpio->dev = &pdev->dev; 709 714 710 715 memres = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 750 755 ((val & 0x0000FE00) >> 9) * 8); 751 756 writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE, 752 757 gpio->base + U300_GPIO_CR); 753 - u300_gpio_init_coh901571(gpio, plat); 758 + u300_gpio_init_coh901571(gpio); 754 759 755 760 /* Add each port with its IRQ separately */ 756 761 INIT_LIST_HEAD(&gpio->port_list); 757 - for (portno = 0 ; portno < plat->ports; portno++) { 762 + for (portno = 0 ; portno < U300_GPIO_NUM_PORTS; portno++) { 758 763 struct u300_gpio_port *port = 759 764 kmalloc(sizeof(struct u300_gpio_port), GFP_KERNEL); 760 765
-22
include/linux/platform_data/pinctrl-coh901.h
··· 1 - /* 2 - * Copyright (C) 2007-2012 ST-Ericsson AB 3 - * License terms: GNU General Public License (GPL) version 2 4 - * GPIO block resgister definitions and inline macros for 5 - * U300 GPIO COH 901 335 or COH 901 571/3 6 - * Author: Linus Walleij <linus.walleij@stericsson.com> 7 - */ 8 - 9 - #ifndef __MACH_U300_GPIO_U300_H 10 - #define __MACH_U300_GPIO_U300_H 11 - 12 - /** 13 - * struct u300_gpio_platform - U300 GPIO platform data 14 - * @ports: number of GPIO block ports 15 - * @gpio_base: first GPIO number for this block (use a free range) 16 - */ 17 - struct u300_gpio_platform { 18 - u8 ports; 19 - int gpio_base; 20 - }; 21 - 22 - #endif /* __MACH_U300_GPIO_U300_H */