mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: x86@kernel.org,
	Jerome Oufella <jerome.oufella@savoirfairelinux.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org,
	Guenter Roeck <guenter.roeck@ericsson.com>,
	Jean Delvare <khali@linux-fr.org>,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH v6 3/3] gpio: TS-5500 GPIO support
Date: Fri, 18 May 2012 10:37:11 -0400	[thread overview]
Message-ID: <1337351831.30231.19.camel@trivette.site> (raw)
In-Reply-To: <CACxGe6v20FnMrpE9ZFTQuhOUoJJrAgN_YKHXDT8GF4rH0VUd6A@mail.gmail.com>

Hi Grant,

On Thu, 2012-05-17 at 16:59 -0600, Grant Likely wrote:
> On Thu, May 17, 2012 at 3:40 PM, Vivien Didelot
> <vivien.didelot@savoirfairelinux.com> wrote:
> > On Thu, 2012-05-17 at 15:06 -0600, Grant Likely wrote:
> >> >  arch/x86/include/asm/ts5500.h |   62 ++++++++
> >>
> >> Why the separate header file?  What will use these defines?  I
> >> normally expect driver-specific defines to be in the driver .c file
> >> directly; particularly for things like gpio drivers which should be a
> >> generic interface that doesn't need to export symbols.
> >
> > Should an intermediate driver directly use values for GPIOs instead of
> > these symbols? For example, how should a temperature sensor plugged on
> > this platform refer to inputs and outputs?
> 
> Tell me more about this platform.  Where does the data about
> connections come from?  Is it a purpose-built embedded system?

This is a generic purpose platform, the GPIO bus is exposed on an
external DB25 connector. End-users can use it however they like.

> Is the
> GPIO controller described in ACPI? (probably not since GPIOs were only
> added to ACPI in v5)  Does the end-user attach her own hardware to the
> board like the temperature sensor you describe?  If so, is that
> hardware driven by kernel drivers or user-space drivers?

Both in fact. For instance, we are connecting an SHT15
humidity/temperature sensor, which already has support in the kernel.

> 
> For userspace drivers you can get information about the GPIO number
> assignments from /sys, but it isn't well documented and can probably
> be improved.
> 
> If it is kernelspace, then you really need a way to add data about the
> platform to the kernel at runtime.  Having it statically compiled in
> isn't a very good solution.  I would recommend injecting configuration
> data into the kernel from userspace.  You could invent something, but
> that wouldn't be very portable.  Xilinx has done some work on this
> using Flattened Device Tree and the firmware loading infrastructure.
> The kernel requests a .dtb (device tree blob) from userspace and uses
> that to configure devices.  That may do the job for you.  GPIO and
> platform device infrastructure already have FDT support which will
> help you here.  I expect it could be done with an ACPI fragment too,
> but I just don't know of anybody having done any work in this area.
> 
> That probably isn't the answer you want though since I assume you just
> need to get something that works rather than investing a whole bunch
> of time on generic infrastructure.

Exactly.

>  What I would recommend is for your
> platform setup code to use a notifier to wait for the
> BUS_NOTIFY_BOUND_DRIVER event and then register the temperature sensor
> with the correct gpio number at that time (because once you have a
> reference to the gpio controller you can calculate the assigned gpio
> numbers).

Thanks.

I've been working on pushing this code mainline for a while. To
summarize, for you to accept this code, you'd prefer me to move every
symbol into the driver itself (in addition to addressing your and Joe's
other requests), and then we're good?

> 
> g.

Thanks,
Vivien.


  reply	other threads:[~2012-05-18 14:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  0:28 [PATCH v6 0/3] TS-5500 platform support Vivien Didelot
2012-04-13  0:28 ` [PATCH v6 1/3] hwmon: Maxim MAX197 support Vivien Didelot
2012-04-14  0:46   ` Guenter Roeck
2012-04-13  0:28 ` [PATCH v6 2/3] x86/platform: TS-5500 basic platform support Vivien Didelot
2012-04-13 10:37   ` Thomas Gleixner
2012-04-13 20:46     ` Vivien Didelot
2012-04-13  0:28 ` [PATCH v6 3/3] gpio: TS-5500 GPIO support Vivien Didelot
2012-04-13 19:04   ` Mark Brown
2012-05-17 21:06   ` Grant Likely
2012-05-17 21:14     ` Joe Perches
2012-05-17 21:40     ` Vivien Didelot
2012-05-17 22:59       ` Grant Likely
2012-05-18 14:37         ` Vivien Didelot [this message]
2012-05-18 19:59           ` Grant Likely

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=1337351831.30231.19.camel@trivette.site \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=grant.likely@secretlab.ca \
    --cc=guenter.roeck@ericsson.com \
    --cc=hpa@zytor.com \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=khali@linux-fr.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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 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®