diff options
author | Nelson Castillo <arhuaco@freaks-unidos.net> | 2009-03-10 12:04:26 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-03-10 12:04:26 +0000 |
commit | 25db5513242fb8d9fac0f461e110cc82d6b3f90f (patch) | |
tree | 2adeedac9d13da47f8093f04e4aa37b1f97aa905 /drivers/input | |
parent | 9e58a18567ec1ef306ea7b973749e5cd9902702c (diff) |
Export symbols and make a few symbols constant.
~ Make a few symbols constant.
~ Export symbols explicitly.
~ Move ts_filter.c to ts_filter_chain.c (this will make sense later).
Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/Makefile | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter.h | 15 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_chain.c (renamed from drivers/input/touchscreen/ts_filter.c) | 12 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_group.c | 5 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_group.h | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_linear.c | 6 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_linear.h | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_mean.c | 5 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_mean.h | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_median.c | 6 | ||||
-rw-r--r-- | drivers/input/touchscreen/ts_filter_median.h | 2 |
11 files changed, 34 insertions, 25 deletions
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 2669d63b0bc..940570b3394 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -35,7 +35,7 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o -obj-$(CONFIG_TOUCHSCREEN_FILTER) += ts_filter.o +obj-$(CONFIG_TOUCHSCREEN_FILTER) += ts_filter_chain.o obj-$(CONFIG_TOUCHSCREEN_FILTER_GROUP) += ts_filter_group.o obj-$(CONFIG_TOUCHSCREEN_FILTER_LINEAR) += ts_filter_linear.o obj-$(CONFIG_TOUCHSCREEN_FILTER_MEDIAN) += ts_filter_median.o diff --git a/drivers/input/touchscreen/ts_filter.h b/drivers/input/touchscreen/ts_filter.h index 630ea51aa78..0e4704f255a 100644 --- a/drivers/input/touchscreen/ts_filter.h +++ b/drivers/input/touchscreen/ts_filter.h @@ -18,9 +18,10 @@ struct ts_filter_configuration; struct ts_filter_api { /* Create the filter - mandatory. */ - struct ts_filter * (*create)(struct platform_device *pdev, - struct ts_filter_configuration *config, - int count_coords); + struct ts_filter * (*create)( + struct platform_device *pdev, + const struct ts_filter_configuration *config, + int count_coords); /* Destroy the filter - mandatory. */ void (*destroy)(struct ts_filter *filter); /* Clear the filter - optional. */ @@ -62,14 +63,14 @@ struct ts_filter_api { */ struct ts_filter_configuration { /* API to use */ - struct ts_filter_api *api; + const struct ts_filter_api *api; /* Generic filter configuration. Different for each filter. */ - struct ts_filter_configuration *config; + const struct ts_filter_configuration *config; }; struct ts_filter { /* Operations for this filter. */ - struct ts_filter_api *api; + const struct ts_filter_api *api; /* Number of coordinates to process. */ int count_coords; }; @@ -82,7 +83,7 @@ struct ts_filter { */ extern struct ts_filter **ts_filter_chain_create( struct platform_device *pdev, - struct ts_filter_configuration conf[], + const struct ts_filter_configuration conf[], int count_coords); /* Helper to destroy a whole chain from the list of filter pointers. */ diff --git a/drivers/input/touchscreen/ts_filter.c b/drivers/input/touchscreen/ts_filter_chain.c index 5551fe32b49..9b2b1c5400d 100644 --- a/drivers/input/touchscreen/ts_filter.c +++ b/drivers/input/touchscreen/ts_filter_chain.c @@ -29,9 +29,10 @@ * sptrlen - Count how many non-null pointers are in a pointer array * @arr: The array of pointers */ -static int sptrlen(void *arr) +static int sptrlen(const void *arr) { - int **p = arr; /* all pointers have the same size */ + /* All pointers have the same size. */ + const int **p = (const int **)arr; int len = 0; while (*(p++)) @@ -43,9 +44,10 @@ static int sptrlen(void *arr) /* FIXME: rename & remove this temporal hack. */ static struct ts_filter **revchain; -struct ts_filter **ts_filter_chain_create(struct platform_device *pdev, - struct ts_filter_configuration conf[], - int count_coords) +struct ts_filter **ts_filter_chain_create( + struct platform_device *pdev, + const struct ts_filter_configuration conf[], + int count_coords) { struct ts_filter **arr; int count = 0; diff --git a/drivers/input/touchscreen/ts_filter_group.c b/drivers/input/touchscreen/ts_filter_group.c index ac3229fcff2..18236e2d0ac 100644 --- a/drivers/input/touchscreen/ts_filter_group.c +++ b/drivers/input/touchscreen/ts_filter_group.c @@ -85,7 +85,7 @@ static void ts_filter_group_clear(struct ts_filter *tsf) static struct ts_filter *ts_filter_group_create( struct platform_device *pdev, - struct ts_filter_configuration *conf, + const struct ts_filter_configuration *conf, int count_coords) { struct ts_filter_group *tsfg; @@ -283,7 +283,7 @@ static void ts_filter_group_scale(struct ts_filter *tsf, int *coords) ts_filter_group_clear_internal(priv, priv->config->attempts); } -struct ts_filter_api ts_filter_group_api = { +const struct ts_filter_api ts_filter_group_api = { .create = ts_filter_group_create, .destroy = ts_filter_group_destroy, .clear = ts_filter_group_clear, @@ -292,4 +292,5 @@ struct ts_filter_api ts_filter_group_api = { .getpoint = ts_filter_group_getpoint, .scale = ts_filter_group_scale, }; +EXPORT_SYMBOL_GPL(ts_filter_group_api); diff --git a/drivers/input/touchscreen/ts_filter_group.h b/drivers/input/touchscreen/ts_filter_group.h index 4fc2af70608..c7d094dce42 100644 --- a/drivers/input/touchscreen/ts_filter_group.h +++ b/drivers/input/touchscreen/ts_filter_group.h @@ -31,6 +31,6 @@ struct ts_filter_group_configuration { struct ts_filter_configuration config; }; -extern struct ts_filter_api ts_filter_group_api; +extern const struct ts_filter_api ts_filter_group_api; #endif diff --git a/drivers/input/touchscreen/ts_filter_linear.c b/drivers/input/touchscreen/ts_filter_linear.c index bb6381457a8..8a10495adc5 100644 --- a/drivers/input/touchscreen/ts_filter_linear.c +++ b/drivers/input/touchscreen/ts_filter_linear.c @@ -127,7 +127,7 @@ static ssize_t const_store(struct const_obj *obj, struct const_attribute *attr, static struct ts_filter *ts_filter_linear_create( struct platform_device *pdev, - struct ts_filter_configuration *conf, + const struct ts_filter_configuration *conf, int count_coords) { struct ts_filter_linear *tsfl; @@ -194,8 +194,10 @@ static void ts_filter_linear_scale(struct ts_filter *tsf, int *coords) coords[tsfl->config->coord1] = (k[5] + k[3] * c0 + k[4] * c1) / k[6]; } -struct ts_filter_api ts_filter_linear_api = { +const struct ts_filter_api ts_filter_linear_api = { .create = ts_filter_linear_create, .destroy = ts_filter_linear_destroy, .scale = ts_filter_linear_scale, }; +EXPORT_SYMBOL_GPL(ts_filter_linear_api); + diff --git a/drivers/input/touchscreen/ts_filter_linear.h b/drivers/input/touchscreen/ts_filter_linear.h index 5cd9a81158d..67f6f945067 100644 --- a/drivers/input/touchscreen/ts_filter_linear.h +++ b/drivers/input/touchscreen/ts_filter_linear.h @@ -26,6 +26,6 @@ struct ts_filter_linear_configuration { struct ts_filter_configuration config; }; -extern struct ts_filter_api ts_filter_linear_api; +extern const struct ts_filter_api ts_filter_linear_api; #endif diff --git a/drivers/input/touchscreen/ts_filter_mean.c b/drivers/input/touchscreen/ts_filter_mean.c index 291226e6fdb..a3c5f0847fd 100644 --- a/drivers/input/touchscreen/ts_filter_mean.c +++ b/drivers/input/touchscreen/ts_filter_mean.c @@ -52,7 +52,7 @@ static void ts_filter_mean_clear(struct ts_filter *tsf); static struct ts_filter *ts_filter_mean_create( struct platform_device *pdev, - struct ts_filter_configuration *conf, + const struct ts_filter_configuration *conf, int count_coords) { struct ts_filter_mean *priv; @@ -161,7 +161,7 @@ static void ts_filter_mean_scale(struct ts_filter *tsf, int *coords) } } -struct ts_filter_api ts_filter_mean_api = { +const struct ts_filter_api ts_filter_mean_api = { .create = ts_filter_mean_create, .destroy = ts_filter_mean_destroy, .clear = ts_filter_mean_clear, @@ -170,4 +170,5 @@ struct ts_filter_api ts_filter_mean_api = { .haspoint = ts_filter_mean_haspoint, .getpoint = ts_filter_mean_getpoint, }; +EXPORT_SYMBOL_GPL(ts_filter_mean_api); diff --git a/drivers/input/touchscreen/ts_filter_mean.h b/drivers/input/touchscreen/ts_filter_mean.h index 7b3935f9e0c..f5b5e4bbe10 100644 --- a/drivers/input/touchscreen/ts_filter_mean.h +++ b/drivers/input/touchscreen/ts_filter_mean.h @@ -23,6 +23,6 @@ struct ts_filter_mean_configuration { }; /* API functions for the mean filter */ -extern struct ts_filter_api ts_filter_mean_api; +extern const struct ts_filter_api ts_filter_mean_api; #endif /* __TS_FILTER_MEAN_H__ */ diff --git a/drivers/input/touchscreen/ts_filter_median.c b/drivers/input/touchscreen/ts_filter_median.c index 547ca8d818a..b8a6206d1b7 100644 --- a/drivers/input/touchscreen/ts_filter_median.c +++ b/drivers/input/touchscreen/ts_filter_median.c @@ -105,7 +105,7 @@ static void ts_filter_median_clear(struct ts_filter *tsf) static struct ts_filter *ts_filter_median_create( struct platform_device *pdev, - struct ts_filter_configuration *conf, + const struct ts_filter_configuration *conf, int count_coords) { int *p; @@ -248,7 +248,7 @@ static void ts_filter_median_getpoint(struct ts_filter *tsf, int *point) priv->ready = 0; } -struct ts_filter_api ts_filter_median_api = { +const struct ts_filter_api ts_filter_median_api = { .create = ts_filter_median_create, .destroy = ts_filter_median_destroy, .clear = ts_filter_median_clear, @@ -257,3 +257,5 @@ struct ts_filter_api ts_filter_median_api = { .haspoint = ts_filter_median_haspoint, .getpoint = ts_filter_median_getpoint, }; +EXPORT_SYMBOL_GPL(ts_filter_median_api); + diff --git a/drivers/input/touchscreen/ts_filter_median.h b/drivers/input/touchscreen/ts_filter_median.h index 17a1ca6d201..1c19472e375 100644 --- a/drivers/input/touchscreen/ts_filter_median.h +++ b/drivers/input/touchscreen/ts_filter_median.h @@ -27,6 +27,6 @@ struct ts_filter_median_configuration { struct ts_filter_configuration config; }; -extern struct ts_filter_api ts_filter_median_api; +extern const struct ts_filter_api ts_filter_median_api; #endif |