Ticket #2236: touchscreenfilter.patch

File touchscreenfilter.patch, 2.2 KB (added by perezdiez, 10 years ago)

Patch to adapt the gta02 ts filters to gta01 (allows to disable them on config)

  • arch/arm/mach-s3c2410/mach-gta01.c

    Signed-off-by:Jose Luis Perez Diez <perezdiez@gmail.com>
    ---
     arch/arm/mach-s3c2410/mach-gta01.c |   38 ++++++++++++++++++++++++++++++++---
     1 files changed, 34 insertions(+), 4 deletions(-)
    
    diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c
    index 6eb8eb3..d424211 100644
    a b  
    8888 
    8989#include <linux/jbt6k74.h> 
    9090 
     91#ifdef CONFIG_TOUCHSCREEN_FILTER 
     92#include <../drivers/input/touchscreen/ts_filter_linear.h> 
    9193#include <../drivers/input/touchscreen/ts_filter_mean.h> 
    9294#include <../drivers/input/touchscreen/ts_filter_median.h> 
     95#include <../drivers/input/touchscreen/ts_filter_group.h> 
     96#endif 
     97 
    9398 
    9499static struct map_desc gta01_iodesc[] __initdata = { 
    95100        { 
    static struct s3c2410_udc_mach_info gta01_udc_cfg = { 
    698703 
    699704 
    700705/* touchscreen configuration */ 
     706#ifdef CONFIG_TOUCHSCREEN_FILTER 
     707static struct ts_filter_linear_configuration gta01_ts_linear_config = { 
     708        .constants = {1, 0, 0, 0, 1, 0, 1},     /* don't modify coords */ 
     709        .coord0 = 0, 
     710        .coord1 = 1, 
     711}; 
     712 
     713static struct ts_filter_group_configuration gta01_ts_group_config = { 
     714        .extent = 12, 
     715        .close_enough = 10, 
     716        .threshold = 6,         /* at least half of the points in a group */ 
     717        .attempts = 10, 
     718}; 
    701719 
    702720static struct ts_filter_median_configuration gta01_ts_median_config = { 
    703721        .extent = 31, 
    static struct s3c2410_ts_mach_info gta01_ts_cfg = { 
    715733        .delay = 10000, 
    716734        .presc = 0xff, /* slow as we can go */ 
    717735        .filter_sequence = { 
    718                 [0] = &ts_filter_median_api, 
    719                 [1] = &ts_filter_mean_api, 
     736                [0] = &ts_filter_group_api, 
     737                [1] = &ts_filter_median_api, 
     738                [2] = &ts_filter_mean_api, 
     739                [3] = &ts_filter_linear_api, 
    720740        }, 
    721741        .filter_config = { 
    722                 [0] = &gta01_ts_median_config, 
    723                 [1] = &gta01_ts_mean_config, 
     742                [0] = &gta01_ts_group_config, 
     743                [1] = &gta01_ts_median_config, 
     744                [2] = &gta01_ts_mean_config, 
     745                [3] = &gta01_ts_linear_config, 
    724746        }, 
    725747}; 
     748#else /* !CONFIG_TOUCHSCREEN_FILTER */ 
     749static struct s3c2410_ts_mach_info gta01_ts_cfg = { 
     750        .delay = 10000, 
     751        .presc = 0xff, /* slow as we can go */ 
     752        .filter_sequence = { NULL }, 
     753        .filter_config = { NULL }, 
     754}; 
     755#endif 
    726756 
    727757 
    728758/* SPI */