From: "Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com> To: nick@shmanahar.org Cc: dmitry.torokhov@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com> Subject: [PATCH v3 2/3] Input: atmel_mxt_ts: Wait for device be ready for communication Date: Tue, 31 Jul 2018 17:18:10 +0200 [thread overview] Message-ID: <1533050291-11502-3-git-send-email-pawel.mikolaj.chmiel@gmail.com> (raw) In-Reply-To: <1533050291-11502-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> According to documentation, device isn't ready for communication, until firmware asserts the CHG line. Add missing wait for this. Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> --- drivers/input/touchscreen/atmel_mxt_ts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 2cd7f6db6ba9..79e08916359f 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -202,6 +202,7 @@ enum t100_type { #define MXT_CRC_TIMEOUT 1000 /* msec */ #define MXT_FW_RESET_TIME 3000 /* msec */ #define MXT_FW_CHG_TIMEOUT 300 /* msec */ +#define MXT_POWERON_DELAY 150 /* msec */ /* Command to unlock bootloader */ #define MXT_UNLOCK_CMD_MSB 0xaa @@ -3046,6 +3047,16 @@ static int mxt_regulator_enable(struct mxt_data *data) msleep(MXT_REGULATOR_DELAY); gpiod_set_value(data->reset_gpio, 1); msleep(MXT_RESET_INVALID_CHG); + +retry_wait: + reinit_completion(&data->bl_completion); + data->in_bootloader = true; + error = mxt_wait_for_completion(data, &data->bl_completion, + MXT_POWERON_DELAY); + if (error == -EINTR) + goto retry_wait; + + data->in_bootloader = false; } return 0; -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: pawel.mikolaj.chmiel@gmail.com (Paweł Chmiel) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/3] Input: atmel_mxt_ts: Wait for device be ready for communication Date: Tue, 31 Jul 2018 17:18:10 +0200 [thread overview] Message-ID: <1533050291-11502-3-git-send-email-pawel.mikolaj.chmiel@gmail.com> (raw) In-Reply-To: <1533050291-11502-1-git-send-email-pawel.mikolaj.chmiel@gmail.com> According to documentation, device isn't ready for communication, until firmware asserts the CHG line. Add missing wait for this. Signed-off-by: Pawe? Chmiel <pawel.mikolaj.chmiel@gmail.com> --- drivers/input/touchscreen/atmel_mxt_ts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 2cd7f6db6ba9..79e08916359f 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -202,6 +202,7 @@ enum t100_type { #define MXT_CRC_TIMEOUT 1000 /* msec */ #define MXT_FW_RESET_TIME 3000 /* msec */ #define MXT_FW_CHG_TIMEOUT 300 /* msec */ +#define MXT_POWERON_DELAY 150 /* msec */ /* Command to unlock bootloader */ #define MXT_UNLOCK_CMD_MSB 0xaa @@ -3046,6 +3047,16 @@ static int mxt_regulator_enable(struct mxt_data *data) msleep(MXT_REGULATOR_DELAY); gpiod_set_value(data->reset_gpio, 1); msleep(MXT_RESET_INVALID_CHG); + +retry_wait: + reinit_completion(&data->bl_completion); + data->in_bootloader = true; + error = mxt_wait_for_completion(data, &data->bl_completion, + MXT_POWERON_DELAY); + if (error == -EINTR) + goto retry_wait; + + data->in_bootloader = false; } return 0; -- 2.7.4
next prev parent reply other threads:[~2018-07-31 15:18 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-31 15:18 [PATCH v3 0/3] Input: atmel_mxt_ts: Add support for optional regulators Paweł Chmiel 2018-07-31 15:18 ` Paweł Chmiel 2018-07-31 15:18 ` [PATCH v3 1/3] " Paweł Chmiel 2018-07-31 15:18 ` Paweł Chmiel 2018-08-22 18:06 ` George G. Davis 2018-08-22 18:06 ` George G. Davis 2018-07-31 15:18 ` Paweł Chmiel [this message] 2018-07-31 15:18 ` [PATCH v3 2/3] Input: atmel_mxt_ts: Wait for device be ready for communication Paweł Chmiel 2018-08-22 18:08 ` George G. Davis 2018-08-22 18:08 ` George G. Davis 2018-07-31 15:18 ` [PATCH v3 3/3] Input: atmel_mxt_ts: Document optional voltage regulators Paweł Chmiel 2018-07-31 15:18 ` Paweł Chmiel
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=1533050291-11502-3-git-send-email-pawel.mikolaj.chmiel@gmail.com \ --to=pawel.mikolaj.chmiel@gmail.com \ --cc=alexandre.belloni@bootlin.com \ --cc=devicetree@vger.kernel.org \ --cc=dmitry.torokhov@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-input@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=nick@shmanahar.org \ --cc=nicolas.ferre@microchip.com \ --cc=robh+dt@kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.