mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/3] ARM: i.MX: IIM: Add function to enable permanent write
Date: Tue, 17 May 2016 11:04:13 +0200	[thread overview]
Message-ID: <1463475854-30224-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1463475854-30224-1-git-send-email-s.hauer@pengutronix.de>

This adds a function to enable/disable permanent write for the IIM
module so that C users no longer have to fiddle with device parameters.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/iim.c              | 10 ++++++++++
 arch/arm/mach-imx/include/mach/iim.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index 3aba02f..2e25f69 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -122,6 +122,16 @@ int imx_iim_write_field(uint32_t field, unsigned value)
 	return regmap_write(imx_iim->bank[bank]->map, byte, value);
 }
 
+int imx_iim_permanent_write(int enable)
+{
+	if (!imx_iim)
+		return -ENODEV;
+
+	imx_iim->write_enable = enable;
+
+	return 0;
+}
+
 static int imx_iim_fuse_sense(struct iim_bank *bank, unsigned int row)
 {
 	struct iim_priv *iim = bank->iim;
diff --git a/arch/arm/mach-imx/include/mach/iim.h b/arch/arm/mach-imx/include/mach/iim.h
index f63712e..2161809 100644
--- a/arch/arm/mach-imx/include/mach/iim.h
+++ b/arch/arm/mach-imx/include/mach/iim.h
@@ -99,5 +99,6 @@ static inline int imx25_iim_register_fec_ethaddr(void)
 
 int imx_iim_read_field(uint32_t field, unsigned *value);
 int imx_iim_write_field(uint32_t field, unsigned value);
+int imx_iim_permanent_write(int enable);
 
 #endif /* __MACH_IMX_IIM_H */
-- 
2.8.0.rc3


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

  reply	other threads:[~2016-05-17  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  9:04 [PATCH 1/3] ARM: i.MX: IIM: Add functions to access fuses field wise Sascha Hauer
2016-05-17  9:04 ` Sascha Hauer [this message]
2016-05-17  9:04 ` [PATCH 3/3] ARM: i.MX: HABv3: Set to production mode Sascha Hauer

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=1463475854-30224-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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