]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - arch/arm/plat-s3c24xx/devs.c
ARM: Merge for-2635/samsung-hwmon
[linux-2.6.git] / arch / arm / plat-s3c24xx / devs.c
index 986d4e5408f5735749dbfb5961c396914f05cf0e..cd5b41d0b5a406122a76e382dd525d58cd25ac3f 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -148,19 +150,41 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
 {
        struct s3c2410fb_mach_info *npd;
 
-       npd = kmalloc(sizeof(*npd), GFP_KERNEL);
+       npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
        if (npd) {
-               memcpy(npd, pd, sizeof(*npd));
                s3c_device_lcd.dev.platform_data = npd;
+               npd->displays = kmemdup(pd->displays,
+                       sizeof(struct s3c2410fb_display) * npd->num_displays,
+                       GFP_KERNEL);
+               if (!npd->displays)
+                       printk(KERN_ERR "no memory for LCD display data\n");
        } else {
                printk(KERN_ERR "no memory for LCD platform data\n");
        }
 }
 
 /* Touchscreen */
+
+static struct resource s3c_ts_resource[] = {
+       [0] = {
+               .start = S3C24XX_PA_ADC,
+               .end   = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TC,
+               .end   = IRQ_TC,
+               .flags = IORESOURCE_IRQ,
+       },
+
+};
+
 struct platform_device s3c_device_ts = {
        .name             = "s3c2410-ts",
        .id               = -1,
+       .dev.parent     = &s3c_device_adc.dev,
+       .num_resources    = ARRAY_SIZE(s3c_ts_resource),
+       .resource         = s3c_ts_resource,
 };
 EXPORT_SYMBOL(s3c_device_ts);
 
@@ -319,14 +343,6 @@ struct platform_device s3c_device_adc = {
        .resource         = s3c_adc_resource,
 };
 
-/* HWMON */
-
-struct platform_device s3c_device_hwmon = {
-       .name           = "s3c-hwmon",
-       .id             = -1,
-       .dev.parent     = &s3c_device_adc.dev,
-};
-
 /* SDI */
 
 static struct resource s3c_sdi_resource[] = {
@@ -352,7 +368,7 @@ struct platform_device s3c_device_sdi = {
 
 EXPORT_SYMBOL(s3c_device_sdi);
 
-void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
+void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
 {
        struct s3c24xx_mci_pdata *npd;