All of lore.kernel.org
 help / color / mirror / Atom feed
From: daniel@caiaq.de (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Voipac PXA270
Date: Tue, 23 Mar 2010 15:07:27 +0100	[thread overview]
Message-ID: <20100323140727.GZ30801@buzzloop.caiaq.de> (raw)
In-Reply-To: <20100323132109.GD9581@radix50.net>

On Tue, Mar 23, 2010 at 02:21:09PM +0100, Baurzhan Ismagulov wrote:
> On Mon, Mar 22, 2010 at 10:10:52AM +0800, Eric Miao wrote:
> > On Wed, Mar 10, 2010 at 11:20 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > > Yes, they are used in the PCMCIA driver. And I'd rather avoid having GPIO
> > > definitions scattered across multiple files.
> > 
> > Mmm... that's because PCMCIA driver is not abstracted well enough to
> > allow all platform specific stuffs back into board file. Once that's done,
> > these shared definitions could be avoided to live in a separate header
> > file.
> 
> What is the recommended method to abstract that? For example, I have two
> boards with different GPIO pins assigned to mean certain external
> signals. I also ended up with GPIO definitions in a header, which is
> used by the driver, and I'd like to clean this up.

Make up a struct to pass as platform_data. Fill it in your board code
and pass down a reference to the actual driver. The driver code should
then only use resources referenced by the platform data.

This is common practice, just have a look how most other driver do it.

Daniel

  reply	other threads:[~2010-03-23 14:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10  1:47 [PATCH] Voipac PXA270 Marek Vasut
2010-03-10  6:18 ` Mike Rapoport
2010-03-10 11:37   ` Marek Vasut
2010-03-10 13:35     ` Daniel Mack
2010-03-10 15:20       ` Marek Vasut
2010-03-22  2:10         ` Eric Miao
2010-03-23 13:21           ` Baurzhan Ismagulov
2010-03-23 14:07             ` Daniel Mack [this message]
2010-03-23 15:45               ` Baurzhan Ismagulov
2010-03-22  2:21     ` Eric Miao

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=20100323140727.GZ30801@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.