diff options
author | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
---|---|---|
committer | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
commit | c6da2cfeb05178a11c6d062a06f8078150ee492f (patch) | |
tree | f3b4021d252c52d6463a9b3c1bb7245e399b009c /include/linux/i2c | |
parent | c6d7c4dbff353eac7919342ae6b3299a378160a6 (diff) | |
download | kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.zip kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.gz kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.bz2 |
samsung update 1
Diffstat (limited to 'include/linux/i2c')
-rwxr-xr-x | include/linux/i2c/ak8975.h | 72 | ||||
-rw-r--r-- | include/linux/i2c/es305.h | 46 | ||||
-rw-r--r-- | include/linux/i2c/fm34_we395.h | 35 | ||||
-rw-r--r-- | include/linux/i2c/mms114.h | 26 | ||||
-rw-r--r-- | include/linux/i2c/mxt1536e.h | 109 | ||||
-rw-r--r-- | include/linux/i2c/mxt1664s.h | 108 | ||||
-rw-r--r-- | include/linux/i2c/mxt224.h | 257 | ||||
-rw-r--r-- | include/linux/i2c/mxt224_gc.h | 190 | ||||
-rw-r--r-- | include/linux/i2c/mxt224_u1.h | 169 | ||||
-rw-r--r-- | include/linux/i2c/mxt540e.h | 133 | ||||
-rw-r--r-- | include/linux/i2c/mxt768e.h | 137 | ||||
-rw-r--r-- | include/linux/i2c/touchkey_i2c.h | 159 | ||||
-rw-r--r-- | include/linux/i2c/voice_processor.h | 27 |
13 files changed, 1468 insertions, 0 deletions
diff --git a/include/linux/i2c/ak8975.h b/include/linux/i2c/ak8975.h new file mode 100755 index 0000000..50b0754 --- /dev/null +++ b/include/linux/i2c/ak8975.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2010 Samsung Electronics. 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 + * version 2 as published by the Free Software Foundation. + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#ifndef AKM8975_H +#define AKM8975_H + +#include <linux/ioctl.h> + +#define AKM8975_I2C_NAME "ak8975" + +#define SENSOR_DATA_SIZE 8 /* Rx buffer size, i.e from ST1 to ST2 */ +#define AKMIO 0xA1 + +/* IOCTLs for AKM library */ +/* WRITE and READ sizes don't include data. On WRITE, the first value is data + * size plus one and the second value is the register address. On READ + * the first value is the data size and second value is the register + * address and the data is written back into the buffer starting at + * the second byte (the length is unchanged). + */ +#define ECS_IOCTL_WRITE _IOW(AKMIO, 0x01, char*) +#define ECS_IOCTL_READ _IOWR(AKMIO, 0x02, char*) +#define ECS_IOCTL_RESET _IO(AKMIO, 0x03) +#define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x04, short) +#define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x05, \ + char[SENSOR_DATA_SIZE]) +#define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x06, short[12]) +#define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x07, int) +#define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x08, int) +#define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x30, int64_t) +#define ECS_IOCTL_GET_PROJECT_NAME _IOR(AKMIO, 0x0D, char[64]) +#define ECS_IOCTL_GET_MATRIX _IOR(AKMIO, 0x0E, short[4][3][3]) + +/* IOCTLs for APPs */ +#define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short) +#define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short) +#define ECS_IOCTL_APP_GET_MFLAG _IOR(AKMIO, 0x12, short) +#define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short) +#define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short) +#define ECS_IOCTL_APP_SET_TFLAG _IOW(AKMIO, 0x15, short) +#define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short) +#define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17) +#define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, int64_t) +#define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY + +/* Set raw magnetic vector flag */ +#define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short) + +/* Get raw magnetic vector flag */ +#define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short) + +#ifdef __KERNEL__ +struct akm8975_platform_data { + int gpio_data_ready_int; +}; +#endif + +#endif diff --git a/include/linux/i2c/es305.h b/include/linux/i2c/es305.h new file mode 100644 index 0000000..a2fcf02 --- /dev/null +++ b/include/linux/i2c/es305.h @@ -0,0 +1,46 @@ +/* include/linux/i2c/es305.h - audience ES305 voice processor driver + * + * Copyright (C) 2012 Samsung Electronics + * + * 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 __ES305_PDATA_H__ +#define __ES305_PDATA_H__ + +#define MODULE_NAME "[Audience] :" +#define DEBUG 0 +#define RETRY_CNT 5 + +enum es305_cmd { + ES305_SW_RESET, + ES305_SYNC, + ES305_BOOT, + ES305_SLEEP, + ES305_BYPASS_DATA, +}; + +struct es305_platform_data { + void (*set_mclk) (bool, bool); + int gpio_wakeup; + int gpio_reset; +}; + +int es305_load_firmware(void); +int es305_hw_reset(void); +int es305_set_cmd(enum es305_cmd); +#endif diff --git a/include/linux/i2c/fm34_we395.h b/include/linux/i2c/fm34_we395.h new file mode 100644 index 0000000..718209d --- /dev/null +++ b/include/linux/i2c/fm34_we395.h @@ -0,0 +1,35 @@ +/* include/linux/i2c/fm34_we395.h - fm34_we395 voice processor driver + * + * Copyright (C) 2012 Samsung Electronics + * + * 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 __FEM34_WE395_PDATA_H__ +#define __FM34_WE395_PDATA_H__ + +#if defined(CONFIG_MACH_C1_KOR_LGT) || defined(CONFIG_MACH_C1VZW) +int fm34_set_mode(int mode); +#endif + +struct fm34_platform_data { + void (*set_mclk) (bool, bool); + int gpio_pwdn; + int gpio_rst; + int gpio_bp; +}; +#endif diff --git a/include/linux/i2c/mms114.h b/include/linux/i2c/mms114.h new file mode 100644 index 0000000..84cab18 --- /dev/null +++ b/include/linux/i2c/mms114.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2011 Samsung Electronics Co.Ltd + * Author: Joonyoung Shim <jy0922.shim@samsung.com> + * + * 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. + * + */ + +#ifndef __LINUX_MMS114_H +#define __LINUX_MMS114_H + +struct mms114_platform_data { + unsigned int x_size; + unsigned int y_size; + unsigned int contact_threshold; + unsigned int moving_threshold; + bool x_invert; + bool y_invert; + + void (*cfg_pin)(bool); +}; + +#endif /* __LINUX_MMS114_H */ diff --git a/include/linux/i2c/mxt1536e.h b/include/linux/i2c/mxt1536e.h new file mode 100644 index 0000000..0a3505c --- /dev/null +++ b/include/linux/i2c/mxt1536e.h @@ -0,0 +1,109 @@ + +/* + * Copyright (C) 2010, Samsung Electronics Co. Ltd. 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. + * + */ + + +#ifndef __MXT_H__ +#define __MXT_H__ + +#define MXT_DEV_NAME "Atmel MXT1536E" + +enum { RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + SPARE_T51, + TOUCH_PROXIMITY_KEY_T52, + GEN_DATASOURCE_T53, + SPARE_T54, + ADAPTIVE_T55, + PROCI_SHIELDLESS_T56, + SPT_GENERICDATA_T57, + RESERVED_T255 = 255, +}; + + +struct mxt_platform_data { + int max_finger_touches; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + const u8 **config_e; + void (*power_on) (void); + void (*power_off) (void); + void (*read_ta_status) (bool *); +}; + + +typedef enum + { MXT_PAGE_UP = 0x01, MXT_PAGE_DOWN = 0x02, MXT_DELTA_MODE = + 0x10, MXT_REFERENCE_MODE = 0x11, MXT_CTE_MODE = 0x31 +} diagnostic_debug_command; + +#endif + diff --git a/include/linux/i2c/mxt1664s.h b/include/linux/i2c/mxt1664s.h new file mode 100644 index 0000000..e8795af --- /dev/null +++ b/include/linux/i2c/mxt1664s.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2012, Samsung Electronics Co. Ltd. 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. + * + */ + +#ifndef __MXT_H__ +#define __MXT_H__ + +#define MXT_DEV_NAME "Atmel MXT1664S" + +#define MXT_1664S_SW_RESET_TIME 300 /* msec */ +#define MXT_1664S_HW_RESET_TIME 300 /* msec */ +#define MXT_1664S_FW_RESET_TIME 500 /* msec */ + +enum { RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + SPARE_T51, + TOUCH_PROXIMITY_KEY_T52, + GEN_DATASOURCE_T53, + SPARE_T54, + ADAPTIVE_T55, + PROCI_SHIELDLESS_T56, + PROCI_EXTRATOUCHSCREENDATA_T57, + SPARE_T58, + SPARE_T59, + SPARE_T60, + SPT_TIMER_T61, + PROCG_NOISESUPPRESSION_T62, + RESERVED_T255 = 255, +}; + +struct mxt_platform_data { + int max_finger_touches; + int gpio_read_done; + const u8 **config; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + int (*power_on) (void); + int (*power_off) (void); + u8 boot_address; +}; + +#endif /* */ diff --git a/include/linux/i2c/mxt224.h b/include/linux/i2c/mxt224.h new file mode 100644 index 0000000..aad3bdd --- /dev/null +++ b/include/linux/i2c/mxt224.h @@ -0,0 +1,257 @@ +/* + * AT42QT602240/ATMXT224 Touchscreen driver + * + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * This touch driver is based on mxt224_u1.h + * Author: Taeheon Kim <th908.kim@samsung.com> + * + * 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. + */ + +#ifndef __MXT224_H__ +#define __MXT224_H__ + +#define MXT224_DEV_NAME "Atmel MXT224" + +#define MXT224_MAX_MT_FINGERS 10 + +#define MAX_USING_FINGER_NUM 10 + +#define MXT224_AUTOCAL_WAIT_TIME 2000 + +#define DRIVER_FILTER +enum { + RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPARE_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + RESERVED_T255 = 255, +}; +struct t22_freq_table_config_t { + u8 fherr_setting; + u8 fherr_cnt; + u8 fherr_num; + u8 t9_blen_for_fherr; + u8 t9_blen_for_fherr_cnt; + u8 t9_thr_for_fherr; + u8 t9_movfilter_for_fherr; + u8 t22_noisethr_for_fherr; + u8 t22_freqscale_for_fherr; + u8 freq_for_fherr1[5]; + u8 freq_for_fherr2[5]; + u8 freq_for_fherr3[5]; + u8 freq_for_fherr4[5]; +}; + +struct t48_median_config_t { + bool median_on_flag; + bool mferr_setting; + u8 mferr_count; + u8 t46_actvsyncsperx_for_mferr; + u8 t48_mfinvlddiffthr_for_mferr; + u8 t48_mferrorthr_for_mferr; + u8 t48_thr_for_mferr; + u8 t48_movfilter_for_mferr; +}; +struct object_t { + u8 object_type; + u16 i2c_address; + u8 size; + u8 instances; + u8 num_report_ids; +} __packed; + +struct finger_info { + s16 x; + s16 y; + s16 z; + u16 w; + int16_t component; +}; +struct mxt224_callbacks { + void (*inform_charger)(struct mxt224_callbacks *, int mode); +}; + +struct mxt224_platform_data { + int max_finger_touches; + const u8 **config; + const u8 **config_e; + const u8 *t48_config_batt_e; + const u8 *t48_config_chrg_e; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + u8 atchcalst; + u8 atchcalsthr; + u8 tchthr_batt; + u8 tchthr_charging; + u8 tchthr_batt_init; + u8 noisethr_batt; + u8 noisethr_charging; + u8 movfilter_batt; + u8 movfilter_charging; + u8 atchcalst_e; + u8 atchcalsthr_e; + u8 tchthr_batt_e; + u8 tchthr_charging_e; + u8 calcfg_batt_e; + u8 calcfg_charging_e; + u8 atchfrccalthr_e; + u8 atchfrccalratio_e; + u8 chrgtime_batt_e; + u8 chrgtime_charging_e; + u8 blen_batt_e; + u8 blen_charging_e; + u8 movfilter_batt_e; + u8 movfilter_charging_e; + u8 actvsyncsperx_e; + u8 nexttchdi_e; + void (*power_on) (void); + void (*power_off) (void); + void (*register_cb)(struct mxt224_callbacks *); + void (*read_ta_status) (void *); +}; + +struct mxt224_data { + struct i2c_client *client; + struct input_dev *input_dev; + struct mxt224_platform_data *pdata; +#ifdef CONFIG_HAS_EARLYSUSPEND + struct early_suspend early_suspend; +#endif + u8 family_id; + u32 finger_mask; + struct object_t *objects; + u8 objects_len; + u8 tsp_version; + const u8 *power_cfg; + const u8 *noise_suppression_cfg_ta; + const u8 *noise_suppression_cfg; + u8 finger_type; + u16 msg_proc; + u16 cmd_proc; + u16 msg_object_size; + u32 x_dropbits:2; + u32 y_dropbits:2; + int num_fingers; + struct finger_info fingers[MXT224_MAX_MT_FINGERS]; + struct t22_freq_table_config_t freq_table; + struct t48_median_config_t noise_median; + + int mxt224_enabled; + bool g_debug_switch; + u8 mxt_version_disp; + u8 tsp_version_disp; + int optiacl_gain; + int firm_status_data; + bool lock_status; + int touch_state; /* 1:release, 2:press, 3:others */ + int palm_chk_flag; + bool ta_status_pre; + int errcondition; + int threshold; + int threshold_e; + bool boot_or_resume; /*1: boot_or_resume,0: others */ + bool sleep_mode_flag; + char *tsp_config_version; + bool median_err_flag; + int touch_is_pressed_arr[MAX_USING_FINGER_NUM]; + struct completion init_done; + struct mutex lock; + bool enabled; +#ifdef DRIVER_FILTER + bool gbfilter; +#endif + unsigned int qt_time_point_freq; + unsigned int qt_time_diff_freq; + unsigned int qt_time_point; + unsigned int qt_time_diff; + unsigned int qt_timer_state; + unsigned int good_check_flag; + unsigned int not_yet_count; + u8 cal_check_flag; + u8 doing_calibration_flag; + unsigned char test_node[5]; + uint16_t qt_refrence_node[209]; + uint16_t qt_delta_node[209]; + int index_delta; + int index_reference; + struct mxt224_callbacks callbacks; +}; + +enum { + QT_PAGE_UP = 0x01, + QT_PAGE_DOWN = 0x02, + QT_DELTA_MODE = 0x10, + QT_REFERENCE_MODE = 0x11, + QT_CTE_MODE = 0x31 +}; + +enum { + ERR_RTN_CONDITION_T9, + ERR_RTN_CONDITION_T48, + ERR_RTN_CONDITION_IDLE +}; + +#define ERR_RTN_CONDITION_MAX (ERR_RTN_CONDITION_IDLE + 1) + + +extern struct class *sec_class; +#endif /* __MXT224_H__ */ + diff --git a/include/linux/i2c/mxt224_gc.h b/include/linux/i2c/mxt224_gc.h new file mode 100644 index 0000000..4d78f7a --- /dev/null +++ b/include/linux/i2c/mxt224_gc.h @@ -0,0 +1,190 @@ +/* + * AT42QT602240/ATMXT224 Touchscreen driver + * + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * This touch driver is based on mxt224_u1.h + * Author: Taeheon Kim <th908.kim@samsung.com> + * + * 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. + */ + +#ifndef __MXT224_H__ +#define __MXT224_H__ + +#define MXT224_DEV_NAME "Atmel MXT224" + +#define MXT224_MAX_MT_FINGERS 10 + +#define MAX_USING_FINGER_NUM 10 + +#define MXT224_AUTOCAL_WAIT_TIME 2000 + +#define DRIVER_FILTER +enum { + RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPARE_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + RESERVED_T255 = 255, +}; +struct t22_freq_table_config_t { + u8 fherr_setting; + u8 fherr_cnt; + u8 fherr_num; + u8 t9_blen_for_fherr; + u8 t9_blen_for_fherr_cnt; + u8 t9_thr_for_fherr; + u8 t9_movfilter_for_fherr; + u8 t22_noisethr_for_fherr; + u8 t22_freqscale_for_fherr; + u8 freq_for_fherr1[5]; + u8 freq_for_fherr2[5]; + u8 freq_for_fherr3[5]; + u8 freq_for_fherr4[5]; +}; + +struct t48_median_config_t { + bool median_on_flag; + bool mferr_setting; + u8 mferr_count; + u8 t46_actvsyncsperx_for_mferr; + u8 t48_mfinvlddiffthr_for_mferr; + u8 t48_mferrorthr_for_mferr; + u8 t48_thr_for_mferr; + u8 t48_movfilter_for_mferr; +}; +struct object_t { + u8 object_type; + u16 i2c_address; + u8 size; + u8 instances; + u8 num_report_ids; +} __packed; + +struct finger_info { + s16 x; + s16 y; + s16 z; + u16 w; + int16_t component; +}; +struct mxt224_callbacks { + void (*inform_charger)(struct mxt224_callbacks *, int mode); +}; + +struct mxt224_platform_data { + int max_finger_touches; + const u8 **config; + const u8 **config_e; + const u8 *t48_config_batt_e; + const u8 *t48_config_chrg_e; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + u8 atchcalst; + u8 atchcalsthr; + u8 tchthr_batt; + u8 tchthr_charging; + u8 tchthr_batt_init; + u8 noisethr_batt; + u8 noisethr_charging; + u8 movfilter_batt; + u8 movfilter_charging; + u8 atchcalst_e; + u8 atchcalsthr_e; + u8 tchthr_batt_e; + u8 tchthr_charging_e; + u8 calcfg_batt_e; + u8 calcfg_charging_e; + u8 atchfrccalthr_e; + u8 atchfrccalratio_e; + u8 chrgtime_batt_e; + u8 chrgtime_charging_e; + u8 blen_batt_e; + u8 blen_charging_e; + u8 movfilter_batt_e; + u8 movfilter_charging_e; + u8 actvsyncsperx_e; + u8 nexttchdi_e; + void (*power_on) (void); + void (*power_off) (void); + void (*register_cb)(struct mxt224_callbacks *); + void (*read_ta_status) (void *); +}; + +enum { + QT_PAGE_UP = 0x01, + QT_PAGE_DOWN = 0x02, + QT_DELTA_MODE = 0x10, + QT_REFERENCE_MODE = 0x11, + QT_CTE_MODE = 0x31 +}; + +enum { + ERR_RTN_CONDITION_T9, + ERR_RTN_CONDITION_T48, + ERR_RTN_CONDITION_IDLE +}; + +#define ERR_RTN_CONDITION_MAX (ERR_RTN_CONDITION_IDLE + 1) + + +extern struct class *sec_class; +#endif /* __MXT224_H__ */ + diff --git a/include/linux/i2c/mxt224_u1.h b/include/linux/i2c/mxt224_u1.h new file mode 100644 index 0000000..66878c2 --- /dev/null +++ b/include/linux/i2c/mxt224_u1.h @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2010, Samsung Electronics Co. Ltd. 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. + * + */ + +#ifndef __MXT224_H__ +#define __MXT224_H__ + +#define MXT224_DEV_NAME "Atmel MXT224" + +#define MXT224_MAX_MT_FINGERS 10 + +enum { + RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPARE_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + RESERVED_T255 = 255, +}; + +struct mxt224_platform_data { + int max_finger_touches; + const u8 **config; + const u8 **config_e; + const u8 *t48_config_batt_e; + const u8 *t48_config_chrg_e; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + u8 atchcalst; + u8 atchcalsthr; + u8 tchthr_batt; + u8 tchthr_charging; + u8 tchthr_batt_init; + u8 noisethr_batt; + u8 noisethr_charging; + u8 movfilter_batt; + u8 movfilter_charging; + u8 atchcalst_e; + u8 atchcalsthr_e; + u8 tchthr_batt_e; + u8 tchthr_charging_e; + u8 calcfg_batt_e; + u8 calcfg_charging_e; + u8 atchfrccalthr_e; + u8 atchfrccalratio_e; + u8 chrgtime_batt_e; + u8 chrgtime_charging_e; + u8 blen_batt_e; + u8 blen_charging_e; + u8 movfilter_batt_e; + u8 movfilter_charging_e; + u8 actvsyncsperx_e; + u8 nexttchdi_e; + void (*power_on) (void); + void (*power_off) (void); + void (*register_cb) (void *); + void (*read_ta_status) (void *); +}; + +enum { + QT_PAGE_UP = 0x01, + QT_PAGE_DOWN = 0x02, + QT_DELTA_MODE = 0x10, + QT_REFERENCE_MODE = 0x11, + QT_CTE_MODE = 0x31 +}; + +enum { + ERR_RTN_CONDITION_T9, + ERR_RTN_CONDITION_T48, + ERR_RTN_CONDITION_IDLE +}; + +#define ERR_RTN_CONDITION_MAX (ERR_RTN_CONDITION_IDLE + 1) + +struct t22_freq_table_config_t { + u8 fherr_setting; + u8 fherr_cnt; + u8 fherr_num; + u8 t9_blen_for_fherr; + u8 t9_blen_for_fherr_cnt; + u8 t9_thr_for_fherr; + u8 t9_movfilter_for_fherr; + u8 t22_noisethr_for_fherr; + u8 t22_freqscale_for_fherr; + u8 freq_for_fherr1[5]; + u8 freq_for_fherr2[5]; + u8 freq_for_fherr3[5]; + u8 freq_for_fherr4[5]; +}; + +struct t48_median_config_t { + bool median_on_flag; + bool mferr_setting; + u8 mferr_count; + u8 t46_actvsyncsperx_for_mferr; + u8 t48_mfinvlddiffthr_for_mferr; + u8 t48_mferrorthr_for_mferr; + u8 t48_thr_for_mferr; + u8 t48_movfilter_for_mferr; +}; + +int get_tsp_status(void); +extern struct class *sec_class; +#endif diff --git a/include/linux/i2c/mxt540e.h b/include/linux/i2c/mxt540e.h new file mode 100644 index 0000000..6c34a39 --- /dev/null +++ b/include/linux/i2c/mxt540e.h @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2010, Samsung Electronics Co. Ltd. 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. + * + */ + +#ifndef __MXT540E_H__ +#define __MXT540E_H__ + +#define MXT540E_DEV_NAME "Atmel MXT540E" + +#define MXT540E_SW_RESET_TIME 300 /* msec */ +#define MXT540E_HW_RESET_TIME 130 /* msec */ + +enum { + RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPARE_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + SPARE_T51, + TOUCH_PROXKEY_T52, + GEN_DATASOURCE_T53, + SPARE_T54, + ADAPTIVE_T55, + SPARE_T56, + SPT_GENERICDATA_T57, + SPARE_T58, + SPARE_T59, + SPARE_T60, + SPT_TIMER_T61, + RESERVED_T255 = 255, +}; + +struct mxt540e_platform_data { + int max_finger_touches; + const u8 **config_e; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + u8 chrgtime_batt; + u8 chrgtime_charging; + u8 tchthr_batt; + u8 tchthr_charging; + u8 actvsyncsperx_batt; + u8 actvsyncsperx_charging; + u8 calcfg_batt_e; + u8 calcfg_charging_e; + u8 atchfrccalthr_e; + u8 atchfrccalratio_e; + const u8 *t48_config_batt_e; + const u8 *t48_config_chrg_e; + void (*power_on) (void); + void (*power_off) (void); + void (*power_on_with_oleddet) (void); + void (*power_off_with_oleddet) (void); + void (*register_cb) (void *); + void (*read_ta_status) (void *); +}; + +enum { + MXT_PAGE_UP = 0x01, + MXT_PAGE_DOWN = 0x02, + MXT_DELTA_MODE = 0x10, + MXT_REFERENCE_MODE = 0x11, + MXT_CTE_MODE = 0x31 +}; + +int get_tsp_status(void); +extern struct class *sec_class; + +#endif diff --git a/include/linux/i2c/mxt768e.h b/include/linux/i2c/mxt768e.h new file mode 100644 index 0000000..e190ce8 --- /dev/null +++ b/include/linux/i2c/mxt768e.h @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2010, Samsung Electronics Co. Ltd. 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. + * + */ + +#ifndef __MXT_H__ +#define __MXT_H__ + +#define MXT_DEV_NAME "Atmel MXT768E" +#define MXT_SW_RESET_TIME 300 /* msec */ +#define MXT_HW_RESET_TIME 300 /* msec */ + +enum { RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + SPARE_T51, + TOUCH_PROXIMITY_KEY_T52, + GEN_DATASOURCE_T53, + SPARE_T54, + ADAPTIVE_T55, + PROCI_SHIELDLESS_T56, + SPT_GENERICDATA_T57, + RESERVED_T255 = 255, +}; + +struct mxt_platform_data { + int max_finger_touches; + int gpio_read_done; + const u8 **config; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + u8 tchthr_batt; + u8 tchthr_charging; + u8 calcfg_batt; + u8 calcfg_charging; + u8 idlesyncsperx_batt; + u8 idlesyncsperx_charging; + u8 actvsyncsperx_batt; + u8 actvsyncsperx_charging; + u8 xloclip_batt; + u8 xloclip_charging; + u8 xhiclip_batt; + u8 xhiclip_charging; + u8 yloclip_batt; + u8 yloclip_charging; + u8 yhiclip_batt; + u8 yhiclip_charging; + u8 xedgectrl_batt; + u8 xedgectrl_charging; + u8 xedgedist_batt; + u8 xedgedist_charging; + u8 yedgectrl_batt; + u8 yedgectrl_charging; + u8 yedgedist_batt; + u8 yedgedist_charging; + const u8 *t48_config_batt; + const u8 *t48_config_chrg; + void (*power_on) (void); + void (*power_off) (void); + void (*register_cb) (void *); + void (*read_ta_status) (bool *); +}; + +enum { + MXT_PAGE_UP = 0x01, + MXT_PAGE_DOWN = 0x02, + MXT_DELTA_MODE = 0x10, + MXT_REFERENCE_MODE = 0x11, + MXT_CTE_MODE = 0x31 +}; + +extern struct class *sec_class; +#endif /* */ diff --git a/include/linux/i2c/touchkey_i2c.h b/include/linux/i2c/touchkey_i2c.h new file mode 100644 index 0000000..e214c28 --- /dev/null +++ b/include/linux/i2c/touchkey_i2c.h @@ -0,0 +1,159 @@ +#ifndef _LINUX_CYPRESS_TOUCHKEY_I2C_H +#define _LINUX_CYPRESS_TOUCHKEY_I2C_H + +#include <linux/module.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/input.h> +#include <linux/i2c.h> +#include <linux/interrupt.h> +#include <linux/slab.h> +#include <linux/hrtimer.h> +#include <linux/gpio.h> +#include <linux/irq.h> +#include <linux/delay.h> + +#ifdef CONFIG_HAS_EARLYSUSPEND +#include <linux/earlysuspend.h> +#endif + +/* Touchkey Register */ +#define KEYCODE_REG 0x00 + +#define TK_BIT_PRESS_EV 0x08 +#define TK_BIT_KEYCODE 0x07 + +#define TK_BIT_AUTOCAL 0x80 + +#if defined(CONFIG_MACH_Q1_BD)\ + || defined(CONFIG_TARGET_LOCALE_NA)\ + || defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_C1VZW) +#define TK_CMD_LED_ON 0x10 +#define TK_CMD_LED_OFF 0x20 +#else +#define TK_CMD_LED_ON 1 +#define TK_CMD_LED_OFF 2 +#endif + +#define I2C_M_WR 0 /* for i2c */ + +#define TK_UPDATE_DOWN 1 +#define TK_UPDATE_FAIL -1 +#define TK_UPDATE_PASS 0 + +/* Firmware Version */ +#if defined(CONFIG_MACH_Q1_BD) +#define TK_FIRMWARE_VER 0x12 +#define TK_MODULE_VER 0x11 +#elif defined(CONFIG_MACH_C1_NA_USCC_REV05) +#define TK_FIRMWARE_VER 0x0E +#define TK_MODULE_VER 0x08 +#elif defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_C1VZW)\ + || defined(CONFIG_MACH_C1) +#define TK_FIRMWARE_VER 0x06 +#define TK_MODULE_VER 0x05 +#elif defined(CONFIG_MACH_S2PLUS) +#define TK_FIRMWARE_VER 0x04 +#define TK_MODULE_VER 0x00 +#else +#define TK_FIRMWARE_VER 0x04 +#define TK_MODULE_VER 0x00 +#endif + +/* LDO Regulator */ +#if defined(CONFIG_MACH_S2PLUS) +#define TK_REGULATOR_NAME "3_touch_1.8v" +#elif defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_C1VZW) +#define TK_REGULATOR_NAME "touchkey" +#else +#define TK_REGULATOR_NAME "touch" +#endif + +/* LED LDO Type*/ +#if defined(CONFIG_MACH_S2PLUS) \ + || defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_C1_KOR_SKT)\ + || defined(CONFIG_MACH_C1_KOR_KT)\ + || defined(CONFIG_MACH_C1VZW)\ + || defined(CONFIG_MACH_C1) +#define LED_LDO_WITH_EN_PIN +#else +#define LED_LDO_WITH_REGULATOR +#endif + +/* Autocalibration */ +#if defined(CONFIG_TARGET_LOCALE_NAATT)\ + || defined(CONFIG_TARGET_LOCALE_NA)\ + || defined(CONFIG_MACH_Q1_BD)\ + || defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_C1VZW) +#define TK_HAS_AUTOCAL +#endif + +/* Generalized SMBus access */ +#if defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_C1VZW)\ + || defined(CONFIG_MACH_C1) +#define TK_USE_GENERAL_SMBUS +#endif + +/* Boot-up Firmware Update */ +#if defined(CONFIG_MACH_Q1_BD) \ + || defined(CONFIG_MACH_C1_NA_USCC_REV05) \ + || defined(CONFIG_TARGET_LOCALE_NA)\ + || defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_C1VZW) +#define TK_HAS_FIRMWARE_UPDATE +#endif + +#if defined(CONFIG_MACH_M0_CHNOPEN) || defined(CONFIG_MACH_M0_HKTW) +#define TOUCHKEY_FW_UPDATEABLE_HW_REV 10 +#elif defined(CONFIG_MACH_M0) +#define TOUCHKEY_FW_UPDATEABLE_HW_REV 11 +#elif defined(CONFIG_MACH_C1) +#if defined(CONFIG_MACH_C1_KOR_SKT) || defined(CONFIG_MACH_C1_KOR_KT) +#define TOUCHKEY_FW_UPDATEABLE_HW_REV 8 +#elif defined(CONFIG_MACH_C1_KOR_LGT) +#define TOUCHKEY_FW_UPDATEABLE_HW_REV 5 +#else +#define TOUCHKEY_FW_UPDATEABLE_HW_REV 7 +#endif +#else +#define TOUCHKEY_FW_UPDATEABLE_HW_REV 11 +#endif + +struct touchkey_platform_data { + int gpio_sda; + int gpio_scl; + int gpio_int; + void (*init_platform_hw)(void); + int (*suspend) (void); + int (*resume) (void); + int (*power_on) (bool); + int (*led_power_on) (bool); + int (*reset_platform_hw)(void); +}; + +/*Parameters for i2c driver*/ +struct touchkey_i2c { + struct i2c_client *client; + struct input_dev *input_dev; + struct early_suspend early_suspend; + struct mutex lock; + struct device *dev; + int irq; + int module_ver; + int firmware_ver; + struct touchkey_platform_data *pdata; + char *name; + int (*power)(int on); + struct work_struct update_work; + int update_status; +}; + +#endif /* _LINUX_CYPRESS_TOUCHKEY_I2C_H */ diff --git a/include/linux/i2c/voice_processor.h b/include/linux/i2c/voice_processor.h new file mode 100644 index 0000000..2ea8e03 --- /dev/null +++ b/include/linux/i2c/voice_processor.h @@ -0,0 +1,27 @@ +/* include/linux/i2c/voice_processor.h - voice processor driver + * + * Copyright (C) 2012 Samsung Corporation. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * 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. + * + */ + +#ifndef __VOICE_PROCESSOR_H__ +#define __VOICE_PROCESSOR_H__ + +enum voice_processing_mode { + VOICE_NS_BYPASS_MODE = 0, + VOICE_NS_HANDSET_MODE, + VOICE_NS_LOUD_MODE, + VOICE_NS_FTM_LOOPBACK_MODE, + NUM_OF_VOICE_NS_MODE, +}; + +#endif |