gpio: add flags to export GPIOs when requesting
Introduce new flags to automatically export GPIOs when using the convenience functions gpio_request_one() or gpio_request_array(). This eases support for custom boards where lots of GPIOs need to be exported for customer applications. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Este cometimento está contido em:

cometido por
Grant Likely

ascendente
dd775ae254
cometimento
fc3a1f04f5
@@ -1302,8 +1302,18 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
|
||||
(flags & GPIOF_INIT_HIGH) ? 1 : 0);
|
||||
|
||||
if (err)
|
||||
gpio_free(gpio);
|
||||
goto free_gpio;
|
||||
|
||||
if (flags & GPIOF_EXPORT) {
|
||||
err = gpio_export(gpio, flags & GPIOF_EXPORT_CHANGEABLE);
|
||||
if (err)
|
||||
goto free_gpio;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
free_gpio:
|
||||
gpio_free(gpio);
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gpio_request_one);
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador