From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Michael Thalmeier <michael.thalmeier@hale.at>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Samuel Ortiz <sameo@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
michael@thalmeier.at
Subject: Re: [PATCH] input/mc13783-ts: add pdata to set conversion delay
Date: Wed, 11 Jan 2012 09:36:34 +0100 [thread overview]
Message-ID: <20120111083634.GL14252@pengutronix.de> (raw)
In-Reply-To: <1326269903-22180-1-git-send-email-michael.thalmeier@hale.at>
Hello Michael,
On Wed, Jan 11, 2012 at 09:18:23AM +0100, Michael Thalmeier wrote:
> 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 <michael.thalmeier@hale.at>
> ---
> 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 <u.kleine-koenig@pengutronix.de>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2012-01-11 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 8:18 [PATCH] input/mc13783-ts: add pdata to set conversion delay Michael Thalmeier
2012-01-11 8:36 ` Uwe Kleine-König [this message]
2012-02-20 11:13 ` Samuel Ortiz
2012-02-20 11:20 ` Samuel Ortiz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120111083634.GL14252@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.thalmeier@hale.at \
--cc=michael@thalmeier.at \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).