* [PATCH 0/5] nvmem: patches for v4.11
@ 2017-01-22 23:02 Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul Srinivas Kandagatla
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Srinivas Kandagatla
Hi Greg,
This patchset contains new driver support for imx6ul, two enhancements
to nvmem core and a fix in doc.
Can you please queue these for v4.11.
Thanks,
srini
Bai Ping (2):
nvmem: octop: Add support for imx6ul
devicetree: bindings: nvmem: Add compatible string for imx6ul
Vivek Gautam (3):
nvmem: core: Allow ignoring length when reading a cell
nvmem: core: Correct a bunch of function documentations
nvmem: core: Allow getting nvmem cell with a NULL cell id
.../devicetree/bindings/nvmem/imx-ocotp.txt | 6 ++-
drivers/nvmem/core.c | 45 +++++++++++++---------
drivers/nvmem/imx-ocotp.c | 1 +
3 files changed, 32 insertions(+), 20 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
@ 2017-01-22 23:02 ` Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] nvmem: octop: Add " Srinivas Kandagatla
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Bai Ping, Srinivas Kandagatla
From: Bai Ping <ping.bai@nxp.com>
i.MX6UL is an new SOC of i.MX6 family. Enable ocotp
driver support for this SOC.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/imx-ocotp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
index 8e7b120..b8ca1e6 100644
--- a/drivers/nvmem/imx-ocotp.c
+++ b/drivers/nvmem/imx-ocotp.c
@@ -73,6 +73,7 @@ static const struct of_device_id imx_ocotp_dt_ids[] = {
{ .compatible = "fsl,imx6q-ocotp", (void *)128 },
{ .compatible = "fsl,imx6sl-ocotp", (void *)64 },
{ .compatible = "fsl,imx6sx-ocotp", (void *)128 },
+ { .compatible = "fsl,imx6ul-ocotp", (void *)128 },
{ },
};
MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/5] nvmem: octop: Add support for imx6ul
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul Srinivas Kandagatla
@ 2017-01-22 23:02 ` Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string " Srinivas Kandagatla
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Bai Ping, Srinivas Kandagatla
From: Bai Ping <ping.bai@nxp.com>
i.MX6UL is an new SOC of i.MX6 family. Enable ocotp
driver support for this SOC.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/imx-ocotp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
index 8e7b120..b8ca1e6 100644
--- a/drivers/nvmem/imx-ocotp.c
+++ b/drivers/nvmem/imx-ocotp.c
@@ -73,6 +73,7 @@ static const struct of_device_id imx_ocotp_dt_ids[] = {
{ .compatible = "fsl,imx6q-ocotp", (void *)128 },
{ .compatible = "fsl,imx6sl-ocotp", (void *)64 },
{ .compatible = "fsl,imx6sx-ocotp", (void *)128 },
+ { .compatible = "fsl,imx6ul-ocotp", (void *)128 },
{ },
};
MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string for imx6ul
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] nvmem: octop: Add " Srinivas Kandagatla
@ 2017-01-22 23:02 ` Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell Srinivas Kandagatla
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Bai Ping, Srinivas Kandagatla
From: Bai Ping <ping.bai@nxp.com>
Add new compatible string for i.MX6UL SOC.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Documentation/devicetree/bindings/nvmem/imx-ocotp.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt
index 383d588..966a72e 100644
--- a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt
+++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt
@@ -1,13 +1,15 @@
Freescale i.MX6 On-Chip OTP Controller (OCOTP) device tree bindings
This binding represents the on-chip eFuse OTP controller found on
-i.MX6Q/D, i.MX6DL/S, i.MX6SL, and i.MX6SX SoCs.
+i.MX6Q/D, i.MX6DL/S, i.MX6SL, i.MX6SX and i.MX6UL SoCs.
Required properties:
- compatible: should be one of
"fsl,imx6q-ocotp" (i.MX6Q/D/DL/S),
"fsl,imx6sl-ocotp" (i.MX6SL), or
- "fsl,imx6sx-ocotp" (i.MX6SX), followed by "syscon".
+ "fsl,imx6sx-ocotp" (i.MX6SX),
+ "fsl,imx6ul-ocotp" (i.MX6UL),
+ followed by "syscon".
- reg: Should contain the register base and length.
- clocks: Should contain a phandle pointing to the gated peripheral clock.
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
` (2 preceding siblings ...)
2017-01-22 23:02 ` [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string " Srinivas Kandagatla
@ 2017-01-22 23:02 ` Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 4/5] nvmem: core: Correct a bunch of function documentations Srinivas Kandagatla
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Vivek Gautam, Srinivas Kandagatla
From: Vivek Gautam <vivek.gautam@codeaurora.org>
nvmem_cell_read() API fills in the argument 'len' with
the number of bytes read from the cell. Many users don't
care about this length value. So allow users to pass a
NULL pointer to this len field.
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 398ea7f..78aa06a 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -970,7 +970,8 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem,
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
- *len = cell->bytes;
+ if (len)
+ *len = cell->bytes;
return 0;
}
@@ -979,7 +980,8 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem,
* nvmem_cell_read() - Read a given nvmem cell
*
* @cell: nvmem cell to be read.
- * @len: pointer to length of cell which will be populated on successful read.
+ * @len: pointer to length of cell which will be populated on successful read;
+ * can be NULL.
*
* Return: ERR_PTR() on error or a valid pointer to a buffer on success. The
* buffer should be freed by the consumer with a kfree().
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] nvmem: core: Correct a bunch of function documentations
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
` (3 preceding siblings ...)
2017-01-22 23:02 ` [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell Srinivas Kandagatla
@ 2017-01-22 23:02 ` Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id Srinivas Kandagatla
2017-01-25 10:49 ` [PATCH 0/5] nvmem: patches for v4.11 Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Vivek Gautam, Srinivas Kandagatla
From: Vivek Gautam <vivek.gautam@codeaurora.org>
Correct the documentation for arguments to a number
of functions.
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/core.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 78aa06a..9c05921 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -608,7 +608,7 @@ static struct nvmem_device *nvmem_find(const char *name)
/**
* of_nvmem_device_get() - Get nvmem device from a given id
*
- * @dev node: Device tree node that uses the nvmem device
+ * @np: Device tree node that uses the nvmem device.
* @id: nvmem name from nvmem-names property.
*
* Return: ERR_PTR() on error or a valid pointer to a struct nvmem_device
@@ -634,8 +634,8 @@ EXPORT_SYMBOL_GPL(of_nvmem_device_get);
/**
* nvmem_device_get() - Get nvmem device from a given id
*
- * @dev : Device that uses the nvmem device
- * @id: nvmem name from nvmem-names property.
+ * @dev: Device that uses the nvmem device.
+ * @dev_name: name of the requested nvmem device.
*
* Return: ERR_PTR() on error or a valid pointer to a struct nvmem_device
* on success.
@@ -674,6 +674,7 @@ static void devm_nvmem_device_release(struct device *dev, void *res)
/**
* devm_nvmem_device_put() - put alredy got nvmem device
*
+ * @dev: Device that uses the nvmem device.
* @nvmem: pointer to nvmem device allocated by devm_nvmem_cell_get(),
* that needs to be released.
*/
@@ -702,8 +703,8 @@ EXPORT_SYMBOL_GPL(nvmem_device_put);
/**
* devm_nvmem_device_get() - Get nvmem cell of device form a given id
*
- * @dev node: Device tree node that uses the nvmem cell
- * @id: nvmem name in nvmems property.
+ * @dev: Device that requests the nvmem device.
+ * @id: name id for the requested nvmem device.
*
* Return: ERR_PTR() on error or a valid pointer to a struct nvmem_cell
* on success. The nvmem_cell will be freed by the automatically once the
@@ -745,8 +746,8 @@ static struct nvmem_cell *nvmem_cell_get_from_list(const char *cell_id)
/**
* of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id
*
- * @dev node: Device tree node that uses the nvmem cell
- * @id: nvmem cell name from nvmem-cell-names property.
+ * @np: Device tree node that uses the nvmem cell.
+ * @name: nvmem cell name from nvmem-cell-names property.
*
* Return: Will be an ERR_PTR() on error or a valid pointer
* to a struct nvmem_cell. The nvmem_cell will be freed by the
@@ -830,8 +831,8 @@ EXPORT_SYMBOL_GPL(of_nvmem_cell_get);
/**
* nvmem_cell_get() - Get nvmem cell of device form a given cell name
*
- * @dev node: Device tree node that uses the nvmem cell
- * @id: nvmem cell name to get.
+ * @dev: Device that requests the nvmem cell.
+ * @cell_id: nvmem cell name to get.
*
* Return: Will be an ERR_PTR() on error or a valid pointer
* to a struct nvmem_cell. The nvmem_cell will be freed by the
@@ -859,8 +860,8 @@ static void devm_nvmem_cell_release(struct device *dev, void *res)
/**
* devm_nvmem_cell_get() - Get nvmem cell of device form a given id
*
- * @dev node: Device tree node that uses the nvmem cell
- * @id: nvmem id in nvmem-names property.
+ * @dev: Device that requests the nvmem cell.
+ * @id: nvmem cell name id to get.
*
* Return: Will be an ERR_PTR() on error or a valid pointer
* to a struct nvmem_cell. The nvmem_cell will be freed by the
@@ -900,7 +901,8 @@ static int devm_nvmem_cell_match(struct device *dev, void *res, void *data)
* devm_nvmem_cell_put() - Release previously allocated nvmem cell
* from devm_nvmem_cell_get.
*
- * @cell: Previously allocated nvmem cell by devm_nvmem_cell_get()
+ * @dev: Device that requests the nvmem cell.
+ * @cell: Previously allocated nvmem cell by devm_nvmem_cell_get().
*/
void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell)
{
@@ -916,7 +918,7 @@ EXPORT_SYMBOL(devm_nvmem_cell_put);
/**
* nvmem_cell_put() - Release previously allocated nvmem cell.
*
- * @cell: Previously allocated nvmem cell by nvmem_cell_get()
+ * @cell: Previously allocated nvmem cell by nvmem_cell_get().
*/
void nvmem_cell_put(struct nvmem_cell *cell)
{
@@ -1128,7 +1130,7 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read);
* nvmem_device_cell_write() - Write cell to a given nvmem device
*
* @nvmem: nvmem device to be written to.
- * @info: nvmem cell info to be written
+ * @info: nvmem cell info to be written.
* @buf: buffer to be written to cell.
*
* Return: length of bytes written or negative error code on failure.
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
` (4 preceding siblings ...)
2017-01-22 23:02 ` [PATCH 4/5] nvmem: core: Correct a bunch of function documentations Srinivas Kandagatla
@ 2017-01-22 23:02 ` Srinivas Kandagatla
2017-01-25 10:49 ` [PATCH 0/5] nvmem: patches for v4.11 Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-01-22 23:02 UTC (permalink / raw)
To: gregkh; +Cc: maxime.ripard, linux-kernel, Vivek Gautam, Srinivas Kandagatla
From: Vivek Gautam <vivek.gautam@codeaurora.org>
The nvmem cell with a NULL cell name/id should be the one
with no accompanying 'nvmem-cell-names' property, and thus
will be the cell at index 0 in the device tree.
So, we default to index 0 and update the cell index only when
nvmem cell name id exists.
Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/core.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 9c05921..408b521 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -747,7 +747,9 @@ static struct nvmem_cell *nvmem_cell_get_from_list(const char *cell_id)
* of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id
*
* @np: Device tree node that uses the nvmem cell.
- * @name: nvmem cell name from nvmem-cell-names property.
+ * @name: nvmem cell name from nvmem-cell-names property, or NULL
+ * for the cell at index 0 (the lone cell with no accompanying
+ * nvmem-cell-names property).
*
* Return: Will be an ERR_PTR() on error or a valid pointer
* to a struct nvmem_cell. The nvmem_cell will be freed by the
@@ -760,9 +762,12 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
struct nvmem_cell *cell;
struct nvmem_device *nvmem;
const __be32 *addr;
- int rval, len, index;
+ int rval, len;
+ int index = 0;
- index = of_property_match_string(np, "nvmem-cell-names", name);
+ /* if cell name exists, find index to the name */
+ if (name)
+ index = of_property_match_string(np, "nvmem-cell-names", name);
cell_np = of_parse_phandle(np, "nvmem-cells", index);
if (!cell_np)
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] nvmem: patches for v4.11
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
` (5 preceding siblings ...)
2017-01-22 23:02 ` [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id Srinivas Kandagatla
@ 2017-01-25 10:49 ` Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2017-01-25 10:49 UTC (permalink / raw)
To: Srinivas Kandagatla; +Cc: maxime.ripard, linux-kernel
On Sun, Jan 22, 2017 at 11:02:34PM +0000, Srinivas Kandagatla wrote:
> Hi Greg,
>
> This patchset contains new driver support for imx6ul, two enhancements
> to nvmem core and a fix in doc.
> Can you please queue these for v4.11.
You really sent 6 patches, one was a duplicate...
I've fixed it up, be more careful next time please.
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-01-25 10:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-22 23:02 [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 1/5] nvmem: octop: Add " Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string " Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 4/5] nvmem: core: Correct a bunch of function documentations Srinivas Kandagatla
2017-01-22 23:02 ` [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id Srinivas Kandagatla
2017-01-25 10:49 ` [PATCH 0/5] nvmem: patches for v4.11 Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox