History

Merge tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio into soc/arm

This removes all usage of global GPIO numbers from arch/arm/mach-omap[12]. The patches have been reviewed and tested by everyone who showed interest which was one person that tested on OSK1 and Nokia 770, and we smoked out the bugs and also addressed all review comments. Any remaining problems can certainly be fixed in-tree. * tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: ARM/musb: omap2: Remove global GPIO numbers from TUSB6010 ARM: omap2: Rewrite WLAN quirk to use GPIO descriptors ARM: omap2: Get USB hub reset GPIO from descriptor ARM/gpio: Push OMAP2 quirk down into TWL4030 driver ARM: omap1: Exorcise the legacy GPIO header ARM: omap1: Make serial wakeup GPIOs use descriptors ARM: omap1: Fix up the Nokia 770 board device IRQs ARM/mmc: Convert old mmci-omap to GPIO descriptors Input: ads7846 - Convert to use software nodes ARM: omap1: Remove reliance on GPIO numbers from SX1 ARM: omap1: Remove reliance on GPIO numbers from PalmTE ARM: omap1: Drop header on AMS Delta ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1

Arnd Bergmann committed 3 years ago

Commit 0b47a622 parents 88813f0 8e0285a32 files · +636 −511Browse files

Unified · Split

32 files
  1. arch/arm/mach-omap1/board-ams-delta.c +0 −1
  2. arch/arm/mach-omap1/board-nokia770.c +130 −77
  3. arch/arm/mach-omap1/board-osk.c +102 −44
  4. arch/arm/mach-omap1/board-palmte.c +31 −20
  5. arch/arm/mach-omap1/board-sx1-mmc.c +0 −1
  6. arch/arm/mach-omap1/board-sx1.c +33 −7
  7. arch/arm/mach-omap1/devices.c +0 −1
  8. arch/arm/mach-omap1/gpio15xx.c +0 −1
  9. arch/arm/mach-omap1/gpio16xx.c +0 −1
  10. arch/arm/mach-omap1/irq.c +0 −1
  11. arch/arm/mach-omap1/serial.c +15 −15
  12. arch/arm/mach-omap2/board-n8x0.c +44 −112
  13. arch/arm/mach-omap2/omap_device.c +0 −1
  14. arch/arm/mach-omap2/pdata-quirks.c +66 −66
  15. arch/arm/mach-omap2/usb-tusb6010.c +4 −16
  16. arch/arm/mach-omap2/usb-tusb6010.h +12 −0
  17. arch/arm/mach-pxa/spitz.c +10 −1
  18. arch/mips/alchemy/devboards/db1000.c +10 −1
  19. drivers/gpio/gpio-twl4030.c +36 −16
  20. drivers/input/touchscreen/ads7846.c +41 −72
  21. drivers/mfd/tps65010.c +5 −9
  22. drivers/mmc/host/omap.c +44 −2
  23. drivers/usb/musb/musb_core.c +0 −1
  24. drivers/usb/musb/musb_core.h +0 −2
  25. drivers/usb/musb/tusb6010.c +39 −14
  26. drivers/video/fbdev/omap/lcd_mipid.c +10 −0
  27. include/linux/mfd/tps65010.h +4 −7
  28. include/linux/mfd/twl.h +0 −3
  29. include/linux/platform_data/lcd-mipid.h +0 −2
  30. include/linux/platform_data/mmc-omap.h +0 −2
  31. include/linux/spi/ads7846.h +0 −2
  32. include/linux/usb/musb.h +0 −13
