diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-05-18 17:55:41 +0000 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-05-18 17:55:41 +0000 |
commit | 9d1188140e188101782d10f520c21088ef9c434a (patch) | |
tree | dd10e61f382ace3afbe40af3af8238757cf5e3d0 /target/linux/s3c24xx/files-2.6.30/include | |
parent | 6aa4a3e4719e5e795d422ef0b5983b22317c2b79 (diff) | |
download | master-187ad058-9d1188140e188101782d10f520c21088ef9c434a.tar.gz master-187ad058-9d1188140e188101782d10f520c21088ef9c434a.tar.bz2 master-187ad058-9d1188140e188101782d10f520c21088ef9c434a.zip |
[s3c24xx] bump to 2.6.30-rc6
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15918 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/s3c24xx/files-2.6.30/include')
16 files changed, 703 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/bq27000_battery.h b/target/linux/s3c24xx/files-2.6.30/include/linux/bq27000_battery.h new file mode 100644 index 0000000000..a617466a51 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/bq27000_battery.h @@ -0,0 +1,16 @@ +#ifndef __BQ27000_BATTERY_H__ +#define __BQ27000_BATTERY_H__ + +void bq27000_charging_state_change(struct platform_device *pdev); + +struct bq27000_platform_data { + const char *name; + int rsense_mohms; + int (*hdq_read)(int); + int (*hdq_write)(int, u8); + int (*hdq_initialized)(void); + int (*get_charger_online_status)(void); + int (*get_charger_active_status)(void); +}; + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/glamo-gpio.h b/target/linux/s3c24xx/files-2.6.30/include/linux/glamo-gpio.h new file mode 100644 index 0000000000..d00f7e95a2 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/glamo-gpio.h @@ -0,0 +1,99 @@ +#ifndef __GLAMO_GPIO_H +#define __GLAMO_GPIO_H + +struct glamo_core; + +#define GLAMO_GPIO_BANKA 0x0000 +#define GLAMO_GPIO_BANKB 0x1000 +#define GLAMO_GPIO_BANKC 0x2000 +#define GLAMO_GPIO_BANKD 0x3000 + +#define GLAMO_GPIONO(bank, pin) ((bank & 0xf000) | ((pin & 0xf) << 8)) + +#define GLAMO_GPIO_F_IN 0x0010 +#define GLAMO_GPIO_F_OUT 0x0020 +#define GLAMO_GPIO_F_FUNC 0x0030 + +#define GLAMO_GPIO0 GLAMO_GPIONO(GLAMO_GPIO_BANKA, 0) +#define GLAMO_GPIO0_INPUT (GLAMO_GPIO0 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO0_OUTPUT (GLAMO_GPIO0 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO0_HA20 (GLAMO_GPIO0 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO1 GLAMO_GPIONO(GLAMO_GPIO_BANKA, 1) +#define GLAMO_GPIO1_INPUT (GLAMO_GPIO1 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO1_OUTPUT (GLAMO_GPIO1 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO1_HA21 (GLAMO_GPIO1 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO2 GLAMO_GPIONO(GLAMO_GPIO_BANKA, 2) +#define GLAMO_GPIO2_INPUT (GLAMO_GPIO2 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO2_OUTPUT (GLAMO_GPIO2 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO2_HA22 (GLAMO_GPIO2 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO3 GLAMO_GPIONO(GLAMO_GPIO_BANKA, 3) +#define GLAMO_GPIO3_INPUT (GLAMO_GPIO3 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO3_OUTPUT (GLAMO_GPIO3 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO3_HA23 (GLAMO_GPIO3 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO4 GLAMO_GPIONO(GLAMO_GPIO_BANKB, 0) +#define GLAMO_GPIO4_INPUT (GLAMO_GPIO4 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO4_OUTPUT (GLAMO_GPIO4 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO4_nLCS0 (GLAMO_GPIO4 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO5 GLAMO_GPIONO(GLAMO_GPIO_BANKB, 1) +#define GLAMO_GPIO5_INPUT (GLAMO_GPIO5 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO5_OUTPUT (GLAMO_GPIO5 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO5_nLCS1 (GLAMO_GPIO5 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO6 GLAMO_GPIONO(GLAMO_GPIO_BANKB, 2) +#define GLAMO_GPIO6_INPUT (GLAMO_GPIO6 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO6_OUTPUT (GLAMO_GPIO6 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO6_LDCLK (GLAMO_GPIO6 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO7 GLAMO_GPIONO(GLAMO_GPIO_BANKB, 3) +#define GLAMO_GPIO7_INPUT (GLAMO_GPIO7 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO7_OUTPUT (GLAMO_GPIO7 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO7_nLDE (GLAMO_GPIO7 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO8 GLAMO_GPIONO(GLAMO_GPIO_BANKC, 0) +#define GLAMO_GPIO8_INPUT (GLAMO_GPIO8 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO8_OUTPUT (GLAMO_GPIO8 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO8_LD16 (GLAMO_GPIO8 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO9 GLAMO_GPIONO(GLAMO_GPIO_BANKC, 1) +#define GLAMO_GPIO9_INPUT (GLAMO_GPIO9 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO9_OUTPUT (GLAMO_GPIO9 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO9_LD17 (GLAMO_GPIO9 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO10 GLAMO_GPIONO(GLAMO_GPIO_BANKC, 2) +#define GLAMO_GPIO10_INPUT (GLAMO_GPIO10 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO10_OUTPUT (GLAMO_GPIO10 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO10_LSCK (GLAMO_GPIO10 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO11 GLAMO_GPIONO(GLAMO_GPIO_BANKC, 3) +#define GLAMO_GPIO11_INPUT (GLAMO_GPIO11 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO11_OUTPUT (GLAMO_GPIO11 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO11_LSDA (GLAMO_GPIO11 | GLAMO_GPIO_F_FUNC) + +#define GLAMO_GPIO12 GLAMO_GPIONO(GLAMO_GPIO_BANKD, 0) +#define GLAMO_GPIO12_INPUT (GLAMO_GPIO12 | GLAMO_GPIO_F_IN) +#define GLAMO_GPIO12_OUTPUT (GLAMO_GPIO12 | GLAMO_GPIO_F_OUT) +#define GLAMO_GPIO12_LSA0 (GLAMO_GPIO12 | GLAMO_GPIO_F_FUNC) + + +#define REG_OF_GPIO(gpio) (((gpio & 0xf000) >> 12)*2 \ + + GLAMO_REG_GPIO_GEN1) +#define NUM_OF_GPIO(gpio) ((gpio & 0x0f00) >> 8) +#define GPIO_OUT_BIT(gpio) (1 << (NUM_OF_GPIO(gpio) + 0)) +#define OUTPUT_BIT(gpio) (1 << (NUM_OF_GPIO(gpio) + 4)) +#define INPUT_BIT(gpio) (1 << (NUM_OF_GPIO(gpio) + 8)) +#define FUNC_BIT(gpio) (1 << (NUM_OF_GPIO(gpio) + 12)) + +void glamo_gpio_setpin(struct glamo_core *glamo, unsigned int pin, + unsigned int value); + +int glamo_gpio_getpin(struct glamo_core *glamo, unsigned int pin); + +void glamo_gpio_cfgpin(struct glamo_core *glamo, unsigned int pinfunc); + + +#endif /* _GLAMO_GPIO */ diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/glamofb.h b/target/linux/s3c24xx/files-2.6.30/include/linux/glamofb.h new file mode 100644 index 0000000000..47d41e6221 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/glamofb.h @@ -0,0 +1,50 @@ +#ifndef _LINUX_GLAMOFB_H +#define _LINUX_GLAMOFB_H + +#include <linux/spi/glamo.h> + +struct glamofb_val { + unsigned int defval; + unsigned int min; + unsigned int max; +}; + +struct glamo_core; + +struct glamofb_platform_data { + int width, height; + int pixclock; + int left_margin, right_margin; + int upper_margin, lower_margin; + int hsync_len, vsync_len; + int fb_mem_size; + + struct glamofb_val xres; + struct glamofb_val yres; + struct glamofb_val bpp; + + struct glamo_spi_info *spi_info; + struct glamo_spigpio_info *spigpio_info; + struct glamo_core *glamo; + + struct platform_device *mmc_dev; + + /* glamo mmc platform specific info */ + int (*glamo_can_set_mci_power)(void); + + /* glamo-mci asking if it should use the slow clock to card */ + int (*glamo_mci_use_slow)(void); + int (*glamo_irq_is_wired)(void); + void (*glamo_external_reset)(int); +}; + +int glamofb_cmd_mode(struct glamofb_handle *gfb, int on); +int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val); + +#ifdef CONFIG_MFD_GLAMO +void glamo_lcm_reset(int level); +#else +#define glamo_lcm_reset(...) do {} while (0) +#endif + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/gta02-shadow.h b/target/linux/s3c24xx/files-2.6.30/include/linux/gta02-shadow.h new file mode 100644 index 0000000000..8d723a2f0e --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/gta02-shadow.h @@ -0,0 +1,33 @@ +/* + * include/linux/gta02-shadow.h + * + * Common utility code for GTA02 + * + * Copyright (C) 2008 by Openmoko, Inc. + * Author: Holger Hans Peter Freyther <freyther@openmoko.org> + * All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + +#ifndef GTA02_SHADOW_H +#define GTA02_SHADOW_H + +void gta02_gpb_add_shadow_gpio(unsigned int gpio); +void gta02_gpb_setpin(unsigned int pin, unsigned to); + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/gta02-vibrator.h b/target/linux/s3c24xx/files-2.6.30/include/linux/gta02-vibrator.h new file mode 100644 index 0000000000..9c24aac319 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/gta02-vibrator.h @@ -0,0 +1,5 @@ +struct gta02_vib_platform_data { + int (* enable_fiq)(void); + void (*disable_fiq)(void); + void (*kick_fiq)(void); +}; diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/gta02_hdq.h b/target/linux/s3c24xx/files-2.6.30/include/linux/gta02_hdq.h new file mode 100644 index 0000000000..ae0c70e24e --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/gta02_hdq.h @@ -0,0 +1,18 @@ +#ifndef __GTA02HDQ_H__ +#define __GTA02HDQ_H__ + +/* platform data */ + +struct gta02_hdq_platform_data { + /* + * give an opportunity to use us as parent for + * devices that depend on us + */ + void (*attach_child_devices)(struct device *parent_device); +}; + +int gta02hdq_read(int address); +int gta02hdq_write(int address, u8 data); +int gta02hdq_initialized(void); + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/hdq.h b/target/linux/s3c24xx/files-2.6.30/include/linux/hdq.h new file mode 100644 index 0000000000..377ab387eb --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/hdq.h @@ -0,0 +1,32 @@ +#ifndef __LINUX_HDQ_H__ +#define __LINUX_HDQ_H__ + +#include <linux/device.h> + +#define HDQ_SAMPLE_PERIOD_US 10 + +/* platform data */ + +struct hdq_platform_data { + /* + * give an opportunity to use us as parent for + * devices that depend on us + */ + void (*attach_child_devices)(struct device *parent_device); + + void (*gpio_dir_out)(void); + void (*gpio_dir_in)(void); + void (*gpio_set)(int); + int (*gpio_get)(void); + + int (*enable_fiq)(void); + void (*disable_fiq)(void); + void (*kick_fiq)(void); + +}; + +int hdq_read(int address); +int hdq_write(int address, u8 data); +int hdq_initialized(void); + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/jbt6k74.h b/target/linux/s3c24xx/files-2.6.30/include/linux/jbt6k74.h new file mode 100644 index 0000000000..962b3fbe04 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/jbt6k74.h @@ -0,0 +1,12 @@ +#ifndef __JBT6K74_H__ +#define __JBT6K74_H__ + +#include <linux/spi/spi.h> + +struct jbt6k74_platform_data { + void (*reset)(int devindex, int level); + void (*resuming)(int devindex); /* called when LCM is resumed */ + void (*probe_completed)(struct device *dev); +}; + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/lis302dl.h b/target/linux/s3c24xx/files-2.6.30/include/linux/lis302dl.h new file mode 100644 index 0000000000..0c1fc30973 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/lis302dl.h @@ -0,0 +1,152 @@ +#ifndef _LINUX_LIS302DL_H +#define _LINUX_LIS302DL_H + +#include <linux/types.h> +#include <linux/spi/spi.h> +#include <linux/input.h> +#include <linux/workqueue.h> + +struct lis302dl_info; + +struct lis302dl_platform_data { + char *name; + unsigned long pin_chip_select; + unsigned long pin_clk; + unsigned long pin_mosi; + unsigned long pin_miso; + int open_drain; + int interrupt; + void (*lis302dl_suspend_io)(struct lis302dl_info *, int resuming); +}; + +struct lis302dl_info { + struct lis302dl_platform_data *pdata; + struct device *dev; + struct input_dev *input_dev; + unsigned int flags; + unsigned int threshold; + unsigned int duration; + u32 overruns; + struct { + unsigned int threshold; /* mg */ + unsigned int duration; /* ms */ + } wakeup; + + struct spi_device *spi; + u_int8_t regs[0x40]; +}; + +enum lis302dl_reg { + LIS302DL_REG_WHO_AM_I = 0x0f, + LIS302DL_REG_CTRL1 = 0x20, + LIS302DL_REG_CTRL2 = 0x21, + LIS302DL_REG_CTRL3 = 0x22, + LIS302DL_REG_HP_FILTER_RESET = 0x23, + LIS302DL_REG_STATUS = 0x27, + LIS302DL_REG_OUT_X = 0x29, + LIS302DL_REG_OUT_Y = 0x2b, + LIS302DL_REG_OUT_Z = 0x2d, + LIS302DL_REG_FF_WU_CFG_1 = 0x30, + LIS302DL_REG_FF_WU_SRC_1 = 0x31, + LIS302DL_REG_FF_WU_THS_1 = 0x32, + LIS302DL_REG_FF_WU_DURATION_1 = 0x33, + LIS302DL_REG_FF_WU_CFG_2 = 0x34, + LIS302DL_REG_FF_WU_SRC_2 = 0x35, + LIS302DL_REG_FF_WU_THS_2 = 0x36, + LIS302DL_REG_FF_WU_DURATION_2 = 0x37, + LIS302DL_REG_CLICK_CFG = 0x38, + LIS302DL_REG_CLICK_SRC = 0x39, + LIS302DL_REG_CLICK_THSY_X = 0x3b, + LIS302DL_REG_CLICK_THSZ = 0x3c, + LIS302DL_REG_CLICK_TIME_LIMIT = 0x3d, + LIS302DL_REG_CLICK_LATENCY = 0x3e, + LIS302DL_REG_CLICK_WINDOW = 0x3f, +}; + +enum lis302dl_reg_ctrl1 { + LIS302DL_CTRL1_Xen = 0x01, + LIS302DL_CTRL1_Yen = 0x02, + LIS302DL_CTRL1_Zen = 0x04, + LIS302DL_CTRL1_STM = 0x08, + LIS302DL_CTRL1_STP = 0x10, + LIS302DL_CTRL1_FS = 0x20, + LIS302DL_CTRL1_PD = 0x40, + LIS302DL_CTRL1_DR = 0x80, +}; + +enum lis302dl_reg_ctrl2 { + LIS302DL_CTRL2_HPC1 = 0x01, + LIS302DL_CTRL2_HPC2 = 0x02, + LIS302DL_CTRL2_HPFF1 = 0x04, + LIS302DL_CTRL2_HPFF2 = 0x08, + LIS302DL_CTRL2_FDS = 0x10, + LIS302DL_CTRL2_BOOT = 0x40, + LIS302DL_CTRL2_SIM = 0x80, +}; +enum lis302dl_reg_ctrl3 { + LIS302DL_CTRL3_PP_OD = 0x40, + LIS302DL_CTRL3_IHL = 0x80, +}; + +enum lis302dl_reg_status { + LIS302DL_STATUS_XDA = 0x01, + LIS302DL_STATUS_YDA = 0x02, + LIS302DL_STATUS_ZDA = 0x04, + LIS302DL_STATUS_XYZDA = 0x08, + LIS302DL_STATUS_XOR = 0x10, + LIS302DL_STATUS_YOR = 0x20, + LIS302DL_STATUS_ZOR = 0x40, + LIS302DL_STATUS_XYZOR = 0x80, +}; + +/* Wakeup/freefall interrupt defs */ +enum lis302dl_reg_ffwucfg { + LIS302DL_FFWUCFG_XLIE = 0x01, + LIS302DL_FFWUCFG_XHIE = 0x02, + LIS302DL_FFWUCFG_YLIE = 0x04, + LIS302DL_FFWUCFG_YHIE = 0x08, + LIS302DL_FFWUCFG_ZLIE = 0x10, + LIS302DL_FFWUCFG_ZHIE = 0x20, + LIS302DL_FFWUCFG_LIR = 0x40, + LIS302DL_FFWUCFG_AOI = 0x80, +}; + +enum lis302dl_reg_ffwuths { + LIS302DL_FFWUTHS_DCRM = 0x80, +}; + +enum lis302dl_reg_ffwusrc { + LIS302DL_FFWUSRC_XL = 0x01, + LIS302DL_FFWUSRC_XH = 0x02, + LIS302DL_FFWUSRC_YL = 0x04, + LIS302DL_FFWUSRC_YH = 0x08, + LIS302DL_FFWUSRC_ZL = 0x10, + LIS302DL_FFWUSRC_ZH = 0x20, + LIS302DL_FFWUSRC_IA = 0x40, +}; + +enum lis302dl_reg_cloik_src { + LIS302DL_CLICKSRC_SINGLE_X = 0x01, + LIS302DL_CLICKSRC_DOUBLE_X = 0x02, + LIS302DL_CLICKSRC_SINGLE_Y = 0x04, + LIS302DL_CLICKSRC_DOUBLE_Y = 0x08, + LIS302DL_CLICKSRC_SINGLE_Z = 0x10, + LIS302DL_CLICKSRC_DOUBLE_Z = 0x20, + LIS302DL_CLICKSRC_IA = 0x40, +}; + +#define LIS302DL_WHO_AM_I_MAGIC 0x3b + +#define LIS302DL_F_WUP_FF_1 0x0001 /* wake up from free fall */ +#define LIS302DL_F_WUP_FF_2 0x0002 +#define LIS302DL_F_WUP_FF 0x0003 +#define LIS302DL_F_WUP_CLICK 0x0004 +#define LIS302DL_F_POWER 0x0010 +#define LIS302DL_F_FS 0x0020 /* ADC full scale */ +#define LIS302DL_F_INPUT_OPEN 0x0040 /* Set if input device is opened */ +#define LIS302DL_F_IRQ_WAKE 0x0080 /* IRQ is setup in wake mode */ +#define LIS302DL_F_DR 0x0100 /* Data rate, 400Hz/100Hz */ + + +#endif /* _LINUX_LIS302DL_H */ + diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/spi/glamo.h b/target/linux/s3c24xx/files-2.6.30/include/linux/spi/glamo.h new file mode 100644 index 0000000000..05b8cd7573 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/spi/glamo.h @@ -0,0 +1,27 @@ +#ifndef __GLAMO_SPI_H +#define __GLAMO_SPI_H + +#include <linux/glamo-gpio.h> + +struct spi_board_info; +struct glamofb_handle; +struct glamo_core; + +struct glamo_spi_info { + unsigned long board_size; + struct spi_board_info *board_info; + struct glamofb_handle *glamofb_handle; +}; + +struct glamo_spigpio_info { + unsigned int pin_clk; + unsigned int pin_mosi; + unsigned int pin_miso; + unsigned int pin_cs; + int bus_num; + + struct glamo_core *glamo; +}; + + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter.h b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter.h new file mode 100644 index 0000000000..aac1e028d0 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter.h @@ -0,0 +1,74 @@ +#ifndef __TS_FILTER_H__ +#define __TS_FILTER_H__ + +/* + * Touchscreen filter. + * + * (c) 2008,2009 Andy Green <andy@openmoko.com> + */ + +#include <linux/platform_device.h> + +#define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure). */ + +struct ts_filter; +struct ts_filter_configuration; + +/* Operations that a filter can perform. */ + +struct ts_filter_api { + /* Create the filter - mandatory. */ + 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. */ + void (*clear)(struct ts_filter *filter); + + + /* + * The next three API functions only make sense if all of them are + * set for a filter. If a filter has the next three methods then + * it can propagate coordinates in the chain. + */ + + /* + * Process the filter. + * It returns non-zero if the filter reaches an error. + */ + int (*process)(struct ts_filter *filter, int *coords); + /* + * Is the filter ready to return a point? + * Please do not code side effects in this function. + */ + int (*haspoint)(struct ts_filter *filter); + /* + * Get a point. + * Do not call unless the filter actually has a point to deliver. + */ + void (*getpoint)(struct ts_filter *filter, int *coords); + + /* + * Scale the points - optional. + * A filter could only scale coordinates. + */ + void (*scale)(struct ts_filter *filter, int *coords); +}; + +/* + * Generic filter configuration. Actual configurations have this structure + * as a member. + */ +struct ts_filter_configuration { +}; + +struct ts_filter { + /* Operations for this filter. */ + const struct ts_filter_api *api; + /* Number of coordinates to process. */ + int count_coords; +}; + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_chain.h b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_chain.h new file mode 100644 index 0000000000..806bffe6c9 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_chain.h @@ -0,0 +1,58 @@ +#ifndef __TS_FILTER_CHAIN_H__ +#define __TS_FILTER_CHAIN_H__ + +/* + * Touchscreen filter chains. + * + * (c) 2008,2009 Andy Green <andy@openmoko.com> + */ + +#include "ts_filter.h" + +#include <linux/err.h> + +struct ts_filter_chain_configuration { + /* API to use. */ + const struct ts_filter_api *api; + /* Generic filter configuration. Different for each filter. */ + const struct ts_filter_configuration *config; +}; + +struct ts_filter_chain; + +#ifdef CONFIG_TOUCHSCREEN_FILTER + +/* + * Create a filter chain. It will allocate an array of + * null-terminated pointers to filters. On error it will return + * an error you can check with IS_ERR. + */ +extern struct ts_filter_chain *ts_filter_chain_create( + struct platform_device *pdev, + const struct ts_filter_chain_configuration conf[], + int count_coords); + +/* Destroy the chain. */ +extern void ts_filter_chain_destroy(struct ts_filter_chain *c); + +/* Clear the filter chain. */ +extern void ts_filter_chain_clear(struct ts_filter_chain *c); + +/* + * Try to get one point. Returns 0 if no points are available. + * coords will be used as temporal space, thus you supply a point + * using coords but you shouldn't rely on its value on return unless + * it returns a nonzero value that is not -1. + * If one of the filters find an error then this function will + * return -1. + */ +int ts_filter_chain_feed(struct ts_filter_chain *c, int *coords); + +#else /* !CONFIG_TOUCHSCREEN_FILTER */ +#define ts_filter_chain_create(pdev, config, count_coords) (NULL) +#define ts_filter_chain_destroy(c) do { } while (0) +#define ts_filter_chain_clear(c) do { } while (0) +#define ts_filter_chain_feed(c, coords) (1) +#endif + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_group.h b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_group.h new file mode 100644 index 0000000000..d1e3590e93 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_group.h @@ -0,0 +1,36 @@ +#ifndef __TS_FILTER_GROUP_H__ +#define __TS_FILTER_GROUP_H__ + +#include "ts_filter.h" + +/* + * Touchscreen group filter. + * + * Copyright (C) 2008,2009 by Openmoko, Inc. + * Author: Nelson Castillo <arhuaco@freaks-unidos.net> + * + */ + +struct ts_filter_group_configuration { + /* Size of the filter. */ + int length; + /* + * If two points are separated by this distance or less they + * are considered to be members of the same group. + */ + int close_enough; + /* Minimum allowed size for the biggest group in the sample set. */ + int threshold; + /* + * Number of times we try to get a group of points with at least + * threshold points. + */ + int attempts; + + /* Generic filter configuration. */ + struct ts_filter_configuration config; +}; + +extern const struct ts_filter_api ts_filter_group_api; + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_linear.h b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_linear.h new file mode 100644 index 0000000000..82df3d25b5 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_linear.h @@ -0,0 +1,31 @@ +#ifndef __TS_FILTER_LINEAR_H__ +#define __TS_FILTER_LINEAR_H__ + +#include "ts_filter.h" +#include <linux/kobject.h> + +/* + * Touchscreen linear filter. + * + * Copyright (C) 2008,2009 by Openmoko, Inc. + * Author: Nelson Castillo <arhuaco@freaks-unidos.net> + * + */ + +#define TS_FILTER_LINEAR_NCONSTANTS 7 + +struct ts_filter_linear_configuration { + /* Calibration constants. */ + int constants[TS_FILTER_LINEAR_NCONSTANTS]; + /* First coordinate. */ + int coord0; + /* Second coordinate. */ + int coord1; + + /* Generic filter configuration. */ + struct ts_filter_configuration config; +}; + +extern const struct ts_filter_api ts_filter_linear_api; + +#endif diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_mean.h b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_mean.h new file mode 100644 index 0000000000..f5b5e4bbe1 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_mean.h @@ -0,0 +1,28 @@ +#ifndef __TS_FILTER_MEAN_H__ +#define __TS_FILTER_MEAN_H__ + +#include "ts_filter.h" + +/* + * Touchscreen filter. + * + * mean + * + * (c) 2008,2009 + * Andy Green <andy@openmoko.com> + * Nelson Castillo <arhuaco@freaks-unidos.net> + */ + +/* Configuration for this filter. */ +struct ts_filter_mean_configuration { + /* Number of points for the mean. */ + int length; + + /* Generic filter configuration. */ + struct ts_filter_configuration config; +}; + +/* API functions for the mean filter */ +extern const struct ts_filter_api ts_filter_mean_api; + +#endif /* __TS_FILTER_MEAN_H__ */ diff --git a/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_median.h b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_median.h new file mode 100644 index 0000000000..1c19472e37 --- /dev/null +++ b/target/linux/s3c24xx/files-2.6.30/include/linux/touchscreen/ts_filter_median.h @@ -0,0 +1,32 @@ +#ifndef __TS_FILTER_MEDIAN_H__ +#define __TS_FILTER_MEDIAN_H__ + +#include "ts_filter.h" + +/* + * Touchscreen filter. + * + * median + * + * (c) 2008 Andy Green <andy@openmoko.com> + */ + +struct ts_filter_median_configuration { + /* Size of the filter. */ + int extent; + /* Precomputed midpoint. */ + int midpoint; + /* A reference value for us to check if we are going fast or slow. */ + int decimation_threshold; + /* How many points to replace if we're going fast. */ + int decimation_above; + /* How many points to replace if we're going slow. */ + int decimation_below; + + /* Generic configuration. */ + struct ts_filter_configuration config; +}; + +extern const struct ts_filter_api ts_filter_median_api; + +#endif |