public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Guinot <simon@sequanux.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] gpio: Add GPIO driver framework for Marvell SoCs
Date: Tue, 2 Aug 2011 14:10:42 +0000	[thread overview]
Message-ID: <20110802141042.GI15950@kw.sim.vm.gnt> (raw)
In-Reply-To: <1311318994-20660-1-git-send-email-ajay.bhargav@einfochips.com>

Hi Ajay,

On Fri, Jul 22, 2011 at 12:46:33PM +0530, Ajay Bhargav wrote:
> This patch adds generic GPIO driver framework support for Marvell SoCs.
> 
> To enable GPIO driver define CONFIG_MARVELL_GPIO and for GPIO commands
> define CONFIG_CMD_GPIO in your board configuration file.
> 
> Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> ---
>  drivers/gpio/Makefile |    1 +
>  drivers/gpio/mvgpio.c |  114 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 115 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/gpio/mvgpio.c

... snip ...

> +int gpio_direction_input(int gp)
> +{
> +	struct gpio_reg *gpio_reg_bank;
> +
> +	if (gp >= MV_MAX_GPIO) {
> +		printf("%s: Invalid GPIO %d\n", __func__, gp);
> +		return -EINVAL;
> +	}
> +
> +	gpio_reg_bank = get_gpio_base(GPIO_TO_REG(gp));
> +	writel(GPIO_TO_BIT(gp), &gpio_reg_bank->gcdr);

AFAIK, Orion and Kirkwood SoCs don't provide bitwise set/clear for
GPIO output/direction registers. Instead, a register must be read
first to leave other bits unchanged (see __set_direction in kw_gpio.c).

Is it possible to handle Armada SoCs GPIOs in a same way ? maybe using
the pin registers (gpxx in the Armada struct gpio_reg array) ?

If not, this code is not Marvell generic but rather specific for Armada
SoCs and then maybe armada_gpio is a better name...

Regards,

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110802/3932c5e3/attachment.pgp 

  reply	other threads:[~2011-08-02 14:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22  7:16 [U-Boot] [PATCH v2 1/2] gpio: Add GPIO driver framework for Marvell SoCs Ajay Bhargav
2011-08-02 14:10 ` Simon Guinot [this message]
2011-08-03 10:18   ` Prafulla Wadaskar
     [not found] <1990439524.39318.1312346163802.JavaMail.root@ahm.einfochips.com>
2011-08-03  4:40 ` Ajay Bhargav
2011-08-04  0:04   ` Simon Guinot
2011-08-04  8:51     ` Albert ARIBAUD
2011-08-04  9:18       ` Lei Wen
     [not found] <1874826476.47235.1312454749903.JavaMail.root@ahm.einfochips.com>
2011-08-04 10:51 ` Ajay Bhargav
2011-08-04 11:25   ` Prafulla Wadaskar
2011-08-04 12:51   ` Lei Wen
     [not found] <2088605993.55298.1312607122087.JavaMail.root@ahm.einfochips.com>
2011-08-06  5:10 ` Ajay Bhargav
2011-08-07  2:16   ` Prafulla Wadaskar

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=20110802141042.GI15950@kw.sim.vm.gnt \
    --to=simon@sequanux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox