aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ucb1x00-core.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-20 17:13:52 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-18 18:15:30 -0500
commitabe06082d07fcb0673cb93338c1d6f037fdc375b (patch)
tree1ea446f1a77a30f3cb06e19f1af6f2a4ddfb6b6b /drivers/mfd/ucb1x00-core.c
parenta6aecae29affdd1a84198afe45ef9e13ecbf9826 (diff)
MFD: mcp/ucb1x00: separate ucb1x00 driver data from the MCP data
Patch taken from 5dd7bf59e0 (ARM: sa11x0: Implement autoloading of codec and codec pdata for mcp bus.) by Jochen Friedrich <jochen@scram.de>. This adds just the codec data part of the patch. Acked-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mfd/ucb1x00-core.c')
-rw-r--r--drivers/mfd/ucb1x00-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index f2fb4205467c..6825169b06fc 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -534,6 +534,7 @@ static int ucb1x00_probe(struct mcp *mcp)
534{ 534{
535 struct ucb1x00 *ucb; 535 struct ucb1x00 *ucb;
536 struct ucb1x00_driver *drv; 536 struct ucb1x00_driver *drv;
537 struct ucb1x00_plat_data *pdata;
537 unsigned int id; 538 unsigned int id;
538 int ret = -ENODEV; 539 int ret = -ENODEV;
539 int temp; 540 int temp;
@@ -551,7 +552,7 @@ static int ucb1x00_probe(struct mcp *mcp)
551 if (!ucb) 552 if (!ucb)
552 goto err_disable; 553 goto err_disable;
553 554
554 555 pdata = mcp->attached_device.platform_data;
555 ucb->dev.class = &ucb1x00_class; 556 ucb->dev.class = &ucb1x00_class;
556 ucb->dev.parent = &mcp->attached_device; 557 ucb->dev.parent = &mcp->attached_device;
557 dev_set_name(&ucb->dev, "ucb1x00"); 558 dev_set_name(&ucb->dev, "ucb1x00");
@@ -570,9 +571,9 @@ static int ucb1x00_probe(struct mcp *mcp)
570 } 571 }
571 572
572 ucb->gpio.base = -1; 573 ucb->gpio.base = -1;
573 if (mcp->gpio_base != 0) { 574 if (pdata && pdata->gpio_base) {
574 ucb->gpio.label = dev_name(&ucb->dev); 575 ucb->gpio.label = dev_name(&ucb->dev);
575 ucb->gpio.base = mcp->gpio_base; 576 ucb->gpio.base = pdata->gpio_base;
576 ucb->gpio.ngpio = 10; 577 ucb->gpio.ngpio = 10;
577 ucb->gpio.set = ucb1x00_gpio_set; 578 ucb->gpio.set = ucb1x00_gpio_set;
578 ucb->gpio.get = ucb1x00_gpio_get; 579 ucb->gpio.get = ucb1x00_gpio_get;