Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564588 > unrolled thread

[PATCH 0/5] nvmem: patches for v4.11

Started bySrinivas Kandagatla <srinivas.kandagatla@linaro.org>
First post2017-01-23 00:10 +0100
Last post2017-01-25 11:50 +0100
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/5] nvmem: patches for v4.11 Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 00:10 +0100
    [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string for imx6ul Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 00:10 +0100
    [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 00:10 +0100
    [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 00:10 +0100
    [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2017-01-23 00:10 +0100
    Re: [PATCH 0/5] nvmem: patches for v4.11 Greg KH <gregkh@linuxfoundation.org> - 2017-01-25 11:50 +0100

#1564588 — [PATCH 0/5] nvmem: patches for v4.11

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2017-01-23 00:10 +0100
Subject[PATCH 0/5] nvmem: patches for v4.11
Message-ID<t2zqN-73O-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1564589 — [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string for imx6ul

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2017-01-23 00:10 +0100
Subject[PATCH 2/5] devicetree: bindings: nvmem: Add compatible string for imx6ul
Message-ID<t2zqO-73O-25@gated-at.bofh.it>
In reply to#1564588
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

[toc] | [prev] | [next] | [standalone]


#1564590 — [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2017-01-23 00:10 +0100
Subject[PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id
Message-ID<t2zqO-73O-15@gated-at.bofh.it>
In reply to#1564588
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

[toc] | [prev] | [next] | [standalone]


#1564591 — [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2017-01-23 00:10 +0100
Subject[PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell
Message-ID<t2zqO-73O-19@gated-at.bofh.it>
In reply to#1564588
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

[toc] | [prev] | [next] | [standalone]


#1564592 — [PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul

FromSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Date2017-01-23 00:10 +0100
Subject[PATCH 1/5] driver: nvmem: Add ocotp driver support for imx6ul
Message-ID<t2zqO-73O-23@gated-at.bofh.it>
In reply to#1564588
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

[toc] | [prev] | [next] | [standalone]


#1566476

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-01-25 11:50 +0100
Message-ID<t3tjk-Dr-27@gated-at.bofh.it>
In reply to#1564588
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web