linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: avictor.za@gmail.com (avictor.za at gmail.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pio: add arch specific gpio_is_valid() function
Date: Tue, 7 Sep 2010 21:13:12 +0200	[thread overview]
Message-ID: <AANLkTinq98+ryOOKx1o1o21x9VnHz3nRCHh=5Wwixn4o@mail.gmail.com> (raw)
In-Reply-To: <569801.35222.qm@web180310.mail.gq1.yahoo.com>

hi,

> NAK still. ?You're trying to abuse gpio_is_valid(),
> which I see no need to support.
>
> In terms of GPIO framework architecture, zero is
> the first GPIO in all cases, and is always
> a valid GPIO number, even if it's not
> requestable/swritable/readable on a given board.
>
> Whether it's usable on a given platform depends
> on whether a GPIO controller is registered which
> claims numbers 0..N ... (assuming gpiolib in use).

How should the following be done in a driver then?

   if (gpio_is_valid(device->output_pin)) {
         if (gpio_request(device->output_pin, "driverX") != 0)
             goto error_handling;

         /* continue with gpio setup */
    }
    else {
        /* there is no vcc_pin, so don't do any gpio setup */
    }

    ....

   if (gpio_is_valid(device->output_pin)) {
       /* set value high */
   }


Regards,
  Andrew Victor

  reply	other threads:[~2010-09-07 19:13 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090930155557.7dae503b@hskinnemoen-d830>
2009-10-23 16:34 ` [PATCH 0/2 v2]mmc: atmel-mci: introduce MCI2 support on at91 Nicolas Ferre
2009-10-23 16:34 ` [PATCH 1/3 v2] atmel-mci: change use of dma slave interface Nicolas Ferre
2009-10-23 16:34 ` [PATCH 2/3 v2] mmc: atmel-mci: New MCI2 module support in atmel-mci driver Nicolas Ferre
2009-11-02 17:18   ` Nicolas Ferre
2009-11-18 13:33     ` Nicolas Ferre
2009-10-23 16:34 ` [PATCH 3/3 v2] at91/atmel-mci: inclusion of sd/mmc driver in at91sam9g45 chip and board Nicolas Ferre
2009-10-26  8:15   ` Yegor Yefremov
2009-11-02 17:14     ` Nicolas Ferre
2009-10-27 19:43   ` Andrew Victor
2009-10-28  0:35     ` Haavard Skinnemoen
2009-10-28  0:53       ` Thiago A. Corrêa
2009-10-28  1:31         ` Haavard Skinnemoen
2009-10-28 19:53         ` Andrew Victor
2009-10-28 20:50           ` Ben Nizette
2009-11-02 17:11             ` Nicolas Ferre
2009-11-02 22:10               ` Ben Nizette
2009-11-02 22:14               ` Ben Nizette
2009-11-03  2:30               ` Ryan Mallon
2009-11-03  2:55                 ` Ben Nizette
2009-11-07 11:20                   ` Haavard Skinnemoen
2010-08-23 15:01                     ` [PATCH] pio: add arch specific gpio_is_valid() function Nicolas Ferre
2010-08-23 16:36                       ` David Brownell
2010-08-24  8:19                         ` Nicolas Ferre
2010-09-06 14:21                           ` [PATCH v2] AT91: pio: add " Nicolas Ferre
2010-09-07  1:51                             ` David Brownell
2010-09-03 16:41                       ` [PATCH] pio: add arch specific " Jean-Christophe PLAGNIOL-VILLARD
2010-09-07  2:23                         ` David Brownell
2010-09-07  2:44                           ` Ryan Mallon
2010-09-07  3:54                             ` Eric Miao
2010-09-07  4:07                               ` Ryan Mallon
2010-09-07  4:19                                 ` Eric Miao
2010-09-07  4:26                                   ` Ryan Mallon
2010-09-07 18:10                                     ` David Brownell
2010-09-07 19:13                                       ` avictor.za at gmail.com [this message]
2010-09-07 19:30                                         ` Ryan Mallon
2010-09-07 21:22                                           ` Alan Cox
2010-09-07 23:44                                             ` David Brownell
2010-09-08  0:11                                               ` Alan Cox
2010-09-07  6:33                             ` David Brownell
2010-09-07  8:41                               ` Ben Nizette
2010-09-07 17:32                                 ` David Brownell

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='AANLkTinq98+ryOOKx1o1o21x9VnHz3nRCHh=5Wwixn4o@mail.gmail.com' \
    --to=avictor.za@gmail.com \
    --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).