Thread (4 messages) 4 messages, 3 authors, 2012-02-20

Re: [PATCH] input/mc13783-ts: add pdata to set conversion delay

From: Uwe Kleine-König <hidden>
Date: 2012-01-11 08:36:39
Also in: lkml

Hello Michael,

On Wed, Jan 11, 2012 at 09:18:23AM +0100, Michael Thalmeier wrote:
quoted hunk ↗ jump to hunk
MC13783 can be programmed to wait some clock cycles between the touch screen
polarization and the resistance conversion. This is needed to adjust for
touchscreens with high capacitance between plates.

Signed-off-by: Michael Thalmeier <redacted>
---
 drivers/hwmon/mc13783-adc.c            |    2 +-
 drivers/input/touchscreen/mc13783_ts.c |    6 +++++-
 drivers/mfd/mc13xxx-core.c             |   11 +++++++++--
 include/linux/mfd/mc13xxx.h            |   16 +++++++++++++++-
 4 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
index ef65ab5..6acd044 100644
--- a/drivers/hwmon/mc13783-adc.c
+++ b/drivers/hwmon/mc13783-adc.c
@@ -53,7 +53,7 @@ static int mc13783_adc_read(struct device *dev,
 
 	ret = mc13xxx_adc_do_conversion(priv->mc13xxx,
 			MC13XXX_ADC_MODE_MULT_CHAN,
-			channel, sample);
+			channel, 0, 0, sample);
 	if (ret)
 		return ret;
 
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
index 68f86f7..d71f45a 100644
--- a/drivers/input/touchscreen/mc13783_ts.c
+++ b/drivers/input/touchscreen/mc13783_ts.c
@@ -39,6 +39,7 @@ struct mc13783_ts_priv {
 	struct delayed_work work;
 	struct workqueue_struct *workq;
 	unsigned int sample[4];
+	struct mc13xxx_ts_platform_data *touch;
 };
 
 static irqreturn_t mc13783_ts_handler(int irq, void *data)
@@ -125,7 +126,9 @@ static void mc13783_ts_work(struct work_struct *work)
 	unsigned int channel = 12;
 
 	if (mc13xxx_adc_do_conversion(priv->mc13xxx,
-				mode, channel, priv->sample) == 0)
+				mode, channel,
+				priv->touch->ato, priv->touch->atox,
+				priv->sample) == 0)
 		mc13783_ts_report_sample(priv);
 }
 
@@ -179,6 +182,7 @@ static int __init mc13783_ts_probe(struct platform_device *pdev)
 	INIT_DELAYED_WORK(&priv->work, mc13783_ts_work);
 	priv->mc13xxx = dev_get_drvdata(pdev->dev.parent);
 	priv->idev = idev;
+	priv->touch = dev_get_platdata(&pdev->dev);
This cannot fail in practice unless the device isn't created via
mc13xxx_probe. Still it would feel a tad better to have error detection
here or at least a comment saying why it doesn't fail.

Other than that:
Acked-by: Uwe Kleine-König <redacted>

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help