mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] mc13xxx: Added mc13xxx_revision() function.
@ 2012-08-04  9:15 Alexander Shiyan
  2012-08-04  9:15 ` [PATCH 2/3] mc13xxx: Hide private struct mc13xxx from other units Alexander Shiyan
  2012-08-04  9:15 ` [PATCH 3/3] mc13xxx: Fixed memory leak Alexander Shiyan
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Shiyan @ 2012-08-04  9:15 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/boards/ccxmx51/ccxmx51.c          |    2 +-
 arch/arm/boards/freescale-mx51-pdk/board.c |    2 +-
 drivers/mfd/mc13xxx.c                      |    6 ++++++
 include/mfd/mc13xxx.h                      |    6 ++++++
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c
index f309e0c..0b450d6 100644
--- a/arch/arm/boards/ccxmx51/ccxmx51.c
+++ b/arch/arm/boards/ccxmx51/ccxmx51.c
@@ -307,7 +307,7 @@ static int ccxmx51_power_init(void)
 		mc13xxx_reg_write(mc13xxx_dev, MC13892_REG_SW_2, val);
 	}
 
-	if (mc13xxx_dev->revision <= MC13892_REVISION_2_0) {
+	if (mc13xxx_revision(mc13xxx_dev) <= MC13892_REVISION_2_0) {
 		/* Set switchers in PWM mode for Atlas 2.0 and lower */
 		/* Setup the switcher mode for SW1 & SW2*/
 		mc13xxx_reg_read(mc13xxx_dev, MC13892_REG_SW_4, &val);
diff --git a/arch/arm/boards/freescale-mx51-pdk/board.c b/arch/arm/boards/freescale-mx51-pdk/board.c
index 7c2c8fe..b67a509 100644
--- a/arch/arm/boards/freescale-mx51-pdk/board.c
+++ b/arch/arm/boards/freescale-mx51-pdk/board.c
@@ -178,7 +178,7 @@ static void babbage_power_init(void)
 		mc13xxx_reg_write(mc13xxx, MC13892_REG_SW_2, val);
 	}
 
-	if (mc13xxx->revision < MC13892_REVISION_2_0) {
+	if (mc13xxx_revision(mc13xxx) < MC13892_REVISION_2_0) {
 		/* Set switchers in PWM mode for Atlas 2.0 and lower */
 		/* Setup the switcher mode for SW1 & SW2*/
 		mc13xxx_reg_read(mc13xxx, MC13892_REG_SW_4, &val);
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 8bb0d00..53d9b7c 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -42,6 +42,12 @@ struct mc13xxx *mc13xxx_get(void)
 }
 EXPORT_SYMBOL(mc13xxx_get);
 
+int mc13xxx_revision(struct mc13xxx *mc13xxx)
+{
+	return mc13xxx->revision;
+}
+EXPORT_SYMBOL(mc13xxx_revision);
+
 #ifdef CONFIG_SPI
 static int spi_rw(struct spi_device *spi, void * buf, size_t len)
 {
diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
index 632c9fb..3770789 100644
--- a/include/mfd/mc13xxx.h
+++ b/include/mfd/mc13xxx.h
@@ -165,6 +165,7 @@ struct mc13xxx {
 
 #ifdef CONFIG_MFD_MC13XXX
 extern struct mc13xxx *mc13xxx_get(void);
+extern int mc13xxx_revision(struct mc13xxx *mc13xxx);
 extern int mc13xxx_reg_read(struct mc13xxx *mc13xxx, u8 reg, u32 *val);
 extern int mc13xxx_reg_write(struct mc13xxx *mc13xxx, u8 reg, u32 val);
 extern int mc13xxx_set_bits(struct mc13xxx *mc13xxx, u8 reg, u32 mask, u32 val);
@@ -174,6 +175,11 @@ static inline struct mc13xxx *mc13xxx_get(void)
 	return NULL;
 }
 
+static inline int mc13xxx_revision(struct mc13xxx *mc13xxx)
+{
+	return -ENODEV;
+}
+
 static inline int mc13xxx_reg_read(struct mc13xxx *mc13xxx, u8 reg, u32 *val)
 {
 	return -ENODEV;
-- 
1.7.3.4


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-10  8:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-04  9:15 [PATCH 1/3] mc13xxx: Added mc13xxx_revision() function Alexander Shiyan
2012-08-04  9:15 ` [PATCH 2/3] mc13xxx: Hide private struct mc13xxx from other units Alexander Shiyan
2012-08-04  9:15 ` [PATCH 3/3] mc13xxx: Fixed memory leak Alexander Shiyan
2012-08-09  6:38   ` Sascha Hauer
2012-08-09 15:33     ` Alexander Shiyan
2012-08-10  8:44       ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox