Commit 517f14d9 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Greg Kroah-Hartman

nvmem: add new config option

We want to add nvmem support for MTD. TI DaVinci is the first platform
that will be using it, but only in non-DT mode. In order not to
introduce any new interface to supporting of which we would have to
commit - add a new config option that tells nvmem not to use the DT
node of the parent device.

This way we won't be creating nvmem devices corresponding with MTD
partitions defined in device tree. By default MTD will set this new
field to true.

Once a set of bindings for MTD nvmem cells is agreed upon, we'll be
able to remove this option.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8b44d5d
...@@ -635,7 +635,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) ...@@ -635,7 +635,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
nvmem->type = config->type; nvmem->type = config->type;
nvmem->reg_read = config->reg_read; nvmem->reg_read = config->reg_read;
nvmem->reg_write = config->reg_write; nvmem->reg_write = config->reg_write;
nvmem->dev.of_node = config->dev->of_node; if (!config->no_of_node)
nvmem->dev.of_node = config->dev->of_node;
if (config->id == -1 && config->name) { if (config->id == -1 && config->name) {
dev_set_name(&nvmem->dev, "%s", config->name); dev_set_name(&nvmem->dev, "%s", config->name);
......
...@@ -38,6 +38,7 @@ enum nvmem_type { ...@@ -38,6 +38,7 @@ enum nvmem_type {
* @type: Type of the nvmem storage * @type: Type of the nvmem storage
* @read_only: Device is read-only. * @read_only: Device is read-only.
* @root_only: Device is accessibly to root only. * @root_only: Device is accessibly to root only.
* @no_of_node: Device should not use the parent's of_node even if it's !NULL.
* @reg_read: Callback to read data. * @reg_read: Callback to read data.
* @reg_write: Callback to write data. * @reg_write: Callback to write data.
* @size: Device size. * @size: Device size.
...@@ -62,6 +63,7 @@ struct nvmem_config { ...@@ -62,6 +63,7 @@ struct nvmem_config {
enum nvmem_type type; enum nvmem_type type;
bool read_only; bool read_only;
bool root_only; bool root_only;
bool no_of_node;
nvmem_reg_read_t reg_read; nvmem_reg_read_t reg_read;
nvmem_reg_write_t reg_write; nvmem_reg_write_t reg_write;
int size; int size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment