linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] GPIO: Add support for GPIO on CLPS711X-target platform
Date: Sun, 7 Oct 2012 11:28:03 +0100	[thread overview]
Message-ID: <20121007102803.GT4625@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20121007135334.3ed2b9a5.shc_work@mail.ru>

On Sun, Oct 07, 2012 at 01:53:34PM +0400, Alexander Shiyan wrote:
> On Fri, 5 Oct 2012 10:02:04 +0100
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> 
> > On Mon, Oct 01, 2012 at 07:42:33PM +0400, Alexander Shiyan wrote:
> > > The CLPS711X CPUs provide some GPIOs for use in the system. This
> > > driver provides support for these via gpiolib. Due to platform
> > > limitations, driver does not support interrupts, only inputs and
> > > outputs.
> ...
> > > +++ b/arch/arm/mach-clps711x/include/mach/gpio.h
> > > @@ -0,0 +1,27 @@
> > > +/*
> > > + *  This file contains the CLPS711X GPIO definitions.
> > > + *
> > > + *  Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
> > > + *
> > > + * This program is free software; you can redistribute it and/or modify
> > > + * it under the terms of the GNU General Public License as published by
> > > + * the Free Software Foundation; either version 2 of the License, or
> > > + * (at your option) any later version.
> > > + */
> > > +
> > > +/* Simple helper for convert port & pin to GPIO number */
> > > +#define CLPS711X_GPIO(port, bit)	((port) * 8 + (bit))
> > > +
> > > +/* Temporaty definitions for GPIO-ports */
> > > +/* Will be removed after remove clps_read(write) macros */
> > > +#include <mach/hardware.h>
> > > +#define _PADR	(CLPS711X_VIRT_BASE + PADR)
> > > +#define _PBDR	(CLPS711X_VIRT_BASE + PBDR)
> > > +#define _PCDR	(CLPS711X_VIRT_BASE + PCDR)
> > > +#define _PDDR	(CLPS711X_VIRT_BASE + PDDR)
> > > +#define _PADDR	(CLPS711X_VIRT_BASE + PADDR)
> > > +#define _PBDDR	(CLPS711X_VIRT_BASE + PBDDR)
> > > +#define _PCDDR	(CLPS711X_VIRT_BASE + PCDDR)
> > > +#define _PDDDR	(CLPS711X_VIRT_BASE + PDDDR)
> > > +#define _PEDR	(CLPS711X_VIRT_BASE + PEDR)
> > > +#define _PEDDR	(CLPS711X_VIRT_BASE + PEDDR)
> > 
> > Why can't this file (or the bulk of it) live in drivers/gpio ?
> We should have access for macros in gpio.h from board support files
> and other drivers. From drivers/gpio it not possible.
> If you ask about port definitions, as I say before, it will be
> removed later after rework on platform hardware definitions.

No other drivers should be directly accessing the GPIO registers -
doing so is likely a bug because of the inherent lack of locking,
which will cause race conditions.

All accesses to GPIOs should be done via gpiolib, even from board
support files.

  reply	other threads:[~2012-10-07 10:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01 15:42 [PATCH v3] GPIO: Add support for GPIO on CLPS711X-target platform Alexander Shiyan
2012-10-05  9:02 ` Russell King - ARM Linux
2012-10-07  9:53   ` Alexander Shiyan
2012-10-07 10:28     ` Russell King - ARM Linux [this message]
2012-10-07 15:12       ` Alexander Shiyan
2012-10-07 15:20         ` Russell King - ARM Linux
2012-10-09 11:45 ` Linus Walleij

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=20121007102803.GT4625@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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).