public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Aaron Sierra <asierra@xes-inc.com>
Cc: Kwangwoo Lee <kwangwoo.lee@gmail.com>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Philip Rakity <prakity@marvell.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 1/2] input: tsc2007: Convert msecs to jiffies only once
Date: Tue, 31 Mar 2015 14:41:19 -0700	[thread overview]
Message-ID: <20150331214119.GB2045@dtor-ws> (raw)
In-Reply-To: <295524964.19874.1427814359807.JavaMail.zimbra@xes-inc.com>

On Tue, Mar 31, 2015 at 10:05:59AM -0500, Aaron Sierra wrote:
> Eliminate redundant calculations by performing millisecond to jiffy
> calculations once during driver initialization.
> 
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/tsc2007.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
> index 1bf9906..4e97afb 100644
> --- a/drivers/input/touchscreen/tsc2007.c
> +++ b/drivers/input/touchscreen/tsc2007.c
> @@ -214,8 +214,7 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
>  			dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt);
>  		}
>  
> -		wait_event_timeout(ts->wait, ts->stopped,
> -				   msecs_to_jiffies(ts->poll_period));
> +		wait_event_timeout(ts->wait, ts->stopped, ts->poll_period);
>  	}
>  
>  	dev_dbg(&ts->client->dev, "UP\n");
> @@ -314,9 +313,9 @@ static int tsc2007_probe_dt(struct i2c_client *client, struct tsc2007 *ts)
>  		ts->fuzzz = val32;
>  
>  	if (!of_property_read_u64(np, "ti,poll-period", &val64))
> -		ts->poll_period = val64;
> +		ts->poll_period = msecs_to_jiffies(val64);
>  	else
> -		ts->poll_period = 1;
> +		ts->poll_period = msecs_to_jiffies(1);
>  
>  	if (!of_property_read_u32(np, "ti,x-plate-ohms", &val32)) {
>  		ts->x_plate_ohms = val32;
> @@ -350,7 +349,9 @@ static int tsc2007_probe_pdev(struct i2c_client *client, struct tsc2007 *ts,
>  	ts->model             = pdata->model;
>  	ts->x_plate_ohms      = pdata->x_plate_ohms;
>  	ts->max_rt            = pdata->max_rt ? : MAX_12BIT;
> -	ts->poll_period       = pdata->poll_period ? : 1;
> +	ts->poll_period       = pdata->poll_period ?
> +					msecs_to_jiffies(pdata->poll_period) :
> +					msecs_to_jiffies(1);
>  	ts->get_pendown_state = pdata->get_pendown_state;
>  	ts->clear_penirq      = pdata->clear_penirq;
>  	ts->fuzzx             = pdata->fuzzx;
> -- 
> 1.9.1

-- 
Dmitry

      reply	other threads:[~2015-03-31 21:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1273443062.19653.1427814254249.JavaMail.zimbra@xes-inc.com>
2015-03-31 15:05 ` [PATCH 1/2] input: tsc2007: Convert msecs to jiffies only once Aaron Sierra
2015-03-31 21:41   ` Dmitry Torokhov [this message]

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=20150331214119.GB2045@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=asierra@xes-inc.com \
    --cc=kwangwoo.lee@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=prakity@marvell.com \
    --cc=thierry.reding@avionic-design.de \
    /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