[PATCH 2/3] ARM: i.MX: IIM: Add function to enable permanent write
Sascha Hauer
s.hauer at pengutronix.de
Tue May 17 02:04:13 PDT 2016
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 at 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
More information about the barebox
mailing list