All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff LaBundy <jeff@labundy.com>
To: dmitry.torokhov@gmail.com, robh+dt@kernel.org
Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	Jeff LaBundy <jeff@labundy.com>
Subject: [PATCH 6/6] input: iqs269a: Disable channels before configuring them
Date: Sun, 16 Aug 2020 16:14:27 -0500	[thread overview]
Message-ID: <1597612467-15093-7-git-send-email-jeff@labundy.com> (raw)
In-Reply-To: <1597612467-15093-1-git-send-email-jeff@labundy.com>

Unless it is being done as part of servicing a soft reset interrupt,
configuring channels on-the-fly (as is the case when writing to the
ati_trigger attribute) may cause GPIO3 (which reflects the state of
touch for a selected channel) to be inadvertently asserted.

To solve this problem, disable all channels before configuring them.
The desired channels are subsequently re-enabled as part of running
calibration (ATI).

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
---
 drivers/input/misc/iqs269a.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c
index 4a0e4ec..cb2773a 100644
--- a/drivers/input/misc/iqs269a.c
+++ b/drivers/input/misc/iqs269a.c
@@ -61,6 +61,7 @@
 #define IQS269_SYS_SETTINGS_REDO_ATI		BIT(2)
 #define IQS269_SYS_SETTINGS_ACK_RESET		BIT(0)
 
+#define IQS269_FILT_STR_ACTIVE_CH		0x81
 #define IQS269_FILT_STR_LP_LTA_MASK		GENMASK(7, 6)
 #define IQS269_FILT_STR_LP_LTA_SHIFT		6
 #define IQS269_FILT_STR_LP_CNT_MASK		GENMASK(5, 4)
@@ -1222,6 +1223,15 @@ static int iqs269_dev_init(struct iqs269_private *iqs269)
 			goto err_mutex;
 	}
 
+	/*
+	 * Temporarily disable all channels to prevent the GPIO3 pin from being
+	 * asserted during subsequent register writes in case this function was
+	 * not preceded by a soft reset.
+	 */
+	error = regmap_write(iqs269->regmap, IQS269_FILT_STR_ACTIVE_CH, 0);
+	if (error)
+		goto err_mutex;
+
 	error = regmap_update_bits(iqs269->regmap, IQS269_HALL_UI,
 				   IQS269_HALL_UI_ENABLE,
 				   iqs269->hall_enable ? ~0 : 0);
-- 
2.7.4


      parent reply	other threads:[~2020-08-16 21:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 21:14 [PATCH 0/6] Add support for slider gestures and OTP variants Jeff LaBundy
2020-08-16 21:14 ` [PATCH 1/6] dt-bindings: input: iqs269a: Add bindings for slider gestures Jeff LaBundy
2020-08-25  2:22   ` Rob Herring
2020-08-16 21:14 ` [PATCH 2/6] input: iqs269a: Add support " Jeff LaBundy
2020-08-16 21:14 ` [PATCH 3/6] dt-bindings: input: iqs269a: Add bindings for OTP variants Jeff LaBundy
2020-08-25  2:24   ` Rob Herring
2020-08-16 21:14 ` [PATCH 4/6] input: iqs269a: Add support " Jeff LaBundy
2020-08-16 21:14 ` [PATCH 5/6] input: iqs269a: Make sliders two-dimensional Jeff LaBundy
2020-08-16 21:14 ` Jeff LaBundy [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=1597612467-15093-7-git-send-email-jeff@labundy.com \
    --to=jeff@labundy.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --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: link
Be 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.