[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANLzEkuXj3M6phmA2vrOpO9ofiMzLf47RHeN3G1GWdtwJ-FXOQ@mail.gmail.com>
Date: Fri, 22 Feb 2013 17:45:20 -0800
From: Benson Leung <bleung@...omium.org>
To: Nick Dyer <nick.dyer@...ev.co.uk>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Daniel Kurtz <djkurtz@...omium.org>,
Henrik Rydberg <rydberg@...omail.se>,
Joonyoung Shim <jy0922.shim@...sung.com>,
"Bowens, Alan" <Alan.Bowens@...el.com>,
linux-input@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Peter Meerwald <pmeerw@...erw.net>,
Olof Johansson <olofj@...omium.org>
Subject: Re: [PATCH 28/40] Input: atmel_mxt_ts - Add CHG line handling in
bootloader code
On Fri, Feb 22, 2013 at 9:58 AM, Nick Dyer <nick.dyer@...ev.co.uk> wrote:
> The bootloader state machine toggles the CHG/Interrupt line to indicate when
> it has transitioned between states. Waiting for this event improves bootloader
> reliability.
>
> Signed-off-by: Nick Dyer <nick.dyer@...ev.co.uk>
> ---
> drivers/input/touchscreen/atmel_mxt_ts.c | 29 +++++++++++++++++++++++++++--
> 1 file changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index a1f196b..f182228 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -430,6 +430,27 @@ static int mxt_probe_bootloader(struct mxt_data *data)
> return 0;
> }
>
> +static int mxt_wait_for_chg(struct mxt_data *data)
> +{
> + int timeout_counter = 0;
> + int count = 1E6;
> +
> + if (data->pdata->read_chg == NULL) {
This also assumes the existence of data->pdata. If data->pdata ==
NULL, you're going to have a bad time.
> + msleep(20);
> + return 0;
> + }
> +
> + while ((timeout_counter++ <= count) && data->pdata->read_chg())
> + udelay(20);
> +
> + if (timeout_counter > count) {
> + dev_err(&data->client->dev, "mxt_wait_for_chg() timeout!\n");
> + return -EIO;
> + }
> +
> + return 0;
> +}
> +
> --
> 1.7.10.4
>
--
Benson Leung
Software Engineer, Chrom* OS
bleung@...omium.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists