| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Hardware definitions for Palm Tungsten|E2 |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Rewrite for mainline: |
|---|
| 8 | 9 | * Marek Vasut <marek.vasut@gmail.com> |
|---|
| 9 | 10 | * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 12 | | - * published by the Free Software Foundation. |
|---|
| 13 | | - * |
|---|
| 14 | 11 | * (find more info at www.hackndev.com) |
|---|
| 15 | | - * |
|---|
| 16 | 12 | */ |
|---|
| 17 | 13 | |
|---|
| 18 | 14 | #include <linux/platform_device.h> |
|---|
| 19 | 15 | #include <linux/delay.h> |
|---|
| 20 | 16 | #include <linux/irq.h> |
|---|
| 21 | 17 | #include <linux/gpio_keys.h> |
|---|
| 18 | +#include <linux/gpio/machine.h> |
|---|
| 22 | 19 | #include <linux/input.h> |
|---|
| 23 | 20 | #include <linux/pda_power.h> |
|---|
| 24 | 21 | #include <linux/pwm.h> |
|---|
| .. | .. |
|---|
| 26 | 23 | #include <linux/gpio.h> |
|---|
| 27 | 24 | #include <linux/wm97xx.h> |
|---|
| 28 | 25 | #include <linux/power_supply.h> |
|---|
| 29 | | -#include <linux/usb/gpio_vbus.h> |
|---|
| 30 | 26 | |
|---|
| 31 | 27 | #include <asm/mach-types.h> |
|---|
| 32 | 28 | #include <asm/mach/arch.h> |
|---|
| .. | .. |
|---|
| 101 | 97 | ******************************************************************************/ |
|---|
| 102 | 98 | static struct pxamci_platform_data palmte2_mci_platform_data = { |
|---|
| 103 | 99 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
|---|
| 104 | | - .gpio_card_detect = GPIO_NR_PALMTE2_SD_DETECT_N, |
|---|
| 105 | | - .gpio_card_ro = GPIO_NR_PALMTE2_SD_READONLY, |
|---|
| 106 | | - .gpio_power = GPIO_NR_PALMTE2_SD_POWER, |
|---|
| 100 | +}; |
|---|
| 101 | + |
|---|
| 102 | +static struct gpiod_lookup_table palmte2_mci_gpio_table = { |
|---|
| 103 | + .dev_id = "pxa2xx-mci.0", |
|---|
| 104 | + .table = { |
|---|
| 105 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTE2_SD_DETECT_N, |
|---|
| 106 | + "cd", GPIO_ACTIVE_LOW), |
|---|
| 107 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTE2_SD_READONLY, |
|---|
| 108 | + "wp", GPIO_ACTIVE_LOW), |
|---|
| 109 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTE2_SD_POWER, |
|---|
| 110 | + "power", GPIO_ACTIVE_HIGH), |
|---|
| 111 | + { }, |
|---|
| 112 | + }, |
|---|
| 107 | 113 | }; |
|---|
| 108 | 114 | |
|---|
| 109 | 115 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
|---|
| .. | .. |
|---|
| 169 | 175 | static struct platform_pwm_backlight_data palmte2_backlight_data = { |
|---|
| 170 | 176 | .max_brightness = PALMTE2_MAX_INTENSITY, |
|---|
| 171 | 177 | .dft_brightness = PALMTE2_MAX_INTENSITY, |
|---|
| 172 | | - .enable_gpio = -1, |
|---|
| 173 | 178 | .init = palmte2_backlight_init, |
|---|
| 174 | 179 | .notify = palmte2_backlight_notify, |
|---|
| 175 | 180 | .exit = palmte2_backlight_exit, |
|---|
| .. | .. |
|---|
| 194 | 199 | /****************************************************************************** |
|---|
| 195 | 200 | * UDC |
|---|
| 196 | 201 | ******************************************************************************/ |
|---|
| 197 | | -static struct gpio_vbus_mach_info palmte2_udc_info = { |
|---|
| 198 | | - .gpio_vbus = GPIO_NR_PALMTE2_USB_DETECT_N, |
|---|
| 199 | | - .gpio_vbus_inverted = 1, |
|---|
| 200 | | - .gpio_pullup = GPIO_NR_PALMTE2_USB_PULLUP, |
|---|
| 202 | +static struct gpiod_lookup_table palmte2_udc_gpiod_table = { |
|---|
| 203 | + .dev_id = "gpio-vbus", |
|---|
| 204 | + .table = { |
|---|
| 205 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTE2_USB_DETECT_N, |
|---|
| 206 | + "vbus", GPIO_ACTIVE_LOW), |
|---|
| 207 | + GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTE2_USB_PULLUP, |
|---|
| 208 | + "pullup", GPIO_ACTIVE_HIGH), |
|---|
| 209 | + { }, |
|---|
| 210 | + }, |
|---|
| 201 | 211 | }; |
|---|
| 202 | 212 | |
|---|
| 203 | 213 | static struct platform_device palmte2_gpio_vbus = { |
|---|
| 204 | 214 | .name = "gpio-vbus", |
|---|
| 205 | 215 | .id = -1, |
|---|
| 206 | | - .dev = { |
|---|
| 207 | | - .platform_data = &palmte2_udc_info, |
|---|
| 208 | | - }, |
|---|
| 209 | 216 | }; |
|---|
| 210 | 217 | |
|---|
| 211 | 218 | /****************************************************************************** |
|---|
| .. | .. |
|---|
| 354 | 361 | pxa_set_stuart_info(NULL); |
|---|
| 355 | 362 | |
|---|
| 356 | 363 | pxa_set_fb_info(NULL, &palmte2_lcd_screen); |
|---|
| 364 | + gpiod_add_lookup_table(&palmte2_mci_gpio_table); |
|---|
| 357 | 365 | pxa_set_mci_info(&palmte2_mci_platform_data); |
|---|
| 358 | 366 | palmte2_udc_init(); |
|---|
| 359 | 367 | pxa_set_ac97_info(&palmte2_ac97_pdata); |
|---|
| 360 | 368 | pxa_set_ficp_info(&palmte2_ficp_platform_data); |
|---|
| 361 | 369 | |
|---|
| 362 | 370 | pwm_add_table(palmte2_pwm_lookup, ARRAY_SIZE(palmte2_pwm_lookup)); |
|---|
| 371 | + gpiod_add_lookup_table(&palmte2_udc_gpiod_table); |
|---|
| 363 | 372 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
|---|
| 364 | 373 | } |
|---|
| 365 | 374 | |
|---|