diff options
author | Simon Glass <sjg@chromium.org> | 2014-10-04 11:29:42 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-10-23 19:29:51 -0600 |
commit | b892d127ffd448e8adf21e9703c0c5107e2a7814 (patch) | |
tree | 60d7b9932cde9d5eaa3ecc0e557f171d39d0f695 /include/asm-generic | |
parent | b3f4ca1135edd66d14254089bbeb8077c6d0bb72 (diff) |
dm: gpio: Implement GPIO reservation in the uclass
We have several GPIO drivers now and all are doing similar things to record
which GPIOs are reserved.
Move this logic into the uclass to make the drivers similar.
We retain the request()/free() methods since currently one driver does use
these for setting up the pin.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/gpio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 1ebb9c724d5..128249ef890 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -29,6 +29,9 @@ * Request a GPIO. This should be called before any of the other functions * are used on this GPIO. * + * Note: With driver model, the label is allocated so there is no need for + * the caller to preserve it. + * * @param gp GPIO number * @param label User label for this GPIO * @return 0 if ok, -1 on error @@ -157,11 +160,14 @@ struct dm_gpio_ops { * @gpio_base: Base GPIO number for this device. For the first active device * this will be 0; the numbering for others will follow sequentially so that * @gpio_base for device 1 will equal the number of GPIOs in device 0. + * @name: Array of pointers to the name for each GPIO in this bank. The + * value of the pointer will be NULL if the GPIO has not been claimed. */ struct gpio_dev_priv { const char *bank_name; unsigned gpio_count; unsigned gpio_base; + char **name; }; /* Access the GPIO operations for a device */ |