Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308786
b: refs/heads/master
c: ca2cad6
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Ortiz committed May 23, 2012
1 parent c0b5dea commit 307ae70
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 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: 78302a194c0ddf4438e50e3f9b327a6dce6bc8fc
refs/heads/master: ca2cad6ae38ea0ff27a7a7a00bfaa571fbe9051f
16 changes: 15 additions & 1 deletion trunk/drivers/mfd/twl6040-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@
#define VIBRACTRL_MEMBER(reg) ((reg == TWL6040_REG_VIBCTLL) ? 0 : 1)
#define TWL6040_NUM_SUPPLIES (2)

static bool twl6040_has_vibra(struct twl6040_platform_data *pdata,
struct device_node *node)
{
if (pdata && pdata->vibra)
return true;

#ifdef CONFIG_OF
if (of_find_node_by_name(node, "vibra"))
return true;
#endif

return false;
}

int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
{
int ret;
Expand Down Expand Up @@ -617,7 +631,7 @@ static int __devinit twl6040_probe(struct i2c_client *client,
}
children++;

if ((pdata && pdata->vibra) || of_find_node_by_name(node, "vibra")) {
if (twl6040_has_vibra(pdata, node)) {
irq = twl6040->irq_base + TWL6040_IRQ_VIB;

cell = &twl6040->cells[children];
Expand Down

0 comments on commit 307ae70

Please sign in to comment.