Commit fde13f8f authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

i2c: move twl4030-usb to platform_device

use new style twl4030-core to register a platform_device
for twl4030-usb.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 3e60d4e6
......@@ -344,12 +344,18 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = {
{OMAP_TAG_SERIAL_CONSOLE, &sdp2430_serial_console_config},
};
static struct twl4030_usb_data sdp2430_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_platform_data sdp2430_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.keypad = &sdp2430_kp_data,
.usb = &sdp2430_usb_data,
};
static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = {
......
......@@ -300,12 +300,17 @@ static struct omap_board_config_kernel sdp3430_config[] __initdata = {
{ OMAP_TAG_LCD, &sdp3430_lcd_config },
};
static struct twl4030_usb_data sdp3430_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_platform_data sdp3430_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.keypad = &sdp3430_kp_data,
.usb = &sdp3430_usb_data,
};
static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
......
......@@ -183,9 +183,16 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {
{ OMAP_TAG_UART, &ldp_uart_config },
};
static struct twl4030_usb_data ldp_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_platform_data ldp_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.usb = &ldp_usb_data,
};
static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
......
......@@ -226,12 +226,17 @@ static struct omap_board_config_kernel omap2_evm_config[] __initdata = {
{ OMAP_TAG_LCD, &omap2_evm_lcd_config },
};
static struct twl4030_usb_data omap2evm_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_platform_data omap2evm_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.keypad = &omap2evm_kp_data,
.usb = &omap2evm_usb_data,
};
static struct i2c_board_info __initdata omap2evm_i2c_boardinfo[] = {
......
......@@ -110,9 +110,16 @@ static struct omap_uart_config omap3_beagle_uart_config __initdata = {
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
};
static struct twl4030_usb_data beagle_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_platform_data beagle_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.usb = &beagle_usb_data,
};
static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
......
......@@ -90,6 +90,10 @@ static struct omap_uart_config omap3_evm_uart_config __initdata = {
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
};
static struct twl4030_usb_data omap3evm_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static int omap3evm_keymap[] = {
KEY(0, 0, KEY_LEFT),
KEY(0, 1, KEY_RIGHT),
......@@ -118,13 +122,13 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
.irq = TWL4030_MODIRQ_KEYPAD,
};
static struct twl4030_platform_data omap3evm_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.keypad = &omap3evm_kp_data,
.usb = &omap3evm_usb_data,
};
static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
......
......@@ -146,9 +146,14 @@ static struct omap_uart_config overo_uart_config __initdata = {
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
};
static struct twl4030_usb_data overo_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_platform_data overo_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
.usb = &overo_usb_data,
};
static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
......
......@@ -186,22 +186,6 @@ config TWL4030_USB
tristate "TWL4030 USB Transceiver Driver"
depends on TWL4030_CORE
choice
prompt "Transceiver mode"
depends on TWL4030_USB
help
TWL4030 USB transceiver can operate in various
mutually-exclusive modes. Select one of them.
config TWL4030_USB_HS_ULPI
depends on TWL4030_USB
bool "High-speed ULPI"
help
Say Y here if the TWL4030 is connected to high-speed USB
controller through a ULPI interface.
endchoice
config TWL4030_PWRBUTTON
tristate "TWL4030 Power button Driver"
depends on TWL4030_CORE
......
......@@ -57,6 +57,12 @@
#define twl_has_keypad() false
#endif
#if defined(CONFIG_TWL4030_USB) || defined(CONFIG_TWL4030_USB_MODULE)
#define twl_has_usb() true
#else
#define twl_has_usb() false
#endif
/* Primary Interrupt Handler on TWL4030 Registers */
/* Register Definitions */
......@@ -701,6 +707,27 @@ static int add_children(struct twl4030_platform_data *pdata)
}
}
if (twl_has_usb() && pdata->usb) {
pdev = platform_device_alloc("twl4030_usb", -1);
if (pdev) {
twl = &twl4030_modules[TWL4030_SLAVENUM_NUM0];
pdev->dev.parent = &twl->client->dev;
device_init_wakeup(&pdev->dev, 1);
status = platform_device_add_data(pdev, pdata->usb,
sizeof(*pdata->usb));
if (status < 0) {
platform_device_put(pdev);
goto err;
}
status = platform_device_add(pdev);
if (status < 0)
platform_device_put(pdev);
} else {
status = -ENOMEM;
goto err;
}
}
err:
pr_err("failed to add twl4030's children\n");
return status;
......
This diff is collapsed.
......@@ -61,9 +61,19 @@ struct twl4030_keypad_data {
unsigned int rep:1;
};
enum twl4030_usb_mode {
T2_USB_MODE_ULPI = 1,
T2_USB_MODE_CEA2011_3PIN = 2,
};
struct twl4030_usb_data {
enum twl4030_usb_mode usb_mode;
};
struct twl4030_platform_data {
unsigned irq_base, irq_end;
struct twl4030_keypad_data *keypad;
struct twl4030_usb_data *usb;
/* REVISIT more to come ... _nothing_ should be hard-wired */
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment