aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/dev-hwmon.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2010-05-04 13:12:32 +0200
committerBen Dooks <ben-linux@fluff.org>2010-05-12 17:43:03 +0900
commit6cd82ffe0cd3836b32b29bd1436e5fd551957d54 (patch)
treed34f023240f7f456cf1c74a325afd15bce2ba2d4 /arch/arm/plat-samsung/dev-hwmon.c
parent7ebd467551ed6ae200d7835a84bbda0dcadaa511 (diff)
downloadkernel_samsung_smdk4412-6cd82ffe0cd3836b32b29bd1436e5fd551957d54.zip
kernel_samsung_smdk4412-6cd82ffe0cd3836b32b29bd1436e5fd551957d54.tar.gz
kernel_samsung_smdk4412-6cd82ffe0cd3836b32b29bd1436e5fd551957d54.tar.bz2
ARM: SAMSUNG: Move HWMON from plat-s3c24xx to plat-samsung
Move HWMON platform definition from plat-s3c24xx to plat-samsung and adjust mach-bast to use the new s3c_hwmon_set_platdata(). This allows usage of dev-hwmon by other Samsung SoCs. Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-samsung/dev-hwmon.c')
-rw-r--r--arch/arm/plat-samsung/dev-hwmon.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/dev-hwmon.c b/arch/arm/plat-samsung/dev-hwmon.c
new file mode 100644
index 0000000..b3ffb95
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-hwmon.c
@@ -0,0 +1,42 @@
+/* linux/arch/arm/plat-samsung/dev-hwmon.c
+ *
+ * Copyright 2008 Simtec Electronics
+ * Ben Dooks <ben@simtec.co.uk>
+ * http://armlinux.simtec.co.uk/
+ *
+ * Adapted for HWMON by Maurus Cuelenaere
+ *
+ * Samsung series device definition for HWMON
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+
+#include <plat/devs.h>
+#include <plat/hwmon.h>
+
+struct platform_device s3c_device_hwmon = {
+ .name = "s3c-hwmon",
+ .id = -1,
+ .dev.parent = &s3c_device_adc.dev,
+};
+
+void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
+{
+ struct s3c_hwmon_pdata *npd;
+
+ if (!pd) {
+ printk(KERN_ERR "%s: no platform data\n", __func__);
+ return;
+ }
+
+ npd = kmemdup(pd, sizeof(struct s3c_hwmon_pdata), GFP_KERNEL);
+ if (!npd)
+ printk(KERN_ERR "%s: no memory for platform data\n", __func__);
+
+ s3c_device_hwmon.dev.platform_data = npd;
+}