Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bf2a98a authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Dmitry Torokhov
Browse files

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: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 46146e7d
Loading
Loading
Loading
Loading
+15 −26
Original line number Original line Diff line number Diff line
@@ -257,7 +257,6 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);


static int twl6040_vibra_probe(struct platform_device *pdev)
static int twl6040_vibra_probe(struct platform_device *pdev)
{
{
	struct twl6040_vibra_data *pdata = pdev->dev.platform_data;
	struct device *twl6040_core_dev = pdev->dev.parent;
	struct device *twl6040_core_dev = pdev->dev.parent;
	struct device_node *twl6040_core_node = NULL;
	struct device_node *twl6040_core_node = NULL;
	struct vibra_info *info;
	struct vibra_info *info;
@@ -270,8 +269,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
						 "vibra");
						 "vibra");
#endif
#endif


	if (!pdata && !twl6040_core_node) {
	if (!twl6040_core_node) {
		dev_err(&pdev->dev, "platform_data not available\n");
		dev_err(&pdev->dev, "parent of node is missing?\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


@@ -284,14 +283,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
	info->dev = &pdev->dev;
	info->dev = &pdev->dev;


	info->twl6040 = dev_get_drvdata(pdev->dev.parent);
	info->twl6040 = dev_get_drvdata(pdev->dev.parent);
	if (pdata) {

		info->vibldrv_res = pdata->vibldrv_res;
		info->vibrdrv_res = pdata->vibrdrv_res;
		info->viblmotor_res = pdata->viblmotor_res;
		info->vibrmotor_res = pdata->vibrmotor_res;
		vddvibl_uV = pdata->vddvibl_uV;
		vddvibr_uV = pdata->vddvibr_uV;
	} else {
	of_property_read_u32(twl6040_core_node, "ti,vibldrv-res",
	of_property_read_u32(twl6040_core_node, "ti,vibldrv-res",
			     &info->vibldrv_res);
			     &info->vibldrv_res);
	of_property_read_u32(twl6040_core_node, "ti,vibrdrv-res",
	of_property_read_u32(twl6040_core_node, "ti,vibrdrv-res",
@@ -300,11 +292,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
			     &info->viblmotor_res);
			     &info->viblmotor_res);
	of_property_read_u32(twl6040_core_node, "ti,vibrmotor-res",
	of_property_read_u32(twl6040_core_node, "ti,vibrmotor-res",
			     &info->vibrmotor_res);
			     &info->vibrmotor_res);
		of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV",
	of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV", &vddvibl_uV);
				     &vddvibl_uV);
	of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", &vddvibr_uV);
		of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV",
				     &vddvibr_uV);
	}


	if ((!info->vibldrv_res && !info->viblmotor_res) ||
	if ((!info->vibldrv_res && !info->viblmotor_res) ||
	    (!info->vibrdrv_res && !info->vibrmotor_res)) {
	    (!info->vibrdrv_res && !info->vibrmotor_res)) {
@@ -334,8 +323,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
	 * When booted with Device tree the regulators are attached to the
	 * When booted with Device tree the regulators are attached to the
	 * parent device (twl6040 MFD core)
	 * parent device (twl6040 MFD core)
	 */
	 */
	ret = regulator_bulk_get(pdata ? info->dev : twl6040_core_dev,
	ret = regulator_bulk_get(twl6040_core_dev, ARRAY_SIZE(info->supplies),
				 ARRAY_SIZE(info->supplies), info->supplies);
				 info->supplies);
	if (ret) {
	if (ret) {
		dev_err(info->dev, "couldn't get regulators %d\n", ret);
		dev_err(info->dev, "couldn't get regulators %d\n", ret);
		return ret;
		return ret;