Commit 8c1f422c authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

i2c: move twl4030-madc to new registration style

Moving twl4030-madc to new style registration just like
the other twl4030 children.

Cc: Mikko Ylinen <mikko.k.ylinen@nokia.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 2e056215
......@@ -355,12 +355,17 @@ static struct twl4030_usb_data sdp2430_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_madc_platform_data sdp2430_madc_data = {
.irq_line = 1,
};
static struct twl4030_platform_data sdp2430_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.gpio = &sdp2430_gpio_data,
.madc = &sdp2430_madc_data,
.keypad = &sdp2430_kp_data,
.usb = &sdp2430_usb_data,
};
......
......@@ -310,12 +310,17 @@ static struct twl4030_usb_data sdp3430_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_madc_platform_data sdp3430_madc_data = {
.irq_line = 1,
};
static struct twl4030_platform_data sdp3430_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.gpio = &sdp3430_gpio_data,
.madc = &sdp3430_madc_data,
.keypad = &sdp3430_kp_data,
.usb = &sdp3430_usb_data,
};
......
......@@ -193,11 +193,16 @@ static struct twl4030_gpio_platform_data ldp_gpio_data = {
.irq_end = TWL4030_GPIO_IRQ_END,
};
static struct twl4030_madc_platform_data ldp_madc_data = {
.irq_line = 1,
};
static struct twl4030_platform_data ldp_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
/* platform_data for children goes here */
.madc = &ldp_madc_data,
.usb = &ldp_usb_data,
.gpio = &ldp_gpio_data,
};
......
......@@ -236,12 +236,17 @@ static struct twl4030_usb_data omap2evm_usb_data = {
.usb_mode = T2_USB_MODE_ULPI,
};
static struct twl4030_madc_platform_data omap2evm_madc_data = {
.irq_line = 1,
};
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,
.madc = &omap2evm_madc_data,
.usb = &omap2evm_usb_data,
.gpio = &omap2evm_gpio_data,
};
......
......@@ -128,12 +128,17 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
.irq = TWL4030_MODIRQ_KEYPAD,
};
static struct twl4030_madc_platform_data omap3evm_madc_data = {
.irq_line = 1,
};
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,
.madc = &omap3evm_madc_data,
.usb = &omap3evm_usb_data,
.gpio = &omap3evm_gpio_data,
};
......
......@@ -69,6 +69,12 @@
#define twl_has_gpio() false
#endif
#if defined(CONFIG_TWL4030_MADC) || defined(CONFIG_TWL4030_MADC_MODULE)
#define twl_has_madc() true
#else
#define twl_has_madc() false
#endif
/* Primary Interrupt Handler on TWL4030 Registers */
/* Register Definitions */
......@@ -772,6 +778,27 @@ static int add_children(struct twl4030_platform_data *pdata)
}
}
if (twl_has_madc() && pdata->madc) {
pdev = platform_device_alloc("twl4030_madc", -1);
if (pdev) {
twl = &twl4030_modules[TWL4030_SLAVENUM_NUM2];
pdev->dev.parent = &twl->client->dev;
device_init_wakeup(&pdev->dev, 1);
status = platform_device_add_data(pdev, pdata->madc,
sizeof(*pdata->madc));
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.
......@@ -67,6 +67,10 @@ struct twl4030_gpio_platform_data {
unsigned gpio, unsigned ngpio);
};
struct twl4030_madc_platform_data {
int irq_line;
};
struct twl4030_keypad_data {
int rows;
int cols;
......@@ -88,6 +92,7 @@ struct twl4030_usb_data {
struct twl4030_platform_data {
unsigned irq_base, irq_end;
struct twl4030_gpio_platform_data *gpio;
struct twl4030_madc_platform_data *madc;
struct twl4030_keypad_data *keypad;
struct twl4030_usb_data *usb;
......
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