diff options
author | Patil, Rachna <rachna@ti.com> | 2012-10-16 03:25:44 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-05 17:50:27 -0500 |
commit | 2b99bafab19145a72e2c557326fc4662a864a162 (patch) | |
tree | d70c833c0b64297439f5b44568754e4fcc592d49 /drivers/mfd/ti_am335x_tscadc.c | |
parent | 01636eb970a029897b06fb96026941429212ddd9 (diff) |
input: TSC: ti_tsc: Convert TSC into a MFDevice
This patch converts touchscreen into a MFD client.
All the register definitions, clock initialization,
etc has been moved to MFD core driver.
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/ti_am335x_tscadc.c')
-rw-r--r-- | drivers/mfd/ti_am335x_tscadc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index 14df67bc390f..d812be4b61df 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/pm_runtime.h> | 24 | #include <linux/pm_runtime.h> |
25 | 25 | ||
26 | #include <linux/mfd/ti_am335x_tscadc.h> | 26 | #include <linux/mfd/ti_am335x_tscadc.h> |
27 | #include <linux/input/ti_am335x_tsc.h> | ||
27 | 28 | ||
28 | static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg) | 29 | static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg) |
29 | { | 30 | { |
@@ -62,15 +63,19 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
62 | struct resource *res; | 63 | struct resource *res; |
63 | struct clk *clk; | 64 | struct clk *clk; |
64 | struct mfd_tscadc_board *pdata = pdev->dev.platform_data; | 65 | struct mfd_tscadc_board *pdata = pdev->dev.platform_data; |
66 | struct mfd_cell *cell; | ||
65 | int irq; | 67 | int irq; |
66 | int err, ctrl; | 68 | int err, ctrl; |
67 | int clk_value, clock_rate; | 69 | int clk_value, clock_rate; |
70 | int tsc_wires; | ||
68 | 71 | ||
69 | if (!pdata) { | 72 | if (!pdata) { |
70 | dev_err(&pdev->dev, "Could not find platform data\n"); | 73 | dev_err(&pdev->dev, "Could not find platform data\n"); |
71 | return -EINVAL; | 74 | return -EINVAL; |
72 | } | 75 | } |
73 | 76 | ||
77 | tsc_wires = pdata->tsc_init->wires; | ||
78 | |||
74 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 79 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
75 | if (!res) { | 80 | if (!res) { |
76 | dev_err(&pdev->dev, "no memory resource defined.\n"); | 81 | dev_err(&pdev->dev, "no memory resource defined.\n"); |
@@ -161,6 +166,12 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
161 | ctrl |= CNTRLREG_TSCSSENB; | 166 | ctrl |= CNTRLREG_TSCSSENB; |
162 | tscadc_writel(tscadc, REG_CTRL, ctrl); | 167 | tscadc_writel(tscadc, REG_CTRL, ctrl); |
163 | 168 | ||
169 | /* TSC Cell */ | ||
170 | cell = &tscadc->cells[TSC_CELL]; | ||
171 | cell->name = "tsc"; | ||
172 | cell->platform_data = tscadc; | ||
173 | cell->pdata_size = sizeof(*tscadc); | ||
174 | |||
164 | err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, | 175 | err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, |
165 | TSCADC_CELLS, NULL, 0, NULL); | 176 | TSCADC_CELLS, NULL, 0, NULL); |
166 | if (err < 0) | 177 | if (err < 0) |