arch/arm/mach-omap1/board-ams-delta.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
11#include <linux/gpio/driver.h>11#include <linux/gpio/driver.h>
12#include <linux/gpio/machine.h>12#include <linux/gpio/machine.h>
13#include <linux/gpio/consumer.h>13#include <linux/gpio/consumer.h>
14#include <linux/gpio.h>
15#include <linux/kernel.h>14#include <linux/kernel.h>
16#include <linux/init.h>15#include <linux/init.h>
17#include <linux/input.h>16#include <linux/input.h>
arch/arm/mach-omap1/board-nokia770.c+130−77
@@ -6,17 +6,18 @@ · 5 unmodified lines
6 */6 */
7#include <linux/clkdev.h>7#include <linux/clkdev.h>
8#include <linux/irq.h>8#include <linux/irq.h>
9#include <linux/gpio.h>9#include <linux/gpio/consumer.h>
10#include <linux/gpio/machine.h>10#include <linux/gpio/machine.h>
11#include <linux/gpio/property.h>
11#include <linux/kernel.h>12#include <linux/kernel.h>
12#include <linux/init.h>13#include <linux/init.h>
13#include <linux/mutex.h>14#include <linux/mutex.h>
14#include <linux/platform_device.h>15#include <linux/platform_device.h>
16#include <linux/property.h>
15#include <linux/input.h>17#include <linux/input.h>
16#include <linux/omapfb.h>18#include <linux/omapfb.h>
17 19
18#include <linux/spi/spi.h>20#include <linux/spi/spi.h>
19#include <linux/spi/ads7846.h>
20#include <linux/workqueue.h>21#include <linux/workqueue.h>
21#include <linux/delay.h>22#include <linux/delay.h>
22 23
@@ -35,6 +36,25 @@ · 12 unmodified lines
35#include "clock.h"36#include "clock.h"
36#include "mmc.h"37#include "mmc.h"
37 38
39static const struct software_node nokia770_mpuio_gpiochip_node = {
40 .name = "mpuio",
41};
42
43static const struct software_node nokia770_gpiochip1_node = {
44 .name = "gpio-0-15",
45};
46
47static const struct software_node nokia770_gpiochip2_node = {
48 .name = "gpio-16-31",
49};
50
51static const struct software_node *nokia770_gpiochip_nodes[] = {
52 &nokia770_mpuio_gpiochip_node,
53 &nokia770_gpiochip1_node,
54 &nokia770_gpiochip2_node,
55 NULL
56};
57
38#define ADS7846_PENDOWN_GPIO 1558#define ADS7846_PENDOWN_GPIO 15
39 59
40static const unsigned int nokia770_keymap[] = {60static const unsigned int nokia770_keymap[] = {
@@ -85,40 +105,47 @@ static struct platform_device *nokia770_devices[] __initdata = { · 44 unmodified lines
85 &nokia770_kp_device,105 &nokia770_kp_device,
86};106};
87 107
88static void mipid_shutdown(struct mipid_platform_data *pdata)108static struct mipid_platform_data nokia770_mipid_platform_data = { };
89{
90 if (pdata->nreset_gpio != -1) {
91 printk(KERN_INFO "shutdown LCD\n");
92 gpio_set_value(pdata->nreset_gpio, 0);
93 msleep(120);
94 }
95}
96
97static struct mipid_platform_data nokia770_mipid_platform_data = {
98 .shutdown = mipid_shutdown,
99};
100 109
101static const struct omap_lcd_config nokia770_lcd_config __initconst = {110static const struct omap_lcd_config nokia770_lcd_config __initconst = {
102 .ctrl_name = "hwa742",111 .ctrl_name = "hwa742",
103};112};
104 113
114static const struct property_entry nokia770_mipid_props[] = {
115 PROPERTY_ENTRY_GPIO("reset-gpios", &nokia770_gpiochip1_node,
116 13, GPIO_ACTIVE_LOW),
117 { }
118};
119
120static const struct software_node nokia770_mipid_swnode = {
121 .name = "lcd_mipid",
122 .properties = nokia770_mipid_props,
123};
124
105static void __init mipid_dev_init(void)125static void __init mipid_dev_init(void)
106{126{
107 nokia770_mipid_platform_data.nreset_gpio = 13;
108 nokia770_mipid_platform_data.data_lines = 16;127 nokia770_mipid_platform_data.data_lines = 16;
109 128
110 omapfb_set_lcd_config(&nokia770_lcd_config);129 omapfb_set_lcd_config(&nokia770_lcd_config);
111}130}
112 131
113static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {132static const struct property_entry nokia770_ads7846_props[] = {
114 .x_max = 0x0fff,133 PROPERTY_ENTRY_STRING("compatible", "ti,ads7846"),
115 .y_max = 0x0fff,134 PROPERTY_ENTRY_U32("touchscreen-size-x", 4096),
116 .x_plate_ohms = 180,135 PROPERTY_ENTRY_U32("touchscreen-size-y", 4096),
117 .pressure_max = 255,136 PROPERTY_ENTRY_U32("touchscreen-max-pressure", 256),
118 .debounce_max = 10,137 PROPERTY_ENTRY_U32("touchscreen-average-samples", 10),
119 .debounce_tol = 3,138 PROPERTY_ENTRY_U16("ti,x-plate-ohms", 180),
120 .debounce_rep = 1,139 PROPERTY_ENTRY_U16("ti,debounce-tol", 3),
121 .gpio_pendown = ADS7846_PENDOWN_GPIO,140 PROPERTY_ENTRY_U16("ti,debounce-rep", 1),
141 PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node,
142 ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_LOW),
143 { }
144};
145
146static const struct software_node nokia770_ads7846_swnode = {
147 .name = "ads7846",
148 .properties = nokia770_ads7846_props,
122};149};
123 150
124static struct spi_board_info nokia770_spi_board_info[] __initdata = {151static struct spi_board_info nokia770_spi_board_info[] __initdata = {
@@ -128,13 +155,14 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = { · 3 unmodified lines
128 .chip_select = 3,155 .chip_select = 3,
129 .max_speed_hz = 12000000,156 .max_speed_hz = 12000000,
130 .platform_data = &nokia770_mipid_platform_data,157 .platform_data = &nokia770_mipid_platform_data,
158 .swnode = &nokia770_mipid_swnode,
131 },159 },
132 [1] = {160 [1] = {
133 .modalias = "ads7846",161 .modalias = "ads7846",
134 .bus_num = 2,162 .bus_num = 2,
135 .chip_select = 0,163 .chip_select = 0,
136 .max_speed_hz = 2500000,164 .max_speed_hz = 2500000,
137 .platform_data = &nokia770_ads7846_platform_data,165 .swnode = &nokia770_ads7846_swnode,
138 },166 },
139};167};
140 168
@@ -156,27 +184,23 @@ static struct omap_usb_config nokia770_usb_config __initdata = { · 15 unmodified lines
156 184
157#if IS_ENABLED(CONFIG_MMC_OMAP)185#if IS_ENABLED(CONFIG_MMC_OMAP)
158 186
159#define NOKIA770_GPIO_MMC_POWER 41187static struct gpiod_lookup_table nokia770_mmc_gpio_table = {
160#define NOKIA770_GPIO_MMC_SWITCH 23188 .dev_id = "mmci-omap.1",
161 189 .table = {
162static int nokia770_mmc_set_power(struct device *dev, int slot, int power_on,190 /* Slot index 0, VSD power, GPIO 41 */
163 int vdd)191 GPIO_LOOKUP_IDX("gpio-32-47", 9,
164{192 "vsd", 0, GPIO_ACTIVE_HIGH),
165 gpio_set_value(NOKIA770_GPIO_MMC_POWER, power_on);193 /* Slot index 0, switch, GPIO 23 */
166 return 0;194 GPIO_LOOKUP_IDX("gpio-16-31", 7,
167}195 "cover", 0, GPIO_ACTIVE_HIGH),
168 196 { }
169static int nokia770_mmc_get_cover_state(struct device *dev, int slot)197 },
170{198};
171 return gpio_get_value(NOKIA770_GPIO_MMC_SWITCH);
172}
173 199
174static struct omap_mmc_platform_data nokia770_mmc2_data = {200static struct omap_mmc_platform_data nokia770_mmc2_data = {
175 .nr_slots = 1,201 .nr_slots = 1,
176 .max_freq = 12000000,202 .max_freq = 12000000,
177 .slots[0] = {203 .slots[0] = {
178 .set_power = nokia770_mmc_set_power,
179 .get_cover_state = nokia770_mmc_get_cover_state,
180 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,204 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
181 .name = "mmcblk",205 .name = "mmcblk",
182 },206 },
@@ -186,20 +210,7 @@ static struct omap_mmc_platform_data *nokia770_mmc_data[OMAP16XX_NR_MMC]; · 3 unmodified lines
186 210
187static void __init nokia770_mmc_init(void)211static void __init nokia770_mmc_init(void)
188{212{
189 int ret;213 gpiod_add_lookup_table(&nokia770_mmc_gpio_table);
190
191 ret = gpio_request(NOKIA770_GPIO_MMC_POWER, "MMC power");
192 if (ret < 0)
193 return;
194 gpio_direction_output(NOKIA770_GPIO_MMC_POWER, 0);
195
196 ret = gpio_request(NOKIA770_GPIO_MMC_SWITCH, "MMC cover");
197 if (ret < 0) {
198 gpio_free(NOKIA770_GPIO_MMC_POWER);
199 return;
200 }
201 gpio_direction_input(NOKIA770_GPIO_MMC_SWITCH);
202
203 /* Only the second MMC controller is used */214 /* Only the second MMC controller is used */
204 nokia770_mmc_data[1] = &nokia770_mmc2_data;215 nokia770_mmc_data[1] = &nokia770_mmc2_data;
205 omap1_init_mmc(nokia770_mmc_data, OMAP16XX_NR_MMC);216 omap1_init_mmc(nokia770_mmc_data, OMAP16XX_NR_MMC);
@@ -212,14 +223,16 @@ static inline void nokia770_mmc_init(void) · 6 unmodified lines
212#endif223#endif
213 224
214#if IS_ENABLED(CONFIG_I2C_CBUS_GPIO)225#if IS_ENABLED(CONFIG_I2C_CBUS_GPIO)
215static struct gpiod_lookup_table nokia770_cbus_gpio_table = {226
216 .dev_id = "i2c-cbus-gpio.2",227static const struct software_node_ref_args nokia770_cbus_gpio_refs[] = {
217 .table = {228 SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 9, 0),
218 GPIO_LOOKUP_IDX("mpuio", 9, NULL, 0, 0), /* clk */229 SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 10, 0),
219 GPIO_LOOKUP_IDX("mpuio", 10, NULL, 1, 0), /* dat */230 SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 11, 0),
220 GPIO_LOOKUP_IDX("mpuio", 11, NULL, 2, 0), /* sel */231};
221 { },232
222 },233static const struct property_entry nokia770_cbus_props[] = {
234 PROPERTY_ENTRY_REF_ARRAY("gpios", nokia770_cbus_gpio_refs),
235 { }
223};236};
224 237
225static struct platform_device nokia770_cbus_device = {238static struct platform_device nokia770_cbus_device = {
@@ -238,22 +251,29 @@ static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = { · 12 unmodified lines
238 251
239static void __init nokia770_cbus_init(void)252static void __init nokia770_cbus_init(void)
240{253{
241 const int retu_irq_gpio = 62;254 struct gpio_desc *d;
242 const int tahvo_irq_gpio = 40;255 int irq;
243 256
244 if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ"))257 d = gpiod_get(NULL, "retu_irq", GPIOD_IN);
245 return;258 if (IS_ERR(d)) {
246 if (gpio_request_one(tahvo_irq_gpio, GPIOF_IN, "Tahvo IRQ")) {259 pr_err("Unable to get CBUS Retu IRQ GPIO descriptor\n");
247 gpio_free(retu_irq_gpio);260 } else {
248 return;261 irq = gpiod_to_irq(d);
262 irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
263 nokia770_i2c_board_info_2[0].irq = irq;
264 }
265 d = gpiod_get(NULL, "tahvo_irq", GPIOD_IN);
266 if (IS_ERR(d)) {
267 pr_err("Unable to get CBUS Tahvo IRQ GPIO descriptor\n");
268 } else {
269 irq = gpiod_to_irq(d);
270 irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
271 nokia770_i2c_board_info_2[1].irq = irq;
249 }272 }
250 irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING);
251 irq_set_irq_type(gpio_to_irq(tahvo_irq_gpio), IRQ_TYPE_EDGE_RISING);
252 nokia770_i2c_board_info_2[0].irq = gpio_to_irq(retu_irq_gpio);
253 nokia770_i2c_board_info_2[1].irq = gpio_to_irq(tahvo_irq_gpio);
254 i2c_register_board_info(2, nokia770_i2c_board_info_2,273 i2c_register_board_info(2, nokia770_i2c_board_info_2,
255 ARRAY_SIZE(nokia770_i2c_board_info_2));274 ARRAY_SIZE(nokia770_i2c_board_info_2));
256 gpiod_add_lookup_table(&nokia770_cbus_gpio_table);275 device_create_managed_software_node(&nokia770_cbus_device.dev,
276 nokia770_cbus_props, NULL);
257 platform_device_register(&nokia770_cbus_device);277 platform_device_register(&nokia770_cbus_device);
258}278}
259#else /* CONFIG_I2C_CBUS_GPIO */279#else /* CONFIG_I2C_CBUS_GPIO */
@@ -262,8 +282,33 @@ static void __init nokia770_cbus_init(void) · 2 unmodified lines
262}282}
263#endif /* CONFIG_I2C_CBUS_GPIO */283#endif /* CONFIG_I2C_CBUS_GPIO */
264 284
285static struct gpiod_lookup_table nokia770_irq_gpio_table = {
286 .dev_id = NULL,
287 .table = {
288 /* GPIO used by SPI device 1 */
289 GPIO_LOOKUP("gpio-0-15", 15, "ads7846_irq",
290 GPIO_ACTIVE_HIGH),
291 /* GPIO used for retu IRQ */
292 GPIO_LOOKUP("gpio-48-63", 15, "retu_irq",
293 GPIO_ACTIVE_HIGH),
294 /* GPIO used for tahvo IRQ */
295 GPIO_LOOKUP("gpio-32-47", 8, "tahvo_irq",
296 GPIO_ACTIVE_HIGH),
297 /* GPIOs used by serial wakeup IRQs */
298 GPIO_LOOKUP_IDX("gpio-32-47", 5, "wakeup", 0,
299 GPIO_ACTIVE_HIGH),
300 GPIO_LOOKUP_IDX("gpio-16-31", 2, "wakeup", 1,
301 GPIO_ACTIVE_HIGH),
302 GPIO_LOOKUP_IDX("gpio-48-63", 1, "wakeup", 2,
303 GPIO_ACTIVE_HIGH),
304 { }
305 },
306};
307
265static void __init omap_nokia770_init(void)308static void __init omap_nokia770_init(void)
266{309{
310 struct gpio_desc *d;
311
267 /* On Nokia 770, the SleepX signal is masked with an312 /* On Nokia 770, the SleepX signal is masked with an
268 * MPUIO line by default. It has to be unmasked for it313 * MPUIO line by default. It has to be unmasked for it
269 * to become functional */314 * to become functional */
@@ -273,8 +318,16 @@ static void __init omap_nokia770_init(void) · 3 unmodified lines
273 /* Unmask SleepX signal */318 /* Unmask SleepX signal */
274 omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);319 omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
275 320
321 software_node_register_node_group(nokia770_gpiochip_nodes);
276 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));322 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
277 nokia770_spi_board_info[1].irq = gpio_to_irq(15);323
324 gpiod_add_lookup_table(&nokia770_irq_gpio_table);
325 d = gpiod_get(NULL, "ads7846_irq", GPIOD_IN);
326 if (IS_ERR(d))
327 pr_err("Unable to get ADS7846 IRQ GPIO descriptor\n");
328 else
329 nokia770_spi_board_info[1].irq = gpiod_to_irq(d);
330
278 spi_register_board_info(nokia770_spi_board_info,331 spi_register_board_info(nokia770_spi_board_info,
279 ARRAY_SIZE(nokia770_spi_board_info));332 ARRAY_SIZE(nokia770_spi_board_info));
280 omap_serial_init();333 omap_serial_init();
arch/arm/mach-omap1/board-osk.c+102−44
@@ -25,7 +25,8 @@ · 24 unmodified lines
25 * with this program; if not, write to the Free Software Foundation, Inc.,25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */27 */
28#include <linux/gpio.h>28#include <linux/gpio/consumer.h>
29#include <linux/gpio/driver.h>
29#include <linux/gpio/machine.h>30#include <linux/gpio/machine.h>
30#include <linux/kernel.h>31#include <linux/kernel.h>
31#include <linux/init.h>32#include <linux/init.h>
@@ -64,13 +65,12 @@ · 32 unmodified lines
64/* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with65/* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
65 * alternate pin configurations for hardware-controlled blinking.66 * alternate pin configurations for hardware-controlled blinking.
66 */67 */
67#define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)68#define OSK_TPS_GPIO_USB_PWR_EN 0
68# define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)69#define OSK_TPS_GPIO_LED_D3 1
69# define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)70#define OSK_TPS_GPIO_LAN_RESET 2
70# define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)71#define OSK_TPS_GPIO_DSP_PWR_EN 3
71# define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)72#define OSK_TPS_GPIO_LED_D9 4
72# define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)73#define OSK_TPS_GPIO_LED_D2 5
73# define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
74 74
75static struct mtd_partition osk_partitions[] = {75static struct mtd_partition osk_partitions[] = {
76 /* bootloader (U-Boot, etc) in first sector */76 /* bootloader (U-Boot, etc) in first sector */
@@ -174,11 +174,20 @@ static const struct gpio_led tps_leds[] = { · 97 unmodified lines
174 /* NOTE: D9 and D2 have hardware blink support.174 /* NOTE: D9 and D2 have hardware blink support.
175 * Also, D9 requires non-battery power.175 * Also, D9 requires non-battery power.
176 */176 */
177 { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9",177 { .name = "d9", .default_trigger = "disk-activity", },
178 .default_trigger = "disk-activity", },178 { .name = "d2", },
179 { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", },179 { .name = "d3", .default_trigger = "heartbeat", },
180 { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1,180};
181 .default_trigger = "heartbeat", },181
182static struct gpiod_lookup_table tps_leds_gpio_table = {
183 .dev_id = "leds-gpio",
184 .table = {
185 /* Use local offsets on TPS65010 */
186 GPIO_LOOKUP_IDX("tps65010", OSK_TPS_GPIO_LED_D9, NULL, 0, GPIO_ACTIVE_HIGH),
187 GPIO_LOOKUP_IDX("tps65010", OSK_TPS_GPIO_LED_D2, NULL, 1, GPIO_ACTIVE_HIGH),
188 GPIO_LOOKUP_IDX("tps65010", OSK_TPS_GPIO_LED_D3, NULL, 2, GPIO_ACTIVE_LOW),
189 { }
190 },
182};191};
183 192
184static struct gpio_led_platform_data tps_leds_data = {193static struct gpio_led_platform_data tps_leds_data = {
@@ -192,29 +201,34 @@ static struct platform_device osk5912_tps_leds = { · 7 unmodified lines
192 .dev.platform_data = &tps_leds_data,201 .dev.platform_data = &tps_leds_data,
193};202};
194 203
195static int osk_tps_setup(struct i2c_client *client, void *context)204/* The board just hold these GPIOs hogged from setup to teardown */
205static struct gpio_desc *eth_reset;
206static struct gpio_desc *vdd_dsp;
207
208static int osk_tps_setup(struct i2c_client *client, struct gpio_chip *gc)
196{209{
210 struct gpio_desc *d;
197 if (!IS_BUILTIN(CONFIG_TPS65010))211 if (!IS_BUILTIN(CONFIG_TPS65010))
198 return -ENOSYS;212 return -ENOSYS;
199 213
200 /* Set GPIO 1 HIGH to disable VBUS power supply;214 /* Set GPIO 1 HIGH to disable VBUS power supply;
201 * OHCI driver powers it up/down as needed.215 * OHCI driver powers it up/down as needed.
202 */216 */
203 gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en");217 d = gpiochip_request_own_desc(gc, OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en",
204 gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1);218 GPIO_ACTIVE_HIGH, GPIOD_OUT_HIGH);
205 /* Free the GPIO again as the driver will request it */219 /* Free the GPIO again as the driver will request it */
206 gpio_free(OSK_TPS_GPIO_USB_PWR_EN);220 gpiochip_free_own_desc(d);
207 221
208 /* Set GPIO 2 high so LED D3 is off by default */222 /* Set GPIO 2 high so LED D3 is off by default */
209 tps65010_set_gpio_out_value(GPIO2, HIGH);223 tps65010_set_gpio_out_value(GPIO2, HIGH);
210 224
211 /* Set GPIO 3 low to take ethernet out of reset */225 /* Set GPIO 3 low to take ethernet out of reset */
212 gpio_request(OSK_TPS_GPIO_LAN_RESET, "smc_reset");226 eth_reset = gpiochip_request_own_desc(gc, OSK_TPS_GPIO_LAN_RESET, "smc_reset",
213 gpio_direction_output(OSK_TPS_GPIO_LAN_RESET, 0);227 GPIO_ACTIVE_HIGH, GPIOD_OUT_LOW);
214 228
215 /* GPIO4 is VDD_DSP */229 /* GPIO4 is VDD_DSP */
216 gpio_request(OSK_TPS_GPIO_DSP_PWR_EN, "dsp_power");230 vdd_dsp = gpiochip_request_own_desc(gc, OSK_TPS_GPIO_DSP_PWR_EN, "dsp_power",
217 gpio_direction_output(OSK_TPS_GPIO_DSP_PWR_EN, 1);231 GPIO_ACTIVE_HIGH, GPIOD_OUT_HIGH);
218 /* REVISIT if DSP support isn't configured, power it off ... */232 /* REVISIT if DSP support isn't configured, power it off ... */
219 233
220 /* Let LED1 (D9) blink; leds-gpio may override it */234 /* Let LED1 (D9) blink; leds-gpio may override it */
@@ -232,15 +246,22 @@ static int osk_tps_setup(struct i2c_client *client, void *context) · 11 unmodified lines
232 246
233 /* register these three LEDs */247 /* register these three LEDs */
234 osk5912_tps_leds.dev.parent = &client->dev;248 osk5912_tps_leds.dev.parent = &client->dev;
249 gpiod_add_lookup_table(&tps_leds_gpio_table);
235 platform_device_register(&osk5912_tps_leds);250 platform_device_register(&osk5912_tps_leds);
236 251
237 return 0;252 return 0;
238}253}
239 254
255static void osk_tps_teardown(struct i2c_client *client, struct gpio_chip *gc)
256{
257 gpiochip_free_own_desc(eth_reset);
258 gpiochip_free_own_desc(vdd_dsp);
259}
260
240static struct tps65010_board tps_board = {261static struct tps65010_board tps_board = {
241 .base = OSK_TPS_GPIO_BASE,
242 .outmask = 0x0f,262 .outmask = 0x0f,
243 .setup = osk_tps_setup,263 .setup = osk_tps_setup,
264 .teardown = osk_tps_teardown,
244};265};
245 266
246static struct i2c_board_info __initdata osk_i2c_board_info[] = {267static struct i2c_board_info __initdata osk_i2c_board_info[] = {
@@ -263,11 +284,6 @@ static void __init osk_init_smc91x(void) · 16 unmodified lines
263{284{
264 u32 l;285 u32 l;
265 286
266 if ((gpio_request(0, "smc_irq")) < 0) {
267 printk("Error requesting gpio 0 for smc91x irq\n");
268 return;
269 }
270
271 /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */287 /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
272 l = omap_readl(EMIFS_CCS(1));288 l = omap_readl(EMIFS_CCS(1));
273 l |= 0x3;289 l |= 0x3;
@@ -279,10 +295,6 @@ static void __init osk_init_cf(int seg) · 5 unmodified lines
279 struct resource *res = &osk5912_cf_resources[1];295 struct resource *res = &osk5912_cf_resources[1];
280 296
281 omap_cfg_reg(M7_1610_GPIO62);297 omap_cfg_reg(M7_1610_GPIO62);
282 if ((gpio_request(62, "cf_irq")) < 0) {
283 printk("Error requesting gpio 62 for CF irq\n");
284 return;
285 }
286 298
287 switch (seg) {299 switch (seg) {
288 /* NOTE: CS0 could be configured too ... */300 /* NOTE: CS0 could be configured too ... */
@@ -308,18 +320,17 @@ static void __init osk_init_cf(int seg) · 19 unmodified lines
308 seg, omap_readl(EMIFS_CCS(seg)), omap_readl(EMIFS_ACS(seg)));320 seg, omap_readl(EMIFS_CCS(seg)), omap_readl(EMIFS_ACS(seg)));
309 omap_writel(0x0004a1b3, EMIFS_CCS(seg)); /* synch mode 4 etc */321 omap_writel(0x0004a1b3, EMIFS_CCS(seg)); /* synch mode 4 etc */
310 omap_writel(0x00000000, EMIFS_ACS(seg)); /* OE hold/setup */322 omap_writel(0x00000000, EMIFS_ACS(seg)); /* OE hold/setup */
311
312 /* the CF I/O IRQ is really active-low */
313 irq_set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING);
314}323}
315 324
316static struct gpiod_lookup_table osk_usb_gpio_table = {325static struct gpiod_lookup_table osk_usb_gpio_table = {
317 .dev_id = "ohci",326 .dev_id = "ohci",
318 .table = {327 .table = {
319 /* Power GPIO on the I2C-attached TPS65010 */328 /* Power GPIO on the I2C-attached TPS65010 */
320 GPIO_LOOKUP("tps65010", 0, "power", GPIO_ACTIVE_HIGH),329 GPIO_LOOKUP("tps65010", OSK_TPS_GPIO_USB_PWR_EN, "power",
330 GPIO_ACTIVE_HIGH),
321 GPIO_LOOKUP(OMAP_GPIO_LABEL, 9, "overcurrent",331 GPIO_LOOKUP(OMAP_GPIO_LABEL, 9, "overcurrent",
322 GPIO_ACTIVE_HIGH),332 GPIO_ACTIVE_HIGH),
333 { }
323 },334 },
324};335};
325 336
@@ -341,8 +352,32 @@ static struct omap_usb_config osk_usb_config __initdata = { · 15 unmodified lines
341 352
342#define EMIFS_CS3_VAL (0x88013141)353#define EMIFS_CS3_VAL (0x88013141)
343 354
355static struct gpiod_lookup_table osk_irq_gpio_table = {
356 .dev_id = NULL,
357 .table = {
358 /* GPIO used for SMC91x IRQ */
359 GPIO_LOOKUP(OMAP_GPIO_LABEL, 0, "smc_irq",
360 GPIO_ACTIVE_HIGH),
361 /* GPIO used for CF IRQ */
362 GPIO_LOOKUP("gpio-48-63", 14, "cf_irq",
363 GPIO_ACTIVE_HIGH),
364 /* GPIO used by the TPS65010 chip */
365 GPIO_LOOKUP("mpuio", 1, "tps65010",
366 GPIO_ACTIVE_HIGH),
367 /* GPIOs used for serial wakeup IRQs */
368 GPIO_LOOKUP_IDX("gpio-32-47", 5, "wakeup", 0,
369 GPIO_ACTIVE_HIGH),
370 GPIO_LOOKUP_IDX("gpio-16-31", 2, "wakeup", 1,
371 GPIO_ACTIVE_HIGH),
372 GPIO_LOOKUP_IDX("gpio-48-63", 1, "wakeup", 2,
373 GPIO_ACTIVE_HIGH),
374 { }
375 },
376};
377
344static void __init osk_init(void)378static void __init osk_init(void)
345{379{
380 struct gpio_desc *d;
346 u32 l;381 u32 l;
347 382
348 osk_init_smc91x();383 osk_init_smc91x();
@@ -359,10 +394,31 @@ static void __init osk_init(void) · 10 unmodified lines
359 394
360 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();395 osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
361 osk_flash_resource.end += SZ_32M - 1;396 osk_flash_resource.end += SZ_32M - 1;
362 osk5912_smc91x_resources[1].start = gpio_to_irq(0);397
363 osk5912_smc91x_resources[1].end = gpio_to_irq(0);398 /*
364 osk5912_cf_resources[0].start = gpio_to_irq(62);399 * Add the GPIOs to be used as IRQs and immediately look them up
365 osk5912_cf_resources[0].end = gpio_to_irq(62);400 * to be passed as an IRQ resource. This is ugly but should work
401 * until the day we convert to device tree.
402 */
403 gpiod_add_lookup_table(&osk_irq_gpio_table);
404
405 d = gpiod_get(NULL, "smc_irq", GPIOD_IN);
406 if (IS_ERR(d)) {
407 pr_err("Unable to get SMC IRQ GPIO descriptor\n");
408 } else {
409 irq_set_irq_type(gpiod_to_irq(d), IRQ_TYPE_EDGE_RISING);
410 osk5912_smc91x_resources[1] = DEFINE_RES_IRQ(gpiod_to_irq(d));
411 }
412
413 d = gpiod_get(NULL, "cf_irq", GPIOD_IN);
414 if (IS_ERR(d)) {
415 pr_err("Unable to get CF IRQ GPIO descriptor\n");
416 } else {
417 /* the CF I/O IRQ is really active-low */
418 irq_set_irq_type(gpiod_to_irq(d), IRQ_TYPE_EDGE_FALLING);
419 osk5912_cf_resources[0] = DEFINE_RES_IRQ(gpiod_to_irq(d));
420 }
421
366 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));422 platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
367 423
368 l = omap_readl(USB_TRANSCEIVER_CTRL);424 l = omap_readl(USB_TRANSCEIVER_CTRL);
@@ -372,13 +428,15 @@ static void __init osk_init(void) · 3 unmodified lines
372 gpiod_add_lookup_table(&osk_usb_gpio_table);428 gpiod_add_lookup_table(&osk_usb_gpio_table);
373 omap1_usb_init(&osk_usb_config);429 omap1_usb_init(&osk_usb_config);
374 430
431 omap_serial_init();
432
375 /* irq for tps65010 chip */433 /* irq for tps65010 chip */
376 /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */434 /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */
377 if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0)435 d = gpiod_get(NULL, "tps65010", GPIOD_IN);
378 gpio_direction_input(OMAP_MPUIO(1));436 if (IS_ERR(d))
379 437 pr_err("Unable to get TPS65010 IRQ GPIO descriptor\n");
380 omap_serial_init();438 else
381 osk_i2c_board_info[0].irq = gpio_to_irq(OMAP_MPUIO(1));439 osk_i2c_board_info[0].irq = gpiod_to_irq(d);
382 omap_register_i2c_bus(1, 400, osk_i2c_board_info,440 omap_register_i2c_bus(1, 400, osk_i2c_board_info,
383 ARRAY_SIZE(osk_i2c_board_info));441 ARRAY_SIZE(osk_i2c_board_info));
384}442}
arch/arm/mach-omap1/board-palmte.c+31−20
@@ -13,7 +13,8 @@ · 12 unmodified lines
13 *13 *
14 * Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org>14 * Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org>
15 */15 */
16#include <linux/gpio.h>16#include <linux/gpio/machine.h>
17#include <linux/gpio/consumer.h>
17#include <linux/kernel.h>18#include <linux/kernel.h>
18#include <linux/init.h>19#include <linux/init.h>
19#include <linux/input.h>20#include <linux/input.h>
@@ -187,23 +188,6 @@ static struct spi_board_info palmte_spi_info[] __initdata = { · 167 unmodified lines
187 },188 },
188};189};
189 190
190static void __init palmte_misc_gpio_setup(void)
191{
192 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
193 if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) {
194 printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n");
195 return;
196 }
197 gpio_direction_input(PALMTE_PINTDAV_GPIO);
198
199 /* Set USB-or-DC-IN pin as input (unused) */
200 if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) {
201 printk(KERN_ERR "Could not reserve cable signal GPIO!\n");
202 return;
203 }
204 gpio_direction_input(PALMTE_USB_OR_DC_GPIO);
205}
206
207#if IS_ENABLED(CONFIG_MMC_OMAP)191#if IS_ENABLED(CONFIG_MMC_OMAP)
208 192
209static struct omap_mmc_platform_data _palmte_mmc_config = {193static struct omap_mmc_platform_data _palmte_mmc_config = {
@@ -231,8 +215,23 @@ static void palmte_mmc_init(void) · 21 unmodified lines
231 215
232#endif /* CONFIG_MMC_OMAP */216#endif /* CONFIG_MMC_OMAP */
233 217
218static struct gpiod_lookup_table palmte_irq_gpio_table = {
219 .dev_id = NULL,
220 .table = {
221 /* GPIO used for TSC2102 PINTDAV IRQ */
222 GPIO_LOOKUP("gpio-0-15", PALMTE_PINTDAV_GPIO, "tsc2102_irq",
223 GPIO_ACTIVE_HIGH),
224 /* GPIO used for USB or DC input detection */
225 GPIO_LOOKUP("gpio-0-15", PALMTE_USB_OR_DC_GPIO, "usb_dc_irq",
226 GPIO_ACTIVE_HIGH),
227 { }
228 },
229};
230
234static void __init omap_palmte_init(void)231static void __init omap_palmte_init(void)
235{232{
233 struct gpio_desc *d;
234
236 /* mux pins for uarts */235 /* mux pins for uarts */
237 omap_cfg_reg(UART1_TX);236 omap_cfg_reg(UART1_TX);
238 omap_cfg_reg(UART1_RTS);237 omap_cfg_reg(UART1_RTS);
@@ -243,9 +242,21 @@ static void __init omap_palmte_init(void) · 4 unmodified lines
243 242
244 platform_add_devices(palmte_devices, ARRAY_SIZE(palmte_devices));243 platform_add_devices(palmte_devices, ARRAY_SIZE(palmte_devices));
245 244
246 palmte_spi_info[0].irq = gpio_to_irq(PALMTE_PINTDAV_GPIO);245 gpiod_add_lookup_table(&palmte_irq_gpio_table);
246 d = gpiod_get(NULL, "tsc2102_irq", GPIOD_IN);
247 if (IS_ERR(d))
248 pr_err("Unable to get TSC2102 IRQ GPIO descriptor\n");
249 else
250 palmte_spi_info[0].irq = gpiod_to_irq(d);
247 spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info));251 spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info));
248 palmte_misc_gpio_setup();252
253 /* We are getting this just to set it up as input */
254 d = gpiod_get(NULL, "usb_dc_irq", GPIOD_IN);
255 if (IS_ERR(d))
256 pr_err("Unable to get USB/DC IRQ GPIO descriptor\n");
257 else
258 gpiod_put(d);
259
249 omap_serial_init();260 omap_serial_init();
250 omap1_usb_init(&palmte_usb_config);261 omap1_usb_init(&palmte_usb_config);
251 omap_register_i2c_bus(1, 100, NULL, 0);262 omap_register_i2c_bus(1, 100, NULL, 0);
arch/arm/mach-omap1/board-sx1-mmc.c+0−1
@@ -9,7 +9,6 @@ · 8 unmodified lines
9 * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT9 * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT
10 */10 */
11 11
12#include <linux/gpio.h>
13#include <linux/platform_device.h>12#include <linux/platform_device.h>
14 13
15#include "hardware.h"14#include "hardware.h"
arch/arm/mach-omap1/board-sx1.c+33−7
@@ -11,7 +11,8 @@ · 10 unmodified lines
11* Maintainters : Vladimir Ananiev (aka Vovan888), Sergge11* Maintainters : Vladimir Ananiev (aka Vovan888), Sergge
12* oslik.ru12* oslik.ru
13*/13*/
14#include <linux/gpio.h>14#include <linux/gpio/machine.h>
15#include <linux/gpio/consumer.h>
15#include <linux/kernel.h>16#include <linux/kernel.h>
16#include <linux/init.h>17#include <linux/init.h>
17#include <linux/input.h>18#include <linux/input.h>
@@ -304,8 +305,23 @@ static struct platform_device *sx1_devices[] __initdata = { · 286 unmodified lines
304 305
305/*-----------------------------------------*/306/*-----------------------------------------*/
306 307
308static struct gpiod_lookup_table sx1_gpio_table = {
309 .dev_id = NULL,
310 .table = {
311 GPIO_LOOKUP("gpio-0-15", 1, "irda_off",
312 GPIO_ACTIVE_HIGH),
313 GPIO_LOOKUP("gpio-0-15", 11, "switch",
314 GPIO_ACTIVE_HIGH),
315 GPIO_LOOKUP("gpio-0-15", 15, "usb_on",
316 GPIO_ACTIVE_HIGH),
317 { }
318 },
319};
320
307static void __init omap_sx1_init(void)321static void __init omap_sx1_init(void)
308{322{
323 struct gpio_desc *d;
324
309 /* mux pins for uarts */325 /* mux pins for uarts */
310 omap_cfg_reg(UART1_TX);326 omap_cfg_reg(UART1_TX);
311 omap_cfg_reg(UART1_RTS);327 omap_cfg_reg(UART1_RTS);
@@ -320,15 +336,25 @@ static void __init omap_sx1_init(void) · 8 unmodified lines
320 omap_register_i2c_bus(1, 100, NULL, 0);336 omap_register_i2c_bus(1, 100, NULL, 0);
321 omap1_usb_init(&sx1_usb_config);337 omap1_usb_init(&sx1_usb_config);
322 sx1_mmc_init();338 sx1_mmc_init();
339 gpiod_add_lookup_table(&sx1_gpio_table);
323 340
324 /* turn on USB power */341 /* turn on USB power */
325 /* sx1_setusbpower(1); can't do it here because i2c is not ready */342 /* sx1_setusbpower(1); can't do it here because i2c is not ready */
326 gpio_request(1, "A_IRDA_OFF");343 d = gpiod_get(NULL, "irda_off", GPIOD_OUT_HIGH);
327 gpio_request(11, "A_SWITCH");344 if (IS_ERR(d))
328 gpio_request(15, "A_USB_ON");345 pr_err("Unable to get IRDA OFF GPIO descriptor\n");
329 gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */346 else
330 gpio_direction_output(11, 0); /*A_SWITCH = 0 */347 gpiod_put(d);
331 gpio_direction_output(15, 0); /*A_USB_ON = 0 */348 d = gpiod_get(NULL, "switch", GPIOD_OUT_LOW);
349 if (IS_ERR(d))
350 pr_err("Unable to get SWITCH GPIO descriptor\n");
351 else
352 gpiod_put(d);
353 d = gpiod_get(NULL, "usb_on", GPIOD_OUT_LOW);
354 if (IS_ERR(d))
355 pr_err("Unable to get USB ON GPIO descriptor\n");
356 else
357 gpiod_put(d);
332 358
333 omapfb_set_lcd_config(&sx1_lcd_config);359 omapfb_set_lcd_config(&sx1_lcd_config);
334}360}
arch/arm/mach-omap1/devices.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
6 */6 */
7 7
8#include <linux/dma-mapping.h>8#include <linux/dma-mapping.h>
9#include <linux/gpio.h>
10#include <linux/module.h>9#include <linux/module.h>
11#include <linux/kernel.h>10#include <linux/kernel.h>
12#include <linux/init.h>11#include <linux/init.h>
arch/arm/mach-omap1/gpio15xx.c+0−1
@@ -8,7 +8,6 @@ · 7 unmodified lines
8 * Charulatha V <charu@ti.com>8 * Charulatha V <charu@ti.com>
9 */9 */
10 10
11#include <linux/gpio.h>
12#include <linux/platform_data/gpio-omap.h>11#include <linux/platform_data/gpio-omap.h>
13#include <linux/soc/ti/omap1-soc.h>12#include <linux/soc/ti/omap1-soc.h>
14#include <asm/irq.h>13#include <asm/irq.h>
arch/arm/mach-omap1/gpio16xx.c+0−1
@@ -8,7 +8,6 @@ · 7 unmodified lines
8 * Charulatha V <charu@ti.com>8 * Charulatha V <charu@ti.com>
9 */9 */
10 10
11#include <linux/gpio.h>
12#include <linux/platform_data/gpio-omap.h>11#include <linux/platform_data/gpio-omap.h>
13#include <linux/soc/ti/omap1-io.h>12#include <linux/soc/ti/omap1-io.h>
14 13
arch/arm/mach-omap1/irq.c+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
35 * with this program; if not, write to the Free Software Foundation, Inc.,35 * with this program; if not, write to the Free Software Foundation, Inc.,
36 * 675 Mass Ave, Cambridge, MA 02139, USA.36 * 675 Mass Ave, Cambridge, MA 02139, USA.
37 */37 */
38#include <linux/gpio.h>
39#include <linux/init.h>38#include <linux/init.h>
40#include <linux/module.h>39#include <linux/module.h>
41#include <linux/sched.h>40#include <linux/sched.h>
arch/arm/mach-omap1/serial.c+15−15
@@ -4,7 +4,8 @@ · 3 unmodified lines
4 *4 *
5 * OMAP1 serial support.5 * OMAP1 serial support.
6 */6 */
7#include <linux/gpio.h>7#include <linux/gpio/machine.h>
8#include <linux/gpio/consumer.h>
8#include <linux/module.h>9#include <linux/module.h>
9#include <linux/kernel.h>10#include <linux/kernel.h>
10#include <linux/init.h>11#include <linux/init.h>
@@ -197,39 +198,38 @@ void omap_serial_wake_trigger(int enable) · 186 unmodified lines
197 }198 }
198}199}
199 200
200static void __init omap_serial_set_port_wakeup(int gpio_nr)201static void __init omap_serial_set_port_wakeup(int idx)
201{202{
203 struct gpio_desc *d;
202 int ret;204 int ret;
203 205
204 ret = gpio_request(gpio_nr, "UART wake");206 d = gpiod_get_index(NULL, "wakeup", idx, GPIOD_IN);
205 if (ret < 0) {207 if (IS_ERR(d)) {
206 printk(KERN_ERR "Could not request UART wake GPIO: %i\n",208 pr_err("Unable to get UART wakeup GPIO descriptor\n");
207 gpio_nr);
208 return;209 return;
209 }210 }
210 gpio_direction_input(gpio_nr);211 ret = request_irq(gpiod_to_irq(d), &omap_serial_wake_interrupt,
211 ret = request_irq(gpio_to_irq(gpio_nr), &omap_serial_wake_interrupt,
212 IRQF_TRIGGER_RISING, "serial wakeup", NULL);212 IRQF_TRIGGER_RISING, "serial wakeup", NULL);
213 if (ret) {213 if (ret) {
214 gpio_free(gpio_nr);214 gpiod_put(d);
215 printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n",215 pr_err("No interrupt for UART%d wake GPIO\n", idx + 1);
216 gpio_nr);
217 return;216 return;
218 }217 }
219 enable_irq_wake(gpio_to_irq(gpio_nr));218 enable_irq_wake(gpiod_to_irq(d));
220}219}
221 220
221
222int __init omap_serial_wakeup_init(void)222int __init omap_serial_wakeup_init(void)
223{223{
224 if (!cpu_is_omap16xx())224 if (!cpu_is_omap16xx())
225 return 0;225 return 0;
226 226
227 if (uart1_ck != NULL)227 if (uart1_ck != NULL)
228 omap_serial_set_port_wakeup(37);228 omap_serial_set_port_wakeup(0);
229 if (uart2_ck != NULL)229 if (uart2_ck != NULL)
230 omap_serial_set_port_wakeup(18);230 omap_serial_set_port_wakeup(1);
231 if (uart3_ck != NULL)231 if (uart3_ck != NULL)
232 omap_serial_set_port_wakeup(49);232 omap_serial_set_port_wakeup(2);
233 233
234 return 0;234 return 0;
235}235}
arch/arm/mach-omap2/board-n8x0.c+44−112
@@ -10,7 +10,8 @@ · 9 unmodified lines
10 10
11#include <linux/clk.h>11#include <linux/clk.h>
12#include <linux/delay.h>12#include <linux/delay.h>
13#include <linux/gpio.h>13#include <linux/gpio/machine.h>
14#include <linux/gpio/consumer.h>
14#include <linux/init.h>15#include <linux/init.h>
15#include <linux/io.h>16#include <linux/io.h>
16#include <linux/irq.h>17#include <linux/irq.h>
@@ -28,13 +29,12 @@ · 11 unmodified lines
28 29
29#include "common.h"30#include "common.h"
30#include "mmc.h"31#include "mmc.h"
32#include "usb-tusb6010.h"
31#include "soc.h"33#include "soc.h"
32#include "common-board-devices.h"34#include "common-board-devices.h"
33 35
34#define TUSB6010_ASYNC_CS 136#define TUSB6010_ASYNC_CS 1
35#define TUSB6010_SYNC_CS 437#define TUSB6010_SYNC_CS 4
36#define TUSB6010_GPIO_INT 58
37#define TUSB6010_GPIO_ENABLE 0
38#define TUSB6010_DMACHAN 0x3f38#define TUSB6010_DMACHAN 0x3f
39 39
40#define NOKIA_N810_WIMAX (1 << 2)40#define NOKIA_N810_WIMAX (1 << 2)
@@ -61,37 +61,6 @@ static void board_check_revision(void) · 20 unmodified lines
61}61}
62 62
63#if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010)63#if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010)
64/*
65 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
66 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
67 * provide then PGOOD signal to TUSB6010 which will release it from reset.
68 */
69static int tusb_set_power(int state)
70{
71 int i, retval = 0;
72
73 if (state) {
74 gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
75 msleep(1);
76
77 /* Wait until TUSB6010 pulls INT pin down */
78 i = 100;
79 while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
80 msleep(1);
81 i--;
82 }
83
84 if (!i) {
85 printk(KERN_ERR "tusb: powerup failed\n");
86 retval = -ENODEV;
87 }
88 } else {
89 gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
90 msleep(10);
91 }
92
93 return retval;
94}
95 64
96static struct musb_hdrc_config musb_config = {65static struct musb_hdrc_config musb_config = {
97 .multipoint = 1,66 .multipoint = 1,
@@ -102,39 +71,36 @@ static struct musb_hdrc_config musb_config = { · 4 unmodified lines
102 71
103static struct musb_hdrc_platform_data tusb_data = {72static struct musb_hdrc_platform_data tusb_data = {
104 .mode = MUSB_OTG,73 .mode = MUSB_OTG,
105 .set_power = tusb_set_power,
106 .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */74 .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
107 .power = 100, /* Max 100 mA VBUS for host mode */75 .power = 100, /* Max 100 mA VBUS for host mode */
108 .config = &musb_config,76 .config = &musb_config,
109};77};
110 78
79static struct gpiod_lookup_table tusb_gpio_table = {
80 .dev_id = "musb-tusb",
81 .table = {
82 GPIO_LOOKUP("gpio-0-15", 0, "enable",
83 GPIO_ACTIVE_HIGH),
84 GPIO_LOOKUP("gpio-48-63", 10, "int",
85 GPIO_ACTIVE_HIGH),
86 { }
87 },
88};
89
111static void __init n8x0_usb_init(void)90static void __init n8x0_usb_init(void)
112{91{
113 int ret = 0;92 int ret = 0;
114 static const char announce[] __initconst = KERN_INFO "TUSB 6010\n";
115
116 /* PM companion chip power control pin */
117 ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW,
118 "TUSB6010 enable");
119 if (ret != 0) {
120 printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
121 TUSB6010_GPIO_ENABLE);
122 return;
123 }
124 tusb_set_power(0);
125 93
94 gpiod_add_lookup_table(&tusb_gpio_table);
126 ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,95 ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
127 TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,96 TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
128 TUSB6010_GPIO_INT, TUSB6010_DMACHAN);97 TUSB6010_DMACHAN);
129 if (ret != 0)98 if (ret != 0)
130 goto err;99 return;
131 100
132 printk(announce);101 pr_info("TUSB 6010\n");
133 102
134 return;103 return;
135
136err:
137 gpio_free(TUSB6010_GPIO_ENABLE);
138}104}
139#else105#else
140 106
@@ -170,22 +136,32 @@ static struct spi_board_info n800_spi_board_info[] __initdata = { · 29 unmodified lines
170 * GPIO23 and GPIO9 slot 2 EMMC on N810136 * GPIO23 and GPIO9 slot 2 EMMC on N810
171 *137 *
172 */138 */
173#define N8X0_SLOT_SWITCH_GPIO 96
174#define N810_EMMC_VSD_GPIO 23
175#define N810_EMMC_VIO_GPIO 9
176
177static int slot1_cover_open;139static int slot1_cover_open;
178static int slot2_cover_open;140static int slot2_cover_open;
179static struct device *mmc_device;141static struct device *mmc_device;
180 142
181static int n8x0_mmc_switch_slot(struct device *dev, int slot)143static struct gpiod_lookup_table nokia8xx_mmc_gpio_table = {
182{144 .dev_id = "mmci-omap.0",
183#ifdef CONFIG_MMC_DEBUG145 .table = {
184 dev_dbg(dev, "Choose slot %d\n", slot + 1);146 /* Slot switch, GPIO 96 */
185#endif147 GPIO_LOOKUP("gpio-80-111", 16,
186 gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot);148 "switch", GPIO_ACTIVE_HIGH),
187 return 0;149 { }
188}150 },
151};
152
153static struct gpiod_lookup_table nokia810_mmc_gpio_table = {
154 .dev_id = "mmci-omap.0",
155 .table = {
156 /* Slot index 1, VSD power, GPIO 23 */
157 GPIO_LOOKUP_IDX("gpio-16-31", 7,
158 "vsd", 1, GPIO_ACTIVE_HIGH),
159 /* Slot index 1, VIO power, GPIO 9 */
160 GPIO_LOOKUP_IDX("gpio-0-15", 9,
161 "vsd", 1, GPIO_ACTIVE_HIGH),
162 { }
163 },
164};
189 165
190static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot,166static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot,
191 int power_on, int vdd)167 int power_on, int vdd)
@@ -256,31 +232,13 @@ static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot, · 64 unmodified lines
256 return 0;232 return 0;
257}233}
258 234
259static void n810_set_power_emmc(struct device *dev,
260 int power_on)
261{
262 dev_dbg(dev, "Set EMMC power %s\n", power_on ? "on" : "off");
263
264 if (power_on) {
265 gpio_set_value(N810_EMMC_VSD_GPIO, 1);
266 msleep(1);
267 gpio_set_value(N810_EMMC_VIO_GPIO, 1);
268 msleep(1);
269 } else {
270 gpio_set_value(N810_EMMC_VIO_GPIO, 0);
271 msleep(50);
272 gpio_set_value(N810_EMMC_VSD_GPIO, 0);
273 msleep(50);
274 }
275}
276
277static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on,235static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on,
278 int vdd)236 int vdd)
279{237{
280 if (board_is_n800() || slot == 0)238 if (board_is_n800() || slot == 0)
281 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);239 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);
282 240
283 n810_set_power_emmc(dev, power_on);241 /* The n810 power will be handled by GPIO code in the driver */
284 242
285 return 0;243 return 0;
286}244}
@@ -418,13 +376,6 @@ static void n8x0_mmc_shutdown(struct device *dev) · 131 unmodified lines
418static void n8x0_mmc_cleanup(struct device *dev)376static void n8x0_mmc_cleanup(struct device *dev)
419{377{
420 menelaus_unregister_mmc_callback();378 menelaus_unregister_mmc_callback();
421
422 gpio_free(N8X0_SLOT_SWITCH_GPIO);
423
424 if (board_is_n810()) {
425 gpio_free(N810_EMMC_VSD_GPIO);
426 gpio_free(N810_EMMC_VIO_GPIO);
427 }
428}379}
429 380
430/*381/*
@@ -433,7 +384,6 @@ static void n8x0_mmc_cleanup(struct device *dev) · 2 unmodified lines
433 */384 */
434static struct omap_mmc_platform_data mmc1_data = {385static struct omap_mmc_platform_data mmc1_data = {
435 .nr_slots = 0,386 .nr_slots = 0,
436 .switch_slot = n8x0_mmc_switch_slot,
437 .init = n8x0_mmc_late_init,387 .init = n8x0_mmc_late_init,
438 .cleanup = n8x0_mmc_cleanup,388 .cleanup = n8x0_mmc_cleanup,
439 .shutdown = n8x0_mmc_shutdown,389 .shutdown = n8x0_mmc_shutdown,
@@ -463,14 +413,9 @@ static struct omap_mmc_platform_data mmc1_data = { · 23 unmodified lines
463 413
464static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC];414static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC];
465 415
466static struct gpio n810_emmc_gpios[] __initdata = {
467 { N810_EMMC_VSD_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf" },
468 { N810_EMMC_VIO_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd" },
469};
470
471static void __init n8x0_mmc_init(void)416static void __init n8x0_mmc_init(void)
472{417{
473 int err;418 gpiod_add_lookup_table(&nokia8xx_mmc_gpio_table);
474 419
475 if (board_is_n810()) {420 if (board_is_n810()) {
476 mmc1_data.slots[0].name = "external";421 mmc1_data.slots[0].name = "external";
@@ -483,20 +428,7 @@ static void __init n8x0_mmc_init(void) · 6 unmodified lines
483 */428 */
484 mmc1_data.slots[1].name = "internal";429 mmc1_data.slots[1].name = "internal";
485 mmc1_data.slots[1].ban_openended = 1;430 mmc1_data.slots[1].ban_openended = 1;
486 }431 gpiod_add_lookup_table(&nokia810_mmc_gpio_table);
487
488 err = gpio_request_one(N8X0_SLOT_SWITCH_GPIO, GPIOF_OUT_INIT_LOW,
489 "MMC slot switch");
490 if (err)
491 return;
492
493 if (board_is_n810()) {
494 err = gpio_request_array(n810_emmc_gpios,
495 ARRAY_SIZE(n810_emmc_gpios));
496 if (err) {
497 gpio_free(N8X0_SLOT_SWITCH_GPIO);
498 return;
499 }
500 }432 }
501 433
502 mmc1_data.nr_slots = 2;434 mmc1_data.nr_slots = 2;
arch/arm/mach-omap2/omap_device.c+0−1
@@ -244,7 +244,6 @@ static int _omap_device_notifier_call(struct notifier_block *nb, · 243 unmodified lines
244 case BUS_NOTIFY_ADD_DEVICE:244 case BUS_NOTIFY_ADD_DEVICE:
245 if (pdev->dev.of_node)245 if (pdev->dev.of_node)
246 omap_device_build_from_dt(pdev);246 omap_device_build_from_dt(pdev);
247 omap_auxdata_legacy_init(dev);
248 fallthrough;247 fallthrough;
249 default:248 default:
250 od = to_omap_device(pdev);249 od = to_omap_device(pdev);
arch/arm/mach-omap2/pdata-quirks.c+66−66
@@ -6,8 +6,8 @@ · 5 unmodified lines
6 */6 */
7#include <linux/clk.h>7#include <linux/clk.h>
8#include <linux/davinci_emac.h>8#include <linux/davinci_emac.h>
9#include <linux/gpio/machine.h>
9#include <linux/gpio/consumer.h>10#include <linux/gpio/consumer.h>
10#include <linux/gpio.h>
11#include <linux/init.h>11#include <linux/init.h>
12#include <linux/kernel.h>12#include <linux/kernel.h>
13#include <linux/of_platform.h>13#include <linux/of_platform.h>
@@ -41,7 +41,6 @@ struct pdata_init { · 27 unmodified lines
41};41};
42 42
43static struct of_dev_auxdata omap_auxdata_lookup[];43static struct of_dev_auxdata omap_auxdata_lookup[];
44static struct twl4030_gpio_platform_data twl_gpio_auxdata;
45 44
46#ifdef CONFIG_MACH_NOKIA_N8X045#ifdef CONFIG_MACH_NOKIA_N8X0
47static void __init omap2420_n8x0_legacy_init(void)46static void __init omap2420_n8x0_legacy_init(void)
@@ -98,52 +97,43 @@ static struct iommu_platform_data omap3_iommu_isp_pdata = { · 50 unmodified lines
98};97};
99#endif98#endif
100 99
101static int omap3_sbc_t3730_twl_callback(struct device *dev,100static void __init omap3_sbc_t3x_usb_hub_init(char *hub_name, int idx)
102 unsigned gpio,
103 unsigned ngpio)
104{101{
105 int res;102 struct gpio_desc *d;
106 103
107 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,104 /* This asserts the RESET line (reverse polarity) */
108 "wlan pwr");105 d = gpiod_get_index(NULL, "reset", idx, GPIOD_OUT_HIGH);
109 if (res)106 if (IS_ERR(d)) {
110 return res;107 pr_err("Unable to get T3x USB reset GPIO descriptor\n");
111
112 gpiod_export(gpio_to_desc(gpio), 0);
113
114 return 0;
115}
116
117static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
118{
119 int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
120
121 if (err) {
122 pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
123 hub_name, err);
124 return;108 return;
125 }109 }
126 110 gpiod_set_consumer_name(d, hub_name);
127 gpiod_export(gpio_to_desc(gpio), 0);111 gpiod_export(d, 0);
128
129 udelay(10);112 udelay(10);
130 gpio_set_value(gpio, 1);113 /* De-assert RESET */
114 gpiod_set_value(d, 0);
131 msleep(1);115 msleep(1);
132}116}
133 117
134static void __init omap3_sbc_t3730_twl_init(void)118static struct gpiod_lookup_table omap3_sbc_t3x_usb_gpio_table = {
135{119 .dev_id = NULL,
136 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;120 .table = {
137}121 GPIO_LOOKUP_IDX("gpio-160-175", 7, "reset", 0,
122 GPIO_ACTIVE_LOW),
123 { }
124 },
125};
138 126
139static void __init omap3_sbc_t3730_legacy_init(void)127static void __init omap3_sbc_t3730_legacy_init(void)
140{128{
141 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");129 gpiod_add_lookup_table(&omap3_sbc_t3x_usb_gpio_table);
130 omap3_sbc_t3x_usb_hub_init("sb-t35 usb hub", 0);
142}131}
143 132
144static void __init omap3_sbc_t3530_legacy_init(void)133static void __init omap3_sbc_t3530_legacy_init(void)
145{134{
146 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");135 gpiod_add_lookup_table(&omap3_sbc_t3x_usb_gpio_table);
136 omap3_sbc_t3x_usb_hub_init("sb-t35 usb hub", 0);
147}137}
148 138
149static void __init omap3_evm_legacy_init(void)139static void __init omap3_evm_legacy_init(void)
@@ -187,31 +177,59 @@ static void __init am35xx_emac_reset(void) · 37 unmodified lines
187 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */177 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
188}178}
189 179
190static struct gpio cm_t3517_wlan_gpios[] __initdata = {180static struct gpiod_lookup_table cm_t3517_wlan_gpio_table = {
191 { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },181 .dev_id = NULL,
192 { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },182 .table = {
183 GPIO_LOOKUP("gpio-48-53", 8, "power",
184 GPIO_ACTIVE_HIGH),
185 GPIO_LOOKUP("gpio-0-15", 4, "noe",
186 GPIO_ACTIVE_HIGH),
187 { }
188 },
193};189};
194 190
195static void __init omap3_sbc_t3517_wifi_init(void)191static void __init omap3_sbc_t3517_wifi_init(void)
196{192{
197 int err = gpio_request_array(cm_t3517_wlan_gpios,193 struct gpio_desc *d;
198 ARRAY_SIZE(cm_t3517_wlan_gpios));194
199 if (err) {195 gpiod_add_lookup_table(&cm_t3517_wlan_gpio_table);
200 pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
201 return;
202 }
203 196
204 gpiod_export(gpio_to_desc(cm_t3517_wlan_gpios[0].gpio), 0);197 /* This asserts the RESET line (reverse polarity) */
205 gpiod_export(gpio_to_desc(cm_t3517_wlan_gpios[1].gpio), 0);198 d = gpiod_get(NULL, "power", GPIOD_OUT_HIGH);
199 if (IS_ERR(d)) {
200 pr_err("Unable to get CM T3517 WLAN power GPIO descriptor\n");
201 } else {
202 gpiod_set_consumer_name(d, "wlan pwr");
203 gpiod_export(d, 0);
204 }
206 205
206 d = gpiod_get(NULL, "noe", GPIOD_OUT_HIGH);
207 if (IS_ERR(d)) {
208 pr_err("Unable to get CM T3517 WLAN XCVR NOE GPIO descriptor\n");
209 } else {
210 gpiod_set_consumer_name(d, "xcvr noe");
211 gpiod_export(d, 0);
212 }
207 msleep(100);213 msleep(100);
208 gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);214 gpiod_set_value(d, 0);
209}215}
216
217static struct gpiod_lookup_table omap3_sbc_t3517_usb_gpio_table = {
218 .dev_id = NULL,
219 .table = {
220 GPIO_LOOKUP_IDX("gpio-144-159", 8, "reset", 0,
221 GPIO_ACTIVE_LOW),
222 GPIO_LOOKUP_IDX("gpio-96-111", 2, "reset", 1,
223 GPIO_ACTIVE_LOW),
224 { }
225 },
226};
210 227
211static void __init omap3_sbc_t3517_legacy_init(void)228static void __init omap3_sbc_t3517_legacy_init(void)
212{229{
213 omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");230 gpiod_add_lookup_table(&omap3_sbc_t3517_usb_gpio_table);
214 omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");231 omap3_sbc_t3x_usb_hub_init("cm-t3517 usb hub", 0);
232 omap3_sbc_t3x_usb_hub_init("sb-t35 usb hub", 1);
215 am35xx_emac_reset();233 am35xx_emac_reset();
216 hsmmc2_internal_input_clk();234 hsmmc2_internal_input_clk();
217 omap3_sbc_t3517_wifi_init();235 omap3_sbc_t3517_wifi_init();
@@ -393,21 +411,6 @@ static struct ti_prm_platform_data ti_prm_pdata = { · 175 unmodified lines
393 .clkdm_lookup = clkdm_lookup,411 .clkdm_lookup = clkdm_lookup,
394};412};
395 413
396/*
397 * GPIOs for TWL are initialized by the I2C bus and need custom
398 * handing until DSS has device tree bindings.
399 */
400void omap_auxdata_legacy_init(struct device *dev)
401{
402 if (dev->platform_data)
403 return;
404
405 if (strcmp("twl4030-gpio", dev_name(dev)))
406 return;
407
408 dev->platform_data = &twl_gpio_auxdata;
409}
410
411#if defined(CONFIG_ARCH_OMAP3) && IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)414#if defined(CONFIG_ARCH_OMAP3) && IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
412static struct omap_mcbsp_platform_data mcbsp_pdata;415static struct omap_mcbsp_platform_data mcbsp_pdata;
413static void __init omap3_mcbsp_init(void)416static void __init omap3_mcbsp_init(void)
@@ -427,9 +430,6 @@ static struct pdata_init auxdata_quirks[] __initdata = { · 13 unmodified lines
427 { "nokia,n800", omap2420_n8x0_legacy_init, },430 { "nokia,n800", omap2420_n8x0_legacy_init, },
428 { "nokia,n810", omap2420_n8x0_legacy_init, },431 { "nokia,n810", omap2420_n8x0_legacy_init, },
429 { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },432 { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
430#endif
431#ifdef CONFIG_ARCH_OMAP3
432 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
433#endif433#endif
434 { /* sentinel */ },434 { /* sentinel */ },
435};435};
arch/arm/mach-omap2/usb-tusb6010.c+4−16
@@ -11,12 +11,12 @@ · 10 unmodified lines
11#include <linux/errno.h>11#include <linux/errno.h>
12#include <linux/delay.h>12#include <linux/delay.h>
13#include <linux/platform_device.h>13#include <linux/platform_device.h>
14#include <linux/gpio.h>
15#include <linux/export.h>14#include <linux/export.h>
16#include <linux/platform_data/usb-omap.h>15#include <linux/platform_data/usb-omap.h>
17 16
18#include <linux/usb/musb.h>17#include <linux/usb/musb.h>
19 18
19#include "usb-tusb6010.h"
20#include "gpmc.h"20#include "gpmc.h"
21 21
22static u8 async_cs, sync_cs;22static u8 async_cs, sync_cs;
@@ -132,10 +132,6 @@ static struct resource tusb_resources[] = { · 109 unmodified lines
132 { /* Synchronous access */132 { /* Synchronous access */
133 .flags = IORESOURCE_MEM,133 .flags = IORESOURCE_MEM,
134 },134 },
135 { /* IRQ */
136 .name = "mc",
137 .flags = IORESOURCE_IRQ,
138 },
139};135};
140 136
141static u64 tusb_dmamask = ~(u32)0;137static u64 tusb_dmamask = ~(u32)0;
@@ -154,9 +150,9 @@ static struct platform_device tusb_device = { · 12 unmodified lines
154 150
155/* this may be called only from board-*.c setup code */151/* this may be called only from board-*.c setup code */
156int __init tusb6010_setup_interface(struct musb_hdrc_platform_data *data,152int __init tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
157 unsigned ps_refclk, unsigned waitpin,153 unsigned int ps_refclk, unsigned int waitpin,
158 unsigned async, unsigned sync,154 unsigned int async, unsigned int sync,
159 unsigned irq, unsigned dmachan)155 unsigned int dmachan)
160{156{
161 int status;157 int status;
162 static char error[] __initdata =158 static char error[] __initdata =
@@ -192,14 +188,6 @@ int __init tusb6010_setup_interface(struct musb_hdrc_platform_data *data, · 29 unmodified lines
192 if (status < 0)188 if (status < 0)
193 return status;189 return status;
194 190
195 /* IRQ */
196 status = gpio_request_one(irq, GPIOF_IN, "TUSB6010 irq");
197 if (status < 0) {
198 printk(error, 3, status);
199 return status;
200 }
201 tusb_resources[2].start = gpio_to_irq(irq);
202
203 /* set up memory timings ... can speed them up later */191 /* set up memory timings ... can speed them up later */
204 if (!ps_refclk) {192 if (!ps_refclk) {
205 printk(error, 4, status);193 printk(error, 4, status);
arch/arm/mach-omap2/usb-tusb6010.h+12−0
@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef __USB_TUSB6010_H
4#define __USB_TUSB6010_H
5
6extern int __init tusb6010_setup_interface(
7 struct musb_hdrc_platform_data *data,
8 unsigned int ps_refclk, unsigned int waitpin,
9 unsigned int async_cs, unsigned int sync_cs,
10 unsigned int dmachan);
11
12#endif /* __USB_TUSB6010_H */
arch/arm/mach-pxa/spitz.c+10−1
@@ -506,10 +506,18 @@ static struct ads7846_platform_data spitz_ads7846_info = { · 505 unmodified lines
506 .x_plate_ohms = 419,506 .x_plate_ohms = 419,
507 .y_plate_ohms = 486,507 .y_plate_ohms = 486,
508 .pressure_max = 1024,508 .pressure_max = 1024,
509 .gpio_pendown = SPITZ_GPIO_TP_INT,
510 .wait_for_sync = spitz_ads7846_wait_for_hsync,509 .wait_for_sync = spitz_ads7846_wait_for_hsync,
511};510};
512 511
512static struct gpiod_lookup_table spitz_ads7846_gpio_table = {
513 .dev_id = "spi2.0",
514 .table = {
515 GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_TP_INT,
516 "pendown", GPIO_ACTIVE_LOW),
517 { }
518 },
519};
520
513static void spitz_bl_kick_battery(void)521static void spitz_bl_kick_battery(void)
514{522{
515 void (*kick_batt)(void);523 void (*kick_batt)(void);
@@ -594,6 +602,7 @@ static void __init spitz_spi_init(void) · 78 unmodified lines
594 else602 else
595 gpiod_add_lookup_table(&spitz_lcdcon_gpio_table);603 gpiod_add_lookup_table(&spitz_lcdcon_gpio_table);
596 604
605 gpiod_add_lookup_table(&spitz_ads7846_gpio_table);
597 gpiod_add_lookup_table(&spitz_spi_gpio_table);606 gpiod_add_lookup_table(&spitz_spi_gpio_table);
598 pxa2xx_set_spi_info(2, &spitz_spi_info);607 pxa2xx_set_spi_info(2, &spitz_spi_info);
599 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));608 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
arch/mips/alchemy/devboards/db1000.c+10−1
@@ -381,13 +381,21 @@ static struct platform_device db1100_mmc1_dev = { · 380 unmodified lines
381static struct ads7846_platform_data db1100_touch_pd = {381static struct ads7846_platform_data db1100_touch_pd = {
382 .model = 7846,382 .model = 7846,
383 .vref_mv = 3300,383 .vref_mv = 3300,
384 .gpio_pendown = 21,
385};384};
386 385
387static struct spi_gpio_platform_data db1100_spictl_pd = {386static struct spi_gpio_platform_data db1100_spictl_pd = {
388 .num_chipselect = 1,387 .num_chipselect = 1,
389};388};
390 389
390static struct gpiod_lookup_table db1100_touch_gpio_table = {
391 .dev_id = "spi0.0",
392 .table = {
393 GPIO_LOOKUP("alchemy-gpio2", 21,
394 "pendown", GPIO_ACTIVE_LOW),
395 { }
396 },
397};
398
391static struct spi_board_info db1100_spi_info[] __initdata = {399static struct spi_board_info db1100_spi_info[] __initdata = {
392 [0] = {400 [0] = {
393 .modalias = "ads7846",401 .modalias = "ads7846",
@@ -474,6 +482,7 @@ int __init db1000_dev_setup(void) · 80 unmodified lines
474 pfc |= (1 << 0); /* SSI0 pins as GPIOs */482 pfc |= (1 << 0); /* SSI0 pins as GPIOs */
475 alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);483 alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);
476 484
485 gpiod_add_lookup_table(&db1100_touch_gpio_table);
477 spi_register_board_info(db1100_spi_info,486 spi_register_board_info(db1100_spi_info,
478 ARRAY_SIZE(db1100_spi_info));487 ARRAY_SIZE(db1100_spi_info));
479 488
drivers/gpio/gpio-twl4030.c+36−16
@@ -17,7 +17,9 @@ · 16 unmodified lines
17#include <linux/interrupt.h>17#include <linux/interrupt.h>
18#include <linux/kthread.h>18#include <linux/kthread.h>
19#include <linux/irq.h>19#include <linux/irq.h>
20#include <linux/gpio/machine.h>
20#include <linux/gpio/driver.h>21#include <linux/gpio/driver.h>
22#include <linux/gpio/consumer.h>
21#include <linux/platform_device.h>23#include <linux/platform_device.h>
22#include <linux/of.h>24#include <linux/of.h>
23#include <linux/irqdomain.h>25#include <linux/irqdomain.h>
@@ -465,8 +467,7 @@ static int gpio_twl4030_debounce(u32 debounce, u8 mmc_cd) · 441 unmodified lines
465 REG_GPIO_DEBEN1, 3);467 REG_GPIO_DEBEN1, 3);
466}468}
467 469
468static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev,470static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev)
469 struct twl4030_gpio_platform_data *pdata)
470{471{
471 struct twl4030_gpio_platform_data *omap_twl_info;472 struct twl4030_gpio_platform_data *omap_twl_info;
472 473
@@ -474,9 +475,6 @@ static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev, · 1 unmodified line
474 if (!omap_twl_info)475 if (!omap_twl_info)
475 return NULL;476 return NULL;
476 477
477 if (pdata)
478 *omap_twl_info = *pdata;
479
480 omap_twl_info->use_leds = of_property_read_bool(dev->of_node,478 omap_twl_info->use_leds = of_property_read_bool(dev->of_node,
481 "ti,use-leds");479 "ti,use-leds");
482 480
@@ -504,9 +502,18 @@ static int gpio_twl4030_remove(struct platform_device *pdev) · 21 unmodified lines
504 return 0;502 return 0;
505}503}
506 504
505/* Called from the registered devm action */
506static void gpio_twl4030_power_off_action(void *data)
507{
508 struct gpio_desc *d = data;
509
510 gpiod_unexport(d);
511 gpiochip_free_own_desc(d);
512}
513
507static int gpio_twl4030_probe(struct platform_device *pdev)514static int gpio_twl4030_probe(struct platform_device *pdev)
508{515{
509 struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);516 struct twl4030_gpio_platform_data *pdata;
510 struct device_node *node = pdev->dev.of_node;517 struct device_node *node = pdev->dev.of_node;
511 struct gpio_twl4030_priv *priv;518 struct gpio_twl4030_priv *priv;
512 int ret, irq_base;519 int ret, irq_base;
@@ -546,9 +553,7 @@ no_irqs: · 33 unmodified lines
546 553
547 mutex_init(&priv->mutex);554 mutex_init(&priv->mutex);
548 555
549 if (node)556 pdata = of_gpio_twl4030(&pdev->dev);
550 pdata = of_gpio_twl4030(&pdev->dev, pdata);
551
552 if (pdata == NULL) {557 if (pdata == NULL) {
553 dev_err(&pdev->dev, "Platform data is missing\n");558 dev_err(&pdev->dev, "Platform data is missing\n");
554 return -ENXIO;559 return -ENXIO;
@@ -585,17 +590,32 @@ no_irqs: · 30 unmodified lines
585 goto out;590 goto out;
586 }591 }
587 592
588 platform_set_drvdata(pdev, priv);593 /*
594 * Special quirk for the OMAP3 to hog and export a WLAN power
595 * GPIO.
596 */
597 if (IS_ENABLED(CONFIG_ARCH_OMAP3) &&
598 of_machine_is_compatible("compulab,omap3-sbc-t3730")) {
599 struct gpio_desc *d;
589 600
590 if (pdata->setup) {601 d = gpiochip_request_own_desc(&priv->gpio_chip,
591 int status;602 2, "wlan pwr",
603 GPIO_ACTIVE_HIGH,
604 GPIOD_OUT_HIGH);
605 if (IS_ERR(d))
606 return dev_err_probe(&pdev->dev, PTR_ERR(d),
607 "unable to hog wlan pwr GPIO\n");
608
609 gpiod_export(d, 0);
610
611 ret = devm_add_action_or_reset(&pdev->dev, gpio_twl4030_power_off_action, d);
612 if (ret)
613 return dev_err_probe(&pdev->dev, ret,
614 "failed to install power off handler\n");
592 615
593 status = pdata->setup(&pdev->dev, priv->gpio_chip.base,
594 TWL4030_GPIO_MAX);
595 if (status)
596 dev_dbg(&pdev->dev, "setup --> %d\n", status);
597 }616 }
598 617
618 platform_set_drvdata(pdev, priv);
599out:619out:
600 return ret;620 return ret;
601}621}
drivers/input/touchscreen/ads7846.c+41−72
@@ -24,11 +24,8 @@ · 23 unmodified lines
24#include <linux/interrupt.h>24#include <linux/interrupt.h>
25#include <linux/slab.h>25#include <linux/slab.h>
26#include <linux/pm.h>26#include <linux/pm.h>
27#include <linux/of.h>27#include <linux/property.h>
28#include <linux/of_gpio.h>
29#include <linux/of_device.h>
30#include <linux/gpio/consumer.h>28#include <linux/gpio/consumer.h>
31#include <linux/gpio.h>
32#include <linux/spi/spi.h>29#include <linux/spi/spi.h>
33#include <linux/spi/ads7846.h>30#include <linux/spi/ads7846.h>
34#include <linux/regulator/consumer.h>31#include <linux/regulator/consumer.h>
@@ -140,7 +137,7 @@ struct ads7846 { · 105 unmodified lines
140 int (*filter)(void *data, int data_idx, int *val);137 int (*filter)(void *data, int data_idx, int *val);
141 void *filter_data;138 void *filter_data;
142 int (*get_pendown_state)(void);139 int (*get_pendown_state)(void);
143 int gpio_pendown;140 struct gpio_desc *gpio_pendown;
144 141
145 void (*wait_for_sync)(void);142 void (*wait_for_sync)(void);
146};143};
@@ -223,7 +220,7 @@ static int get_pendown_state(struct ads7846 *ts) · 76 unmodified lines
223 if (ts->get_pendown_state)220 if (ts->get_pendown_state)
224 return ts->get_pendown_state();221 return ts->get_pendown_state();
225 222
226 return !gpio_get_value(ts->gpio_pendown);223 return gpiod_get_value(ts->gpio_pendown);
227}224}
228 225
229static void ads7846_report_pen_up(struct ads7846 *ts)226static void ads7846_report_pen_up(struct ads7846 *ts)
@@ -989,8 +986,6 @@ static int ads7846_setup_pendown(struct spi_device *spi, · 759 unmodified lines
989 struct ads7846 *ts,986 struct ads7846 *ts,
990 const struct ads7846_platform_data *pdata)987 const struct ads7846_platform_data *pdata)
991{988{
992 int err;
993
994 /*989 /*
995 * REVISIT when the irq can be triggered active-low, or if for some990 * REVISIT when the irq can be triggered active-low, or if for some
996 * reason the touchscreen isn't hooked up, we don't need to access991 * reason the touchscreen isn't hooked up, we don't need to access
@@ -999,25 +994,15 @@ static int ads7846_setup_pendown(struct spi_device *spi, · 2 unmodified lines
999 994
1000 if (pdata->get_pendown_state) {995 if (pdata->get_pendown_state) {
1001 ts->get_pendown_state = pdata->get_pendown_state;996 ts->get_pendown_state = pdata->get_pendown_state;
1002 } else if (gpio_is_valid(pdata->gpio_pendown)) {997 } else {
1003 998 ts->gpio_pendown = gpiod_get(&spi->dev, "pendown", GPIOD_IN);
1004 err = devm_gpio_request_one(&spi->dev, pdata->gpio_pendown,999 if (IS_ERR(ts->gpio_pendown)) {
1005 GPIOF_IN, "ads7846_pendown");1000 dev_err(&spi->dev, "failed to request pendown GPIO\n");
1006 if (err) {1001 return PTR_ERR(ts->gpio_pendown);
1007 dev_err(&spi->dev,
1008 "failed to request/setup pendown GPIO%d: %d\n",
1009 pdata->gpio_pendown, err);
1010 return err;
1011 }1002 }
1012
1013 ts->gpio_pendown = pdata->gpio_pendown;
1014
1015 if (pdata->gpio_pendown_debounce)1003 if (pdata->gpio_pendown_debounce)
1016 gpiod_set_debounce(gpio_to_desc(ts->gpio_pendown),1004 gpiod_set_debounce(ts->gpio_pendown,
1017 pdata->gpio_pendown_debounce);1005 pdata->gpio_pendown_debounce);
1018 } else {
1019 dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
1020 return -EINVAL;
1021 }1006 }
1022 1007
1023 return 0;1008 return 0;
@@ -1119,7 +1104,6 @@ static int ads7846_setup_spi_msg(struct ads7846 *ts, · 95 unmodified lines
1119 return 0;1104 return 0;
1120}1105}
1121 1106
1122#ifdef CONFIG_OF
1123static const struct of_device_id ads7846_dt_ids[] = {1107static const struct of_device_id ads7846_dt_ids[] = {
1124 { .compatible = "ti,tsc2046", .data = (void *) 7846 },1108 { .compatible = "ti,tsc2046", .data = (void *) 7846 },
1125 { .compatible = "ti,ads7843", .data = (void *) 7843 },1109 { .compatible = "ti,ads7843", .data = (void *) 7843 },
@@ -1130,20 +1114,14 @@ static const struct of_device_id ads7846_dt_ids[] = { · 4 unmodified lines
1130};1114};
1131MODULE_DEVICE_TABLE(of, ads7846_dt_ids);1115MODULE_DEVICE_TABLE(of, ads7846_dt_ids);
1132 1116
1133static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)1117static const struct ads7846_platform_data *ads7846_get_props(struct device *dev)
1134{1118{
1135 struct ads7846_platform_data *pdata;1119 struct ads7846_platform_data *pdata;
1136 struct device_node *node = dev->of_node;1120 const struct platform_device_id *pdev_id;
1137 const struct of_device_id *match;
1138 u32 value;1121 u32 value;
1139 1122
1140 if (!node) {1123 pdev_id = device_get_match_data(dev);
1141 dev_err(dev, "Device does not have associated DT data\n");1124 if (!pdev_id) {
1142 return ERR_PTR(-EINVAL);
1143 }
1144
1145 match = of_match_device(ads7846_dt_ids, dev);
1146 if (!match) {
1147 dev_err(dev, "Unknown device model\n");1125 dev_err(dev, "Unknown device model\n");
1148 return ERR_PTR(-EINVAL);1126 return ERR_PTR(-EINVAL);
1149 }1127 }
@@ -1152,60 +1130,51 @@ static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev) · 2 unmodified lines
1152 if (!pdata)1130 if (!pdata)
1153 return ERR_PTR(-ENOMEM);1131 return ERR_PTR(-ENOMEM);
1154 1132
1155 pdata->model = (unsigned long)match->data;1133 pdata->model = (unsigned long)pdev_id->driver_data;
1156 1134
1157 of_property_read_u16(node, "ti,vref-delay-usecs",1135 device_property_read_u16(dev, "ti,vref-delay-usecs",
1158 &pdata->vref_delay_usecs);1136 &pdata->vref_delay_usecs);
1159 of_property_read_u16(node, "ti,vref-mv", &pdata->vref_mv);1137 device_property_read_u16(dev, "ti,vref-mv", &pdata->vref_mv);
1160 pdata->keep_vref_on = of_property_read_bool(node, "ti,keep-vref-on");1138 pdata->keep_vref_on = device_property_read_bool(dev, "ti,keep-vref-on");
1161 1139
1162 pdata->swap_xy = of_property_read_bool(node, "ti,swap-xy");1140 pdata->swap_xy = device_property_read_bool(dev, "ti,swap-xy");
1163 1141
1164 of_property_read_u16(node, "ti,settle-delay-usec",1142 device_property_read_u16(dev, "ti,settle-delay-usec",
1165 &pdata->settle_delay_usecs);1143 &pdata->settle_delay_usecs);
1166 of_property_read_u16(node, "ti,penirq-recheck-delay-usecs",1144 device_property_read_u16(dev, "ti,penirq-recheck-delay-usecs",
1167 &pdata->penirq_recheck_delay_usecs);1145 &pdata->penirq_recheck_delay_usecs);
1168 1146
1169 of_property_read_u16(node, "ti,x-plate-ohms", &pdata->x_plate_ohms);1147 device_property_read_u16(dev, "ti,x-plate-ohms", &pdata->x_plate_ohms);
1170 of_property_read_u16(node, "ti,y-plate-ohms", &pdata->y_plate_ohms);1148 device_property_read_u16(dev, "ti,y-plate-ohms", &pdata->y_plate_ohms);
1171 1149
1172 of_property_read_u16(node, "ti,x-min", &pdata->x_min);1150 device_property_read_u16(dev, "ti,x-min", &pdata->x_min);
1173 of_property_read_u16(node, "ti,y-min", &pdata->y_min);1151 device_property_read_u16(dev, "ti,y-min", &pdata->y_min);
1174 of_property_read_u16(node, "ti,x-max", &pdata->x_max);1152 device_property_read_u16(dev, "ti,x-max", &pdata->x_max);
1175 of_property_read_u16(node, "ti,y-max", &pdata->y_max);1153 device_property_read_u16(dev, "ti,y-max", &pdata->y_max);
1176 1154
1177 /*1155 /*
1178 * touchscreen-max-pressure gets parsed during1156 * touchscreen-max-pressure gets parsed during
1179 * touchscreen_parse_properties()1157 * touchscreen_parse_properties()
1180 */1158 */
1181 of_property_read_u16(node, "ti,pressure-min", &pdata->pressure_min);1159 device_property_read_u16(dev, "ti,pressure-min", &pdata->pressure_min);
1182 if (!of_property_read_u32(node, "touchscreen-min-pressure", &value))1160 if (!device_property_read_u32(dev, "touchscreen-min-pressure", &value))
1183 pdata->pressure_min = (u16) value;1161 pdata->pressure_min = (u16) value;
1184 of_property_read_u16(node, "ti,pressure-max", &pdata->pressure_max);1162 device_property_read_u16(dev, "ti,pressure-max", &pdata->pressure_max);
1185 1163
1186 of_property_read_u16(node, "ti,debounce-max", &pdata->debounce_max);1164 device_property_read_u16(dev, "ti,debounce-max", &pdata->debounce_max);
1187 if (!of_property_read_u32(node, "touchscreen-average-samples", &value))1165 if (!device_property_read_u32(dev, "touchscreen-average-samples", &value))
1188 pdata->debounce_max = (u16) value;1166 pdata->debounce_max = (u16) value;
1189 of_property_read_u16(node, "ti,debounce-tol", &pdata->debounce_tol);1167 device_property_read_u16(dev, "ti,debounce-tol", &pdata->debounce_tol);
1190 of_property_read_u16(node, "ti,debounce-rep", &pdata->debounce_rep);1168 device_property_read_u16(dev, "ti,debounce-rep", &pdata->debounce_rep);
1191 1169
1192 of_property_read_u32(node, "ti,pendown-gpio-debounce",1170 device_property_read_u32(dev, "ti,pendown-gpio-debounce",
1193 &pdata->gpio_pendown_debounce);1171 &pdata->gpio_pendown_debounce);
1194 1172
1195 pdata->wakeup = of_property_read_bool(node, "wakeup-source") ||1173 pdata->wakeup = device_property_read_bool(dev, "wakeup-source") ||
1196 of_property_read_bool(node, "linux,wakeup");1174 device_property_read_bool(dev, "linux,wakeup");
1197
1198 pdata->gpio_pendown = of_get_named_gpio(dev->of_node, "pendown-gpio", 0);
1199 1175
1200 return pdata;1176 return pdata;
1201}1177}
1202#else
1203static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
1204{
1205 dev_err(dev, "no platform data defined\n");
1206 return ERR_PTR(-EINVAL);
1207}
1208#endif
1209 1178
1210static void ads7846_regulator_disable(void *regulator)1179static void ads7846_regulator_disable(void *regulator)
1211{1180{
@@ -1269,7 +1238,7 @@ static int ads7846_probe(struct spi_device *spi) · 57 unmodified lines
1269 1238
1270 pdata = dev_get_platdata(dev);1239 pdata = dev_get_platdata(dev);
1271 if (!pdata) {1240 if (!pdata) {
1272 pdata = ads7846_probe_dt(dev);1241 pdata = ads7846_get_props(dev);
1273 if (IS_ERR(pdata))1242 if (IS_ERR(pdata))
1274 return PTR_ERR(pdata);1243 return PTR_ERR(pdata);
1275 }1244 }
@@ -1426,7 +1395,7 @@ static struct spi_driver ads7846_driver = { · 150 unmodified lines
1426 .driver = {1395 .driver = {
1427 .name = "ads7846",1396 .name = "ads7846",
1428 .pm = pm_sleep_ptr(&ads7846_pm),1397 .pm = pm_sleep_ptr(&ads7846_pm),
1429 .of_match_table = of_match_ptr(ads7846_dt_ids),1398 .of_match_table = ads7846_dt_ids,
1430 },1399 },
1431 .probe = ads7846_probe,1400 .probe = ads7846_probe,
1432 .remove = ads7846_remove,1401 .remove = ads7846_remove,
drivers/mfd/tps65010.c+5−9
@@ -506,12 +506,8 @@ static void tps65010_remove(struct i2c_client *client) · 505 unmodified lines
506 struct tps65010 *tps = i2c_get_clientdata(client);506 struct tps65010 *tps = i2c_get_clientdata(client);
507 struct tps65010_board *board = dev_get_platdata(&client->dev);507 struct tps65010_board *board = dev_get_platdata(&client->dev);
508 508
509 if (board && board->teardown) {509 if (board && board->teardown)
510 int status = board->teardown(client, board->context);510 board->teardown(client, &tps->chip);
511 if (status < 0)
512 dev_dbg(&client->dev, "board %s %s err %d\n",
513 "teardown", client->name, status);
514 }
515 if (client->irq > 0)511 if (client->irq > 0)
516 free_irq(client->irq, tps);512 free_irq(client->irq, tps);
517 cancel_delayed_work_sync(&tps->work);513 cancel_delayed_work_sync(&tps->work);
@@ -619,7 +615,7 @@ static int tps65010_probe(struct i2c_client *client) · 101 unmodified lines
619 tps, DEBUG_FOPS);615 tps, DEBUG_FOPS);
620 616
621 /* optionally register GPIOs */617 /* optionally register GPIOs */
622 if (board && board->base != 0) {618 if (board) {
623 tps->outmask = board->outmask;619 tps->outmask = board->outmask;
624 620
625 tps->chip.label = client->name;621 tps->chip.label = client->name;
@@ -632,7 +628,7 @@ static int tps65010_probe(struct i2c_client *client) · 6 unmodified lines
632 /* NOTE: only partial support for inputs; nyet IRQs */628 /* NOTE: only partial support for inputs; nyet IRQs */
633 tps->chip.get = tps65010_gpio_get;629 tps->chip.get = tps65010_gpio_get;
634 630
635 tps->chip.base = board->base;631 tps->chip.base = -1;
636 tps->chip.ngpio = 7;632 tps->chip.ngpio = 7;
637 tps->chip.can_sleep = 1;633 tps->chip.can_sleep = 1;
638 634
@@ -641,7 +637,7 @@ static int tps65010_probe(struct i2c_client *client) · 2 unmodified lines
641 dev_err(&client->dev, "can't add gpiochip, err %d\n",637 dev_err(&client->dev, "can't add gpiochip, err %d\n",
642 status);638 status);
643 else if (board->setup) {639 else if (board->setup) {
644 status = board->setup(client, board->context);640 status = board->setup(client, &tps->chip);
645 if (status < 0) {641 if (status < 0) {
646 dev_dbg(&client->dev,642 dev_dbg(&client->dev,
647 "board %s %s err %d\n",643 "board %s %s err %d\n",
drivers/mmc/host/omap.c+44−2
@@ -26,6 +26,7 @@ · 25 unmodified lines
26#include <linux/clk.h>26#include <linux/clk.h>
27#include <linux/scatterlist.h>27#include <linux/scatterlist.h>
28#include <linux/slab.h>28#include <linux/slab.h>
29#include <linux/gpio/consumer.h>
29#include <linux/platform_data/mmc-omap.h>30#include <linux/platform_data/mmc-omap.h>
30 31
31 32
@@ -111,6 +112,9 @@ struct mmc_omap_slot { · 79 unmodified lines
111 struct mmc_request *mrq;112 struct mmc_request *mrq;
112 struct mmc_omap_host *host;113 struct mmc_omap_host *host;
113 struct mmc_host *mmc;114 struct mmc_host *mmc;
115 struct gpio_desc *vsd;
116 struct gpio_desc *vio;
117 struct gpio_desc *cover;
114 struct omap_mmc_slot_data *pdata;118 struct omap_mmc_slot_data *pdata;
115};119};
116 120
@@ -133,6 +137,7 @@ struct mmc_omap_host { · 16 unmodified lines
133 int irq;137 int irq;
134 unsigned char bus_mode;138 unsigned char bus_mode;
135 unsigned int reg_shift;139 unsigned int reg_shift;
140 struct gpio_desc *slot_switch;
136 141
137 struct work_struct cmd_abort_work;142 struct work_struct cmd_abort_work;
138 unsigned abort:1;143 unsigned abort:1;
@@ -216,8 +221,13 @@ no_claim: · 77 unmodified lines
216 221
217 if (host->current_slot != slot) {222 if (host->current_slot != slot) {
218 OMAP_MMC_WRITE(host, CON, slot->saved_con & 0xFC00);223 OMAP_MMC_WRITE(host, CON, slot->saved_con & 0xFC00);
219 if (host->pdata->switch_slot != NULL)224 if (host->slot_switch)
220 host->pdata->switch_slot(mmc_dev(slot->mmc), slot->id);225 /*
226 * With two slots and a simple GPIO switch, setting
227 * the GPIO to 0 selects slot ID 0, setting it to 1
228 * selects slot ID 1.
229 */
230 gpiod_set_value(host->slot_switch, slot->id);
221 host->current_slot = slot;231 host->current_slot = slot;
222 }232 }
223 233
@@ -297,6 +307,9 @@ static void mmc_omap_release_slot(struct mmc_omap_slot *slot, int clk_enabled) · 73 unmodified lines
297static inline307static inline
298int mmc_omap_cover_is_open(struct mmc_omap_slot *slot)308int mmc_omap_cover_is_open(struct mmc_omap_slot *slot)
299{309{
310 /* If we have a GPIO then use that */
311 if (slot->cover)
312 return gpiod_get_value(slot->cover);
300 if (slot->pdata->get_cover_state)313 if (slot->pdata->get_cover_state)
301 return slot->pdata->get_cover_state(mmc_dev(slot->mmc),314 return slot->pdata->get_cover_state(mmc_dev(slot->mmc),
302 slot->id);315 slot->id);
@@ -1106,6 +1119,11 @@ static void mmc_omap_set_power(struct mmc_omap_slot *slot, int power_on, · 803 unmodified lines
1106 1119
1107 host = slot->host;1120 host = slot->host;
1108 1121
1122 if (slot->vsd)
1123 gpiod_set_value(slot->vsd, power_on);
1124 if (slot->vio)
1125 gpiod_set_value(slot->vio, power_on);
1126
1109 if (slot->pdata->set_power != NULL)1127 if (slot->pdata->set_power != NULL)
1110 slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on,1128 slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on,
1111 vdd);1129 vdd);
@@ -1240,6 +1258,23 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id) · 128 unmodified lines
1240 slot->power_mode = MMC_POWER_UNDEFINED;1258 slot->power_mode = MMC_POWER_UNDEFINED;
1241 slot->pdata = &host->pdata->slots[id];1259 slot->pdata = &host->pdata->slots[id];
1242 1260
1261 /* Check for some optional GPIO controls */
1262 slot->vsd = gpiod_get_index_optional(host->dev, "vsd",
1263 id, GPIOD_OUT_LOW);
1264 if (IS_ERR(slot->vsd))
1265 return dev_err_probe(host->dev, PTR_ERR(slot->vsd),
1266 "error looking up VSD GPIO\n");
1267 slot->vio = gpiod_get_index_optional(host->dev, "vio",
1268 id, GPIOD_OUT_LOW);
1269 if (IS_ERR(slot->vio))
1270 return dev_err_probe(host->dev, PTR_ERR(slot->vio),
1271 "error looking up VIO GPIO\n");
1272 slot->cover = gpiod_get_index_optional(host->dev, "cover",
1273 id, GPIOD_IN);
1274 if (IS_ERR(slot->cover))
1275 return dev_err_probe(host->dev, PTR_ERR(slot->cover),
1276 "error looking up cover switch GPIO\n");
1277
1243 host->slots[id] = slot;1278 host->slots[id] = slot;
1244 1279
1245 mmc->caps = 0;1280 mmc->caps = 0;
@@ -1349,6 +1384,13 @@ static int mmc_omap_probe(struct platform_device *pdev) · 103 unmodified lines
1349 if (IS_ERR(host->virt_base))1384 if (IS_ERR(host->virt_base))
1350 return PTR_ERR(host->virt_base);1385 return PTR_ERR(host->virt_base);
1351 1386
1387 host->slot_switch = gpiod_get_optional(host->dev, "switch",
1388 GPIOD_OUT_LOW);
1389 if (IS_ERR(host->slot_switch))
1390 return dev_err_probe(host->dev, PTR_ERR(host->slot_switch),
1391 "error looking up slot switch GPIO\n");
1392
1393
1352 INIT_WORK(&host->slot_release_work, mmc_omap_slot_release_work);1394 INIT_WORK(&host->slot_release_work, mmc_omap_slot_release_work);
1353 INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work);1395 INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work);
1354 1396
drivers/usb/musb/musb_core.c+0−1
@@ -2330,7 +2330,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 2329 unmodified lines
2330 2330
2331 spin_lock_init(&musb->lock);2331 spin_lock_init(&musb->lock);
2332 spin_lock_init(&musb->list_lock);2332 spin_lock_init(&musb->list_lock);
2333 musb->board_set_power = plat->set_power;
2334 musb->min_power = plat->min_power;2333 musb->min_power = plat->min_power;
2335 musb->ops = plat->platform_ops;2334 musb->ops = plat->platform_ops;
2336 musb->port_mode = plat->mode;2335 musb->port_mode = plat->mode;
drivers/usb/musb/musb_core.h+0−2
@@ -352,8 +352,6 @@ struct musb { · 351 unmodified lines
352 u16 epmask;352 u16 epmask;
353 u8 nr_endpoints;353 u8 nr_endpoints;
354 354
355 int (*board_set_power)(int state);
356
357 u8 min_power; /* vbus for periph, in mA/2 */355 u8 min_power; /* vbus for periph, in mA/2 */
358 356
359 enum musb_mode port_mode;357 enum musb_mode port_mode;
drivers/usb/musb/tusb6010.c+39−14
@@ -11,6 +11,8 @@ · 10 unmodified lines
11 * interface.11 * interface.
12 */12 */
13 13
14#include <linux/gpio/consumer.h>
15#include <linux/delay.h>
14#include <linux/module.h>16#include <linux/module.h>
15#include <linux/kernel.h>17#include <linux/kernel.h>
16#include <linux/errno.h>18#include <linux/errno.h>
@@ -30,6 +32,8 @@ struct tusb6010_glue { · 13 unmodified lines
30 struct device *dev;32 struct device *dev;
31 struct platform_device *musb;33 struct platform_device *musb;
32 struct platform_device *phy;34 struct platform_device *phy;
35 struct gpio_desc *enable;
36 struct gpio_desc *intpin;
33};37};
34 38
35static void tusb_musb_set_vbus(struct musb *musb, int is_on);39static void tusb_musb_set_vbus(struct musb *musb, int is_on);
@@ -1021,16 +1025,29 @@ static void tusb_setup_cpu_interface(struct musb *musb) · 985 unmodified lines
1021 1025
1022static int tusb_musb_start(struct musb *musb)1026static int tusb_musb_start(struct musb *musb)
1023{1027{
1028 struct tusb6010_glue *glue = dev_get_drvdata(musb->controller->parent);
1024 void __iomem *tbase = musb->ctrl_base;1029 void __iomem *tbase = musb->ctrl_base;
1025 int ret = 0;
1026 unsigned long flags;1030 unsigned long flags;
1027 u32 reg;1031 u32 reg;
1032 int i;
1028 1033
1029 if (musb->board_set_power)1034 /*
1030 ret = musb->board_set_power(1);1035 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
1031 if (ret != 0) {1036 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
1032 printk(KERN_ERR "tusb: Cannot enable TUSB6010\n");1037 * provide then PGOOD signal to TUSB6010 which will release it from reset.
1033 return ret;1038 */
1039 gpiod_set_value(glue->enable, 1);
1040 msleep(1);
1041
1042 /* Wait for 100ms until TUSB6010 pulls INT pin down */
1043 i = 100;
1044 while (i && gpiod_get_value(glue->intpin)) {
1045 msleep(1);
1046 i--;
1047 }
1048 if (!i) {
1049 pr_err("tusb: Powerup respones failed\n");
1050 return -ENODEV;
1034 }1051 }
1035 1052
1036 spin_lock_irqsave(&musb->lock, flags);1053 spin_lock_irqsave(&musb->lock, flags);
@@ -1083,8 +1100,8 @@ static int tusb_musb_start(struct musb *musb) · 46 unmodified lines
1083err:1100err:
1084 spin_unlock_irqrestore(&musb->lock, flags);1101 spin_unlock_irqrestore(&musb->lock, flags);
1085 1102
1086 if (musb->board_set_power)1103 gpiod_set_value(glue->enable, 0);
1087 musb->board_set_power(0);1104 msleep(10);
1088 1105
1089 return -ENODEV;1106 return -ENODEV;
1090}1107}
@@ -1158,11 +1175,13 @@ done: · 67 unmodified lines
1158 1175
1159static int tusb_musb_exit(struct musb *musb)1176static int tusb_musb_exit(struct musb *musb)
1160{1177{
1178 struct tusb6010_glue *glue = dev_get_drvdata(musb->controller->parent);
1179
1161 del_timer_sync(&musb->dev_timer);1180 del_timer_sync(&musb->dev_timer);
1162 the_musb = NULL;1181 the_musb = NULL;
1163 1182
1164 if (musb->board_set_power)1183 gpiod_set_value(glue->enable, 0);
1165 musb->board_set_power(0);1184 msleep(10);
1166 1185
1167 iounmap(musb->sync_va);1186 iounmap(musb->sync_va);
1168 1187
@@ -1218,6 +1237,15 @@ static int tusb_probe(struct platform_device *pdev) · 49 unmodified lines
1218 1237
1219 glue->dev = &pdev->dev;1238 glue->dev = &pdev->dev;
1220 1239
1240 glue->enable = devm_gpiod_get(glue->dev, "enable", GPIOD_OUT_LOW);
1241 if (IS_ERR(glue->enable))
1242 return dev_err_probe(glue->dev, PTR_ERR(glue->enable),
1243 "could not obtain power on/off GPIO\n");
1244 glue->intpin = devm_gpiod_get(glue->dev, "int", GPIOD_IN);
1245 if (IS_ERR(glue->intpin))
1246 return dev_err_probe(glue->dev, PTR_ERR(glue->intpin),
1247 "could not obtain INT GPIO\n");
1248
1221 pdata->platform_ops = &tusb_ops;1249 pdata->platform_ops = &tusb_ops;
1222 1250
1223 usb_phy_generic_register();1251 usb_phy_generic_register();
@@ -1236,10 +1264,7 @@ static int tusb_probe(struct platform_device *pdev) · 12 unmodified lines
1236 musb_resources[1].end = pdev->resource[1].end;1264 musb_resources[1].end = pdev->resource[1].end;
1237 musb_resources[1].flags = pdev->resource[1].flags;1265 musb_resources[1].flags = pdev->resource[1].flags;
1238 1266
1239 musb_resources[2].name = pdev->resource[2].name;1267 musb_resources[2] = DEFINE_RES_IRQ_NAMED(gpiod_to_irq(glue->intpin), "mc");
1240 musb_resources[2].start = pdev->resource[2].start;
1241 musb_resources[2].end = pdev->resource[2].end;
1242 musb_resources[2].flags = pdev->resource[2].flags;
1243 1268
1244 pinfo = tusb_dev_info;1269 pinfo = tusb_dev_info;
1245 pinfo.parent = &pdev->dev;1270 pinfo.parent = &pdev->dev;
drivers/video/fbdev/omap/lcd_mipid.c+10−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
7 */7 */
8#include <linux/device.h>8#include <linux/device.h>
9#include <linux/delay.h>9#include <linux/delay.h>
10#include <linux/gpio/consumer.h>
10#include <linux/slab.h>11#include <linux/slab.h>
11#include <linux/workqueue.h>12#include <linux/workqueue.h>
12#include <linux/spi/spi.h>13#include <linux/spi/spi.h>
@@ -41,6 +42,7 @@ struct mipid_device { · 28 unmodified lines
41 when we can issue the42 when we can issue the
42 next sleep in/out command */43 next sleep in/out command */
43 unsigned long hw_guard_wait; /* max guard time in jiffies */44 unsigned long hw_guard_wait; /* max guard time in jiffies */
45 struct gpio_desc *reset;
44 46
45 struct omapfb_device *fbdev;47 struct omapfb_device *fbdev;
46 struct spi_device *spi;48 struct spi_device *spi;
@@ -556,6 +558,12 @@ static int mipid_spi_probe(struct spi_device *spi) · 509 unmodified lines
556 return -ENOMEM;558 return -ENOMEM;
557 }559 }
558 560
561 /* This will de-assert RESET if active */
562 md->reset = gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW);
563 if (IS_ERR(md->reset))
564 return dev_err_probe(&spi->dev, PTR_ERR(md->reset),
565 "no reset GPIO line\n");
566
559 spi->mode = SPI_MODE_0;567 spi->mode = SPI_MODE_0;
560 md->spi = spi;568 md->spi = spi;
561 dev_set_drvdata(&spi->dev, md);569 dev_set_drvdata(&spi->dev, md);
@@ -574,6 +582,8 @@ static void mipid_spi_remove(struct spi_device *spi) · 12 unmodified lines
574{582{
575 struct mipid_device *md = dev_get_drvdata(&spi->dev);583 struct mipid_device *md = dev_get_drvdata(&spi->dev);
576 584
585 /* Asserts RESET */
586 gpiod_set_value(md->reset, 1);
577 mipid_disable(&md->panel);587 mipid_disable(&md->panel);
578 kfree(md);588 kfree(md);
579}589}
include/linux/mfd/tps65010.h+4−7
@@ -28,6 +28,8 @@ · 27 unmodified lines
28#ifndef __LINUX_I2C_TPS65010_H28#ifndef __LINUX_I2C_TPS65010_H
29#define __LINUX_I2C_TPS65010_H29#define __LINUX_I2C_TPS65010_H
30 30
31struct gpio_chip;
32
31/*33/*
32 * ----------------------------------------------------------------------------34 * ----------------------------------------------------------------------------
33 * Registers, all 8 bits35 * Registers, all 8 bits
@@ -176,12 +178,10 @@ struct i2c_client; · 142 unmodified lines
176 178
177/**179/**
178 * struct tps65010_board - packages GPIO and LED lines180 * struct tps65010_board - packages GPIO and LED lines
179 * @base: the GPIO number to assign to GPIO-1
180 * @outmask: bit (N-1) is set to allow GPIO-N to be used as an181 * @outmask: bit (N-1) is set to allow GPIO-N to be used as an
181 * (open drain) output182 * (open drain) output
182 * @setup: optional callback issued once the GPIOs are valid183 * @setup: optional callback issued once the GPIOs are valid
183 * @teardown: optional callback issued before the GPIOs are invalidated184 * @teardown: optional callback issued before the GPIOs are invalidated
184 * @context: optional parameter passed to setup() and teardown()
185 *185 *
186 * Board data may be used to package the GPIO (and LED) lines for use186 * Board data may be used to package the GPIO (and LED) lines for use
187 * in by the generic GPIO and LED frameworks. The first four GPIOs187 * in by the generic GPIO and LED frameworks. The first four GPIOs
@@ -193,12 +193,9 @@ struct i2c_client; · 5 unmodified lines
193 * devices in their initial states using these GPIOs.193 * devices in their initial states using these GPIOs.
194 */194 */
195struct tps65010_board {195struct tps65010_board {
196 int base;
197 unsigned outmask;196 unsigned outmask;
198 197 int (*setup)(struct i2c_client *client, struct gpio_chip *gc);
199 int (*setup)(struct i2c_client *client, void *context);198 void (*teardown)(struct i2c_client *client, struct gpio_chip *gc);
200 int (*teardown)(struct i2c_client *client, void *context);
201 void *context;
202};199};
203 200
204#endif /* __LINUX_I2C_TPS65010_H */201#endif /* __LINUX_I2C_TPS65010_H */
include/linux/mfd/twl.h+0−3
@@ -593,9 +593,6 @@ struct twl4030_gpio_platform_data { · 592 unmodified lines
593 */593 */
594 u32 pullups;594 u32 pullups;
595 u32 pulldowns;595 u32 pulldowns;
596
597 int (*setup)(struct device *dev,
598 unsigned gpio, unsigned ngpio);
599};596};
600 597
601struct twl4030_madc_platform_data {598struct twl4030_madc_platform_data {
include/linux/platform_data/lcd-mipid.h+0−2
@@ -15,10 +15,8 @@ enum mipid_test_result { · 14 unmodified lines
15#ifdef __KERNEL__15#ifdef __KERNEL__
16 16
17struct mipid_platform_data {17struct mipid_platform_data {
18 int nreset_gpio;
19 int data_lines;18 int data_lines;
20 19
21 void (*shutdown)(struct mipid_platform_data *pdata);
22 void (*set_bklight_level)(struct mipid_platform_data *pdata,20 void (*set_bklight_level)(struct mipid_platform_data *pdata,
23 int level);21 int level);
24 int (*get_bklight_level)(struct mipid_platform_data *pdata);22 int (*get_bklight_level)(struct mipid_platform_data *pdata);
include/linux/platform_data/mmc-omap.h+0−2
@@ -20,8 +20,6 @@ struct omap_mmc_platform_data { · 19 unmodified lines
20 * maximum frequency on the MMC bus */20 * maximum frequency on the MMC bus */
21 unsigned int max_freq;21 unsigned int max_freq;
22 22
23 /* switch the bus to a new slot */
24 int (*switch_slot)(struct device *dev, int slot);
25 /* initialize board-specific MMC functionality, can be NULL if23 /* initialize board-specific MMC functionality, can be NULL if
26 * not supported */24 * not supported */
27 int (*init)(struct device *dev);25 int (*init)(struct device *dev);
include/linux/spi/ads7846.h+0−2
@@ -35,8 +35,6 @@ struct ads7846_platform_data { · 34 unmodified lines
35 u16 debounce_tol; /* tolerance used for filtering */35 u16 debounce_tol; /* tolerance used for filtering */
36 u16 debounce_rep; /* additional consecutive good readings36 u16 debounce_rep; /* additional consecutive good readings
37 * required after the first two */37 * required after the first two */
38 int gpio_pendown; /* the GPIO used to decide the pendown
39 * state if get_pendown_state == NULL */
40 int gpio_pendown_debounce; /* platform specific debounce time for38 int gpio_pendown_debounce; /* platform specific debounce time for
41 * the gpio_pendown */39 * the gpio_pendown */
42 int (*get_pendown_state)(void);40 int (*get_pendown_state)(void);
include/linux/usb/musb.h+0−13
@@ -99,9 +99,6 @@ struct musb_hdrc_platform_data { · 98 unmodified lines
99 /* (HOST or OTG) program PHY for external Vbus */99 /* (HOST or OTG) program PHY for external Vbus */
100 unsigned extvbus:1;100 unsigned extvbus:1;
101 101
102 /* Power the device on or off */
103 int (*set_power)(int state);
104
105 /* MUSB configuration-specific details */102 /* MUSB configuration-specific details */
106 const struct musb_hdrc_config *config;103 const struct musb_hdrc_config *config;
107 104
@@ -135,14 +132,4 @@ static inline int musb_mailbox(enum musb_vbus_id_status status) · 27 unmodified lines
135#define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */132#define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */
136#define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */133#define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */
137 134
138#ifdef CONFIG_ARCH_OMAP2
139
140extern int __init tusb6010_setup_interface(
141 struct musb_hdrc_platform_data *data,
142 unsigned ps_refclk, unsigned waitpin,
143 unsigned async_cs, unsigned sync_cs,
144 unsigned irq, unsigned dmachan);
145
146#endif /* OMAP2 */
147
148#endif /* __LINUX_USB_MUSB_H */135#endif /* __LINUX_USB_MUSB_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t