From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
"Jan Sebastian Götte" <linux@jaseg.net>,
"Phil Reid" <preid@electromag.com.au>,
"Nishad Kamdar" <nishadkamdar@gmail.com>
Subject: Re: [PATCH v1 1/2] fbtft: Rectify GPIO handling
Date: Fri, 16 Apr 2021 16:41:19 +0300 [thread overview]
Message-ID: <YHmT/+B1Hq2baSNs@smile.fi.intel.com> (raw)
In-Reply-To: <YHmTLPWT/BoTik/P@smile.fi.intel.com>
On Fri, Apr 16, 2021 at 04:37:48PM +0300, Andy Shevchenko wrote:
> On Fri, Apr 16, 2021 at 02:51:59PM +0200, Greg Kroah-Hartman wrote:
> > On Fri, Apr 16, 2021 at 03:31:16PM +0300, Andy Shevchenko wrote:
> > > The infamous commit c440eee1a7a1 ("Staging: fbtft: Switch to
> > > the GPIO descriptor interface") broke GPIO handling completely.
> > > It has already four commits to rectify and it seems not enough.
> > > In order to fix the mess here we:
> > >
> > > 1) Set default to "inactive" for all requested pins
> > >
> > > 2) Fix CS, RD, and WR pins polarity since it's active low and
> > > GPIO descriptor interface takes it into consideration from
> > > the Device Tree or ACPI
> > >
> > > 3) Fix RESET pin polarity in the places missed by the commit
> > > b918d1c27066 ("Staging: fbtft: Fix reset assertion when using gpio descriptor")
> > >
> > > 4) Consolidate chip activation (CS assert) under default
> > > ->reset() callback
> > >
> > > To summarize the expectations about polarity for GPIOs:
> > >
> > > #RD Low
> > > #WR Low
> > > #CS Low
> > > #RESET Low
> > > DC or RS High
> > > RW High
> > > Data 0..15 High
> > >
> > > See also Adafruit learning course [1] for the example of the schematics.
> > >
> > > While at it, drop unneeded NULL checks, since GPIO API is tolerant to that.
> > > At the end, update TODO to mark this job eventually done.
> > >
> > > [1]: https://learn.adafruit.com/adafruit-2-8-and-3-2-color-tft-touchscreen-breakout-v2/downloads
> >
> > Shouldn't this be broken up into "one patch per thing" from your list
> > above? Feels like you did a lot of different things all in the same
> > patch :(
>
> I am aware, but breaking to the things here will bring it to the state where
> the functionality is still broken in between. Another point is that the drop
> of unneeded checks will bring the modification of the same line in the code
> twice. Or if you look at 5), for instance, due to CS management breakage,
> fixing it w/o 5) will bring it to the weird case that previously handled CS
> due to lucky defaults from firmware or bootloader, suddenly won't work and
> nothing can help it. The split in this case would look like adding the CS
> handling to all drivers followed by removal all of them. I think it's ugly.
> And so on. Believe me, I really tried hard to split this, but it always
> becomes to undesired result.
>
> Any ideas how to split that we fix stuff in one commit?
Okay, item 3) can be split to a separate patch.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-04-16 13:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 12:31 [PATCH v1 1/2] fbtft: Rectify GPIO handling Andy Shevchenko
2021-04-16 12:31 ` [PATCH v1 2/2] fbtft: Don't spam logs when probe is deferred Andy Shevchenko
2021-04-16 12:51 ` [PATCH v1 1/2] fbtft: Rectify GPIO handling Greg Kroah-Hartman
2021-04-16 13:37 ` Andy Shevchenko
2021-04-16 13:41 ` Andy Shevchenko [this message]
2021-04-16 14:20 ` Andy Shevchenko
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=YHmT/+B1Hq2baSNs@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux@jaseg.net \
--cc=nishadkamdar@gmail.com \
--cc=preid@electromag.com.au \
/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).