summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ti_am335x_tscadc.c
diff options
context:
space:
mode:
authorPatil, Rachna <rachna@ti.com>2012-10-16 12:55:44 +0530
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-05 23:50:27 +0100
commit2b99bafab19145a72e2c557326fc4662a864a162 (patch)
treed70c833c0b64297439f5b44568754e4fcc592d49 /drivers/mfd/ti_am335x_tscadc.c
parent01636eb970a029897b06fb96026941429212ddd9 (diff)
downloadblackbird-obmc-linux-2b99bafab19145a72e2c557326fc4662a864a162.tar.gz
blackbird-obmc-linux-2b99bafab19145a72e2c557326fc4662a864a162.zip
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.c11
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 @@
#include <linux/pm_runtime.h>
#include <linux/mfd/ti_am335x_tscadc.h>
+#include <linux/input/ti_am335x_tsc.h>
static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg)
{
@@ -62,15 +63,19 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev)
struct resource *res;
struct clk *clk;
struct mfd_tscadc_board *pdata = pdev->dev.platform_data;
+ struct mfd_cell *cell;
int irq;
int err, ctrl;
int clk_value, clock_rate;
+ int tsc_wires;
if (!pdata) {
dev_err(&pdev->dev, "Could not find platform data\n");
return -EINVAL;
}
+ tsc_wires = pdata->tsc_init->wires;
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "no memory resource defined.\n");
@@ -161,6 +166,12 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev)
ctrl |= CNTRLREG_TSCSSENB;
tscadc_writel(tscadc, REG_CTRL, ctrl);
+ /* TSC Cell */
+ cell = &tscadc->cells[TSC_CELL];
+ cell->name = "tsc";
+ cell->platform_data = tscadc;
+ cell->pdata_size = sizeof(*tscadc);
+
err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells,
TSCADC_CELLS, NULL, 0, NULL);
if (err < 0)
OpenPOWER on IntegriCloud