Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329975
b: refs/heads/master
c: 64b9e4d
h: refs/heads/master
i:
  329973: 151f8f9
  329971: c9be862
  329967: 11693b8
v: v3
  • Loading branch information
Peter Ujfalusi authored and Samuel Ortiz committed Sep 18, 2012
1 parent 004a3da commit a0cf7b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 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: 019a7e6b7b312b17cd74b45d09d4ec17486c4088
refs/heads/master: 64b9e4d803b154a78a2e76bd466bb32ad6f383de
18 changes: 16 additions & 2 deletions trunk/drivers/input/misc/twl4030-vibra.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/workqueue.h>
#include <linux/i2c/twl.h>
#include <linux/mfd/twl4030-audio.h>
Expand Down Expand Up @@ -194,13 +195,26 @@ static int twl4030_vibra_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
twl4030_vibra_suspend, twl4030_vibra_resume);

static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
struct device_node *node)
{
if (pdata && pdata->coexist)
return true;

if (of_find_node_by_name(node, "codec"))
return true;

return false;
}

static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
{
struct twl4030_vibra_data *pdata = pdev->dev.platform_data;
struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
struct vibra_info *info;
int ret;

if (!pdata) {
if (!pdata && !twl4030_core_node) {
dev_dbg(&pdev->dev, "platform_data not available\n");
return -EINVAL;
}
Expand All @@ -210,7 +224,7 @@ static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
return -ENOMEM;

info->dev = &pdev->dev;
info->coexist = pdata->coexist;
info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
INIT_WORK(&info->play_work, vibra_play_work);

info->input_dev = input_allocate_device();
Expand Down

0 comments on commit a0cf7b0

Please sign in to comment.