Skip to content

Commit

Permalink
ARM: S3C24XX: touchscreen device definition
Browse files Browse the repository at this point in the history
Add definition for the touchscreen driver platform data and initial
support for the H1940 machine.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Arnaud Patard authored and Ben Dooks committed Dec 23, 2009
1 parent d3ef7ee commit ce8877b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
21 changes: 21 additions & 0 deletions arch/arm/mach-s3c2410/include/mach/ts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* linux/include/asm/arch-s3c2410/ts.h
*
* Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>
*
* 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.
*/

#ifndef __ASM_ARM_TS_H
#define __ASM_ARM_TS_H

struct s3c2410_ts_mach_info {
int delay;
int presc;
int oversampling_shift;
};

extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *);

#endif /* __ASM_ARM_TS_H */
8 changes: 8 additions & 0 deletions arch/arm/mach-s3c2410/mach-h1940.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <mach/h1940.h>
#include <mach/h1940-latch.h>
#include <mach/fb.h>
#include <mach/ts.h>
#include <plat/udc.h>
#include <plat/iic.h>

Expand Down Expand Up @@ -140,6 +141,11 @@ static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
.vbus_pin_inverted = 1,
};

static struct s3c2410_ts_mach_info h1940_ts_cfg __initdata = {
.delay = 10000,
.presc = 49,
.oversampling_shift = 2,
};

/**
* Set lcd on or off
Expand Down Expand Up @@ -265,6 +271,7 @@ static struct platform_device h1940_lcd_powerdev = {
};

static struct platform_device *h1940_devices[] __initdata = {
&s3c_device_ts,
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
Expand Down Expand Up @@ -305,6 +312,7 @@ static void __init h1940_init(void)

s3c24xx_fb_set_platdata(&h1940_fb_info);
s3c24xx_udc_set_platdata(&h1940_udc_cfg);
s3c24xx_ts_set_platdata(&h1940_ts_cfg);
s3c_i2c0_set_platdata(NULL);

s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-s3c/include/plat/devs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern struct platform_device s3c64xx_device_iisv4;
extern struct platform_device s3c64xx_device_pcm0;
extern struct platform_device s3c64xx_device_pcm1;

extern struct platform_device s3c_device_ts;
extern struct platform_device s3c_device_fb;
extern struct platform_device s3c_device_usb;
extern struct platform_device s3c_device_lcd;
Expand Down
18 changes: 18 additions & 0 deletions arch/arm/plat-s3c24xx/devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <plat/cpu.h>
#include <plat/regs-spi.h>

#include <mach/ts.h>

/* Serial port registrations */

static struct resource s3c2410_uart0_resource[] = {
Expand Down Expand Up @@ -182,6 +184,22 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
}
}

/* Touchscreen */
struct platform_device s3c_device_ts = {
.name = "s3c2410-ts",
.id = -1,
};
EXPORT_SYMBOL(s3c_device_ts);

static struct s3c2410_ts_mach_info s3c2410ts_info;

void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
{
memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info));
s3c_device_ts.dev.platform_data = &s3c2410ts_info;
}
EXPORT_SYMBOL(s3c24xx_ts_set_platdata);

/* USB Device (Gadget)*/

static struct resource s3c_usbgadget_resource[] = {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-s3c24xx/s3c244x.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void __init s3c244x_map_io(void)
s3c_device_sdi.name = "s3c2440-sdi";
s3c_device_i2c0.name = "s3c2440-i2c";
s3c_device_nand.name = "s3c2440-nand";
s3c_device_ts.name = "s3c2440-ts";
s3c_device_usbgadget.name = "s3c2440-usbgadget";
}

Expand Down

0 comments on commit ce8877b

Please sign in to comment.