linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: David Brownell <david-b@pacbell.net>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API
Date: Mon, 21 Apr 2008 18:49:38 +0400	[thread overview]
Message-ID: <20080421144938.GA25627@polina.dev.rtsoft.ru> (raw)
In-Reply-To: <20080421143313.GB18008@polina.dev.rtsoft.ru>

On Mon, Apr 21, 2008 at 06:33:13PM +0400, Anton Vorontsov wrote:
[...]
> > >  +static int __init qe_add_gpiochips(void)
> > >  +{
> > >  +       int ret;
> > >  +       struct device_node *np;
> > >  +
> > >  +       for_each_compatible_node(np, NULL, "fsl,qe-pario-bank") {
> > >  +               struct qe_gpio_chip *qe_gc;
> > >  +               struct of_mm_gpio_chip *mm_gc;
> > >  +               struct of_gpio_chip *of_gc;
> > >  +               struct gpio_chip *gc;
> > >  +
> > >  +               qe_gc = kzalloc(sizeof(*qe_gc), GFP_KERNEL);
> > >  +               if (!qe_gc) {
> > >  +                       ret = -ENOMEM;
> > >  +                       goto err;
> > >  +               }
> > >  +
> > >  +               spin_lock_init(&qe_gc->lock);
> > >  +
> > >  +               mm_gc = &qe_gc->mm_gc;
> > >  +               of_gc = &mm_gc->of_gc;
> > >  +               gc = &of_gc->gc;
> > >  +
> > >  +               mm_gc->save_regs = qe_gpio_save_regs;
> > >  +               of_gc->gpio_cells = 2;
> > >  +               gc->ngpio = QE_PIO_PINS;
> > >  +               gc->direction_input = qe_gpio_dir_in;
> > >  +               gc->direction_output = qe_gpio_dir_out;
> > >  +               gc->get = qe_gpio_get;
> > >  +               gc->set = qe_gpio_set;
> > >  +
> > >  +               ret = of_mm_gpiochip_add(np, mm_gc);
> > >  +               if (ret)
> > >  +                       goto err;
> > >  +       }
> > >  +
> > >  +       return 0;
> > >  +err:
> > >  +       pr_err("%s: registration failed with status %d\n", np->full_name, ret);
> > >  +       of_node_put(np);
> > >  +       return ret;
> > >  +}
> > >  +arch_initcall(qe_add_gpiochips);
> > 
> > Should this really be a arch_initcall()?  Would it be better for
> > platforms needing it to call it explicitly from one of the platform's
> > machine_arch_initcall()?  Otherwise it gets called for all platforms
> > in a multiplatform kernel.
> 
> Ok, I'll place it into qe_reset().

Ugh, no, I can't. qe_reset() is called too early. And I don't like
having every QE board file to call this through machine_arch_initcall...
Hmm, what to do.. well, is this thaat bad to call this for every
platform?..

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2008-04-21 14:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 19:06 [PATCH 0/5 v2] Few more patches for Kumar's powerpc.git Anton Vorontsov
2008-04-18 19:09 ` [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support Anton Vorontsov
2008-04-21 14:03   ` Grant Likely
2008-04-21 14:28     ` Anton Vorontsov
2008-04-21 16:28       ` Segher Boessenkool
2008-04-21 18:39     ` Scott Wood
2008-04-21 23:27       ` Grant Likely
2008-04-18 19:09 ` [PATCH 2/5] [POWERPC] QE: add support for QE USB clocks routing Anton Vorontsov
2008-04-18 19:09 ` [PATCH 3/5] [POWERPC] QE: prepare QE PIO code for GPIO LIB support Anton Vorontsov
2008-04-21 14:08   ` Grant Likely
2008-04-21 14:28     ` Anton Vorontsov
2008-04-18 19:09 ` [PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API Anton Vorontsov
2008-04-19  5:49   ` David Brownell
2008-04-21 14:19   ` Grant Likely
2008-04-21 14:33     ` Anton Vorontsov
2008-04-21 14:49       ` Anton Vorontsov [this message]
2008-04-21 14:58         ` Grant Likely
2008-04-21 16:41           ` Anton Vorontsov
2008-04-21 20:01             ` David Brownell
2008-04-21 21:33               ` Anton Vorontsov
2008-04-21 22:19                 ` David Brownell
2008-04-21 21:15             ` Grant Likely
2008-04-21 16:30       ` Segher Boessenkool
2008-04-18 19:10 ` [PATCH 5/5] [POWERPC] 83xx: new board support: MPC8360E-RDK Anton Vorontsov
2008-04-21 21:05   ` Grant Likely
2008-04-21 22:04     ` Anton Vorontsov
  -- strict thread matches above, loose matches on Subject: below --
2008-04-17 19:26 [PATCH 0/5] Few more patches for Kumar's powerpc.git Anton Vorontsov
2008-04-17 19:29 ` [PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API Anton Vorontsov
2008-04-17 22:35   ` Kumar Gala
2008-04-17 22:41     ` Anton Vorontsov
2008-04-18  2:21       ` Kumar Gala

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=20080421144938.GA25627@polina.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=david-b@pacbell.net \
    --cc=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).