aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvmem/nvmem.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-25nvmem: core: remove nvmem_sysfs_get_groups()Srinivas Kandagatla1-61/+0
Now that we are using is_bin_visible callback, we do not need nvmem_sysfs_get_groups() anymore so move all the relevant data-structures and code to core.c Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200325131951.31887-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25nvmem: core: use is_bin_visible for permissionsSrinivas Kandagatla1-6/+2
By using is_bin_visible callback to set permissions will remove a large list of attribute groups. These group permissions can be dynamically derived in the callback. Also add checks for read/write callbacks and set permissions accordingly. Suggested-by: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200325131951.31887-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25nvmem: core: add root_only member to nvmem device structSrinivas Kandagatla1-0/+1
As we are planning to move to use sysfs is_bin_visible callback, having root_only as part of nvmem_device will help decide correct permissions. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200325122116.15096-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09nvmem: add support for the write-protect pinKhouloud Touil1-0/+2
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>
2019-04-25nvmem: core: add NVMEM_SYSFS KconfigSrinivas Kandagatla1-0/+62
Many nvmem providers are not very keen on having default sysfs nvmem entry, as most of the usecases for them are inside kernel itself. And in some cases read/writes to some areas in nvmem are restricted and trapped at secure monitor level, so accessing them from userspace would result in board reboots. This patch adds new NVMEM_SYSFS Kconfig to make binary sysfs entry an optional one. This provision will give more flexibility to users. This patch also moves existing sysfs code to a new file so that its not compiled in when its not really required. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Gaurav Kohli <gkohli@codeaurora.org> Tested-by: Gaurav Kohli <gkohli@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>