linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Reid <preid@electromag.com.au>
To: gregkh@linuxfoundation.org, bhanusreemahesh@gmail.com,
	leobras.c@gmail.com, nsaenzjulienne@suse.de,
	nishadkamdar@gmail.com, preid@electromag.com.au,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	devel@driverdev.osuosl.org
Subject: [PATCH v2 2/2] Staging: fbtft: Fix reset assertion when using gpio descriptor
Date: Tue, 16 Jul 2019 00:24:37 +0000	[thread overview]
Message-ID: <1563236677-5045-3-git-send-email-preid@electromag.com.au> (raw)
In-Reply-To: <1563236677-5045-1-git-send-email-preid@electromag.com.au>

Typically gpiod_set_value calls would assert the reset line and
then release it using the symantics of:
	gpiod_set_value(par->gpio.reset, 0);
	... delay
	gpiod_set_value(par->gpio.reset, 1);
And the gpio binding would specify the polarity.

Prior to conversion to gpiod calls the polarity in the DT
was ignored and assumed to be active low. Fix it so that
DT polarity is respected.

Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface")
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tested-by: Jan Sebastian Götte <linux@jaseg.net>
Signed-off-by: Phil Reid <preid@electromag.com.au>
---
 drivers/staging/fbtft/fbtft-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 44b8074..bc75025 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -231,9 +231,9 @@ static void fbtft_reset(struct fbtft_par *par)
 	if (!par->gpio.reset)
 		return;
 	fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);
-	gpiod_set_value_cansleep(par->gpio.reset, 0);
-	usleep_range(20, 40);
 	gpiod_set_value_cansleep(par->gpio.reset, 1);
+	usleep_range(20, 40);
+	gpiod_set_value_cansleep(par->gpio.reset, 0);
 	msleep(120);
 }
 
-- 
1.8.3.1

      parent reply	other threads:[~2019-07-16  0:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11  8:31 [PATCH 0/2] Staging: fbtft: Fix probing of gpio descriptor Phil Reid
2019-07-11  8:31 ` [PATCH 1/2] " Phil Reid
2019-07-11  8:31 ` [PATCH 2/2] Staging: fbtft: Fix reset assertion when using " Phil Reid
2019-07-15 14:27 ` [PATCH 0/2] Staging: fbtft: Fix probing of " Nicolas Saenz Julienne
2019-07-16  0:24 ` Phil Reid
2019-07-16  0:24   ` [PATCH v2 1/2] " Phil Reid
2019-07-16  0:24   ` Phil Reid [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=1563236677-5045-3-git-send-email-preid@electromag.com.au \
    --to=preid@electromag.com.au \
    --cc=bhanusreemahesh@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=leobras.c@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=nishadkamdar@gmail.com \
    --cc=nsaenzjulienne@suse.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;
as well as URLs for NNTP newsgroup(s).