diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2010-05-04 07:12:44 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:25:14 -0400 |
commit | 909de0d67dbd9488d5f77bdcadcd34264fea3c02 (patch) | |
tree | 5a114e652b5b47d6c491e58b6cec68aff1dc7254 /arch/arm/mach-s3c64xx | |
parent | 73e59b1d6b69f5ae02e3be5e2b3259c46d8bb27a (diff) |
ARM: S3C64XX: Add touchscreen platform device definition
This patch adds the touchscreen platform device definition for S3C64XX boards.
Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r-- | arch/arm/mach-s3c64xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/dev-ts.c | 61 |
2 files changed, 62 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index d78c3dd43a1a..a10f1fc6b023 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile | |||
@@ -58,3 +58,4 @@ obj-$(CONFIG_MACH_HMT) += mach-hmt.o | |||
58 | obj-y += dev-uart.o | 58 | obj-y += dev-uart.o |
59 | obj-y += dev-audio.o | 59 | obj-y += dev-audio.o |
60 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o | 60 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o |
61 | obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o | ||
diff --git a/arch/arm/mach-s3c64xx/dev-ts.c b/arch/arm/mach-s3c64xx/dev-ts.c new file mode 100644 index 000000000000..17cc7934afbe --- /dev/null +++ b/arch/arm/mach-s3c64xx/dev-ts.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* linux/arch/arm/mach-s3c64xx/dev-ts.c | ||
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org> | ||
6 | * | ||
7 | * Adapted by Maurus Cuelenaere for s3c64xx | ||
8 | * | ||
9 | * S3C64XX series device definition for touchscreen device | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <mach/irqs.h> | ||
21 | #include <mach/map.h> | ||
22 | |||
23 | #include <plat/devs.h> | ||
24 | #include <plat/ts.h> | ||
25 | |||
26 | static struct resource s3c_ts_resource[] = { | ||
27 | [0] = { | ||
28 | .start = S3C64XX_PA_ADC, | ||
29 | .end = S3C64XX_PA_ADC + SZ_256 - 1, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | }, | ||
32 | [1] = { | ||
33 | .start = IRQ_TC, | ||
34 | .end = IRQ_TC, | ||
35 | .flags = IORESOURCE_IRQ, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | struct platform_device s3c_device_ts = { | ||
40 | .name = "s3c64xx-ts", | ||
41 | .id = -1, | ||
42 | .num_resources = ARRAY_SIZE(s3c_ts_resource), | ||
43 | .resource = s3c_ts_resource, | ||
44 | }; | ||
45 | |||
46 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd) | ||
47 | { | ||
48 | struct s3c2410_ts_mach_info *npd; | ||
49 | |||
50 | if (!pd) { | ||
51 | printk(KERN_ERR "%s: no platform data\n", __func__); | ||
52 | return; | ||
53 | } | ||
54 | |||
55 | npd = kmemdup(pd, sizeof(struct s3c2410_ts_mach_info), GFP_KERNEL); | ||
56 | if (!npd) | ||
57 | printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
58 | |||
59 | s3c_device_ts.dev.platform_data = npd; | ||
60 | } | ||
61 | EXPORT_SYMBOL(s3c24xx_ts_set_platdata); | ||