lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110130214355.GA28220@pengutronix.de>
Date:	Sun, 30 Jan 2011 22:43:55 +0100
From:	Wolfram Sang <w.sang@...gutronix.de>
To:	Joachim Eastwood <manabian@...il.com>
Cc:	rpurdie@...ys.net, riku.voipio@....fi,
	linux-kernel@...r.kernel.org, joachim.eastwood@...ron.com
Subject: Re: [leds-pca9532] Add gpio capability


> > 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/  |

Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