From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Joel Stanley <joel@jms.id.au>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
linux-aspeed <linux-aspeed@lists.ozlabs.org>,
devicetree <devicetree@vger.kernel.org>,
Andrew Jeffery <andrew@aj.id.au>
Subject: Re: [PATCH 1/2] gpio/aspeed-sgpio: enable access to all 80 input & output sgpios
Date: Fri, 11 Sep 2020 09:10:29 +0800 [thread overview]
Message-ID: <788526c84deb4763d874be1748fcc5a583f8f79d.camel@codeconstruct.com.au> (raw)
In-Reply-To: <CACPK8XcT02qv+1H=DDv8BRAdUmrBoweZ+Qb3aG34bQ9-UC08Xg@mail.gmail.com>
Hi Joel,
Thanks for the review!
> A Fixes: might be a good idea.
OK, given this isn't strictly (just) a fix, should I split that out?
> > -#define MAX_NR_SGPIO 80
> > +#define MAX_NR_HW_SGPIO 80
> > +#define SGPIO_OUTPUT_OFFSET MAX_NR_HW_SGPIO
>
> A short comment explaining what's going on with these defines (as you
> did in your commit message) will help future reviewers.
Sounds good, I'll add one.
>
> > +static void aspeed_sgpio_irq_init_valid_mask(struct gpio_chip *gc,
> > + unsigned long *valid_mask, unsigned int ngpios)
> > +{
> > + struct aspeed_sgpio *sgpio = gpiochip_get_data(gc);
> > + int n = sgpio->n_sgpio;
> > +
> > + WARN_ON(ngpios < MAX_NR_HW_SGPIO * 2);
> > +
> > + /* input GPIOs in the lower range */
> > + bitmap_set(valid_mask, 0, n);
> > + bitmap_clear(valid_mask, n, ngpios - n);
> > +}
> > +
> > +static const bool aspeed_sgpio_is_input(unsigned int offset)
>
> The 0day bot complained about the 'const' here.
ack, will remove.
> > +{
> > + return offset < SGPIO_OUTPUT_OFFSET;
> > +}
> > static int aspeed_sgpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val)
> > {
> > struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
> > unsigned long flags;
> > + int rc;
> >
> > - spin_lock_irqsave(&gpio->lock, flags);
> > -
> > - gpio->dir_in[GPIO_BANK(offset)] &= ~GPIO_BIT(offset);
> > - sgpio_set_value(gc, offset, val);
> > + /* No special action is required for setting the direction; we'll
> > + * error-out in sgpio_set_value if this isn't an output GPIO */
> >
> > + spin_lock_irqsave(&gpio->lock, flags);
> > + rc = sgpio_set_value(gc, offset, val);
> > spin_unlock_irqrestore(&gpio->lock, flags);
> >
> > return 0;
>
> I think this should be 'return rc'
Yup. I'll send a v2 with these changes.
Cheers,
Jeremy
next prev parent reply other threads:[~2020-09-11 1:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 13:54 [PATCH 1/2] gpio/aspeed-sgpio: enable access to all 80 input & output sgpios Jeremy Kerr
2020-07-15 13:54 ` [PATCH 2/2] gpio/aspeed-sgpio: don't enable all interrupts by default Jeremy Kerr
2020-09-10 3:57 ` Joel Stanley
2020-09-11 1:12 ` Jeremy Kerr
2020-07-15 19:37 ` [PATCH 1/2] gpio/aspeed-sgpio: enable access to all 80 input & output sgpios kernel test robot
2020-07-15 22:50 ` kernel test robot
2020-09-10 4:10 ` Joel Stanley
2020-09-11 1:10 ` Jeremy Kerr [this message]
2020-09-11 1:15 ` Joel Stanley
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=788526c84deb4763d874be1748fcc5a583f8f79d.camel@codeconstruct.com.au \
--to=jk@codeconstruct.com.au \
--cc=andrew@aj.id.au \
--cc=devicetree@vger.kernel.org \
--cc=joel@jms.id.au \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-gpio@vger.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;
as well as URLs for NNTP newsgroup(s).