From: Peter Tyser <ptyser@xes-inc.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: "Jean Delvare" <khali@linux-fr.org>,
linux-kernel@vger.kernel.org, "Alek Du" <alek.du@intel.com>,
"Samuel Ortiz" <sameo@linux.intel.com>,
"Eric Miao" <eric.y.miao@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Mark Brown" <broonie@opensource.wolfsonmicro.com>,
"Joe Perches" <joe@perches.com>,
"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
"Syed S Azam" <Syed.Azam@hp.com>,
"Vincent Palatin" <vpalatin@chromium.org>
Subject: Re: [PATCH v6] gpio: Add support for Intel ICHx/3100/Series[56] GPIO
Date: Fri, 27 May 2011 16:29:54 -0500 [thread overview]
Message-ID: <1306531794.10752.19.camel@ptyser-laptop> (raw)
In-Reply-To: <20110527205526.GJ6645@ponder.secretlab.ca>
<snip>
> > More importantly, the PCI device that contains the pointer to the GPIO
> > IO space also has other uses that prevent it from being claimed. Eg the
> > drivers/mtd/maps/esb2rom.c driver uses the same PCI device to configure
> > firmware hub registers. The esb2rom.c driver isn't a PCI driver either,
> > so it wouldn't cause a conflict, but it seemed to support the idea that
> > we shouldn't be using a PCI driver.
> >
> > The drivers/wdt/iTCO_wdt.c file also uses the same PCI device to get the
> > ACPI base (similar to us getting the GPIO base), and it is implemented
> > as a platform driver.
> >
> > What determines if the driver should use the mfd or platform model? Eg
> > the iTCO_wdt.c that I used as an example doesn't use the mfd model
> > despite using the PCI device the same as we are.
>
> An mfd device is merely a bag of platform devices. It's fine to use a
> platform_device, but it should be registered in the context of the pci
> probe hook, not from the context of the module_init() hook.
>
> > My own (completely biased) preference would be to use my driver as a
> > starting point, primarily because it supports newer chips that require
> > different access methods, as well as the older-style chips Jean's
> > supports. Its also been hanging out for about 6 months without many
> > complaints, a tested-by, etc.
>
> I like the /structure/ of Jean's driver better, particularly that it doesn't
> play games with the device model by registering devices at module load
> time.
But the driver shouldn't be a PCI driver - that's worse in my opinion
than a platform driver. Multiple drivers currently use the same PCI
device ID as Jean's - they can't all claim the PCI device, so why should
Jean's GPIO driver? It seems incorrect, and likely to break things in
the future. Mine has its warts too, but it doesn't have the possibility
of negatively affect other drivers at least, as well as supports more
hardware.
> If one device performs more than one function, then it should
> register all the interfaces from a single probe, or go in the
> direction of MFD devices and register a bunch of child
> platform_devices.
In this case its not really "one device performing more than one
function", its one device specifying the location of other devices. The
device being claimed is used for FWH and IRQ configuration and happens
to have a pointer to a GPIO device (among other things). Claiming it
for a GPIO device seems very wrong - it has very little to do with GPIO
at all.
> I'm going to merge Jean's driver and leave this one out for now
> (sorry), but I reserve the right to replace Jean's with your driver in
> the next merge window. This is pretty much an arbitrary decision, but
> I may as well merge at least one of them now instead of kicking both
> out for another cycle. It really seams to me like there is still
> a few architectural issues to sort out in both drivers and to make
> sure that one driver will be useful for both of you.
I disagree with the logic, and its a bit frustrating to have a patch
hanging out for 6 months to be superseded by a more recent change that
seems to be more likely to cause conflicts.
Best,
Peter
next prev parent reply other threads:[~2011-05-27 21:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 23:28 [PATCH v5 1/4] gpiolib: Add "unknown" direction support Peter Tyser
2011-03-01 23:28 ` [PATCH v5 2/4] gpiolib: Add ability to get GPIO direction Peter Tyser
2011-03-06 7:30 ` Grant Likely
2011-03-07 3:07 ` Peter Tyser
2011-03-07 7:08 ` Grant Likely
2011-03-08 0:38 ` Peter Tyser
2011-03-11 17:48 ` Peter Tyser
2011-03-12 9:18 ` Grant Likely
2011-04-20 22:17 ` Peter Tyser
2011-04-20 22:41 ` Mike Frysinger
2011-03-08 12:13 ` Alan Cox
2011-03-09 22:53 ` Peter Tyser
2011-03-12 9:19 ` Grant Likely
2011-03-01 23:28 ` [PATCH v5 3/4] gpio: pca953x: Implement get_direction() hook Peter Tyser
2011-03-01 23:28 ` [PATCH v5 4/4] gpio: Add support for Intel ICHx/3100/Series[56] GPIO Peter Tyser
2011-04-20 16:35 ` [PATCH v6] " Peter Tyser
2011-05-24 14:18 ` Peter Tyser
2011-05-27 6:42 ` Grant Likely
2011-05-27 9:01 ` Jean Delvare
2011-05-27 14:26 ` Peter Tyser
2011-05-27 20:55 ` Grant Likely
2011-05-27 21:29 ` Peter Tyser [this message]
2011-05-27 23:54 ` Grant Likely
2011-05-30 17:27 ` Peter Tyser
2011-06-03 16:43 ` Grant Likely
2011-03-06 7:25 ` [PATCH v5 1/4] gpiolib: Add "unknown" direction support Grant Likely
2011-03-06 20:19 ` Ryan Mallon
2011-03-07 2:48 ` Peter Tyser
2011-03-07 6:50 ` Grant Likely
2011-03-07 2:43 ` Peter Tyser
2011-03-07 6:52 ` Grant Likely
2011-03-08 0:28 ` Peter Tyser
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=1306531794.10752.19.camel@ptyser-laptop \
--to=ptyser@xes-inc.com \
--cc=Syed.Azam@hp.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alek.du@intel.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=eric.y.miao@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=joe@perches.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vpalatin@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®