diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2013-07-13 16:36:19 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-08-13 01:30:39 -0400 |
commit | 7bf2a98a436ebc60b5388b1cb5fd3d0fbf78814c (patch) | |
tree | 7b420008f5472bb5b0c8fb9734eae7a23a055afe /drivers/input/misc/twl6040-vibra.c | |
parent | 46146e7d4b383d5b34014d072553498c7cd52821 (diff) |
Input: twl6040-vibra - remove support for legacy (pdata) mode
TWL6040 is used only with OMAP4/5 SoCs and they can only boot in in DT mode.
The support for pdata/legacy boot can be removed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc/twl6040-vibra.c')
-rw-r--r-- | drivers/input/misc/twl6040-vibra.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 0c2dfc8e9691..7864b0c3ebb3 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c | |||
@@ -257,7 +257,6 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); | |||
257 | 257 | ||
258 | static int twl6040_vibra_probe(struct platform_device *pdev) | 258 | static int twl6040_vibra_probe(struct platform_device *pdev) |
259 | { | 259 | { |
260 | struct twl6040_vibra_data *pdata = pdev->dev.platform_data; | ||
261 | struct device *twl6040_core_dev = pdev->dev.parent; | 260 | struct device *twl6040_core_dev = pdev->dev.parent; |
262 | struct device_node *twl6040_core_node = NULL; | 261 | struct device_node *twl6040_core_node = NULL; |
263 | struct vibra_info *info; | 262 | struct vibra_info *info; |
@@ -270,8 +269,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev) | |||
270 | "vibra"); | 269 | "vibra"); |
271 | #endif | 270 | #endif |
272 | 271 | ||
273 | if (!pdata && !twl6040_core_node) { | 272 | if (!twl6040_core_node) { |
274 | dev_err(&pdev->dev, "platform_data not available\n"); | 273 | dev_err(&pdev->dev, "parent of node is missing?\n"); |
275 | return -EINVAL; | 274 | return -EINVAL; |
276 | } | 275 | } |
277 | 276 | ||
@@ -284,27 +283,17 @@ static int twl6040_vibra_probe(struct platform_device *pdev) | |||
284 | info->dev = &pdev->dev; | 283 | info->dev = &pdev->dev; |
285 | 284 | ||
286 | info->twl6040 = dev_get_drvdata(pdev->dev.parent); | 285 | info->twl6040 = dev_get_drvdata(pdev->dev.parent); |
287 | if (pdata) { | 286 | |
288 | info->vibldrv_res = pdata->vibldrv_res; | 287 | of_property_read_u32(twl6040_core_node, "ti,vibldrv-res", |
289 | info->vibrdrv_res = pdata->vibrdrv_res; | 288 | &info->vibldrv_res); |
290 | info->viblmotor_res = pdata->viblmotor_res; | 289 | of_property_read_u32(twl6040_core_node, "ti,vibrdrv-res", |
291 | info->vibrmotor_res = pdata->vibrmotor_res; | 290 | &info->vibrdrv_res); |
292 | vddvibl_uV = pdata->vddvibl_uV; | 291 | of_property_read_u32(twl6040_core_node, "ti,viblmotor-res", |
293 | vddvibr_uV = pdata->vddvibr_uV; | 292 | &info->viblmotor_res); |
294 | } else { | 293 | of_property_read_u32(twl6040_core_node, "ti,vibrmotor-res", |
295 | of_property_read_u32(twl6040_core_node, "ti,vibldrv-res", | 294 | &info->vibrmotor_res); |
296 | &info->vibldrv_res); | 295 | of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV", &vddvibl_uV); |
297 | of_property_read_u32(twl6040_core_node, "ti,vibrdrv-res", | 296 | of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", &vddvibr_uV); |
298 | &info->vibrdrv_res); | ||
299 | of_property_read_u32(twl6040_core_node, "ti,viblmotor-res", | ||
300 | &info->viblmotor_res); | ||
301 | of_property_read_u32(twl6040_core_node, "ti,vibrmotor-res", | ||
302 | &info->vibrmotor_res); | ||
303 | of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV", | ||
304 | &vddvibl_uV); | ||
305 | of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", | ||
306 | &vddvibr_uV); | ||
307 | } | ||
308 | 297 | ||
309 | if ((!info->vibldrv_res && !info->viblmotor_res) || | 298 | if ((!info->vibldrv_res && !info->viblmotor_res) || |
310 | (!info->vibrdrv_res && !info->vibrmotor_res)) { | 299 | (!info->vibrdrv_res && !info->vibrmotor_res)) { |
@@ -334,8 +323,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev) | |||
334 | * When booted with Device tree the regulators are attached to the | 323 | * When booted with Device tree the regulators are attached to the |
335 | * parent device (twl6040 MFD core) | 324 | * parent device (twl6040 MFD core) |
336 | */ | 325 | */ |
337 | ret = regulator_bulk_get(pdata ? info->dev : twl6040_core_dev, | 326 | ret = regulator_bulk_get(twl6040_core_dev, ARRAY_SIZE(info->supplies), |
338 | ARRAY_SIZE(info->supplies), info->supplies); | 327 | info->supplies); |
339 | if (ret) { | 328 | if (ret) { |
340 | dev_err(info->dev, "couldn't get regulators %d\n", ret); | 329 | dev_err(info->dev, "couldn't get regulators %d\n", ret); |
341 | return ret; | 330 | return ret; |