linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Jochen Friedrich" <jochen@scram.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linuxppc-dev@ozlabs.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH/RFC] [POWERPC] CPM1: implement GPIO LIB API
Date: Thu, 17 Jan 2008 06:47:07 -0700	[thread overview]
Message-ID: <fa686aa40801170547q8c758dxef5aa301396f7f38@mail.gmail.com> (raw)
In-Reply-To: <478F4514.7030906@scram.de>

Hi Jochen,

comments below.

On 1/17/08, Jochen Friedrich <jochen@scram.de> wrote:
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---

Need a more detailed change description.

>  arch/powerpc/platforms/8xx/Kconfig |    2 +
>  arch/powerpc/sysdev/commproc.c     |  162 +++++++++++++++++++++++++++++++++++-

Is this 8xx only?  Can it live in arch/powerpc/platforms/8xx?

>  2 files changed, 163 insertions(+), 1 deletions(-)
>
> +static struct of_gpio_chip cpm1_gc16 = {
> +       .gpio_cells = 1,
> +       .xlate = of_gpio_simple_xlate,
> +
> +       .gc = {
> +               .ngpio = 16,
> +               .direction_input = cpm1_gpio_dir_in16,
> +               .direction_output = cpm1_gpio_dir_out16,
> +               .get = cpm1_gpio_get16,
> +               .set = cpm1_gpio_set16,
> +       },
> +};
<snip>
> +static struct of_gpio_chip cpm1_gc32 = {
> +       .gpio_cells = 1,
> +       .xlate = of_gpio_simple_xlate,
> +
> +       .gc = {
> +               .ngpio = 32,
> +               .direction_input = cpm1_gpio_dir_in32,
> +               .direction_output = cpm1_gpio_dir_out32,
> +               .get = cpm1_gpio_get32,
> +               .set = cpm1_gpio_set32,
> +       },
> +};

Nit: Your naming convention seems a little backwards.  It took me a
moment to figure out what your hooks lined up with.  Can you make the
'16' and '32' part of the prefix instead of appended on the end?

ie. use 'cpm1_gpio16_dir_in' instead of 'cpm1_gpio_dir_in16'

> +int cpm1_gpiochip_add32(struct device_node *np)
> +{
> +       return of_mm_gpiochip_add(np, &cpm1_gc32);
> +}

Can you just drop this function and roll it into cpm_init_par_io?

> +
> +static int cpm_init_par_io(void)
> +{
> +       struct device_node *np;
> +
> +       for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank16")
> +               cpm1_gpiochip_add16(np);
> +
> +       for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank32")
> +               cpm1_gpiochip_add32(np);
> +       return 0;
> +}
> +arch_initcall(cpm_init_par_io);

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  parent reply	other threads:[~2008-01-17 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17 12:07 [PATCH/RFC] [POWERPC] CPM1: implement GPIO LIB API Jochen Friedrich
2008-01-17 13:06 ` Anton Vorontsov
2008-01-17 13:47 ` Grant Likely [this message]
2008-01-17 14:42   ` Jochen Friedrich
2008-01-17 18:48     ` Scott Wood

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=fa686aa40801170547q8c758dxef5aa301396f7f38@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=arnd@arndb.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=jochen@scram.de \
    --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).