LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Joachim Eastwood <manabian@gmail.com>
Cc: rpurdie@rpsys.net, riku.voipio@iki.fi,
	linux-kernel@vger.kernel.org, joachim.eastwood@jotron.com
Subject: Re: [leds-pca9532] Add gpio capability
Date: Sun, 30 Jan 2011 22:43:55 +0100	[thread overview]
Message-ID: <20110130214355.GA28220@pengutronix.de> (raw)
In-Reply-To: <AANLkTi=UYOeNXtL9ZhyVESBvWQwMEdbVUAOMqp4aV4_H@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]


> > Some Kconfig-magic is missing. Iff that feature is used, then it depends on
> > GENERIC_GPIO.
> 
> I though about it just when I had hit send. I'll create an updated
> version where gpio capability is optional.
> 
> GENERIC_GPIO? Shouldn't it be GPIOLIB in this case?

Yes, you are right. You are adding a gpiochip, so you need GPIOLIB.

> >> +	if (gpios) {
> >> +		data->gpio.label = "gpio-pca9532";
> >> +		data->gpio.set = pca9532_gpio_set_value;
> >> +		data->gpio.get = pca9532_gpio_get_value;
> >> +		data->gpio.request = pca9532_gpio_request_pin;
> >> +		data->gpio.can_sleep = 1;
> >> +		data->gpio.base = pdata->gpio_base;
> >> +		data->gpio.ngpio = 16;
> >> +		data->gpio.dev = &client->dev;
> >> +		data->gpio.owner = THIS_MODULE;
> >
> > I'd assume that you also need to define a direction_output-function which
> > always
> > returns success?
> 
> Yes, you are right. It is not possible to set direction in hw, but I
> should provide them.

It should be okay to skip direction_input, because gpiolib will return an error
if it is not available. This is exactly why IMO you need a direction_output
returning 0. Otherwise drivers checking if that operation was successful, might
be fooled.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2011-01-30 21:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30 17:31 Joachim Eastwood
2011-01-30 18:25 ` Wolfram Sang
2011-01-30 19:12   ` Joachim Eastwood
2011-01-30 21:43     ` Wolfram Sang [this message]
2011-01-31 23:56 H Hartley Sweeten
2011-02-01  8:01 ` Wolfram Sang
2011-02-01 16:27   ` H Hartley Sweeten
2011-02-01 17:22     ` Joachim Eastwood
2011-02-01 18:44     ` Wolfram Sang

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=20110130214355.GA28220@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=joachim.eastwood@jotron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=riku.voipio@iki.fi \
    --cc=rpurdie@rpsys.net \
    --subject='Re: [leds-pca9532] Add gpio capability' \
    /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

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).