diff options
author | Khouloud Touil <ktouil@baylibre.com> | 2020-01-07 12:29:19 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-01-09 12:48:54 +0300 |
commit | 2a127da461a9d8d97782d6e82b227041393eb4d2 (patch) | |
tree | 909764a234c16d372e7f5b332777f90d1355cae0 /include/linux/nvmem-provider.h | |
parent | 14f4957313fbf575c7bbd37d45cb148e11fdbc20 (diff) | |
download | linux-2a127da461a9d8d97782d6e82b227041393eb4d2.tar.xz |
nvmem: add support for the write-protect pin
The write-protect pin handling looks like a standard property that
could benefit other users if available in the core nvmem framework.
Instead of modifying all the memory drivers to check this pin, make
the NVMEM subsystem check if the write-protect GPIO being passed
through the nvmem_config or defined in the device tree and pull it
low whenever writing to the memory.
There was a suggestion for introducing the gpiodesc from pdata, but
as pdata is already removed it could be replaced by adding it to
nvmem_config.
Reference: https://lists.96boards.org/pipermail/dev/2018-August/001056.html
Signed-off-by: Khouloud Touil <ktouil@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'include/linux/nvmem-provider.h')
-rw-r--r-- | include/linux/nvmem-provider.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index fe051323be0a..6d6f8e5d24c9 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -11,6 +11,7 @@ #include <linux/err.h> #include <linux/errno.h> +#include <linux/gpio/consumer.h> struct nvmem_device; struct nvmem_cell_info; @@ -45,6 +46,7 @@ enum nvmem_type { * @word_size: Minimum read/write access granularity. * @stride: Minimum read/write access stride. * @priv: User context passed to read/write callbacks. + * @wp-gpio: Write protect pin * * Note: A default "nvmem<id>" name will be assigned to the device if * no name is specified in its configuration. In such case "<id>" is @@ -58,6 +60,7 @@ struct nvmem_config { const char *name; int id; struct module *owner; + struct gpio_desc *wp_gpio; const struct nvmem_cell_info *cells; int ncells; enum nvmem_type type; |