Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296366
b: refs/heads/master
c: 2f7510c
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed Feb 18, 2012
1 parent 0ae4ad9 commit 898e4ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c364ff473a8d31c93da5e21ac5d2789a935c8faf
refs/heads/master: 2f7510c6070932371e0b842a5470ce7190dcf162
17 changes: 13 additions & 4 deletions trunk/drivers/mfd/ucb1x00-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,17 @@ static struct class ucb1x00_class = {

static int ucb1x00_probe(struct mcp *mcp)
{
struct ucb1x00 *ucb;
struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data;
struct ucb1x00_driver *drv;
struct ucb1x00_plat_data *pdata;
struct ucb1x00 *ucb;
unsigned int id;
int ret = -ENODEV;
int temp;

/* Tell the platform to deassert the UCB1x00 reset */
if (pdata && pdata->reset)
pdata->reset(UCB_RST_PROBE);

mcp_enable(mcp);
id = mcp_reg_read(mcp, UCB_ID);

Expand All @@ -550,7 +554,6 @@ static int ucb1x00_probe(struct mcp *mcp)
if (!ucb)
goto err_disable;

pdata = mcp->attached_device.platform_data;
ucb->dev.class = &ucb1x00_class;
ucb->dev.parent = &mcp->attached_device;
dev_set_name(&ucb->dev, "ucb1x00");
Expand Down Expand Up @@ -606,7 +609,7 @@ static int ucb1x00_probe(struct mcp *mcp)
}
mutex_unlock(&ucb1x00_mutex);

goto out;
return ret;

err_irq:
free_irq(ucb->irq, ucb);
Expand All @@ -618,11 +621,14 @@ static int ucb1x00_probe(struct mcp *mcp)
err_disable:
mcp_disable(mcp);
out:
if (pdata && pdata->reset)
pdata->reset(UCB_RST_PROBE_FAIL);
return ret;
}

static void ucb1x00_remove(struct mcp *mcp)
{
struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data;
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct list_head *l, *n;
int ret;
Expand All @@ -643,6 +649,9 @@ static void ucb1x00_remove(struct mcp *mcp)

free_irq(ucb->irq, ucb);
device_unregister(&ucb->dev);

if (pdata && pdata->reset)
pdata->reset(UCB_RST_REMOVE);
}

int ucb1x00_register_driver(struct ucb1x00_driver *drv)
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/linux/mfd/ucb1x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@
#define UCB_MODE_DYN_VFLAG_ENA (1 << 12)
#define UCB_MODE_AUD_OFF_CAN (1 << 13)

enum ucb1x00_reset {
UCB_RST_PROBE,
UCB_RST_REMOVE,
UCB_RST_PROBE_FAIL,
};

struct ucb1x00_plat_data {
void (*reset)(enum ucb1x00_reset);
int gpio_base;
};

Expand Down

0 comments on commit 898e4ee

Please sign in to comment.