All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] bcm: Add GPIO driver
Date: Tue, 31 Jul 2012 09:52:18 -0600	[thread overview]
Message-ID: <5017FF32.2060308@wwwdotorg.org> (raw)
In-Reply-To: <5017FDD4.9080602@gmail.com>

On 07/31/2012 09:46 AM, Vikram Narayanan wrote:
> On 7/15/2012 10:53 PM, Stephen Warren wrote:
>> On 07/11/2012 02:37 PM, Vikram Narayanan wrote:
>>> Driver for BCM2835 SoC. This gives the basic functionality of
>>> setting/clearing the output.
>>
>>> diff --git a/arch/arm/include/asm/arch-bcm2835/gpio.h
>>> b/arch/arm/include/asm/arch-bcm2835/gpio.h

One more comment on the patch subject; it probably should be "gpio:
bcm2835:" not "bcm:" since (a) it's in the GPIO directory and (b) the
GPIO module is specifically for a BCM2835, and probably doesn't apply to
any/all Broadcom devices.

>>> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
>>
>>>   COBJS-$(CONFIG_DA8XX_GPIO)    += da8xx_gpio.o
>>>   COBJS-$(CONFIG_ALTERA_PIO)    += altera_pio.o
>>>   COBJS-$(CONFIG_MPC83XX_GPIO)    += mpc83xx_gpio.o
>>> +COBJS-$(CONFIG_BCM2835_GPIO)    += gpio_bcm2835.o
>>
>> It looks like the name bcm2835_gpio.c would be more consistent with
>> existing drivers, but not a big deal.
>>
>>> diff --git a/drivers/gpio/gpio_bcm2835.c b/drivers/gpio/gpio_bcm2835.c
> 
> Linux kernel follows this naming, to be exact, it should've been
> gpio-bcm2835.c. Having a thought in mind that one day the namings would
> be made consistent with the kernel. That is the reason for this naming,
> but isn't a big deal to change it.

Hmmm. It seems better to be internally consistent with U-Boot rather
than keeping (onyl part of) U-Boot consistent with the kernel...

>> Shouldn't that be BCM2835_GPIO_COMMON_SHIFT not BCM2835_GPIO_COMMON_MASK?
> 
> If you'd like to have naming consistency FSEL_SHIFT/COMMON_SHIFT, then
> it shall be COMMON_SHIFT.
> 
> But it doesn't do any shifting like the FSEL_SHIFT, rather it does only
> masking of bits. So, it makes more sense for me to name it as MASK and
> not SHIFT.

The full quote you're replying to was:

>> +int gpio_get_value(unsigned gpio)
> 
>> +	return (val >> BCM2835_GPIO_COMMON_MASK(gpio)) & 0x1;
> 
> Shouldn't that be BCM2835_GPIO_COMMON_SHIFT not BCM2835_GPIO_COMMON_MASK?

... so that macro is being used as a shift not as a mask.

  reply	other threads:[~2012-07-31 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 20:35 [U-Boot] [PATCH v2 0/2] GPIO driver for BCM2835 SoC Vikram Narayanan
2012-07-11 20:37 ` [U-Boot] [PATCH v2 1/2] bcm: Add GPIO driver Vikram Narayanan
2012-07-15 17:23   ` Stephen Warren
2012-07-31 15:46     ` Vikram Narayanan
2012-07-31 15:52       ` Stephen Warren [this message]
2012-07-31 16:09         ` Vikram Narayanan
2012-07-11 20:38 ` [U-Boot] [PATCH v2 2/2] rbpi: Add BCM2835 GPIO driver for raspberry pi Vikram Narayanan

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=5017FF32.2060308@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /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.