| .. | .. |
|---|
| 26 | 26 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 27 | 27 | */ |
|---|
| 28 | 28 | #include <linux/gpio.h> |
|---|
| 29 | +#include <linux/gpio/machine.h> |
|---|
| 29 | 30 | #include <linux/kernel.h> |
|---|
| 30 | 31 | #include <linux/init.h> |
|---|
| 31 | 32 | #include <linux/platform_device.h> |
|---|
| .. | .. |
|---|
| 54 | 55 | #include <mach/usb.h> |
|---|
| 55 | 56 | |
|---|
| 56 | 57 | #include "common.h" |
|---|
| 58 | + |
|---|
| 59 | +/* Name of the GPIO chip used by the OMAP for GPIOs 0..15 */ |
|---|
| 60 | +#define OMAP_GPIO_LABEL "gpio-0-15" |
|---|
| 57 | 61 | |
|---|
| 58 | 62 | /* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ |
|---|
| 59 | 63 | #define OMAP_OSK_ETHR_START 0x04800300 |
|---|
| .. | .. |
|---|
| 199 | 203 | */ |
|---|
| 200 | 204 | gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en"); |
|---|
| 201 | 205 | gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1); |
|---|
| 206 | + /* Free the GPIO again as the driver will request it */ |
|---|
| 207 | + gpio_free(OSK_TPS_GPIO_USB_PWR_EN); |
|---|
| 202 | 208 | |
|---|
| 203 | 209 | /* Set GPIO 2 high so LED D3 is off by default */ |
|---|
| 204 | 210 | tps65010_set_gpio_out_value(GPIO2, HIGH); |
|---|
| .. | .. |
|---|
| 240 | 246 | |
|---|
| 241 | 247 | static struct i2c_board_info __initdata osk_i2c_board_info[] = { |
|---|
| 242 | 248 | { |
|---|
| 249 | + /* This device will get the name "i2c-tps65010" */ |
|---|
| 243 | 250 | I2C_BOARD_INFO("tps65010", 0x48), |
|---|
| 251 | + .dev_name = "tps65010", |
|---|
| 244 | 252 | .platform_data = &tps_board, |
|---|
| 245 | 253 | |
|---|
| 246 | 254 | }, |
|---|
| .. | .. |
|---|
| 277 | 285 | /* the CF I/O IRQ is really active-low */ |
|---|
| 278 | 286 | irq_set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING); |
|---|
| 279 | 287 | } |
|---|
| 288 | + |
|---|
| 289 | +static struct gpiod_lookup_table osk_usb_gpio_table = { |
|---|
| 290 | + .dev_id = "ohci", |
|---|
| 291 | + .table = { |
|---|
| 292 | + /* Power GPIO on the I2C-attached TPS65010 */ |
|---|
| 293 | + GPIO_LOOKUP("tps65010", 0, "power", GPIO_ACTIVE_HIGH), |
|---|
| 294 | + GPIO_LOOKUP(OMAP_GPIO_LABEL, 9, "overcurrent", |
|---|
| 295 | + GPIO_ACTIVE_HIGH), |
|---|
| 296 | + }, |
|---|
| 297 | +}; |
|---|
| 280 | 298 | |
|---|
| 281 | 299 | static struct omap_usb_config osk_usb_config __initdata = { |
|---|
| 282 | 300 | /* has usb host connector (A) ... for development it can also |
|---|
| .. | .. |
|---|
| 581 | 599 | l |= (3 << 1); |
|---|
| 582 | 600 | omap_writel(l, USB_TRANSCEIVER_CTRL); |
|---|
| 583 | 601 | |
|---|
| 602 | + gpiod_add_lookup_table(&osk_usb_gpio_table); |
|---|
| 584 | 603 | omap1_usb_init(&osk_usb_config); |
|---|
| 585 | 604 | |
|---|
| 586 | 605 | /* irq for tps65010 chip */ |
|---|