diff options
Diffstat (limited to 'arch/arm/mach-s3c2442/mach-gta02.c')
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index cdd569885cd..b182c3392a2 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -109,6 +109,15 @@ #include <linux/platform_battery.h> +#include <mach/ts.h> +#include <linux/input/touchscreen/ts_filter_chain.h> +#ifdef CONFIG_TOUCHSCREEN_FILTER +#include <linux/input/touchscreen/ts_filter_linear.h> +#include <linux/input/touchscreen/ts_filter_mean.h> +#include <linux/input/touchscreen/ts_filter_median.h> +#include <linux/input/touchscreen/ts_filter_group.h> +#endif + struct pcf50633 *gta02_pcf; /* @@ -519,7 +528,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = { .max_uV = 3300000, .valid_modes_mask = REGULATOR_MODE_NORMAL, .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | - REGULATOR_CHANGE_STATUS, + REGULATOR_CHANGE_VOLTAGE, + .always_on = 1, }, .num_consumer_supplies = ARRAY_SIZE(hcldo_consumers), .consumer_supplies = hcldo_consumers, @@ -974,6 +984,51 @@ static struct platform_device gta02_pwm_leds_device = { } }; +/* Touchscreen configuration. */ + +#ifdef CONFIG_TOUCHSCREEN_FILTER +const static struct ts_filter_group_configuration gta02_ts_group = { + .length = 12, + .close_enough = 10, + .threshold = 6, /* At least half of the points in a group. */ + .attempts = 10, +}; + +const static struct ts_filter_median_configuration gta02_ts_median = { + .extent = 20, + .decimation_below = 3, + .decimation_threshold = 8 * 3, + .decimation_above = 4, +}; + +const static struct ts_filter_mean_configuration gta02_ts_mean = { + .length = 4, +}; + +const static struct ts_filter_linear_configuration gta02_ts_linear = { + .constants = {1, 0, 0, 0, 1, 0, 1}, /* Don't modify coords. */ + .coord0 = 0, + .coord1 = 1, +}; +#endif + +const static struct ts_filter_chain_configuration gta02_filter_configuration[] = +{ +#ifdef CONFIG_TOUCHSCREEN_FILTER + {&ts_filter_group_api, >a02_ts_group.config}, + {&ts_filter_median_api, >a02_ts_median.config}, + {&ts_filter_mean_api, >a02_ts_mean.config}, + {&ts_filter_linear_api, >a02_ts_linear.config}, +#endif + {NULL, NULL}, +}; + +const static struct s3c2410_ts_mach_info gta02_ts_cfg = { + .delay = 10000, + .presc = 0xff, /* slow as we can go */ + .filter_config = gta02_filter_configuration, +}; + struct hdq_platform_data gta02_hdq_platform_data = { .gpio_dir_out = gta02_hdq_gpio_direction_out, .gpio_dir_in = gta02_hdq_gpio_direction_in, @@ -991,7 +1046,7 @@ struct platform_device gta02_hdq_device = { .resource = gta02_hdq_resources, .dev = { .platform_data = >a02_hdq_platform_data, - .parent = &s3c_device_timer[0].dev, + .parent = &s3c_device_timer[2].dev, }, }; @@ -1030,6 +1085,7 @@ static struct platform_device *gta02_devices[] __initdata = { /* These guys DO need to be children of PMU. */ static struct platform_device *gta02_devices_pmu_children[] = { + &s3c_device_ts, >a02_glamo_dev, &s3c_device_timer[2], >a02_hdq_device, @@ -1224,6 +1280,8 @@ static void __init gta02_machine_init(void) /* Set the panic callback to make AUX LED blink at ~5Hz. */ panic_blink = gta02_panic_blink; + s3c_device_ts.name = "s3c2440-ts"; + gta02_hijack_gpb(); gta02_request_gpios(); @@ -1239,6 +1297,7 @@ static void __init gta02_machine_init(void) s3c24xx_udc_set_platdata(>a02_udc_cfg); s3c_i2c0_set_platdata(NULL); + set_s3c2410ts_info(>a02_ts_cfg); i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs)); spi_register_board_info(gta02_spi_board_info, |