mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 2/6] ocotp: Register OCOTP with 'nvmem'
Date: Fri, 29 Apr 2016 10:24:02 -0700	[thread overview]
Message-ID: <1461950646-15037-3-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1461950646-15037-1-git-send-email-andrew.smirnov@gmail.com>

From: Sascha Hauer <s.hauer@pengutronix.de>

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/ocotp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-imx/ocotp.c b/arch/arm/mach-imx/ocotp.c
index 1dc9108..3901619 100644
--- a/arch/arm/mach-imx/ocotp.c
+++ b/arch/arm/mach-imx/ocotp.c
@@ -28,6 +28,7 @@
 #include <clock.h>
 #include <regmap.h>
 #include <linux/clk.h>
+#include <linux/nvmem-provider.h>
 
 /*
  * a single MAC address reference has the form
@@ -85,6 +86,7 @@ struct ocotp_priv {
 	int sense_enable;
 	char ethaddr[6];
 	struct regmap_config map_config;
+	struct nvmem_config nvmem_config;
 };
 
 static int imx6_ocotp_set_timing(struct ocotp_priv *priv)
@@ -412,6 +414,12 @@ static int imx_ocotp_probe(struct device_d *dev)
 	if (ret)
 		return ret;
 
+	priv->nvmem_config.name = "imx-ocotp";
+	priv->nvmem_config.read_only = true;
+	priv->nvmem_config.dev = dev;
+
+	nvmem_register(&priv->nvmem_config, priv->map);
+
 	if (IS_ENABLED(CONFIG_IMX_OCOTP_WRITE)) {
 		dev_add_param_bool(&(priv->dev), "permanent_write_enable",
 				NULL, NULL, &priv->permanent_write_enable, NULL);
-- 
2.5.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-04-29 17:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 17:24 [PATCH 0/6] AIODEV subsystem Andrey Smirnov
2016-04-29 17:24 ` [PATCH 1/6] drivers: add nvmem framework from kernel Andrey Smirnov
2016-04-29 17:24 ` Andrey Smirnov [this message]
2016-04-29 17:24 ` [PATCH 3/6] drivers: Introduce AIODEV subsystem Andrey Smirnov
2016-05-03  6:13   ` Sascha Hauer
2016-05-04 15:47     ` Andrey Smirnov
2016-05-03  6:21   ` Sascha Hauer
2016-04-29 17:24 ` [PATCH 4/6] commands: Add 'hwmon' command Andrey Smirnov
2016-04-29 17:24 ` [PATCH 5/6] aiodev: Add TEMPMON driver Andrey Smirnov
2016-04-29 17:24 ` [PATCH 6/6] aiodev: Add basic LM75 temperature driver Andrey Smirnov
2016-05-03  5:46 ` [PATCH 0/6] AIODEV subsystem Sascha Hauer
2016-05-04 15:39   ` Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461950646-15037-3-git-send-email-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox