public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: Sharing resources between several drivers.
Date: Fri, 27 Jul 2012 11:19:58 +0200	[thread overview]
Message-ID: <20120727111958.4409033f@skate> (raw)
In-Reply-To: <CACKLOr2enmsVqQnJ8JZJJd3z3gGKDKwj74PnWKEk6SwSN=ZoJw@mail.gmail.com>

Le Fri, 27 Jul 2012 09:59:21 +0200,
javier Martin <javier.martin@vista-silicon.com> a ?crit :

> Hi,
> we are trying to support pinctrl for i.MX21, i.MX1 and i.MX27.
> 
> In these chips, gpio and pinctrl use the same HW memory area
> registers. This means that we have to request the same memory area
> from two different drivers (gpio and pinctrl) but we don't know how to
> do that.
> 
> A similar example available is mxs, but it only works with device
> tree, so this problem is avoided.  However, some of these chips
> (i.MX21, i.MX1...) don't support device tree yet, so we need to
> provide backwards compatibility.
> 
> What is the right way to request the same memory region from two
> different drivers? Moreover, how can we guarantee that there won't be
> any conflicts when accessing these shared resources?

I would say there is no right way. If the pinctrl/gpio registers are
really intermixed and belong to the same region, then there should be
only one driver that requests this region and that implements both the
pinctrl and gpio features.

See the drivers/pinctrl/pinctrl-coh901.c driver for example. It
implements both the pinctrl and the gpio logic.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  parent reply	other threads:[~2012-07-27  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27  7:59 Sharing resources between several drivers javier Martin
2012-07-27  9:03 ` Bedia, Vaibhav
2012-07-28 14:07   ` Shawn Guo
2012-07-30 12:00     ` Bedia, Vaibhav
2012-07-27  9:19 ` Thomas Petazzoni [this message]
2012-07-27  9:33   ` javier Martin
2012-07-29 14:19 ` Arnd Bergmann
2012-08-04 23:46   ` Linus Walleij

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=20120727111958.4409033f@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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