diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 08:09:18 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 08:09:18 +0100 |
commit | 68fe0f0a6dcd2ac1ace5da3647a6d1cf0f4d2fea (patch) | |
tree | 69d855c2e46d42ef8f23680cf3a1e6ff38de9ef4 /drivers/input/misc/twl4030-vibra.c | |
parent | Input: wacom - add INPUT_PROP_DIRECT flag to Cintiq 24HD (diff) | |
parent | Linux 3.7-rc3 (diff) | |
download | linux-68fe0f0a6dcd2ac1ace5da3647a6d1cf0f4d2fea.tar.xz linux-68fe0f0a6dcd2ac1ace5da3647a6d1cf0f4d2fea.zip |
Merge tag 'v3.7-rc3' into for-linus to sync up with recent USB changes
Diffstat (limited to 'drivers/input/misc/twl4030-vibra.c')
-rw-r--r-- | drivers/input/misc/twl4030-vibra.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index fc0ed9b43424..2194a3c7236a 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c @@ -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> @@ -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; } @@ -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(); |