summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Marklund <robert.marklund@stericsson.com>2011-09-28 09:48:38 +0200
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 15:09:02 +0200
commit91606c1f3e602e5a519136556f07db04b77433d1 (patch)
tree9d17a500ce25f01e1446c5684dd7e2d5bf16fc98
parente5fce67d437701d6c4793fa3b785a8c2cd585ade (diff)
hwmon: Make all ux500 mach build at once
Alter the hwmon driver so we can build both the MACH_U5500 and the U8500 at the same time. Change-Id: I2ff9665427c1c33181552e7e51074c5eca3f1473 Signed-off-by: Robert Marklund <robert.marklund@stericsson.com>
-rw-r--r--drivers/hwmon/ab5500.c3
-rw-r--r--drivers/hwmon/ab8500.c3
-rw-r--r--drivers/hwmon/abx500.c7
-rw-r--r--drivers/hwmon/abx500.h3
4 files changed, 12 insertions, 4 deletions
diff --git a/drivers/hwmon/ab5500.c b/drivers/hwmon/ab5500.c
index 7352e07ffde..0122f315ac6 100644
--- a/drivers/hwmon/ab5500.c
+++ b/drivers/hwmon/ab5500.c
@@ -25,6 +25,7 @@
#include <linux/mfd/abx500/ab5500-gpadc.h>
#include <linux/mfd/abx500/ab5500-bm.h>
#include "abx500.h"
+#include <asm/mach-types.h>
/* AB5500 driver monitors GPADC - XTAL_TEMP, PCB_TEMP,
* BTEMP_BALL, BAT_CTRL and DIE_TEMP
@@ -159,7 +160,7 @@ static int ab5500_temp_irq_handler(int irq, struct abx500_temp *data)
return 0;
}
-int __init abx500_hwmon_init(struct abx500_temp *data)
+int __init ab5500_hwmon_init(struct abx500_temp *data)
{
int err;
diff --git a/drivers/hwmon/ab8500.c b/drivers/hwmon/ab8500.c
index 9e81445322b..c6694206b4d 100644
--- a/drivers/hwmon/ab8500.c
+++ b/drivers/hwmon/ab8500.c
@@ -25,6 +25,7 @@
#include <linux/mfd/ab8500/gpadc.h>
#include <linux/mfd/ab8500/bm.h>
#include "abx500.h"
+#include <asm/mach-types.h>
#define DEFAULT_POWER_OFF_DELAY 10000
@@ -136,7 +137,7 @@ static int ab8500_temp_irq_handler(int irq, struct abx500_temp *data)
return 0;
}
-int __init abx500_hwmon_init(struct abx500_temp *data)
+int __init ab8500_hwmon_init(struct abx500_temp *data)
{
data->ab8500_gpadc = ab8500_gpadc_get();
if (IS_ERR(data->ab8500_gpadc))
diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c
index b26a13e8438..de4e6280b4b 100644
--- a/drivers/hwmon/abx500.c
+++ b/drivers/hwmon/abx500.c
@@ -36,6 +36,8 @@
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include <linux/pm.h>
+#include <asm/mach-types.h>
+
#include "abx500.h"
#define DEFAULT_MONITOR_DELAY 1000
@@ -610,7 +612,10 @@ static int __devinit abx500_temp_probe(struct platform_device *pdev)
mutex_init(&data->lock);
/* Chip specific initialization */
- err = abx500_hwmon_init(data);
+ if (!machine_is_u5500())
+ err = ab8500_hwmon_init(data);
+ else
+ err = ab5500_hwmon_init(data);
if (err < 0) {
dev_err(&pdev->dev, "abx500 init failed");
goto exit;
diff --git a/drivers/hwmon/abx500.h b/drivers/hwmon/abx500.h
index 65a9a8238ba..9fe28dac28f 100644
--- a/drivers/hwmon/abx500.h
+++ b/drivers/hwmon/abx500.h
@@ -89,6 +89,7 @@ struct abx500_temp {
int monitored_sensors;
};
-int abx500_hwmon_init(struct abx500_temp *data) __init;
+int ab8500_hwmon_init(struct abx500_temp *data) __init;
+int ab5500_hwmon_init(struct abx500_temp *data) __init;
#endif /* _ABX500_H */