diff options
Diffstat (limited to 'include/linux/input')
33 files changed, 2725 insertions, 0 deletions
diff --git a/include/linux/input/ad714x.h b/include/linux/input/ad714x.h new file mode 100644 index 00000000..d388d857 --- /dev/null +++ b/include/linux/input/ad714x.h @@ -0,0 +1,64 @@ +/* + * include/linux/input/ad714x.h + * + * AD714x is very flexible, it can be used as buttons, scrollwheel, + * slider, touchpad at the same time. That depends on the boards. + * The platform_data for the device's "struct device" holds this + * information. + * + * Copyright 2009-2011 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef __LINUX_INPUT_AD714X_H__ +#define __LINUX_INPUT_AD714X_H__ + +#define STAGE_NUM 12 +#define STAGE_CFGREG_NUM 8 +#define SYS_CFGREG_NUM 8 + +/* board information which need be initialized in arch/mach... */ +struct ad714x_slider_plat { + int start_stage; + int end_stage; + int max_coord; +}; + +struct ad714x_wheel_plat { + int start_stage; + int end_stage; + int max_coord; +}; + +struct ad714x_touchpad_plat { + int x_start_stage; + int x_end_stage; + int x_max_coord; + + int y_start_stage; + int y_end_stage; + int y_max_coord; +}; + +struct ad714x_button_plat { + int keycode; + unsigned short l_mask; + unsigned short h_mask; +}; + +struct ad714x_platform_data { + int slider_num; + int wheel_num; + int touchpad_num; + int button_num; + struct ad714x_slider_plat *slider; + struct ad714x_wheel_plat *wheel; + struct ad714x_touchpad_plat *touchpad; + struct ad714x_button_plat *button; + unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM]; + unsigned short sys_cfg_reg[SYS_CFGREG_NUM]; + unsigned long irqflags; +}; + +#endif diff --git a/include/linux/input/adp5589.h b/include/linux/input/adp5589.h new file mode 100644 index 00000000..1a05eee1 --- /dev/null +++ b/include/linux/input/adp5589.h @@ -0,0 +1,188 @@ +/* + * Analog Devices ADP5589/ADP5585 I/O Expander and QWERTY Keypad Controller + * + * Copyright 2010-2011 Analog Devices Inc. + * + * Licensed under the GPL-2. + */ + +#ifndef _ADP5589_H +#define _ADP5589_H + +/* + * ADP5589 specific GPI and Keymap defines + */ + +#define ADP5589_KEYMAPSIZE 88 + +#define ADP5589_GPI_PIN_ROW0 97 +#define ADP5589_GPI_PIN_ROW1 98 +#define ADP5589_GPI_PIN_ROW2 99 +#define ADP5589_GPI_PIN_ROW3 100 +#define ADP5589_GPI_PIN_ROW4 101 +#define ADP5589_GPI_PIN_ROW5 102 +#define ADP5589_GPI_PIN_ROW6 103 +#define ADP5589_GPI_PIN_ROW7 104 +#define ADP5589_GPI_PIN_COL0 105 +#define ADP5589_GPI_PIN_COL1 106 +#define ADP5589_GPI_PIN_COL2 107 +#define ADP5589_GPI_PIN_COL3 108 +#define ADP5589_GPI_PIN_COL4 109 +#define ADP5589_GPI_PIN_COL5 110 +#define ADP5589_GPI_PIN_COL6 111 +#define ADP5589_GPI_PIN_COL7 112 +#define ADP5589_GPI_PIN_COL8 113 +#define ADP5589_GPI_PIN_COL9 114 +#define ADP5589_GPI_PIN_COL10 115 +#define GPI_LOGIC1 116 +#define GPI_LOGIC2 117 + +#define ADP5589_GPI_PIN_ROW_BASE ADP5589_GPI_PIN_ROW0 +#define ADP5589_GPI_PIN_ROW_END ADP5589_GPI_PIN_ROW7 +#define ADP5589_GPI_PIN_COL_BASE ADP5589_GPI_PIN_COL0 +#define ADP5589_GPI_PIN_COL_END ADP5589_GPI_PIN_COL10 + +#define ADP5589_GPI_PIN_BASE ADP5589_GPI_PIN_ROW_BASE +#define ADP5589_GPI_PIN_END ADP5589_GPI_PIN_COL_END + +#define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) + +/* + * ADP5585 specific GPI and Keymap defines + */ + +#define ADP5585_KEYMAPSIZE 30 + +#define ADP5585_GPI_PIN_ROW0 37 +#define ADP5585_GPI_PIN_ROW1 38 +#define ADP5585_GPI_PIN_ROW2 39 +#define ADP5585_GPI_PIN_ROW3 40 +#define ADP5585_GPI_PIN_ROW4 41 +#define ADP5585_GPI_PIN_ROW5 42 +#define ADP5585_GPI_PIN_COL0 43 +#define ADP5585_GPI_PIN_COL1 44 +#define ADP5585_GPI_PIN_COL2 45 +#define ADP5585_GPI_PIN_COL3 46 +#define ADP5585_GPI_PIN_COL4 47 +#define GPI_LOGIC 48 + +#define ADP5585_GPI_PIN_ROW_BASE ADP5585_GPI_PIN_ROW0 +#define ADP5585_GPI_PIN_ROW_END ADP5585_GPI_PIN_ROW5 +#define ADP5585_GPI_PIN_COL_BASE ADP5585_GPI_PIN_COL0 +#define ADP5585_GPI_PIN_COL_END ADP5585_GPI_PIN_COL4 + +#define ADP5585_GPI_PIN_BASE ADP5585_GPI_PIN_ROW_BASE +#define ADP5585_GPI_PIN_END ADP5585_GPI_PIN_COL_END + +#define ADP5585_GPIMAPSIZE_MAX (ADP5585_GPI_PIN_END - ADP5585_GPI_PIN_BASE + 1) + +struct adp5589_gpi_map { + unsigned short pin; + unsigned short sw_evt; +}; + +/* scan_cycle_time */ +#define ADP5589_SCAN_CYCLE_10ms 0 +#define ADP5589_SCAN_CYCLE_20ms 1 +#define ADP5589_SCAN_CYCLE_30ms 2 +#define ADP5589_SCAN_CYCLE_40ms 3 + +/* RESET_CFG */ +#define RESET_PULSE_WIDTH_500us 0 +#define RESET_PULSE_WIDTH_1ms 1 +#define RESET_PULSE_WIDTH_2ms 2 +#define RESET_PULSE_WIDTH_10ms 3 + +#define RESET_TRIG_TIME_0ms (0 << 2) +#define RESET_TRIG_TIME_1000ms (1 << 2) +#define RESET_TRIG_TIME_1500ms (2 << 2) +#define RESET_TRIG_TIME_2000ms (3 << 2) +#define RESET_TRIG_TIME_2500ms (4 << 2) +#define RESET_TRIG_TIME_3000ms (5 << 2) +#define RESET_TRIG_TIME_3500ms (6 << 2) +#define RESET_TRIG_TIME_4000ms (7 << 2) + +#define RESET_PASSTHRU_EN (1 << 5) +#define RESET1_POL_HIGH (1 << 6) +#define RESET1_POL_LOW (0 << 6) +#define RESET2_POL_HIGH (1 << 7) +#define RESET2_POL_LOW (0 << 7) + +/* ADP5589 Mask Bits: + * C C C C C C C C C C C | R R R R R R R R + * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 + * 0 + * ---------------- BIT ------------------ + * 1 1 1 1 1 1 1 1 1 0 0 | 0 0 0 0 0 0 0 0 + * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 + */ + +#define ADP_ROW(x) (1 << (x)) +#define ADP_COL(x) (1 << (x + 8)) +#define ADP5589_ROW_MASK 0xFF +#define ADP5589_COL_MASK 0xFF +#define ADP5589_COL_SHIFT 8 +#define ADP5589_MAX_ROW_NUM 7 +#define ADP5589_MAX_COL_NUM 10 + +/* ADP5585 Mask Bits: + * C C C C C | R R R R R R + * 4 3 2 1 0 | 5 4 3 2 1 0 + * + * ---- BIT -- ----------- + * 1 0 0 0 0 | 0 0 0 0 0 0 + * 0 9 8 7 6 | 5 4 3 2 1 0 + */ + +#define ADP5585_ROW_MASK 0x3F +#define ADP5585_COL_MASK 0x1F +#define ADP5585_ROW_SHIFT 0 +#define ADP5585_COL_SHIFT 6 +#define ADP5585_MAX_ROW_NUM 5 +#define ADP5585_MAX_COL_NUM 4 + +#define ADP5585_ROW(x) (1 << ((x) & ADP5585_ROW_MASK)) +#define ADP5585_COL(x) (1 << (((x) & ADP5585_COL_MASK) + ADP5585_COL_SHIFT)) + +/* Put one of these structures in i2c_board_info platform_data */ + +struct adp5589_kpad_platform_data { + unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ + const unsigned short *keymap; /* Pointer to keymap */ + unsigned short keymapsize; /* Keymap size */ + bool repeat; /* Enable key repeat */ + bool en_keylock; /* Enable key lock feature (ADP5589 only)*/ + unsigned char unlock_key1; /* Unlock Key 1 (ADP5589 only) */ + unsigned char unlock_key2; /* Unlock Key 2 (ADP5589 only) */ + unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable (ADP5589 only) */ + unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ + unsigned char reset_cfg; /* Reset config */ + unsigned short reset1_key_1; /* Reset Key 1 */ + unsigned short reset1_key_2; /* Reset Key 2 */ + unsigned short reset1_key_3; /* Reset Key 3 */ + unsigned short reset2_key_1; /* Reset Key 1 */ + unsigned short reset2_key_2; /* Reset Key 2 */ + unsigned debounce_dis_mask; /* Disable debounce mask */ + unsigned pull_dis_mask; /* Disable all pull resistors mask */ + unsigned pullup_en_100k; /* Pull-Up 100k Enable Mask */ + unsigned pullup_en_300k; /* Pull-Up 300k Enable Mask */ + unsigned pulldown_en_300k; /* Pull-Down 300k Enable Mask */ + const struct adp5589_gpi_map *gpimap; + unsigned short gpimapsize; + const struct adp5589_gpio_platform_data *gpio_data; +}; + +struct i2c_client; /* forward declaration */ + +struct adp5589_gpio_platform_data { + int gpio_start; /* GPIO Chip base # */ + int (*setup)(struct i2c_client *client, + int gpio, unsigned ngpio, + void *context); + int (*teardown)(struct i2c_client *client, + int gpio, unsigned ngpio, + void *context); + void *context; +}; + +#endif diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h new file mode 100644 index 00000000..010d9817 --- /dev/null +++ b/include/linux/input/adxl34x.h @@ -0,0 +1,358 @@ +/* + * include/linux/input/adxl34x.h + * + * Digital Accelerometer characteristics are highly application specific + * and may vary between boards and models. The platform_data for the + * device's "struct device" holds this information. + * + * Copyright 2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef __LINUX_INPUT_ADXL34X_H__ +#define __LINUX_INPUT_ADXL34X_H__ + +#include <linux/input.h> + +struct adxl34x_platform_data { + + /* + * X,Y,Z Axis Offset: + * offer user offset adjustments in twoscompliment + * form with a scale factor of 15.6 mg/LSB (i.e. 0x7F = +2 g) + */ + + s8 x_axis_offset; + s8 y_axis_offset; + s8 z_axis_offset; + + /* + * TAP_X/Y/Z Enable: Setting TAP_X, Y, or Z Enable enables X, + * Y, or Z participation in Tap detection. A '0' excludes the + * selected axis from participation in Tap detection. + * Setting the SUPPRESS bit suppresses Double Tap detection if + * acceleration greater than tap_threshold is present during the + * tap_latency period, i.e. after the first tap but before the + * opening of the second tap window. + */ + +#define ADXL_SUPPRESS (1 << 3) +#define ADXL_TAP_X_EN (1 << 2) +#define ADXL_TAP_Y_EN (1 << 1) +#define ADXL_TAP_Z_EN (1 << 0) + + u8 tap_axis_control; + + /* + * tap_threshold: + * holds the threshold value for tap detection/interrupts. + * The data format is unsigned. The scale factor is 62.5 mg/LSB + * (i.e. 0xFF = +16 g). A zero value may result in undesirable + * behavior if Tap/Double Tap is enabled. + */ + + u8 tap_threshold; + + /* + * tap_duration: + * is an unsigned time value representing the maximum + * time that an event must be above the tap_threshold threshold + * to qualify as a tap event. The scale factor is 625 us/LSB. A zero + * value will prevent Tap/Double Tap functions from working. + */ + + u8 tap_duration; + + /* + * tap_latency: + * is an unsigned time value representing the wait time + * from the detection of a tap event to the opening of the time + * window tap_window for a possible second tap event. The scale + * factor is 1.25 ms/LSB. A zero value will disable the Double Tap + * function. + */ + + u8 tap_latency; + + /* + * tap_window: + * is an unsigned time value representing the amount + * of time after the expiration of tap_latency during which a second + * tap can begin. The scale factor is 1.25 ms/LSB. A zero value will + * disable the Double Tap function. + */ + + u8 tap_window; + + /* + * act_axis_control: + * X/Y/Z Enable: A '1' enables X, Y, or Z participation in activity + * or inactivity detection. A '0' excludes the selected axis from + * participation. If all of the axes are excluded, the function is + * disabled. + * AC/DC: A '0' = DC coupled operation and a '1' = AC coupled + * operation. In DC coupled operation, the current acceleration is + * compared with activity_threshold and inactivity_threshold directly + * to determine whether activity or inactivity is detected. In AC + * coupled operation for activity detection, the acceleration value + * at the start of activity detection is taken as a reference value. + * New samples of acceleration are then compared to this + * reference value and if the magnitude of the difference exceeds + * activity_threshold the device will trigger an activity interrupt. In + * AC coupled operation for inactivity detection, a reference value + * is used again for comparison and is updated whenever the + * device exceeds the inactivity threshold. Once the reference + * value is selected, the device compares the magnitude of the + * difference between the reference value and the current + * acceleration with inactivity_threshold. If the difference is below + * inactivity_threshold for a total of inactivity_time, the device is + * considered inactive and the inactivity interrupt is triggered. + */ + +#define ADXL_ACT_ACDC (1 << 7) +#define ADXL_ACT_X_EN (1 << 6) +#define ADXL_ACT_Y_EN (1 << 5) +#define ADXL_ACT_Z_EN (1 << 4) +#define ADXL_INACT_ACDC (1 << 3) +#define ADXL_INACT_X_EN (1 << 2) +#define ADXL_INACT_Y_EN (1 << 1) +#define ADXL_INACT_Z_EN (1 << 0) + + u8 act_axis_control; + + /* + * activity_threshold: + * holds the threshold value for activity detection. + * The data format is unsigned. The scale factor is + * 62.5 mg/LSB. A zero value may result in undesirable behavior if + * Activity interrupt is enabled. + */ + + u8 activity_threshold; + + /* + * inactivity_threshold: + * holds the threshold value for inactivity + * detection. The data format is unsigned. The scale + * factor is 62.5 mg/LSB. A zero value may result in undesirable + * behavior if Inactivity interrupt is enabled. + */ + + u8 inactivity_threshold; + + /* + * inactivity_time: + * is an unsigned time value representing the + * amount of time that acceleration must be below the value in + * inactivity_threshold for inactivity to be declared. The scale factor + * is 1 second/LSB. Unlike the other interrupt functions, which + * operate on unfiltered data, the inactivity function operates on the + * filtered output data. At least one output sample must be + * generated for the inactivity interrupt to be triggered. This will + * result in the function appearing un-responsive if the + * inactivity_time register is set with a value less than the time + * constant of the Output Data Rate. A zero value will result in an + * interrupt when the output data is below inactivity_threshold. + */ + + u8 inactivity_time; + + /* + * free_fall_threshold: + * holds the threshold value for Free-Fall detection. + * The data format is unsigned. The root-sum-square(RSS) value + * of all axes is calculated and compared to the value in + * free_fall_threshold to determine if a free fall event may be + * occurring. The scale factor is 62.5 mg/LSB. A zero value may + * result in undesirable behavior if Free-Fall interrupt is + * enabled. Values between 300 and 600 mg (0x05 to 0x09) are + * recommended. + */ + + u8 free_fall_threshold; + + /* + * free_fall_time: + * is an unsigned time value representing the minimum + * time that the RSS value of all axes must be less than + * free_fall_threshold to generate a Free-Fall interrupt. The + * scale factor is 5 ms/LSB. A zero value may result in + * undesirable behavior if Free-Fall interrupt is enabled. + * Values between 100 to 350 ms (0x14 to 0x46) are recommended. + */ + + u8 free_fall_time; + + /* + * data_rate: + * Selects device bandwidth and output data rate. + * RATE = 3200 Hz / (2^(15 - x)). Default value is 0x0A, or 100 Hz + * Output Data Rate. An Output Data Rate should be selected that + * is appropriate for the communication protocol and frequency + * selected. Selecting too high of an Output Data Rate with a low + * communication speed will result in samples being discarded. + */ + + u8 data_rate; + + /* + * data_range: + * FULL_RES: When this bit is set with the device is + * in Full-Resolution Mode, where the output resolution increases + * with RANGE to maintain a 4 mg/LSB scale factor. When this + * bit is cleared the device is in 10-bit Mode and RANGE determine the + * maximum g-Range and scale factor. + */ + +#define ADXL_FULL_RES (1 << 3) +#define ADXL_RANGE_PM_2g 0 +#define ADXL_RANGE_PM_4g 1 +#define ADXL_RANGE_PM_8g 2 +#define ADXL_RANGE_PM_16g 3 + + u8 data_range; + + /* + * low_power_mode: + * A '0' = Normal operation and a '1' = Reduced + * power operation with somewhat higher noise. + */ + + u8 low_power_mode; + + /* + * power_mode: + * LINK: A '1' with both the activity and inactivity functions + * enabled will delay the start of the activity function until + * inactivity is detected. Once activity is detected, inactivity + * detection will begin and prevent the detection of activity. This + * bit serially links the activity and inactivity functions. When '0' + * the inactivity and activity functions are concurrent. Additional + * information can be found in the ADXL34x datasheet's Application + * section under Link Mode. + * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode + * when inactivity (acceleration has been below inactivity_threshold + * for at least inactivity_time) is detected and the LINK bit is set. + * A '0' disables automatic switching to Sleep Mode. See the + * Sleep Bit section of the ADXL34x datasheet for more information. + */ + +#define ADXL_LINK (1 << 5) +#define ADXL_AUTO_SLEEP (1 << 4) + + u8 power_mode; + + /* + * fifo_mode: + * BYPASS The FIFO is bypassed + * FIFO FIFO collects up to 32 values then stops collecting data + * STREAM FIFO holds the last 32 data values. Once full, the FIFO's + * oldest data is lost as it is replaced with newer data + * + * DEFAULT should be ADXL_FIFO_STREAM + */ + +#define ADXL_FIFO_BYPASS 0 +#define ADXL_FIFO_FIFO 1 +#define ADXL_FIFO_STREAM 2 + + u8 fifo_mode; + + /* + * watermark: + * The Watermark feature can be used to reduce the interrupt load + * of the system. The FIFO fills up to the value stored in watermark + * [1..32] and then generates an interrupt. + * A '0' disables the watermark feature. + */ + + u8 watermark; + + /* + * When acceleration measurements are received from the ADXL34x + * events are sent to the event subsystem. The following settings + * select the event type and event code for new x, y and z axis data + * respectively. + */ + u32 ev_type; /* EV_ABS or EV_REL */ + + u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ + u32 ev_code_y; /* ABS_X,Y,Z or REL_X,Y,Z */ + u32 ev_code_z; /* ABS_X,Y,Z or REL_X,Y,Z */ + + /* + * A valid BTN or KEY Code; use tap_axis_control to disable + * event reporting + */ + + u32 ev_code_tap[3]; /* EV_KEY {X-Axis, Y-Axis, Z-Axis} */ + + /* + * A valid BTN or KEY Code for Free-Fall or Activity enables + * input event reporting. A '0' disables the Free-Fall or + * Activity reporting. + */ + + u32 ev_code_ff; /* EV_KEY */ + u32 ev_code_act_inactivity; /* EV_KEY */ + + /* + * Use ADXL34x INT2 pin instead of INT1 pin for interrupt output + */ + u8 use_int2; + + /* + * ADXL346 only ORIENTATION SENSING feature + * The orientation function of the ADXL346 reports both 2-D and + * 3-D orientation concurrently. + */ + +#define ADXL_EN_ORIENTATION_2D 1 +#define ADXL_EN_ORIENTATION_3D 2 +#define ADXL_EN_ORIENTATION_2D_3D 3 + + u8 orientation_enable; + + /* + * The width of the deadzone region between two or more + * orientation positions is determined by setting the Deadzone + * value. The deadzone region size can be specified with a + * resolution of 3.6deg. The deadzone angle represents the total + * angle where the orientation is considered invalid. + */ + +#define ADXL_DEADZONE_ANGLE_0p0 0 /* !!!0.0 [deg] */ +#define ADXL_DEADZONE_ANGLE_3p6 1 /* 3.6 [deg] */ +#define ADXL_DEADZONE_ANGLE_7p2 2 /* 7.2 [deg] */ +#define ADXL_DEADZONE_ANGLE_10p8 3 /* 10.8 [deg] */ +#define ADXL_DEADZONE_ANGLE_14p4 4 /* 14.4 [deg] */ +#define ADXL_DEADZONE_ANGLE_18p0 5 /* 18.0 [deg] */ +#define ADXL_DEADZONE_ANGLE_21p6 6 /* 21.6 [deg] */ +#define ADXL_DEADZONE_ANGLE_25p2 7 /* 25.2 [deg] */ + + u8 deadzone_angle; + + /* + * To eliminate most human motion such as walking or shaking, + * a Divisor value should be selected to effectively limit the + * orientation bandwidth. Set the depth of the filter used to + * low-pass filter the measured acceleration for stable + * orientation sensing + */ + +#define ADXL_LP_FILTER_DIVISOR_2 0 +#define ADXL_LP_FILTER_DIVISOR_4 1 +#define ADXL_LP_FILTER_DIVISOR_8 2 +#define ADXL_LP_FILTER_DIVISOR_16 3 +#define ADXL_LP_FILTER_DIVISOR_32 4 +#define ADXL_LP_FILTER_DIVISOR_64 5 +#define ADXL_LP_FILTER_DIVISOR_128 6 +#define ADXL_LP_FILTER_DIVISOR_256 7 + + u8 divisor_length; + + u32 ev_codes_orient_2d[4]; /* EV_KEY {+X, -X, +Y, -Y} */ + u32 ev_codes_orient_3d[6]; /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */ +}; +#endif diff --git a/include/linux/input/as5011.h b/include/linux/input/as5011.h new file mode 100644 index 00000000..1affd0dd --- /dev/null +++ b/include/linux/input/as5011.h @@ -0,0 +1,20 @@ +#ifndef _AS5011_H +#define _AS5011_H + +/* + * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com> + * + * 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. + */ + +struct as5011_platform_data { + unsigned int button_gpio; + unsigned int axis_irq; /* irq number */ + unsigned long axis_irqflags; + char xp, xn; /* threshold for x axis */ + char yp, yn; /* threshold for y axis */ +}; + +#endif /* _AS5011_H */ diff --git a/include/linux/input/auo-pixcir-ts.h b/include/linux/input/auo-pixcir-ts.h new file mode 100644 index 00000000..5049f219 --- /dev/null +++ b/include/linux/input/auo-pixcir-ts.h @@ -0,0 +1,54 @@ +/* + * Driver for AUO in-cell touchscreens + * + * Copyright (c) 2011 Heiko Stuebner <heiko@sntech.de> + * + * based on auo_touch.h from Dell Streak kernel + * + * Copyright (c) 2008 QUALCOMM Incorporated. + * Copyright (c) 2008 QUALCOMM USA, INC. + * + * + * 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 __AUO_PIXCIR_TS_H__ +#define __AUO_PIXCIR_TS_H__ + +/* + * Interrupt modes: + * periodical: interrupt is asserted periodicaly + * compare coordinates: interrupt is asserted when coordinates change + * indicate touch: interrupt is asserted during touch + */ +#define AUO_PIXCIR_INT_PERIODICAL 0x00 +#define AUO_PIXCIR_INT_COMP_COORD 0x01 +#define AUO_PIXCIR_INT_TOUCH_IND 0x02 + +/* + * @gpio_int interrupt gpio + * @int_setting one of AUO_PIXCIR_INT_* + * @init_hw hardwarespecific init + * @exit_hw hardwarespecific shutdown + * @x_max x-resolution + * @y_max y-resolution + */ +struct auo_pixcir_ts_platdata { + int gpio_int; + int gpio_rst; + + int int_setting; + + unsigned int x_max; + unsigned int y_max; +}; + +#endif diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h new file mode 100644 index 00000000..6230d76b --- /dev/null +++ b/include/linux/input/bu21013.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) ST-Ericsson SA 2010 + * Author: Naveen Kumar G <naveen.gaddipati@stericsson.com> for ST-Ericsson + * License terms:GNU General Public License (GPL) version 2 + */ + +#ifndef _BU21013_H +#define _BU21013_H + +/** + * struct bu21013_platform_device - Handle the platform data + * @touch_x_max: touch x max + * @touch_y_max: touch y max + * @cs_pin: chip select pin + * @touch_pin: touch gpio pin + * @ext_clk: external clock flag + * @x_flip: x flip flag + * @y_flip: y flip flag + * @wakeup: wakeup flag + * + * This is used to handle the platform data + */ +struct bu21013_platform_device { + int touch_x_max; + int touch_y_max; + unsigned int cs_pin; + unsigned int touch_pin; + bool ext_clk; + bool x_flip; + bool y_flip; + bool wakeup; +}; + +#endif diff --git a/include/linux/input/cma3000.h b/include/linux/input/cma3000.h new file mode 100644 index 00000000..cbbaac27 --- /dev/null +++ b/include/linux/input/cma3000.h @@ -0,0 +1,59 @@ +/* + * VTI CMA3000_Dxx Accelerometer driver + * + * Copyright (C) 2010 Texas Instruments + * Author: Hemanth V <hemanthv@ti.com> + * + * 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _LINUX_CMA3000_H +#define _LINUX_CMA3000_H + +#define CMAMODE_DEFAULT 0 +#define CMAMODE_MEAS100 1 +#define CMAMODE_MEAS400 2 +#define CMAMODE_MEAS40 3 +#define CMAMODE_MOTDET 4 +#define CMAMODE_FF100 5 +#define CMAMODE_FF400 6 +#define CMAMODE_POFF 7 + +#define CMARANGE_2G 2000 +#define CMARANGE_8G 8000 + +/** + * struct cma3000_i2c_platform_data - CMA3000 Platform data + * @fuzz_x: Noise on X Axis + * @fuzz_y: Noise on Y Axis + * @fuzz_z: Noise on Z Axis + * @g_range: G range in milli g i.e 2000 or 8000 + * @mode: Operating mode + * @mdthr: Motion detect threshold value + * @mdfftmr: Motion detect and free fall time value + * @ffthr: Free fall threshold value + */ + +struct cma3000_platform_data { + int fuzz_x; + int fuzz_y; + int fuzz_z; + int g_range; + uint8_t mode; + uint8_t mdthr; + uint8_t mdfftmr; + uint8_t ffthr; + unsigned long irqflags; +}; + +#endif diff --git a/include/linux/input/cy8ctmg110_pdata.h b/include/linux/input/cy8ctmg110_pdata.h new file mode 100644 index 00000000..09522cb5 --- /dev/null +++ b/include/linux/input/cy8ctmg110_pdata.h @@ -0,0 +1,10 @@ +#ifndef _LINUX_CY8CTMG110_PDATA_H +#define _LINUX_CY8CTMG110_PDATA_H + +struct cy8ctmg110_pdata +{ + int reset_pin; /* Reset pin is wired to this GPIO (optional) */ + int irq_pin; /* IRQ pin is wired to this GPIO */ +}; + +#endif diff --git a/include/linux/input/cyttsp.h b/include/linux/input/cyttsp.h new file mode 100644 index 00000000..5af7c66f --- /dev/null +++ b/include/linux/input/cyttsp.h @@ -0,0 +1,58 @@ +/* + * Header file for: + * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers. + * For use with Cypress Txx3xx parts. + * Supported parts include: + * CY8CTST341 + * CY8CTMA340 + * + * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc. + * Copyright (C) 2012 Javier Martinez Canillas <javier@dowhile0.org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2, and only 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contact Cypress Semiconductor at www.cypress.com (kev@cypress.com) + * + */ +#ifndef _CYTTSP_H_ +#define _CYTTSP_H_ + +#define CY_SPI_NAME "cyttsp-spi" +#define CY_I2C_NAME "cyttsp-i2c" +/* Active Power state scanning/processing refresh interval */ +#define CY_ACT_INTRVL_DFLT 0x00 /* ms */ +/* touch timeout for the Active power */ +#define CY_TCH_TMOUT_DFLT 0xFF /* ms */ +/* Low Power state scanning/processing refresh interval */ +#define CY_LP_INTRVL_DFLT 0x0A /* ms */ +/* Active distance in pixels for a gesture to be reported */ +#define CY_ACT_DIST_DFLT 0xF8 /* pixels */ + +struct cyttsp_platform_data { + u32 maxx; + u32 maxy; + bool use_hndshk; + u8 act_dist; /* Active distance */ + u8 act_intrvl; /* Active refresh interval; ms */ + u8 tch_tmout; /* Active touch timeout; ms */ + u8 lp_intrvl; /* Low power refresh interval; ms */ + int (*init)(void); + void (*exit)(void); + char *name; + s16 irq_gpio; + u8 *bl_keys; +}; + +#endif /* _CYTTSP_H_ */ diff --git a/include/linux/input/edt-ft5x06.h b/include/linux/input/edt-ft5x06.h new file mode 100644 index 00000000..8a1e0d1a --- /dev/null +++ b/include/linux/input/edt-ft5x06.h @@ -0,0 +1,24 @@ +#ifndef _EDT_FT5X06_H +#define _EDT_FT5X06_H + +/* + * Copyright (c) 2012 Simon Budig, <simon.budig@kernelconcepts.de> + * + * 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. + */ + +struct edt_ft5x06_platform_data { + int irq_pin; + int reset_pin; + + /* startup defaults for operational parameters */ + bool use_parameters; + u8 gain; + u8 threshold; + u8 offset; + u8 report_rate; +}; + +#endif /* _EDT_FT5X06_H */ diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h new file mode 100644 index 00000000..16625d79 --- /dev/null +++ b/include/linux/input/eeti_ts.h @@ -0,0 +1,10 @@ +#ifndef LINUX_INPUT_EETI_TS_H +#define LINUX_INPUT_EETI_TS_H + +struct eeti_ts_platform_data { + int irq_gpio; + unsigned int irq_active_high; +}; + +#endif /* LINUX_INPUT_EETI_TS_H */ + diff --git a/include/linux/input/gp2ap002a00f.h b/include/linux/input/gp2ap002a00f.h new file mode 100644 index 00000000..aad2fd44 --- /dev/null +++ b/include/linux/input/gp2ap002a00f.h @@ -0,0 +1,22 @@ +#ifndef _GP2AP002A00F_H_ +#define _GP2AP002A00F_H_ + +#include <linux/i2c.h> + +#define GP2A_I2C_NAME "gp2ap002a00f" + +/** + * struct gp2a_platform_data - Sharp gp2ap002a00f proximity platform data + * @vout_gpio: The gpio connected to the object detected pin (VOUT) + * @wakeup: Set to true if the proximity can wake the device from suspend + * @hw_setup: Callback for setting up hardware such as gpios and vregs + * @hw_shutdown: Callback for properly shutting down hardware + */ +struct gp2a_platform_data { + int vout_gpio; + bool wakeup; + int (*hw_setup)(struct i2c_client *client); + int (*hw_shutdown)(struct i2c_client *client); +}; + +#endif diff --git a/include/linux/input/gpio_tilt.h b/include/linux/input/gpio_tilt.h new file mode 100644 index 00000000..c1cc52d3 --- /dev/null +++ b/include/linux/input/gpio_tilt.h @@ -0,0 +1,73 @@ +#ifndef _INPUT_GPIO_TILT_H +#define _INPUT_GPIO_TILT_H + +/** + * struct gpio_tilt_axis - Axis used by the tilt switch + * @axis: Constant describing the axis, e.g. ABS_X + * @min: minimum value for abs_param + * @max: maximum value for abs_param + * @fuzz: fuzz value for abs_param + * @flat: flat value for abs_param + */ +struct gpio_tilt_axis { + int axis; + int min; + int max; + int fuzz; + int flat; +}; + +/** + * struct gpio_tilt_state - state description + * @gpios: bitfield of gpio target-states for the value + * @axes: array containing the axes settings for the gpio state + * The array indizes must correspond to the axes defined + * in platform_data + * + * This structure describes a supported axis settings + * and the necessary gpio-state which represent it. + * + * The n-th bit in the bitfield describes the state of the n-th GPIO + * from the gpios-array defined in gpio_regulator_config below. + */ +struct gpio_tilt_state { + int gpios; + int *axes; +}; + +/** + * struct gpio_tilt_platform_data + * @gpios: Array containing the gpios determining the tilt state + * @nr_gpios: Number of gpios + * @axes: Array of gpio_tilt_axis descriptions + * @nr_axes: Number of axes + * @states: Array of gpio_tilt_state entries describing + * the gpio state for specific tilts + * @nr_states: Number of states available + * @debounce_interval: debounce ticks interval in msecs + * @poll_interval: polling interval in msecs - for polling driver only + * @enable: callback to enable the tilt switch + * @disable: callback to disable the tilt switch + * + * This structure contains gpio-tilt-switch configuration + * information that must be passed by platform code to the + * gpio-tilt input driver. + */ +struct gpio_tilt_platform_data { + struct gpio *gpios; + int nr_gpios; + + struct gpio_tilt_axis *axes; + int nr_axes; + + struct gpio_tilt_state *states; + int nr_states; + + int debounce_interval; + + unsigned int poll_interval; + int (*enable)(struct device *dev); + void (*disable)(struct device *dev); +}; + +#endif diff --git a/include/linux/input/ili210x.h b/include/linux/input/ili210x.h new file mode 100644 index 00000000..a5471245 --- /dev/null +++ b/include/linux/input/ili210x.h @@ -0,0 +1,10 @@ +#ifndef _ILI210X_H +#define _ILI210X_H + +struct ili210x_platform_data { + unsigned long irq_flags; + unsigned int poll_period; + bool (*get_pendown_state)(void); +}; + +#endif diff --git a/include/linux/input/ist30xx.h b/include/linux/input/ist30xx.h new file mode 100644 index 00000000..55b6b65e --- /dev/null +++ b/include/linux/input/ist30xx.h @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2010, Imagis Technology 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 __IST30XX_H__ +#define __IST30XX_H__ + +/* + * Support F/W ver : IST3000 v2.2~v3.3 (included tag) + * Release : 2013.06.12 by Ian Bae + */ + +#define I2C_BURST_MODE (1) +#define I2C_MONOPOLY_MODE (0) + +#define IST30XX_EVENT_MODE (1) +#if IST30XX_EVENT_MODE +# define IST30XX_NOISE_MODE (1) +# define IST30XX_TRACKING_MODE (1) +#endif +#define IST30XX_DETECT_TA (1) +#define IST30XX_DETECT_TEMPER (0) +#define IST30XX_DETECT_CALLER (0) +#define IST30XX_USE_KEY (1) +#define IST30XX_DEBUG (1) + +#define IST30XX_FACTORY_TEST (1) + +#define IST30XX_DEV_NAME "IST30XX" +#define IST30XX_CHIP_ID (0x30003000) +#define IST30XXA_CHIP_ID (0x300a300a) + +#define IST30XX_DEV_ID (0xA0 >> 1) +#define IST30XX_FW_DEV_ID (0xA4 >> 1) + +#define IST30XX_ADDR_LEN (4) +#define IST30XX_DATA_LEN (4) + +#define IST30XX_ISP_CMD_LEN (3) + +#define IST30XX_MAX_MT_FINGERS (10) + +#if (defined CONFIG_MACH_POCKET2) || (defined CONFIG_MACH_YOUNG2) +#define IST30XX_MAX_X (320) +#define IST30XX_MAX_Y (480) +#else +#define IST30XX_MAX_X (240) +#define IST30XX_MAX_Y (320) +#endif +#define IST30XX_MAX_Z (255) +#define IST30XX_MAX_W (15) + +/* I2C Transfer msg number */ +#define WRITE_CMD_MSG_LEN (1) +#define READ_CMD_MSG_LEN (2) + +#define NORMAL_TEMPERATURE (0) +#define LOW_TEMPERATURE (1) +#define HIGH_TEMPERATURE (2) + +/* Debug message */ +#define DEV_ERR (1) +#define DEV_WARN (2) +#define DEV_INFO (3) +#define DEV_DEBUG (4) +#define DEV_VERB (5) + +#define IST30XX_DEBUG_TAG "[ TSP ]" +#define IST30XX_DEBUG_LEVEL DEV_DEBUG + +#define tsp_err(fmt, ...) tsp_printk(DEV_ERR, fmt, ## __VA_ARGS__) +#define tsp_warn(fmt, ...) tsp_printk(DEV_WARN, fmt, ## __VA_ARGS__) +#define tsp_info(fmt, ...) tsp_printk(DEV_INFO, fmt, ## __VA_ARGS__) +#define tsp_debug(fmt, ...) tsp_printk(DEV_DEBUG, fmt, ## __VA_ARGS__) +#define tsp_verb(fmt, ...) tsp_printk(DEV_VERB, fmt, ## __VA_ARGS__) + + +enum ist30xx_commands { + CMD_ENTER_UPDATE = 0x02, + CMD_EXIT_UPDATE = 0x03, + CMD_UPDATE_SENSOR = 0x04, + CMD_UPDATE_CONFIG = 0x05, + CMD_ENTER_REG_ACCESS = 0x07, + CMD_EXIT_REG_ACCESS = 0x08, + CMD_SET_TA_MODE = 0x0A, + CMD_START_SCAN = 0x0B, + CMD_ENTER_FW_UPDATE = 0x0C, + CMD_RUN_DEVICE = 0x0D, + CMD_SET_TEST_MODE = 0x0F, + + CMD_CALIBRATE = 0x11, + CMD_USE_IDLE = 0x12, + CMD_USE_DEBUG = 0x13, + CMD_ZVALUE_MODE = 0x15, + CMD_CHECK_CALIB = 0x1A, + CMD_SET_TEMPER_MODE = 0x1B, + CMD_SET_CALL_MODE = 0x1C, + + CMD_GET_COORD = 0x20, + + CMD_GET_CHIP_ID = 0x30, + CMD_GET_FW_VER = 0x31, + CMD_GET_CHECKSUM = 0x32, + CMD_GET_LCD_RESOLUTION = 0x33, + CMD_GET_TSP_CHNUM1 = 0x34, + CMD_GET_PARAM_VER = 0x35, + CMD_GET_CALIB_RESULT = 0x37, + CMD_GET_TSP_SWAP_INFO = 0x38, + CMD_GET_KEY_INFO1 = 0x39, + CMD_GET_KEY_INFO2 = 0x3A, + CMD_GET_KEY_INFO3 = 0x3B, + CMD_GET_TSP_CHNUM2 = 0x3C, + CMD_GET_TSP_DIRECTION = 0x3D, + + CMD_GET_TSP_VENDOR = 0x3E, + CMD_GET_TSP_PANNEL_TYPE = 0x40, + + CMD_GET_CHECKSUM_ALL = 0x41, +}; + +#define CMD_FW_UPDATE_MAGIC (0x85FDAE8A) + + +typedef union { + struct { + u32 y : 10; + u32 w : 6; + u32 x : 10; + u32 id : 4; + u32 udmg : 2; + } bit_field; + u32 full_field; +} finger_info; + + +struct ist30xx_status { + int power; + int update; + int calib; + int calib_msg; +}; + +struct ist30xx_fw { + u32 pre_ver; + u32 ver; + u32 index; + u32 size; + u32 chksum; +}; + +#define IST30XX_TAG_MAGIC "ISTV1TAG" +struct ist30xx_tags { + char magic1[8]; + u32 fw_addr; + u32 fw_size; + u32 flag_addr; + u32 flag_size; + u32 cfg_addr; + u32 cfg_size; + u32 sensor1_addr; + u32 sensor1_size; + u32 sensor2_addr; + u32 sensor2_size; + u32 chksum; + u32 reserved2; + char magic2[8]; +}; + +#include <linux/earlysuspend.h> +struct ist30xx_data { + struct i2c_client * client; + struct input_dev * input_dev; + struct early_suspend early_suspend; + struct ist30xx_status status; + struct ist30xx_fw fw; + struct ist30xx_tags tags; + u32 chip_id; + u32 param_ver; + u32 num_fingers; + u32 num_keys; + u32 irq_enabled; + finger_info fingers[IST30XX_MAX_MT_FINGERS]; + finger_info prev_fingers[IST30XX_MAX_MT_FINGERS]; + finger_info prev_keys[IST30XX_MAX_MT_FINGERS]; +}; +struct tsp_dev_info{ + int gpio; +}; +extern struct mutex ist30xx_mutex; +extern int ist30xx_dbg_level; + +void tsp_printk(int level, const char *fmt, ...); + +void ist30xx_enable_irq(struct ist30xx_data *data); +void ist30xx_disable_irq(struct ist30xx_data *data); + +void ist30xx_start(struct ist30xx_data *data); +int ist30xx_get_ver_info(struct ist30xx_data *data); +int ist30xx_init_touch_driver(struct ist30xx_data *data); + +int ist30xx_get_position(struct i2c_client *client, u32 *buf, u16 len); + +int ist30xx_read_cmd(struct i2c_client *client, u32 cmd, u32 *buf); +int ist30xx_write_cmd(struct i2c_client *client, u32 cmd, u32 val); + +int ist30xx_cmd_run_device(struct i2c_client *client); +int ist30xx_cmd_start_scan(struct i2c_client *client); +int ist30xx_cmd_calibrate(struct i2c_client *client); +int ist30xx_cmd_check_calib(struct i2c_client *client); +int ist30xx_cmd_update(struct i2c_client *client, int cmd); +int ist30xx_cmd_reg(struct i2c_client *client, int cmd); + +int ist30xx_power_on(void); +int ist30xx_power_off(void); +int ist30xx_reset(void); +void ts_power_enable(int en); + +int ist30xx_internal_suspend(struct ist30xx_data *data); +int ist30xx_internal_resume(struct ist30xx_data *data); + +int ist30xx_init_factory_sysfs(void); +int ist30xx_init_system(void); + +#endif // __IST30XX_H__ diff --git a/include/linux/input/ist30xxb.h b/include/linux/input/ist30xxb.h new file mode 100644 index 00000000..d7f0bfc8 --- /dev/null +++ b/include/linux/input/ist30xxb.h @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2010, Imagis Technology 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 __IST30XX_H__ +#define __IST30XX_H__ + +/* + * Support F/W ver : IST30xxB v3.3 (included tag) + * Support IC : IST30xxB + * Release : 2013.11.06 by Ian Bae + */ + +#define I2C_BURST_MODE (1) +#define I2C_MONOPOLY_MODE (0) + +#define IST30XX_EVENT_MODE (1) +#if IST30XX_EVENT_MODE +# define IST30XX_NOISE_MODE (1) +# define IST30XX_TRACKING_MODE (1) +# define IST30XX_ALGORITHM_MODE (1) +#else +# define IST30XX_NOISE_MODE (0) +# define IST30XX_TRACKING_MODE (0) +# define IST30XX_ALGORITHM_MODE (0) +#endif +#define IST30XX_DETECT_TA (1) +#define IST30XX_DETECT_CALLER (0) +#define IST30XX_USE_KEY (1) +#define IST30XX_DEBUG (0) + +#define SEC_FACTORY_MODE (1) +#define IST30XX_FACTORY_TEST (1) + +#define IST30XX_DEV_NAME "sec_touch" +#define IST30XX_CHIP_ID (0x30003000) +#define IST30XXA_CHIP_ID (0x300a300a) +#define IST30XXB_CHIP_ID (0x300b300b) + +#define IST30XX_DEV_ID (0xA0 >> 1) +#define IST30XX_FW_DEV_ID (0xA4 >> 1) + +#define IST30XX_ADDR_LEN (4) +#define IST30XX_DATA_LEN (4) + +#define IST30XX_ISP_CMD_LEN (3) + +#define IST30XX_MAX_MT_FINGERS (10) + +#if defined (CONFIG_MACH_CORSICA_VE) || defined (CONFIG_MACH_POCKET2) +#define IST30XX_MAX_X (240) +#define IST30XX_MAX_Y (320) +#elif defined CONFIG_MACH_YOUNG2 || defined (CONFIG_MACH_PIKEAYOUNG2DTV) +#define IST30XX_MAX_X (320) +#define IST30XX_MAX_Y (480) +#elif defined CONFIG_MACH_VIVALTO +#define IST30XX_MAX_X (480) +#define IST30XX_MAX_Y (800) +#endif + +#define IST30XX_MAX_W (15) + +#define IST30XX (1) +#define IST30XXB (2) + +/* I2C Transfer msg number */ +#define WRITE_CMD_MSG_LEN (1) +#define READ_CMD_MSG_LEN (2) + +#define NORMAL_TEMPERATURE (0) +#define LOW_TEMPERATURE (1) +#define HIGH_TEMPERATURE (2) + +/* Debug message */ +#define DEV_ERR (1) +#define DEV_WARN (2) +#define DEV_INFO (3) +#define DEV_DEBUG (4) +#define DEV_VERB (5) + +#define PRINT_TSP_LOG (0) + +#define IST30XX_DEBUG_TAG "[ TSP ]" +#define IST30XX_DEBUG_LEVEL DEV_DEBUG +//#define IST30XX_DEBUG_LEVEL DEV_VERB + +#define tsp_err(fmt, ...) tsp_printk(DEV_ERR, fmt, ## __VA_ARGS__) +#define tsp_warn(fmt, ...) tsp_printk(DEV_WARN, fmt, ## __VA_ARGS__) +#define tsp_info(fmt, ...) tsp_printk(DEV_INFO, fmt, ## __VA_ARGS__) +#define tsp_debug(fmt, ...) tsp_printk(DEV_DEBUG, fmt, ## __VA_ARGS__) +#define tsp_verb(fmt, ...) tsp_printk(DEV_VERB, fmt, ## __VA_ARGS__) + + +enum ist30xx_commands { + CMD_ENTER_UPDATE = 0x02, + CMD_EXIT_UPDATE = 0x03, + CMD_UPDATE_SENSOR = 0x04, + CMD_UPDATE_CONFIG = 0x05, + CMD_ENTER_REG_ACCESS = 0x07, + CMD_EXIT_REG_ACCESS = 0x08, + CMD_SET_TA_MODE = 0x0A, + CMD_START_SCAN = 0x0B, + CMD_ENTER_FW_UPDATE = 0x0C, + CMD_RUN_DEVICE = 0x0D, + CMD_SET_TEST_MODE = 0x0F, + + CMD_CALIBRATE = 0x11, + CMD_USE_IDLE = 0x12, + CMD_USE_DEBUG = 0x13, + CMD_ZVALUE_MODE = 0x15, + CMD_CHECK_CALIB = 0x1A, + CMD_SET_TEMPER_MODE = 0x1B, + CMD_SET_CALL_MODE = 0x1C, + + CMD_GET_COORD = 0x20, + + CMD_GET_CHIP_ID = 0x30, + CMD_GET_FW_VER = 0x31, + CMD_GET_CHECKSUM = 0x32, + CMD_GET_LCD_RESOLUTION = 0x33, + CMD_GET_TSP_CHNUM1 = 0x34, + CMD_GET_PARAM_VER = 0x35, + CMD_GET_CALIB_RESULT = 0x37, + CMD_GET_TSP_SWAP_INFO = 0x38, + CMD_GET_KEY_INFO1 = 0x39, + CMD_GET_KEY_INFO2 = 0x3A, + CMD_GET_KEY_INFO3 = 0x3B, + CMD_GET_TSP_CHNUM2 = 0x3C, + CMD_GET_TSP_DIRECTION = 0x3D, + + CMD_GET_TSP_VENDOR = 0x3E, + CMD_GET_TSP_PANNEL_TYPE = 0x40, + + CMD_GET_CHECKSUM_ALL = 0x41, +}; + +#define CMD_FW_UPDATE_MAGIC (0x85FDAE8A) + + +typedef struct _ALGR_INFO { + u32 scan_status; + u8 touch_cnt; + u8 intl_touch_cnt; + u16 status_flag; + + u16 raw_peak_min; + u16 raw_peak_max; + u16 flt_peak_max; + u16 adpt_threshold; + + u16 key_raw_data[6]; +} ALGR_INFO; + +typedef union { + struct { + u32 y : 10; + u32 w : 6; + u32 x : 10; + u32 id : 4; + u32 udmg : 2; + } bit_field; + u32 full_field; +} finger_info; + + +struct ist30xx_status { + int power; + int update; + int calib; + int calib_msg; + bool event_mode; + bool noise_mode; +}; + +struct ist30xx_fw { + u32 prev_core_ver; + u32 prev_param_ver; + u32 core_ver; + u32 param_ver; + u32 index; + u32 size; + u32 chksum; + u32 buf_size; + u8 * buf; +}; + +#define IST30XX_TAG_MAGIC "ISTV1TAG" +struct ist30xx_tags { + char magic1[8]; + u32 fw_addr; + u32 fw_size; + u32 flag_addr; + u32 flag_size; + u32 cfg_addr; + u32 cfg_size; + u32 sensor1_addr; + u32 sensor1_size; + u32 sensor2_addr; + u32 sensor2_size; + u32 sensor3_addr; + u32 sensor3_size; + u32 chksum; + u32 reserved2; + char magic2[8]; +}; + +#include "../../drivers/input/touchscreen/ist30xxb/ist30xxb_sec.h" +#include <linux/earlysuspend.h> + +struct tsp_dev_info{ + int gpio; +}; +struct ist30xx_data { + struct i2c_client * client; + struct input_dev * input_dev; + struct early_suspend early_suspend; + struct ist30xx_status status; + struct ist30xx_fw fw; + struct ist30xx_tags tags; +#if SEC_FACTORY_MODE + struct sec_factory sec; +#endif + u32 chip_id; + u32 tsp_type; + u32 num_fingers; + u32 num_keys; + u32 max_fingers; + u32 max_keys; + u32 irq_enabled; + finger_info fingers[IST30XX_MAX_MT_FINGERS]; + finger_info prev_fingers[IST30XX_MAX_MT_FINGERS]; + finger_info prev_keys[IST30XX_MAX_MT_FINGERS]; +}; + + +extern struct mutex ist30xx_mutex; +extern int ist30xx_dbg_level; + +void tsp_printk(int level, const char *fmt, ...); + +void ist30xx_enable_irq(struct ist30xx_data *data); +void ist30xx_disable_irq(struct ist30xx_data *data); + +void ist30xx_start(struct ist30xx_data *data); +int ist30xx_get_ver_info(struct ist30xx_data *data); +int ist30xx_init_touch_driver(struct ist30xx_data *data); + +int ist30xx_get_position(struct i2c_client *client, u32 *buf, u16 len); + +int ist30xx_read_cmd(struct i2c_client *client, u32 cmd, u32 *buf); +int ist30xx_write_cmd(struct i2c_client *client, u32 cmd, u32 val); + +int ist30xx_cmd_run_device(struct i2c_client *client); +int ist30xx_cmd_start_scan(struct i2c_client *client); +int ist30xx_cmd_calibrate(struct i2c_client *client); +int ist30xx_cmd_check_calib(struct i2c_client *client); +int ist30xx_cmd_update(struct i2c_client *client, int cmd); +int ist30xx_cmd_reg(struct i2c_client *client, int cmd); + +int ist30xx_power_on(void); +int ist30xx_power_off(void); +int ist30xx_reset(void); + +int ist30xx_internal_suspend(struct ist30xx_data *data); +int ist30xx_internal_resume(struct ist30xx_data *data); + +int ist30xx_init_factory_sysfs(void); +int ist30xx_init_system(void); + +#endif // __IST30XX_H__ diff --git a/include/linux/input/kxtj9.h b/include/linux/input/kxtj9.h new file mode 100644 index 00000000..d415579b --- /dev/null +++ b/include/linux/input/kxtj9.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 Kionix, Inc. + * Written by Chris Hudson <chudson@kionix.com> + * + * 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., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ + +#ifndef __KXTJ9_H__ +#define __KXTJ9_H__ + +#define KXTJ9_I2C_ADDR 0x0F + +struct kxtj9_platform_data { + unsigned int min_interval; /* minimum poll interval (in milli-seconds) */ + unsigned int init_interval; /* initial poll interval (in milli-seconds) */ + + /* + * By default, x is axis 0, y is axis 1, z is axis 2; these can be + * changed to account for sensor orientation within the host device. + */ + u8 axis_map_x; + u8 axis_map_y; + u8 axis_map_z; + + /* + * Each axis can be negated to account for sensor orientation within + * the host device. + */ + bool negate_x; + bool negate_y; + bool negate_z; + + /* CTRL_REG1: set resolution, g-range, data ready enable */ + /* Output resolution: 8-bit valid or 12-bit valid */ + #define RES_8BIT 0 + #define RES_12BIT (1 << 6) + u8 res_12bit; + /* Output g-range: +/-2g, 4g, or 8g */ + #define KXTJ9_G_2G 0 + #define KXTJ9_G_4G (1 << 3) + #define KXTJ9_G_8G (1 << 4) + u8 g_range; + + int (*init)(void); + void (*exit)(void); + int (*power_on)(void); + int (*power_off)(void); +}; +#endif /* __KXTJ9_H__ */ diff --git a/include/linux/input/lm8333.h b/include/linux/input/lm8333.h new file mode 100644 index 00000000..79f918c6 --- /dev/null +++ b/include/linux/input/lm8333.h @@ -0,0 +1,24 @@ +/* + * public include for LM8333 keypad driver - same license as driver + * Copyright (C) 2012 Wolfram Sang, Pengutronix <w.sang@pengutronix.de> + */ + +#ifndef _LM8333_H +#define _LM8333_H + +struct lm8333; + +struct lm8333_platform_data { + /* Keymap data */ + const struct matrix_keymap_data *matrix_data; + /* Active timeout before enter HALT mode in microseconds */ + unsigned active_time; + /* Debounce interval in microseconds */ + unsigned debounce_time; +}; + +extern int lm8333_read8(struct lm8333 *lm8333, u8 cmd); +extern int lm8333_write8(struct lm8333 *lm8333, u8 cmd, u8 val); +extern int lm8333_read_block(struct lm8333 *lm8333, u8 cmd, u8 len, u8 *buf); + +#endif /* _LM8333_H */ diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h new file mode 100644 index 00000000..27e06acc --- /dev/null +++ b/include/linux/input/matrix_keypad.h @@ -0,0 +1,103 @@ +#ifndef _MATRIX_KEYPAD_H +#define _MATRIX_KEYPAD_H + +#include <linux/types.h> +#include <linux/input.h> +#include <linux/of.h> + +#define MATRIX_MAX_ROWS 32 +#define MATRIX_MAX_COLS 32 + +#define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ + (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ + ((val) & 0xffff)) + +#define KEY_ROW(k) (((k) >> 24) & 0xff) +#define KEY_COL(k) (((k) >> 16) & 0xff) +#define KEY_VAL(k) ((k) & 0xffff) + +#define MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col)) + +/** + * struct matrix_keymap_data - keymap for matrix keyboards + * @keymap: pointer to array of uint32 values encoded with KEY() macro + * representing keymap + * @keymap_size: number of entries (initialized) in this keymap + * + * This structure is supposed to be used by platform code to supply + * keymaps to drivers that implement matrix-like keypads/keyboards. + */ +struct matrix_keymap_data { + const uint32_t *keymap; + unsigned int keymap_size; +}; + +/** + * struct matrix_keypad_platform_data - platform-dependent keypad data + * @keymap_data: pointer to &matrix_keymap_data + * @row_gpios: pointer to array of gpio numbers representing rows + * @col_gpios: pointer to array of gpio numbers reporesenting colums + * @num_row_gpios: actual number of row gpios used by device + * @num_col_gpios: actual number of col gpios used by device + * @col_scan_delay_us: delay, measured in microseconds, that is + * needed before we can keypad after activating column gpio + * @debounce_ms: debounce interval in milliseconds + * @clustered_irq: may be specified if interrupts of all row/column GPIOs + * are bundled to one single irq + * @clustered_irq_flags: flags that are needed for the clustered irq + * @active_low: gpio polarity + * @wakeup: controls whether the device should be set up as wakeup + * source + * @no_autorepeat: disable key autorepeat + * + * This structure represents platform-specific data that use used by + * matrix_keypad driver to perform proper initialization. + */ +struct matrix_keypad_platform_data { + const struct matrix_keymap_data *keymap_data; + + const unsigned int *row_gpios; + const unsigned int *col_gpios; + + unsigned int num_row_gpios; + unsigned int num_col_gpios; + + unsigned int col_scan_delay_us; + + /* key debounce interval in milli-second */ + unsigned int debounce_ms; + + unsigned int clustered_irq; + unsigned int clustered_irq_flags; + + bool active_low; + bool wakeup; + bool no_autorepeat; +}; + +int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data, + const char *keymap_name, + unsigned int rows, unsigned int cols, + unsigned short *keymap, + struct input_dev *input_dev); + +#ifdef CONFIG_OF +/** + * matrix_keypad_parse_of_params() - Read parameters from matrix-keypad node + * + * @dev: Device containing of_node + * @rows: Returns number of matrix rows + * @cols: Returns number of matrix columns + * @return 0 if OK, <0 on error + */ +int matrix_keypad_parse_of_params(struct device *dev, + unsigned int *rows, unsigned int *cols); +#else +static inline int matrix_keypad_parse_of_params(struct device *dev, + unsigned int *rows, unsigned int *cols) +{ + return -ENOSYS; +} +#endif /* CONFIG_OF */ + +#endif /* _MATRIX_KEYPAD_H */ diff --git a/include/linux/input/mms134s.h b/include/linux/input/mms134s.h new file mode 100644 index 00000000..c365bbd4 --- /dev/null +++ b/include/linux/input/mms134s.h @@ -0,0 +1,255 @@ +#ifndef _LINUX_MMS134S_TOUCH_H_ +#define _LINUX_MMS134S_TOUCH_H_ + +#define MMS_DEV_NAME "mms134s" + +//fw infor +#define MMS_FW_NAME "mms134s.fw" +#define MMS_FW_SIZE 20544 + + +/* Flag */ +#define TSP_SEC_FACTORY 0 +#define MMS_HAS_TOUCH_KEY 1 +#define FLASH_VERBOSE_DEBUG 0 + +#define MAX_SECTION_NUM 3 +#define MAX_FINGER_NUM 5 +#define MAX_WIDTH 30 +#define MAX_PRESSURE 255 +#define MAX_LOG_LENGTH 128 +#define FINGER_EVENT_SZ 6 +#define ESD_DETECT_COUNT 10 + +/* + * ISC_XFER_LEN - ISC unit transfer length. + * Give number of 2 power n, where n is between 2 and 10 + * i.e. 4, 8, 16 ,,, 1024 + */ +#define ISC_XFER_LEN 1024 +#define MMS_FLASH_PAGE_SZ 1024 +#define ISC_BLOCK_NUM (MMS_FLASH_PAGE_SZ / ISC_XFER_LEN) + +/* Registers */ +#define MMS_MODE_CONTROL 0x01 +#define MMS_THRESHOLD 0x05 +#define MMS_TX_NUM 0x0B +#define MMS_RX_NUM 0x0C +#define MMS_KEY_NUM 0x0D +#define MMS_EVENT_PKT_SZ 0x0F +#define MMS_EVENT_PKT 0x10 +#define MMS_UNIVERSAL_CMD 0xA0 +#define MMS_UNIVERSAL_RESULT_SZ 0xAE +#define MMS_UNIVERSAL_RESULT 0xAF +#define MMS_CMD_ENTER_ISC 0x5F +#define MMS_FW_VERSION 0xE1 +#define MMS_POWER_CONTROL 0xB0 + +/* Universal commands */ +#define MMS_CMD_SET_LOG_MODE 0x20 +#define MMS_UNIV_ENTER_TEST 0x40 +#define MMS_UNIV_CM_DELTA 0x41 +#define MMS_UNIV_CM_ABS 0x43 +#define MMS_UNIV_CM_JITTER 0x45 +#define MMS_UNIV_GET_DELTA_KEY 0x4A +#define MMS_UNIV_GET_ABS_KEY 0x4B +#define MMS_UNIV_GET_JITTER_KEY 0x4C +#define MMS_UNIV_EXIT_TEST 0x4F +#define MMS_UNIV_INTENSITY 0x70 +#define MMS_UNIV_REFERENCE 0x72 + +/* Event types */ +#define MMS_TEST_MODE 0X0C +#define MMS_LOG_EVENT 0x0D +#define MMS_NOTIFY_EVENT 0x0E +#define MMS_ERROR_EVENT 0x0F +#define MMS_INPUT_EVENT 0x10 +#define MMS_TOUCH_KEY_EVENT 0x40 + +#if TSP_SEC_FACTORY +#define TSP_CMD_STR_LEN 32 +#define TSP_CMD_RESULT_STR_LEN 512 +#define TSP_CMD_PARAM_NUM 8 +#define TSP_CMD_FULL_VER_LEN 9 +#endif + +enum { + SYS_TXNUM = 3, + SYS_RXNUM, + SYS_CLEAR, + SYS_ENABLE, + SYS_DISABLE, + SYS_INTERRUPT, + SYS_RESET, +}; + +enum { + GET_RX_NUM = 1, + GET_TX_NUM, + GET_EVENT_DATA, +}; + +enum { + LOG_TYPE_U08 = 2, + LOG_TYPE_S08, + LOG_TYPE_U16, + LOG_TYPE_S16, + LOG_TYPE_U32 = 8, + LOG_TYPE_S32, +}; + +enum { + ISC_ADDR = 0xD5, + ISC_CMD_READ_STATUS = 0xD9, + ISC_CMD_READ = 0x4000, + ISC_CMD_EXIT = 0x8200, + ISC_CMD_PAGE_ERASE = 0xC000, + ISC_CMD_ERASE = 0xC100, + ISC_PAGE_ERASE_DONE = 0x10000, + ISC_PAGE_ERASE_ENTER = 0x20000, +}; + +#if TSP_SEC_FACTORY +enum { + CMD_STATUS_WAITING = 0, + CMD_STATUS_RUNNING, + CMD_STATUS_OK, + CMD_STATUS_FAIL, + CMD_STATUS_NOT_APPLICABLE, +}; + +enum { + FW_FROM_BUILT_IN = 0, + FW_FROM_UMS, +}; + +struct mms_fac_data { + struct device *fac_tsp_dev; +#if MMS_HAS_TOUCH_KEY + struct device *fac_key_dev; +#endif + struct list_head cmd_list_head; + u8 cmd_state; + char cmd[TSP_CMD_STR_LEN]; + char cmd_buff[TSP_CMD_STR_LEN]; + int cmd_param[TSP_CMD_PARAM_NUM]; + char cmd_result[TSP_CMD_RESULT_STR_LEN]; + struct mutex cmd_lock; + bool cmd_is_running; + + u8 xnode_num; + u8 ynode_num; +#if MMS_HAS_TOUCH_KEY + u8 keynode_num; +#endif +/* + u8 num_xnode; + u8 num_ynode; + u16 num_nodes; + u16 *reference; + s16 *delta; + + u32 ref_max_data; + u32 ref_min_data; + s16 delta_max_data; + u16 delta_max_node;*/ +}; +#endif /* TSP_SEC_FACTORY */ +#if 0 +struct mms_platform_data { + unsigned int max_x; + unsigned int max_y; + unsigned long irqflags; + int gpio_int; + int vdd_regulator_volt; + char const *inkernel_fw_name; + char const *ums_fw_name; +}; +#endif + +struct mms_info { + struct mms_platform_data *pdata; + struct i2c_client *client; + struct input_dev *input_dev; + char phys[32]; + struct notifier_block nb; + int irq; + bool enabled; + bool *finger_state; +#if TSP_SEC_FACTORY + struct mms_fac_data *fac_data; +#endif +}; + +struct mms_bin_hdr { + char tag[8]; + u16 core_version; + u16 section_num; + u16 contains_full_binary; + u16 reserved0; + u32 binary_offset; + u32 binary_length; + u32 extention_offset; + u32 reserved1; +} __attribute__ ((packed)); + +struct mms_fw_img { + u16 type; + u16 version; + u16 start_page; + u16 end_page; + u32 offset; + u32 length; +} __attribute__ ((packed)); + +struct isc_packet { + u8 cmd; + u32 addr; + u8 data[0]; +} __attribute__ ((packed)); + + +#ifndef CONFIG_TOUCHSCREEN_MMS134S +extern struct tsp_callbacks *charger_callbacks; +struct tsp_callbacks { + void (*inform_charger)(struct tsp_callbacks *tsp_cb, bool mode); +}; +#endif + +struct mms_platform_data { + int max_x; + int max_y; + + bool invert_x; + bool invert_y; + + int gpio_sda; + int gpio_scl; + int gpio_int; + int gpio_resetb; +#ifndef CONFIG_TOUCHSCREEN_MMS134S + int gpio_vdd_en; +#else + int gpio_lcd_type; +#endif + int (*mux_fw_flash)(bool to_gpios); + void (*vdd_on)(bool); + int (*is_vdd_on)(void); + void (*register_cb)(struct tsp_callbacks *); + const char *fw_name; + char const *inkernel_fw_name; + char const *ums_fw_name; + + bool use_touchkey; + bool use_surface_touch; + const u8 *touchkey_keycode; + int check_module_type; + void (*tkey_led_vdd_on)(bool); + const char *tsp_ic_name; +}; +#ifndef CONFIG_TOUCHSCREEN_MMS134S +extern struct class *sec_class; +extern int touch_is_pressed; +#endif + +#endif /* _LINUX_MMS134S_TOUCH_H_ */ diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h new file mode 100644 index 00000000..1b1dfa80 --- /dev/null +++ b/include/linux/input/mt.h @@ -0,0 +1,125 @@ +#ifndef _INPUT_MT_H +#define _INPUT_MT_H + +/* + * Input Multitouch Library + * + * Copyright (c) 2010 Henrik Rydberg + * + * 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. + */ + +#include <linux/input.h> + +#define TRKID_MAX 0xffff + +#define INPUT_MT_POINTER 0x0001 /* pointer device, e.g. trackpad */ +#define INPUT_MT_DIRECT 0x0002 /* direct device, e.g. touchscreen */ +#define INPUT_MT_DROP_UNUSED 0x0004 /* drop contacts not seen in frame */ +#define INPUT_MT_TRACK 0x0008 /* use in-kernel tracking */ +#define INPUT_MT_SEMI_MT 0x0010 /* semi-mt device, finger count handled manually */ + +/** + * struct input_mt_slot - represents the state of an input MT slot + * @abs: holds current values of ABS_MT axes for this slot + * @frame: last frame at which input_mt_report_slot_state() was called + * @key: optional driver designation of this slot + */ +struct input_mt_slot { + int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; + unsigned int frame; + unsigned int key; +}; + +/** + * struct input_mt - state of tracked contacts + * @trkid: stores MT tracking ID for the next contact + * @num_slots: number of MT slots the device uses + * @slot: MT slot currently being transmitted + * @flags: input_mt operation flags + * @frame: increases every time input_mt_sync_frame() is called + * @red: reduced cost matrix for in-kernel tracking + * @slots: array of slots holding current values of tracked contacts + */ +struct input_mt { + int trkid; + int num_slots; + int slot; + unsigned int flags; + unsigned int frame; + int *red; + struct input_mt_slot slots[]; +}; + +static inline void input_mt_set_value(struct input_mt_slot *slot, + unsigned code, int value) +{ + slot->abs[code - ABS_MT_FIRST] = value; +} + +static inline int input_mt_get_value(const struct input_mt_slot *slot, + unsigned code) +{ + return slot->abs[code - ABS_MT_FIRST]; +} + +static inline bool input_mt_is_active(const struct input_mt_slot *slot) +{ + return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; +} + +static inline bool input_mt_is_used(const struct input_mt *mt, + const struct input_mt_slot *slot) +{ + return slot->frame == mt->frame; +} + +int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, + unsigned int flags); +void input_mt_destroy_slots(struct input_dev *dev); + +static inline int input_mt_new_trkid(struct input_mt *mt) +{ + return mt->trkid++ & TRKID_MAX; +} + +static inline void input_mt_slot(struct input_dev *dev, int slot) +{ + input_event(dev, EV_ABS, ABS_MT_SLOT, slot); +} + +static inline bool input_is_mt_value(int axis) +{ + return axis >= ABS_MT_FIRST && axis <= ABS_MT_LAST; +} + +static inline bool input_is_mt_axis(int axis) +{ + return axis == ABS_MT_SLOT || input_is_mt_value(axis); +} + +void input_mt_report_slot_state(struct input_dev *dev, + unsigned int tool_type, bool active); + +void input_mt_report_finger_count(struct input_dev *dev, int count); +void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); + +void input_mt_sync_frame(struct input_dev *dev); + +/** + * struct input_mt_pos - contact position + * @x: horizontal coordinate + * @y: vertical coordinate + */ +struct input_mt_pos { + s16 x, y; +}; + +int input_mt_assign_slots(struct input_dev *dev, int *slots, + const struct input_mt_pos *pos, int num_pos); + +int input_mt_get_slot_by_key(struct input_dev *dev, int key); + +#endif diff --git a/include/linux/input/navpoint.h b/include/linux/input/navpoint.h new file mode 100644 index 00000000..45050eb3 --- /dev/null +++ b/include/linux/input/navpoint.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2012 Paul Parsons <lost.distance@yahoo.com> + * + * 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. + */ + +struct navpoint_platform_data { + int port; /* PXA SSP port for pxa_ssp_request() */ + int gpio; /* GPIO for power on/off */ +}; diff --git a/include/linux/input/pixcir_ts.h b/include/linux/input/pixcir_ts.h new file mode 100644 index 00000000..7163d91c --- /dev/null +++ b/include/linux/input/pixcir_ts.h @@ -0,0 +1,10 @@ +#ifndef _PIXCIR_I2C_TS_H +#define _PIXCIR_I2C_TS_H + +struct pixcir_ts_platform_data { + int (*attb_read_val)(void); + int x_max; + int y_max; +}; + +#endif diff --git a/include/linux/input/pmic8xxx-keypad.h b/include/linux/input/pmic8xxx-keypad.h new file mode 100644 index 00000000..5f1e2f9a --- /dev/null +++ b/include/linux/input/pmic8xxx-keypad.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2011, Code Aurora Forum. 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 and + * only 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. + */ + +#ifndef __PMIC8XXX_KEYPAD_H__ +#define __PMIC8XXX_KEYPAD_H__ + +#include <linux/input/matrix_keypad.h> + +#define PM8XXX_KEYPAD_DEV_NAME "pm8xxx-keypad" + +/** + * struct pm8xxx_keypad_platform_data - platform data for keypad + * @keymap_data - matrix keymap data + * @input_name - input device name + * @input_phys_device - input device name + * @num_cols - number of columns of keypad + * @num_rows - number of row of keypad + * @debounce_ms - debounce period in milliseconds + * @scan_delay_ms - scan delay in milliseconds + * @row_hold_ns - row hold period in nanoseconds + * @wakeup - configure keypad as wakeup + * @rep - enable or disable key repeat bit + */ +struct pm8xxx_keypad_platform_data { + const struct matrix_keymap_data *keymap_data; + + const char *input_name; + const char *input_phys_device; + + unsigned int num_cols; + unsigned int num_rows; + unsigned int rows_gpio_start; + unsigned int cols_gpio_start; + + unsigned int debounce_ms; + unsigned int scan_delay_ms; + unsigned int row_hold_ns; + + bool wakeup; + bool rep; +}; + +#endif /*__PMIC8XXX_KEYPAD_H__ */ diff --git a/include/linux/input/pmic8xxx-pwrkey.h b/include/linux/input/pmic8xxx-pwrkey.h new file mode 100644 index 00000000..6d2974e5 --- /dev/null +++ b/include/linux/input/pmic8xxx-pwrkey.h @@ -0,0 +1,31 @@ +/* Copyright (c) 2010-2011, Code Aurora Forum. 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 and + * only 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. + */ + +#ifndef __PMIC8XXX_PWRKEY_H__ +#define __PMIC8XXX_PWRKEY_H__ + +#define PM8XXX_PWRKEY_DEV_NAME "pm8xxx-pwrkey" + +/** + * struct pm8xxx_pwrkey_platform_data - platform data for pwrkey driver + * @pull up: power on register control for pull up/down configuration + * @kpd_trigger_delay_us: time delay for power key state change interrupt + * trigger. + * @wakeup: configure power key as wakeup source + */ +struct pm8xxx_pwrkey_platform_data { + bool pull_up; + u32 kpd_trigger_delay_us; + u32 wakeup; +}; + +#endif /* __PMIC8XXX_PWRKEY_H__ */ diff --git a/include/linux/input/samsung-keypad.h b/include/linux/input/samsung-keypad.h new file mode 100644 index 00000000..f25619bf --- /dev/null +++ b/include/linux/input/samsung-keypad.h @@ -0,0 +1,43 @@ +/* + * Samsung Keypad platform data definitions + * + * Copyright (C) 2010 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 __SAMSUNG_KEYPAD_H +#define __SAMSUNG_KEYPAD_H + +#include <linux/input/matrix_keypad.h> + +#define SAMSUNG_MAX_ROWS 8 +#define SAMSUNG_MAX_COLS 8 + +/** + * struct samsung_keypad_platdata - Platform device data for Samsung Keypad. + * @keymap_data: pointer to &matrix_keymap_data. + * @rows: number of keypad row supported. + * @cols: number of keypad col supported. + * @no_autorepeat: disable key autorepeat. + * @wakeup: controls whether the device should be set up as wakeup source. + * @cfg_gpio: configure the GPIO. + * + * Initialisation data specific to either the machine or the platform + * for the device driver to use or call-back when configuring gpio. + */ +struct samsung_keypad_platdata { + const struct matrix_keymap_data *keymap_data; + unsigned int rows; + unsigned int cols; + bool no_autorepeat; + bool wakeup; + + void (*cfg_gpio)(unsigned int rows, unsigned int cols); +}; + +#endif /* __SAMSUNG_KEYPAD_H */ diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h new file mode 100644 index 00000000..5d253cd9 --- /dev/null +++ b/include/linux/input/sh_keysc.h @@ -0,0 +1,15 @@ +#ifndef __SH_KEYSC_H__ +#define __SH_KEYSC_H__ + +#define SH_KEYSC_MAXKEYS 64 + +struct sh_keysc_info { + enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3, + SH_KEYSC_MODE_4, SH_KEYSC_MODE_5, SH_KEYSC_MODE_6 } mode; + int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ + int delay; + int kycr2_delay; + int keycodes[SH_KEYSC_MAXKEYS]; /* KEYIN * KEYOUT */ +}; + +#endif /* __SH_KEYSC_H__ */ diff --git a/include/linux/input/sparse-keymap.h b/include/linux/input/sparse-keymap.h new file mode 100644 index 00000000..52db6206 --- /dev/null +++ b/include/linux/input/sparse-keymap.h @@ -0,0 +1,62 @@ +#ifndef _SPARSE_KEYMAP_H +#define _SPARSE_KEYMAP_H + +/* + * Copyright (c) 2009 Dmitry Torokhov + * + * 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. + */ + +#define KE_END 0 /* Indicates end of keymap */ +#define KE_KEY 1 /* Ordinary key/button */ +#define KE_SW 2 /* Switch (predetermined value) */ +#define KE_VSW 3 /* Switch (value supplied at runtime) */ +#define KE_IGNORE 4 /* Known entry that should be ignored */ +#define KE_LAST KE_IGNORE + +/** + * struct key_entry - keymap entry for use in sparse keymap + * @type: Type of the key entry (KE_KEY, KE_SW, KE_VSW, KE_END); + * drivers are allowed to extend the list with their own + * private definitions. + * @code: Device-specific data identifying the button/switch + * @keycode: KEY_* code assigned to a key/button + * @sw.code: SW_* code assigned to a switch + * @sw.value: Value that should be sent in an input even when KE_SW + * switch is toggled. KE_VSW switches ignore this field and + * expect driver to supply value for the event. + * + * This structure defines an entry in a sparse keymap used by some + * input devices for which traditional table-based approach is not + * suitable. + */ +struct key_entry { + int type; /* See KE_* above */ + u32 code; + union { + u16 keycode; /* For KE_KEY */ + struct { /* For KE_SW, KE_VSW */ + u8 code; + u8 value; /* For KE_SW, ignored by KE_VSW */ + } sw; + }; +}; + +struct key_entry *sparse_keymap_entry_from_scancode(struct input_dev *dev, + unsigned int code); +struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev, + unsigned int code); +int sparse_keymap_setup(struct input_dev *dev, + const struct key_entry *keymap, + int (*setup)(struct input_dev *, struct key_entry *)); +void sparse_keymap_free(struct input_dev *dev); + +void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *ke, + unsigned int value, bool autorelease); + +bool sparse_keymap_report_event(struct input_dev *dev, unsigned int code, + unsigned int value, bool autorelease); + +#endif /* _SPARSE_KEYMAP_H */ diff --git a/include/linux/input/tca8418_keypad.h b/include/linux/input/tca8418_keypad.h new file mode 100644 index 00000000..e71a85dc --- /dev/null +++ b/include/linux/input/tca8418_keypad.h @@ -0,0 +1,44 @@ +/* + * TCA8418 keypad platform support + * + * Copyright (C) 2011 Fuel7, Inc. All rights reserved. + * + * Author: Kyle Manna <kyle.manna@fuel7.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License v2 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., 59 Temple Place - Suite 330, + * Boston, MA 021110-1307, USA. + * + * If you can't comply with GPLv2, alternative licensing terms may be + * arranged. Please contact Fuel7, Inc. (http://fuel7.com/) for proprietary + * alternative licensing inquiries. + */ + +#ifndef _TCA8418_KEYPAD_H +#define _TCA8418_KEYPAD_H + +#include <linux/types.h> +#include <linux/input/matrix_keypad.h> + +#define TCA8418_I2C_ADDR 0x34 +#define TCA8418_NAME "tca8418_keypad" + +struct tca8418_keypad_platform_data { + const struct matrix_keymap_data *keymap_data; + unsigned rows; + unsigned cols; + bool rep; + bool irq_is_gpio; +}; + +#endif diff --git a/include/linux/input/ti_am335x_tsc.h b/include/linux/input/ti_am335x_tsc.h new file mode 100644 index 00000000..49269a2a --- /dev/null +++ b/include/linux/input/ti_am335x_tsc.h @@ -0,0 +1,23 @@ +#ifndef __LINUX_TI_AM335X_TSC_H +#define __LINUX_TI_AM335X_TSC_H + +/** + * struct tsc_data Touchscreen wire configuration + * @wires: Wires refer to application modes + * i.e. 4/5/8 wire touchscreen support + * on the platform. + * @x_plate_resistance: X plate resistance. + * @steps_to_configure: The sequencer supports a total of + * 16 programmable steps. + * A step configured to read a single + * co-ordinate value, can be applied + * more number of times for better results. + */ + +struct tsc_data { + int wires; + int x_plate_resistance; + int steps_to_configure; +}; + +#endif diff --git a/include/linux/input/tps6507x-ts.h b/include/linux/input/tps6507x-ts.h new file mode 100644 index 00000000..ab144031 --- /dev/null +++ b/include/linux/input/tps6507x-ts.h @@ -0,0 +1,24 @@ +/* linux/i2c/tps6507x-ts.h + * + * Functions to access TPS65070 touch screen chip. + * + * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com) + * + * + * For licencing details see kernel-base/COPYING + */ + +#ifndef __LINUX_I2C_TPS6507X_TS_H +#define __LINUX_I2C_TPS6507X_TS_H + +/* Board specific touch screen initial values */ +struct touchscreen_init_data { + int poll_period; /* ms */ + int vref; /* non-zero to leave vref on */ + __u16 min_pressure; /* min reading to be treated as a touch */ + __u16 vendor; + __u16 product; + __u16 version; +}; + +#endif /* __LINUX_I2C_TPS6507X_TS_H */ diff --git a/include/linux/input/zinitix_bt541_ts.h b/include/linux/input/zinitix_bt541_ts.h new file mode 100644 index 00000000..17d213de --- /dev/null +++ b/include/linux/input/zinitix_bt541_ts.h @@ -0,0 +1,311 @@ +/* + * + * Zinitix bt541 touch driver + * + * Copyright (C) 2013 Samsung Electronics Co.Ltd + * + * 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 _LINUX_BT541_TS_H +#define _LINUX_BT541_TS_H + +#define TS_DRVIER_VERSION "1.0.18_1" + +#define BT541_TS_DEVICE "bt541_ts" + +#define zinitix_debug_msg(fmt, args...) \ + do { \ + if (m_ts_debug_mode) \ + printk(KERN_INFO "bt541_ts[%-18s:%5d] " fmt, \ + __func__, __LINE__, ## args); \ + } while (0); + +#define zinitix_printk(fmt, args...) \ + do { \ + printk(KERN_INFO "bt541_ts[%-18s:%5d] " fmt, \ + __func__, __LINE__, ## args); \ + } while (0); + +extern struct class *sec_class; + +/* SPEC V0.4 + * DND 30%, HF DND 25% + */ + +static const u16 (*dnd_v_diff)[10], (*dnd_h_diff)[9]; +static const u16 (*pdnd_max)[10], (*pdnd_min)[10]; +static const u16 (*hfdnd_max)[10], (*hfdnd_min)[10]; + +static const u16 tsp_dnd_v_diff[18][10] = { + {4240, 4570, 4430, 4510, 4470, 4460, 4410, 4460, 4430, 4670}, + {2200, 2510, 2360, 2410, 2350, 2350, 2310, 2400, 2390, 2730}, + {2420, 2910, 2750, 2850, 2800, 2810, 2750, 2780, 2750, 3120}, + {2510, 2060, 2200, 2180, 2260, 2250, 2290, 2210, 2180, 2340}, + {2090, 2490, 2470, 2490, 2460, 2480, 2430, 2430, 2410, 2920}, + {2760, 2420, 2290, 2320, 2360, 2350, 2380, 2330, 2300, 2360}, + {2270, 2210, 2410, 2420, 2400, 2410, 2340, 2350, 2340, 2990}, + {2920, 2680, 2280, 2310, 2360, 2360, 2410, 2370, 2320, 2530}, + {2530, 2120, 2370, 2390, 2340, 2340, 2270, 2270, 2280, 3120}, + {3220, 2860, 2350, 2380, 2450, 2460, 2520, 2520, 2440, 2700}, + {2850, 2220, 2410, 2400, 2330, 2330, 2260, 2240, 2270, 3410}, + {4570, 3350, 3270, 3320, 3390, 3420, 3450, 3480, 3380, 2660}, + {3700, 2650, 2790, 2780, 2710, 2720, 2640, 2580, 2630, 4710}, + {2530, 6280, 6440, 6580, 6650, 6080, 6550, 6370, 6060, 5740}, + {4580, 2840, 2890, 2890, 2880, 2930, 2920, 2920, 2900, 2900}, + {2700, 2240, 2290, 2380, 2370, 2120, 2270, 2220, 2140, 3350}, + {4800, 4390, 4410, 4430, 4500, 4560, 4620, 4610, 4610, 4110}, + {0, 0, 0, 0, 4060, 0, 0, 4040, 0, 0} +}; + +static const u16 tsp_dnd_h_diff[19][9] = { + {2070, 2080, 2050, 2100, 2070, 2090, 2060, 2190, 2220}, + {2300, 2160, 2090, 2080, 2080, 2090, 2090, 2210, 2060}, + {2070, 2080, 2060, 2110, 2080, 2090, 2060, 2200, 2330}, + {2490, 2170, 2120, 2080, 2070, 2090, 2060, 2230, 2070}, + {2060, 2090, 2110, 2130, 2080, 2080, 2100, 2250, 2470}, + {2530, 2100, 2130, 2120, 2080, 2100, 2110, 2270, 2080}, + {2200, 2160, 2170, 2140, 2080, 2090, 2140, 2310, 2600}, + {2660, 2120, 2180, 2130, 2080, 2110, 2140, 2320, 2080}, + {2420, 2350, 2210, 2180, 2090, 2090, 2180, 2360, 2790}, + {2840, 2160, 2220, 2140, 2090, 2130, 2190, 2340, 2080}, + {2490, 2410, 2250, 2210, 2090, 2090, 2190, 2420, 3090}, + {3170, 2200, 2240, 2140, 2090, 2130, 2210, 2380, 2090}, + {2120, 2150, 2290, 2210, 2080, 2100, 2180, 2490, 3980}, + {4280, 2280, 2280, 2150, 2080, 2160, 2250, 2450, 2140}, + {4520, 2120, 2140, 2090, 2580, 2620, 2080, 2150, 2440}, + {2790, 2100, 2140, 2100, 2530, 2610, 2080, 2130, 4230}, + {3710, 2080, 2070, 2100, 2830, 2810, 2060, 2090, 3010}, + {3290, 2090, 2050, 2090, 2770, 2870, 2050, 2080, 3500}, + {0, 0, 0, 0, 0, 0, 0, 2100, 0} +}; + +static const u16 tsp_pdnd_max[19][10] = { + {15937, 15897, 15961, 16001, 15853, 15675, 15993, 16031, 15824, 15618}, + {18235, 18491, 18525, 18572, 18608, 18347, 18526, 18559, 18408, 18400}, + {18050, 18004, 18184, 18132, 18282, 17921, 18192, 18065, 17958, 17468}, + {18446, 19007, 18840, 19042, 18969, 19102, 18935, 18972, 18711, 18809}, + {19029, 18964, 19006, 19135, 19199, 19083, 19162, 19172, 18901, 18402}, + {18925, 19418, 19509, 19631, 19704, 19616, 19575, 19556, 19336, 19257}, + {19499, 19932, 19719, 19927, 19917, 19948, 19954, 19929, 19572, 18963}, + {19436, 20144, 20213, 20350, 20396, 20322, 20284, 20297, 19962, 20023}, + {20440, 20880, 20479, 20798, 20705, 20891, 20628, 20717, 20279, 19630}, + {19961, 20760, 20858, 20955, 21091, 21065, 20933, 20913, 20535, 20526}, + {21210, 21551, 21281, 21446, 21530, 21468, 21439, 21389, 21054, 19835}, + {20225, 21365, 21584, 21803, 21771, 21746, 21664, 21611, 21237, 21186}, + {22822, 22633, 22773, 23041, 23047, 23007, 23011, 22937, 22499, 20572}, + {21235, 23763, 23600, 23606, 23752, 23645, 23680, 22900, 23201, 23190}, + {21549, 19124, 19261, 19311, 19287, 19936, 19278, 19214, 19150, 19625}, + {18951, 18317, 18329, 18452, 18528, 19271, 18390, 18391, 18248, 20687}, + {19657, 18063, 17934, 18128, 18091, 19018, 18141, 18190, 18153, 19169}, + {16869, 15549, 15567, 15517, 15558, 16483, 15440, 15474, 15473, 17061}, + {0, 0, 0, 0, 16320, 0, 0, 16485, 0, 0} +}; + +static const u16 tsp_pdnd_min[19][10] = { + {6245, 6205, 6269, 6309, 6161, 5983, 6301, 6339, 6132, 5926}, + {8543, 8799, 8833, 8880, 8916, 8655, 8834, 8867, 8716, 8708}, + {8358, 8312, 8492, 8440, 8590, 8229, 8500, 8373, 8266, 7776}, + {8754, 9315, 9148, 9350, 9277, 9410, 9243, 9280, 9019, 9117}, + {9337, 9272, 9314, 9443, 9507, 9391, 9470, 9480, 9209, 8710}, + {9233, 9726, 9817, 9939, 10012, 9924, 9883, 9864, 9644, 9565}, + {9807, 10240, 10027, 10235, 10225, 10256, 10262, 10237, 9880, 9271}, + {9744, 10452, 10521, 10658, 10704, 10630, 10592, 10605, 10270, 10331}, + {10748, 11188, 10787, 11106, 11013, 11199, 10936, 11025, 10587, 9938}, + {10269, 11068, 11166, 11263, 11399, 11373, 11241, 11221, 10843, 10834}, + {11518, 11859, 11589, 11754, 11838, 11776, 11747, 11697, 11362, 10143}, + {10533, 11673, 11892, 12111, 12079, 12054, 11972, 11919, 11545, 11494}, + {13130, 12941, 13081, 13349, 13355, 13315, 13319, 13245, 12807, 10880}, + {11543, 14071, 13908, 13914, 14060, 13953, 13988, 13208, 13509, 13498}, + {11857, 9432, 9569, 9619, 9595, 10244, 9586, 9522, 9458, 9933}, + {9259, 8625, 8637, 8760, 8836, 9579, 8698, 8699, 8556, 10995}, + {9965, 8371, 8242, 8436, 8399, 9326, 8449, 8498, 8461, 9477}, + {7177, 5857, 5875, 5825, 5866, 6791, 5748, 5782, 5781, 7369}, + {0, 0, 0, 0, 6628, 0, 0, 6793, 0, 0} +}; + +static const u16 tsp_hfdnd_max[19][10] = { + {13200, 13180, 13156, 13185, 13191, 13077, 13251, 13304, 13133, 12948}, + {15022, 15249, 15165, 15275, 15256, 15036, 15194, 15299, 15088, 15167}, + {14604, 14574, 14556, 14602, 14615, 14377, 14618, 14640, 14464, 14179}, + {14625, 15089, 14875, 14986, 14967, 14657, 14928, 14994, 14782, 14862}, + {14685, 14722, 14670, 14767, 14823, 14431, 14754, 14761, 14549, 14103}, + {13997, 14618, 14525, 14647, 14688, 14250, 14548, 14583, 14381, 14438}, + {14380, 14654, 14365, 14516, 14581, 14061, 14475, 14432, 14246, 13581}, + {13423, 14266, 14189, 14285, 14398, 13784, 14248, 14242, 14023, 14077}, + {14011, 14489, 13985, 14081, 14112, 13515, 14118, 14067, 13857, 12863}, + {12675, 13840, 13763, 13841, 13965, 13210, 13838, 13845, 13629, 13719}, + {13886, 14202, 13790, 13880, 14036, 13135, 13894, 13926, 13675, 12131}, + {11912, 13693, 13639, 13686, 13795, 12833, 13675, 13695, 13467, 13654}, + {14550, 14026, 13921, 14011, 14052, 13037, 14004, 14082, 13834, 11338}, + {11256, 14049, 14051, 14053, 14141, 12977, 14037, 14083, 13873, 14323}, + {16314, 13046, 12950, 13040, 13035, 12000, 12865, 13046, 13008, 13288}, + {13148, 12499, 12372, 12527, 12526, 11499, 12516, 12484, 12473, 15475}, + {13521, 11411, 11279, 11323, 11349, 10502, 11386, 11398, 11437, 12669}, + {11680, 10124, 10012, 10015, 10011, 9395 , 10032, 10022, 10056, 12041}, + {0, 0, 0, 0, 9899, 0, 0, 9884 , 0, 0} +}; + +static const u16 tsp_hfdnd_min[19][10] = { + {7208, 7188, 7164, 7193, 7199, 7085, 7259, 7312, 7141, 6956}, + {9030, 9257, 9173, 9283, 9264, 9044, 9202, 9307, 9096, 9175}, + {8612, 8582, 8564, 8610, 8623, 8385, 8626, 8648, 8472, 8187}, + {8633, 9097, 8883, 8994, 8975, 8665, 8936, 9002, 8790, 8870}, + {8693, 8730, 8678, 8775, 8831, 8439, 8762, 8769, 8557, 8111}, + {8005, 8626, 8533, 8655, 8696, 8258, 8556, 8591, 8389, 8446}, + {8388, 8662, 8373, 8524, 8589, 8069, 8483, 8440, 8254, 7589}, + {7431, 8274, 8197, 8293, 8406, 7792, 8256, 8250, 8031, 8085}, + {8019, 8497, 7993, 8089, 8120, 7523, 8126, 8075, 7865, 6871}, + {6683, 7848, 7771, 7849, 7973, 7218, 7846, 7853, 7637, 7727}, + {7894, 8210, 7798, 7888, 8044, 7143, 7902, 7934, 7683, 6139}, + {5920, 7701, 7647, 7694, 7803, 6841, 7683, 7703, 7475, 7662}, + {8558, 8034, 7929, 8019, 8060, 7045, 8012, 8090, 7842, 5346}, + {5264, 8057, 8059, 8061, 8149, 6985, 8045, 8091, 7881, 8331}, + {10322, 7054, 6958, 7048, 7043, 6008, 6873, 7054, 7016, 7296}, + {7156, 6507, 6380, 6535, 6534, 5507, 6524, 6492, 6481, 9483}, + {7529, 5419, 5287, 5331, 5357, 4510, 5394, 5406, 5445, 6677}, + {5688, 4132, 4020, 4023, 4019, 3403, 4040, 4030, 4064, 6049}, + {0, 0, 0, 0, 3907, 0, 0, 3892, 0, 0} +}; + +static const u16 assy_dnd_v_diff[18][10] = { + {4360, 4580, 4510, 4580, 4540, 4520, 4500, 4540, 4540, 4720}, + {2360, 2590, 2510, 2550, 2520, 2500, 2490, 2530, 2500, 2800}, + {2430, 2870, 2710, 2750, 2740, 2720, 2710, 2720, 2680, 3040}, + {2410, 2040, 2140, 2130, 2160, 2160, 2160, 2140, 2120, 2320}, + {2040, 2460, 2400, 2410, 2400, 2410, 2390, 2400, 2380, 2830}, + {2640, 2390, 2240, 2260, 2290, 2260, 2270, 2260, 2250, 2320}, + {2190, 2160, 2360, 2330, 2330, 2360, 2360, 2340, 2370, 2890}, + {2760, 2640, 2230, 2260, 2270, 2250, 2260, 2260, 2230, 2460}, + {2430, 2150, 2280, 2270, 2260, 2280, 2270, 2270, 2290, 2990}, + {3040, 2780, 2310, 2310, 2340, 2320, 2330, 2320, 2320, 2610}, + {2730, 2240, 2250, 2260, 2230, 2250, 2240, 2260, 2260, 3200}, + {4000, 3010, 2980, 2980, 3000, 3040, 2980, 2990, 2990, 2590}, + {3320, 2480, 2530, 2520, 2520, 2510, 2530, 2510, 2550, 4160}, + {2410, 5480, 5520, 5540, 5610, 4890, 5550, 5520, 5360, 5030}, + {4210, 2810, 2790, 2770, 2740, 2810, 2760, 2770, 2780, 2590}, + {2680, 2070, 2090, 2120, 2140, 2260, 2070, 2080, 2050, 3010}, + {4840, 4470, 4450, 4460, 4490, 4570, 4570, 4580, 4600, 4220}, + {0, 0, 0, 0, 5480, 0, 0, 5390, 0, 0} +}; + +static const u16 assy_dnd_h_diff[19][9] = { + {2070, 2080, 2040, 2060, 2040, 2070, 2040, 2140, 2180}, + {2160, 2120, 2070, 2090, 2050, 2050, 2060, 2130, 2050}, + {2080, 2070, 2030, 2060, 2050, 2050, 2040, 2110, 2300}, + {2370, 2190, 2050, 2060, 2050, 2050, 2040, 2140, 2080}, + {2060, 2070, 2030, 2050, 2050, 2060, 2030, 2160, 2370}, + {2410, 2100, 2050, 2050, 2040, 2050, 2030, 2170, 2090}, + {2170, 2250, 2050, 2050, 2060, 2060, 2040, 2180, 2480}, + {2500, 2060, 2040, 2070, 2040, 2050, 2030, 2160, 2060}, + {2390, 2460, 2050, 2070, 2060, 2040, 2030, 2190, 2630}, + {2670, 2060, 2050, 2060, 2040, 2040, 2020, 2170, 2080}, + {2420, 2510, 2050, 2090, 2060, 2050, 2030, 2170, 2850}, + {2910, 2060, 2050, 2060, 2050, 2040, 2030, 2170, 2110}, + {2100, 2080, 2050, 2080, 2030, 2070, 2020, 2170, 3470}, + {3710, 2050, 2040, 2090, 2030, 2060, 2030, 2130, 2150}, + {4180, 2070, 2030, 2060, 2710, 2710, 2050, 2050, 2490}, + {2780, 2060, 2050, 2070, 2650, 2660, 2050, 2060, 3840}, + {3510, 2070, 2030, 2070, 3040, 2970, 2060, 2060, 2870}, + {3140, 2070, 2030, 2080, 2960, 2970, 2040, 2050, 3250}, + {0, 0, 0, 0, 0, 0, 0, 2060, 0} +}; + +static const u16 assy_pdnd_max[19][10] = { + {15111, 15032, 15006, 14992, 14958, 14920, 14982, 15022, 14865, 14750}, + {17494, 17625, 17528, 17560, 17502, 17487, 17528, 17584, 17449, 17439}, + {17112, 17040, 17019, 17003, 16984, 17020, 17001, 17056, 16938, 16680}, + {17535, 17906, 17710, 17742, 17751, 17763, 17769, 17770, 17633, 17689}, + {17938, 17928, 17833, 17828, 17865, 17869, 17854, 17884, 17715, 17374}, + {17946, 18354, 18257, 18233, 18290, 18273, 18272, 18255, 18095, 18152}, + {18555, 18777, 18463, 18522, 18561, 18527, 18453, 18498, 18317, 17843}, + {18374, 18900, 18842, 18810, 18926, 18874, 18869, 18842, 18684, 18709}, + {19192, 19608, 19057, 19089, 19167, 19140, 19087, 19097, 18938, 18291}, + {18743, 19399, 19337, 19339, 19426, 19398, 19366, 19361, 19221, 19287}, + {19768, 20170, 19666, 19665, 19763, 19698, 19709, 19687, 19543, 18710}, + {19011, 19934, 19885, 19942, 19963, 19995, 19927, 19963, 19811, 19888}, + {21104, 20974, 20909, 20940, 21013, 21019, 20946, 20955, 20792, 19328}, + {19726, 21476, 21441, 21471, 21582, 21584, 21521, 21490, 21361, 21507}, + {20165, 17917, 17863, 17889, 17933, 18607, 17951, 17969, 18034, 18495}, + {17946, 17124, 17076, 17141, 17215, 17806, 17174, 17195, 17256, 19081}, + {18601, 17063, 16973, 16976, 17016, 18066, 17098, 17138, 17179, 18084}, + {15794, 14644, 14550, 14544, 14520, 15494, 14536, 14555, 14594, 15849}, + {0, 0, 0, 0, 16745, 0, 0, 16809, 0, 0} +}; + +static const u16 assy_pdnd_min[19][10] = { + {6427, 6348, 6322, 6308, 6274, 6236, 6298, 6338, 6181, 6066}, + {8810, 8941, 8844, 8876, 8818, 8803, 8844, 8900, 8765, 8755}, + {8428, 8356, 8335, 8319, 8300, 8336, 8317, 8372, 8254, 7996}, + {8851, 9222, 9026, 9058, 9067, 9079, 9085, 9086, 8949, 9005}, + {9254, 9244, 9149, 9144, 9181, 9185, 9170, 9200, 9031, 8690}, + {9262, 9670, 9573, 9549, 9606, 9589, 9588, 9571, 9411, 9468}, + {9871, 10093, 9779, 9838, 9877, 9843, 9769, 9814, 9633, 9159}, + {9690, 10216, 10158, 10126, 10242, 10190, 10185, 10158, 10000, 10025}, + {10508, 10924, 10373, 10405, 10483, 10456, 10403, 10413, 10254, 9607}, + {10059, 10715, 10653, 10655, 10742, 10714, 10682, 10677, 10537, 10603}, + {11084, 11486, 10982, 10981, 11079, 11014, 11025, 11003, 10859, 10026}, + {10327, 11250, 11201, 11258, 11279, 11311, 11243, 11279, 11127, 11204}, + {12420, 12290, 12225, 12256, 12329, 12335, 12262, 12271, 12108, 10644}, + {11042, 12792, 12757, 12787, 12898, 12900, 12837, 12806, 12677, 12823}, + {11481, 9233, 9179, 9205, 9249, 9923, 9267, 9285, 9350, 9811}, + {9262, 8440, 8392, 8457, 8531, 9122, 8490, 8511, 8572, 10397}, + {9917, 8379, 8289, 8292, 8332, 9382, 8414, 8454, 8495, 9400}, + {7110, 5960, 5866, 5860, 5836, 6810, 5852, 5871, 5910, 7165}, + {0, 0, 0, 0, 8061, 0, 0, 8125, 0, 0} +}; + +static const u16 assy_hfdnd_max[19][10] = { + {12329, 12231, 12233, 12168, 12101, 11994, 12099, 12117, 12066, 11885}, + {14026, 14173, 14149, 14203, 14051, 13904, 14048, 14118, 13995, 13991}, + {13535, 13448, 13492, 13435, 13364, 13158, 13362, 13422, 13371, 13076}, + {13525, 13908, 13773, 13748, 13607, 13359, 13614, 13683, 13594, 13624}, + {13529, 13458, 13497, 13412, 13322, 13002, 13361, 13356, 13319, 12900}, + {12938, 13345, 13318, 13228, 13118, 12804, 13164, 13181, 13159, 13155}, + {13161, 13238, 13143, 13017, 12936, 12528, 12967, 12981, 13009, 12343}, + {12311, 12866, 12931, 12808, 12697, 12235, 12758, 12752, 12826, 12778}, + {12713, 12974, 12706, 12548, 12492, 11945, 12544, 12543, 12609, 11660}, + {11509, 12393, 12451, 12281, 12219, 11655, 12310, 12321, 12390, 12401}, + {12423, 12834, 12348, 12238, 12156, 11512, 12250, 12273, 12328, 11006}, + {10777, 12081, 12187, 12011, 11965, 11204, 12034, 12097, 12151, 12258}, + {12630, 12269, 12297, 12179, 12138, 11316, 12232, 12250, 12323, 10178}, + {9960, 12143, 12316, 12161, 12124, 11154, 12183, 12207, 12296, 12666}, + {14247, 11617, 11682, 11494, 11435, 10666, 11540, 11582, 11843, 11931}, + {11744, 11133, 11209, 11045, 11011, 10232, 11097, 11136, 11409, 13644}, + {12017, 10235, 10238, 10071, 10043, 9421, 10141, 10188, 10387, 11286}, + {10392, 9075, 9048, 8908, 8899, 8472, 8956, 8974, 9119, 10674}, + {0, 0, 0, 0, 9685, 0, 0, 9767, 0, 0} +}; + +static const u16 assy_hfdnd_min[19][10] = { + {7119, 7021, 7023, 6958, 6891, 6784, 6889, 6907, 6856, 6675}, + {8816, 8963, 8939, 8993, 8841, 8694, 8838, 8908, 8785, 8781}, + {8325, 8238, 8282, 8225, 8154, 7948, 8152, 8212, 8161, 7866}, + {8315, 8698, 8563, 8538, 8397, 8149, 8404, 8473, 8384, 8414}, + {8319, 8248, 8287, 8202, 8112, 7792, 8151, 8146, 8109, 7690}, + {7728, 8135, 8108, 8018, 7908, 7594, 7954, 7971, 7949, 7945}, + {7951, 8028, 7933, 7807, 7726, 7318, 7757, 7771, 7799, 7133}, + {7101, 7656, 7721, 7598, 7487, 7025, 7548, 7542, 7616, 7568}, + {7503, 7764, 7496, 7338, 7282, 6735, 7334, 7333, 7399, 6450}, + {6299, 7183, 7241, 7071, 7009, 6445, 7100, 7111, 7180, 7191}, + {7213, 7624, 7138, 7028, 6946, 6302, 7040, 7063, 7118, 5796}, + {5567, 6871, 6977, 6801, 6755, 5994, 6824, 6887, 6941, 7048}, + {7420, 7059, 7087, 6969, 6928, 6106, 7022, 7040, 7113, 4968}, + {4750, 6933, 7106, 6951, 6914, 5944, 6973, 6997, 7086, 7456}, + {9037, 6407, 6472, 6284, 6225, 5456, 6330, 6372, 6633, 6721}, + {6534, 5923, 5999, 5835, 5801, 5022, 5887, 5926, 6199, 8434}, + {6807, 5025, 5028, 4861, 4833, 4211, 4931, 4978, 5177, 6076}, + {5182, 3865, 3838, 3698, 3689, 3262, 3746, 3764, 3909, 5464}, + {0, 0, 0, 0, 4475, 0, 0, 4557, 0, 0} +}; + +#endif /* LINUX_BT531_TS_H */ diff --git a/include/linux/input/zt7554_platform_data.h b/include/linux/input/zt7554_platform_data.h new file mode 100755 index 00000000..a2d1e228 --- /dev/null +++ b/include/linux/input/zt7554_platform_data.h @@ -0,0 +1,30 @@ +/* + * Zinitix zt7554 touchscreen driver - Platform Data + * + * Copyright (C) 2013 Samsung Electronics Co.Ltd + * + * Default path : linux/input/zt7554_platform_data.h + * + */ + +#ifndef _LINUX_ZT7554_TOUCH_H +#define _LINUX_ZT7554_TOUCH_H + +struct zt7554_ts_platform_data { + int gpio_int; + int gpio_scl; + int gpio_sda; + int gpio_ldo_en; + int (*tsp_power)(struct i2c_client *client, int on, int gpio_ctrl_pin); + u32 x_resolution; + u32 y_resolution; + const char *fw_name; + const char *ext_fw_name; + u32 page_size; + u32 orientation; + u32 tsp_supply_type; + int gpio_ctrl_pin; +}; + +#endif + |
