aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/ti_am335x_tscadc.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index 292d34eaed54..e78b9df590c0 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -26,8 +26,6 @@
26#include <linux/of_device.h> 26#include <linux/of_device.h>
27 27
28#include <linux/mfd/ti_am335x_tscadc.h> 28#include <linux/mfd/ti_am335x_tscadc.h>
29#include <linux/input/ti_am335x_tsc.h>
30#include <linux/platform_data/ti_am335x_adc.h>
31 29
32static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg) 30static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg)
33{ 31{
@@ -91,31 +89,22 @@ static int ti_tscadc_probe(struct platform_device *pdev)
91 struct ti_tscadc_dev *tscadc; 89 struct ti_tscadc_dev *tscadc;
92 struct resource *res; 90 struct resource *res;
93 struct clk *clk; 91 struct clk *clk;
94 struct mfd_tscadc_board *pdata = pdev->dev.platform_data;
95 struct device_node *node = pdev->dev.of_node; 92 struct device_node *node = pdev->dev.of_node;
96 struct mfd_cell *cell; 93 struct mfd_cell *cell;
97 int err, ctrl; 94 int err, ctrl;
98 int clk_value, clock_rate; 95 int clk_value, clock_rate;
99 int tsc_wires = 0, adc_channels = 0, total_channels; 96 int tsc_wires = 0, adc_channels = 0, total_channels;
100 97
101 if (!pdata && !pdev->dev.of_node) { 98 if (!pdev->dev.of_node) {
102 dev_err(&pdev->dev, "Could not find platform data\n"); 99 dev_err(&pdev->dev, "Could not find valid DT data.\n");
103 return -EINVAL; 100 return -EINVAL;
104 } 101 }
105 102
106 if (pdev->dev.platform_data) { 103 node = of_get_child_by_name(pdev->dev.of_node, "tsc");
107 if (pdata->tsc_init) 104 of_property_read_u32(node, "ti,wires", &tsc_wires);
108 tsc_wires = pdata->tsc_init->wires;
109 105
110 if (pdata->adc_init) 106 node = of_get_child_by_name(pdev->dev.of_node, "adc");
111 adc_channels = pdata->adc_init->adc_channels; 107 of_property_read_u32(node, "ti,adc-channels", &adc_channels);
112 } else {
113 node = of_get_child_by_name(pdev->dev.of_node, "tsc");
114 of_property_read_u32(node, "ti,wires", &tsc_wires);
115
116 node = of_get_child_by_name(pdev->dev.of_node, "adc");
117 of_property_read_u32(node, "ti,adc-channels", &adc_channels);
118 }
119 108
120 total_channels = tsc_wires + adc_channels; 109 total_channels = tsc_wires + adc_channels;
121 110