diff options
18 files changed, 79 insertions, 69 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/ts.h b/arch/arm/mach-s3c2410/include/mach/ts.h index ab4433f10bd..1b451ea1624 100644 --- a/arch/arm/mach-s3c2410/include/mach/ts.h +++ b/arch/arm/mach-s3c2410/include/mach/ts.h @@ -16,7 +16,7 @@ #ifndef __ASM_ARM_TS_H #define __ASM_ARM_TS_H -#include <linux/ts_filter.h> +#include <../drivers/input/touchscreen/ts_filter.h> struct s3c2410_ts_mach_info { int delay; diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index 74c3d8e1d74..4102d047ab0 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -96,6 +96,7 @@ config MACH_NEO1973_GTA02 select POWER_SUPPLY select GTA02_HDQ select MACH_NEO1973 + select S3C2410_PWM help Say Y here if you are using the FIC Neo1973 GSM Phone diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index 4520d7b3ec0..cff7affa0d7 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -103,10 +103,10 @@ #include "../plat-s3c24xx/neo1973_pm_gps.h" -#include <linux/ts_filter_linear.h> -#include <linux/ts_filter_mean.h> -#include <linux/ts_filter_median.h> -#include <linux/ts_filter_group.h> +#include <../drivers/input/touchscreen/ts_filter_linear.h> +#include <../drivers/input/touchscreen/ts_filter_mean.h> +#include <../drivers/input/touchscreen/ts_filter_median.h> +#include <../drivers/input/touchscreen/ts_filter_group.h> /* arbitrates which sensor IRQ owns the shared SPI bus */ static spinlock_t motion_irq_lock; diff --git a/drivers/ar6000/htc/ar6k.c b/drivers/ar6000/htc/ar6k.c index 0fd671ab064..72472abb0d8 100644 --- a/drivers/ar6000/htc/ar6k.c +++ b/drivers/ar6000/htc/ar6k.c @@ -723,7 +723,7 @@ static A_STATUS GetCredits(AR6K_DEVICE *pDev, int mbox, int *pCredits) } /* delay a little, target may not be ready */ - A_MDELAY(1000); + msleep(1000); } diff --git a/drivers/ar6000/htc/ar6k_events.c b/drivers/ar6000/htc/ar6k_events.c index fbbcd51896e..91b29af3711 100644 --- a/drivers/ar6000/htc/ar6k_events.c +++ b/drivers/ar6000/htc/ar6k_events.c @@ -131,7 +131,7 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, } /* delay a little */ - A_MDELAY(DELAY_PER_INTERVAL_MS); + msleep(DELAY_PER_INTERVAL_MS); AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" Retry Mbox Poll : %d \n",timeout)); } diff --git a/drivers/ar6000/miscdrv/common_drv.c b/drivers/ar6000/miscdrv/common_drv.c index 2b0dfd32931..4f127346665 100644 --- a/drivers/ar6000/miscdrv/common_drv.c +++ b/drivers/ar6000/miscdrv/common_drv.c @@ -311,7 +311,7 @@ ar6000_reset_device_skipflash(HIF_DEVICE *hifDevice) } } - A_MDELAY(50); /* delay to allow dragon to come to BMI phase */ + msleep(50); /* delay to allow dragon to come to BMI phase */ return A_OK; } @@ -350,7 +350,7 @@ A_STATUS ar6000_reset_device(HIF_DEVICE *hifDevice, A_UINT32 TargetType) * Read back the RESET CAUSE register to ensure that the cold reset * went through. */ - A_MDELAY(2000); /* 2 second delay to allow things to settle down */ + msleep(2000); /* 2 second delay to allow things to settle down */ // address = RESET_CAUSE_ADDRESS; diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 5db7a67d5b2..014a9e7a1ef 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -50,7 +50,7 @@ config TOUCHSCREEN_FILTER_LINEAR depends on INPUT_TOUCHSCREEN && TOUCHSCREEN_FILTER default Y help - Say Y here if you want to use the Mean touchscreen filter, it + Say Y here if you want to use the Linear touchscreen filter, it enables the use of calibration data for the touchscreen. endif diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index 46a33dfddc1..1a930a2aacc 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c @@ -65,7 +65,7 @@ #include <plat/regs-adc.h> -#include <linux/ts_filter.h> +#include "ts_filter.h" /* For ts.dev.id.version */ #define S3C2410TSVERSION 0x0101 diff --git a/drivers/input/touchscreen/ts_filter.c b/drivers/input/touchscreen/ts_filter.c index 15083882e1c..832844da55f 100644 --- a/drivers/input/touchscreen/ts_filter.c +++ b/drivers/input/touchscreen/ts_filter.c @@ -18,11 +18,13 @@ #include <linux/kernel.h> #include <linux/device.h> -#include <linux/ts_filter.h> +#include "ts_filter.h" + +static DEFINE_MUTEX(chain_mutex); int ts_filter_create_chain(struct platform_device *pdev, struct ts_filter_api **api, void **config, - struct ts_filter **list, int count_coords) + struct ts_filter **arr, int count_coords) { int count = 0; struct ts_filter *last = NULL; @@ -30,35 +32,42 @@ int ts_filter_create_chain(struct platform_device *pdev, if (!api) return 0; - while (*api && count < MAX_TS_FILTER_CHAIN) { - *list = ((*api)->create)(pdev, *config++, count_coords); - if (!*list) { + mutex_lock(&chain_mutex); + + while (*api) { + *arr = ((*api)->create)(pdev, *config++, count_coords); + if (!*arr) { printk(KERN_ERR "Filter %d failed init\n", count); return count; } - (*list)->api = *api++; + (*arr)->api = *api++; if (last) - last->next = *list; - last = *list; - list++; + last->next = *arr; + last = *arr; + arr++; count++; } + mutex_unlock(&chain_mutex); + return count; } EXPORT_SYMBOL_GPL(ts_filter_create_chain); void ts_filter_destroy_chain(struct platform_device *pdev, - struct ts_filter **list) + struct ts_filter **arr) { - struct ts_filter **first; - int count = 0; + struct ts_filter **first = arr; - first = list; - while (*list && count++ < MAX_TS_FILTER_CHAIN) { - ((*list)->api->destroy)(pdev, *list); - list++; + mutex_lock(&chain_mutex); + + while (*arr) { + ((*arr)->api->destroy)(pdev, *arr); + arr++; } *first = NULL; + + mutex_unlock(&chain_mutex); } EXPORT_SYMBOL_GPL(ts_filter_destroy_chain); + diff --git a/include/linux/ts_filter.h b/drivers/input/touchscreen/ts_filter.h index 167104482dd..5578e936b91 100644 --- a/include/linux/ts_filter.h +++ b/drivers/input/touchscreen/ts_filter.h @@ -2,20 +2,20 @@ #define __TS_FILTER_H__ /* - * touchscreen filter + * Touchscreen filter. * * (c) 2008 Andy Green <andy@openmoko.com> */ #include <linux/platform_device.h> -#define MAX_TS_FILTER_CHAIN 4 /* max filters you can chain up */ -#define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure) */ +#define MAX_TS_FILTER_CHAIN 8 /* Max. filters we can chain up. */ +#define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure). */ struct ts_filter; -/* operations that a filter can perform - */ +/* Operations that a filter can perform. */ + struct ts_filter_api { struct ts_filter * (*create)(struct platform_device *pdev, void *config, int count_coords); @@ -25,32 +25,33 @@ struct ts_filter_api { void (*scale)(struct ts_filter *filter, int *coords); }; -/* this is the common part of all filters, the result - * we use this type as an otherwise opaque handle on to +/* + * This is the common part of all filters. + * We use this type as an otherwise opaque handle on to * the actual filter. Therefore you need one of these - * at the start of your actual filter struct + * at the start of your actual filter struct. */ struct ts_filter { - struct ts_filter *next; /* next in chain */ - struct ts_filter_api *api; /* operations to use for this object */ + struct ts_filter *next; /* Next in chain. */ + struct ts_filter_api *api; /* Operations to use for this object. */ int count_coords; int coords[MAX_TS_FILTER_COORDS]; }; /* - * helper to create a filter chain from array of API pointers and - * array of config ints... leaves pointers to created filters in list - * array and fills in ->next pointers to create the chain + * Helper to create a filter chain from an array of API pointers and + * array of config ints. Leaves pointers to created filters in arr + * array and fills in ->next pointers to create the chain. */ extern int ts_filter_create_chain(struct platform_device *pdev, struct ts_filter_api **api, void **config, - struct ts_filter **list, int count_coords); + struct ts_filter **arr, int count_coords); -/* helper to destroy a whole chain from the list of filter pointers */ +/* Helper to destroy a whole chain from the list of filter pointers. */ extern void ts_filter_destroy_chain(struct platform_device *pdev, - struct ts_filter **list); + struct ts_filter **arr); #endif diff --git a/drivers/input/touchscreen/ts_filter_group.c b/drivers/input/touchscreen/ts_filter_group.c index 73e3625a5a6..f2ecd92916e 100644 --- a/drivers/input/touchscreen/ts_filter_group.c +++ b/drivers/input/touchscreen/ts_filter_group.c @@ -40,7 +40,7 @@ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/sort.h> -#include <linux/ts_filter_group.h> +#include "ts_filter_group.h" static void ts_filter_group_clear_internal(struct ts_filter_group *tsfg, int attempts) diff --git a/include/linux/ts_filter_group.h b/drivers/input/touchscreen/ts_filter_group.h index 1e74c8dc741..c411080eae2 100644 --- a/include/linux/ts_filter_group.h +++ b/drivers/input/touchscreen/ts_filter_group.h @@ -1,7 +1,7 @@ #ifndef __TS_FILTER_GROUP_H__ #define __TS_FILTER_GROUP_H__ -#include <linux/ts_filter.h> +#include "ts_filter.h" /* * Touchscreen group filter. diff --git a/drivers/input/touchscreen/ts_filter_linear.c b/drivers/input/touchscreen/ts_filter_linear.c index 4803e17ae49..c336252d0ff 100644 --- a/drivers/input/touchscreen/ts_filter_linear.c +++ b/drivers/input/touchscreen/ts_filter_linear.c @@ -24,15 +24,13 @@ * */ -#include <linux/ts_filter_linear.h> +#include "ts_filter_linear.h" #include <linux/kernel.h> #include <linux/slab.h> #include <linux/string.h> -/* - * sysfs functions - */ +/* sysfs functions */ static ssize_t const_attr_show(struct kobject *kobj, @@ -82,9 +80,7 @@ static ssize_t const_store(struct const_obj *obj, struct const_attribute *attr, return count; } -/* - * filter functions - */ +/* filter functions */ static struct ts_filter *ts_filter_linear_create(struct platform_device *pdev, void *conf, int count_coords) @@ -118,7 +114,6 @@ static struct ts_filter *ts_filter_linear_create(struct platform_device *pdev, tsfl->const_ktype.default_attrs = tsfl->attrs; tsfl->c_obj.tsfl = tsfl; /* kernel frees tsfl in const_release */ - /* TODO: /sys/ts-calibration is not OK */ ret = kobject_init_and_add(&tsfl->c_obj.kobj, &tsfl->const_ktype, &pdev->dev.kobj, "calibration"); if (ret) { diff --git a/include/linux/ts_filter_linear.h b/drivers/input/touchscreen/ts_filter_linear.h index dab53907a90..fc27cf77228 100644 --- a/include/linux/ts_filter_linear.h +++ b/drivers/input/touchscreen/ts_filter_linear.h @@ -1,11 +1,11 @@ #ifndef __TS_FILTER_LINEAR_H__ #define __TS_FILTER_LINEAR_H__ -#include <linux/ts_filter.h> +#include "ts_filter.h" #include <linux/kobject.h> /* - * touchscreen linear filter. + * Touchscreen linear filter. * * Copyright (C) 2008 by Openmoko, Inc. * Author: Nelson Castillo <arhuaco@freaks-unidos.net> diff --git a/drivers/input/touchscreen/ts_filter_mean.c b/drivers/input/touchscreen/ts_filter_mean.c index a7b4a5aac6f..e4e0f2ac68e 100644 --- a/drivers/input/touchscreen/ts_filter_mean.c +++ b/drivers/input/touchscreen/ts_filter_mean.c @@ -34,7 +34,7 @@ #include <linux/errno.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/ts_filter_mean.h> +#include "ts_filter_mean.h" static void ts_filter_mean_clear_internal(struct ts_filter *tsf) { @@ -63,7 +63,7 @@ static struct ts_filter *ts_filter_mean_create(struct platform_device *pdev, int n; struct ts_filter_mean *tsfs = kzalloc( sizeof(struct ts_filter_mean), GFP_KERNEL); - + if (!tsfs) return NULL; @@ -112,8 +112,9 @@ static void ts_filter_mean_scale(struct ts_filter *tsf, int *coords) (tsf->next->api->scale)(tsf->next, coords); } -/* give us the raw sample data in x and y, and if we return 1 then you can - * get a filtered coordinate from tsm->x and tsm->y: if we return 0 you didn't +/* + * Give us the raw sample data in x and y, and if we return 1 then you can + * get a filtered coordinate from tsm->x and tsm->y. If we return 0 you didn't * fill the filter with samples yet. */ @@ -125,7 +126,8 @@ static int ts_filter_mean_process(struct ts_filter *tsf, int *coords) for (n = 0; n < tsf->count_coords; n++) { - /* has he moved far enough away that we should abandon current + /* + * Has he moved far enough away that we should abandon current * low pass filtering state? */ if ((coords[n] < (tsfs->reported[n] - diff --git a/include/linux/ts_filter_mean.h b/drivers/input/touchscreen/ts_filter_mean.h index 46ff01a4c82..44c506c99c0 100644 --- a/include/linux/ts_filter_mean.h +++ b/drivers/input/touchscreen/ts_filter_mean.h @@ -1,10 +1,10 @@ #ifndef __TS_FILTER_MEAN_H__ #define __TS_FILTER_MEAN_H__ -#include <linux/ts_filter.h> +#include "ts_filter.h" /* - * touchscreen filter + * Touchscreen filter. * * mean * diff --git a/drivers/input/touchscreen/ts_filter_median.c b/drivers/input/touchscreen/ts_filter_median.c index 883ab06bff0..b3b6a9c1e5c 100644 --- a/drivers/input/touchscreen/ts_filter_median.c +++ b/drivers/input/touchscreen/ts_filter_median.c @@ -32,7 +32,7 @@ #include <linux/errno.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/ts_filter_median.h> +#include "ts_filter_median.h" static void ts_filter_median_insert(int *p, int sample, int count) { @@ -141,8 +141,9 @@ static void ts_filter_median_scale(struct ts_filter *tsf, int *coords) (tsf->next->api->scale)(tsf->next, coords); } -/* give us the raw sample data coords, and if we return 1 then you can - * get a filtered coordinate from coords: if we return 0 you didn't +/* + * Give us the raw sample data coords, and if we return 1 then you can + * get a filtered coordinate from coords. If we return 0 you didn't * fill all the filters with samples yet. */ @@ -169,9 +170,10 @@ static int ts_filter_median_process(struct ts_filter *tsf, int *coords) /* discard the oldest sample in median sorted array */ tsfm->valid--; - /* sum the middle 3 in the median sorted arrays. We don't divide back + /* + * Sum the middle 3 in the median sorted arrays. We don't divide back * down which increases the sum resolution by a factor of 3 until the - * scale API is called + * scale API is called. */ for (n = 0; n < tsfm->tsf.count_coords; n++) /* perform the deletion of the oldest sample */ diff --git a/include/linux/ts_filter_median.h b/drivers/input/touchscreen/ts_filter_median.h index d81642883f7..8f25e27b2aa 100644 --- a/include/linux/ts_filter_median.h +++ b/drivers/input/touchscreen/ts_filter_median.h @@ -1,10 +1,10 @@ #ifndef __TS_FILTER_MEDIAN_H__ #define __TS_FILTER_MEDIAN_H__ -#include <linux/ts_filter.h> +#include "ts_filter.h" /* - * touchscreen filter + * Touchscreen filter. * * median * |