diff options
Diffstat (limited to 'include/linux/input')
-rwxr-xr-x | include/linux/input/atmel_maxtouch_ts.h | 61 | ||||
-rw-r--r-- | include/linux/input/ft5x06_ts.h | 77 | ||||
-rw-r--r-- | include/linux/input/gen_vkeys.h | 24 | ||||
-rw-r--r-- | include/linux/input/qpnp-power-on.h | 96 | ||||
-rw-r--r-- | include/linux/input/synaptics_dsx_v2.h | 108 |
5 files changed, 366 insertions, 0 deletions
diff --git a/include/linux/input/atmel_maxtouch_ts.h b/include/linux/input/atmel_maxtouch_ts.h new file mode 100755 index 000000000000..adc359008c42 --- /dev/null +++ b/include/linux/input/atmel_maxtouch_ts.h @@ -0,0 +1,61 @@ +/* + * Atmel maXTouch Touchscreen driver + * + * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Linux foundation chooses to take subject only to the GPLv2 license terms, + * and distributes only under these terms. + * + * 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 __LINUX_ATMEL_MAXTOUCH_TS_H +#define __LINUX_ATMEL_MAXTOUCH_TS_H + +#include <linux/types.h> + +/* The platform data for the Atmel maXTouch touchscreen driver */ +struct mxt_platform_data { + unsigned long irqflags; + unsigned long resetflags; + int gpio_reset; + int gpio_irq; + int gpio_i2cmode; + u8 t19_num_keys; + const unsigned int *t19_keymap; + int t15_num_keys; + const unsigned int *t15_keymap; + const char *cfg_name; + const char *fw_name; + bool ignore_crc; + + const struct mxt_config_info *config_array; + size_t config_array_size; + + /* touch panel's minimum and maximum coordinates */ + u32 panel_minx; + u32 panel_maxx; + u32 panel_miny; + u32 panel_maxy; + + /* display's minimum and maximum coordinates */ + u32 disp_minx; + u32 disp_maxx; + u32 disp_miny; + u32 disp_maxy; + + int *key_codes; + u8 bl_addr; + + u8(*read_chg) (void); + int (*init_hw) (bool); + int (*power_on) (bool); +}; + +#endif /* __LINUX_ATMEL_MAXTOUCH_TS_H */ diff --git a/include/linux/input/ft5x06_ts.h b/include/linux/input/ft5x06_ts.h new file mode 100644 index 000000000000..ad95957d9189 --- /dev/null +++ b/include/linux/input/ft5x06_ts.h @@ -0,0 +1,77 @@ +/* + * + * FocalTech ft5x06 TouchScreen driver header file. + * + * Copyright (c) 2010 Focal tech Ltd. + * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. + * + * 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_FT5X06_TS_H__ +#define __LINUX_FT5X06_TS_H__ + +#define FT5X06_ID 0x55 +#define FT5X16_ID 0x0A +#define FT5X36_ID 0x14 +#define FT6X06_ID 0x06 +#define FT6X36_ID 0x36 + +struct fw_upgrade_info { + bool auto_cal; + u16 delay_aa; + u16 delay_55; + u8 upgrade_id_1; + u8 upgrade_id_2; + u16 delay_readid; + u16 delay_erase_flash; +}; + +struct ft5x06_gesture_platform_data { + int gesture_enable_to_set; /* enable/disable gesture */ + int in_pocket; /* whether in pocket mode or not */ + struct device *dev; + struct class *gesture_class; + struct ft5x06_ts_data *data; +}; + +struct ft5x06_ts_platform_data { + struct fw_upgrade_info info; + const char *name; + const char *fw_name; + u32 irqflags; + u32 irq_gpio; + u32 irq_gpio_flags; + u32 reset_gpio; + u32 reset_gpio_flags; + u32 family_id; + u32 x_max; + u32 y_max; + u32 x_min; + u32 y_min; + u32 panel_minx; + u32 panel_miny; + u32 panel_maxx; + u32 panel_maxy; + u32 group_id; + u32 hard_rst_dly; + u32 soft_rst_dly; + u32 num_max_touches; + bool fw_vkey_support; + bool no_force_update; + bool i2c_pull_up; + bool ignore_id_check; + bool gesture_support; + bool resume_in_workqueue; + int (*power_init)(bool); + int (*power_on)(bool); +}; + +#endif diff --git a/include/linux/input/gen_vkeys.h b/include/linux/input/gen_vkeys.h new file mode 100644 index 000000000000..a58158d703bd --- /dev/null +++ b/include/linux/input/gen_vkeys.h @@ -0,0 +1,24 @@ +/* Copyright (c) 2013, The Linux Foundation. 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 __GEN_VKEYS_ +struct vkeys_platform_data { + const char *name; + int disp_maxx; + int disp_maxy; + int panel_maxx; + int panel_maxy; + int *keycodes; + int num_keys; + int y_offset; +}; +#endif diff --git a/include/linux/input/qpnp-power-on.h b/include/linux/input/qpnp-power-on.h new file mode 100644 index 000000000000..a2624ab57826 --- /dev/null +++ b/include/linux/input/qpnp-power-on.h @@ -0,0 +1,96 @@ +/* Copyright (c) 2012-2015, 2017, The Linux Foundation. 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 QPNP_PON_H +#define QPNP_PON_H + +#include <linux/errno.h> + +/** + * enum pon_trigger_source: List of PON trigger sources + * %PON_SMPL: PON triggered by SMPL - Sudden Momentary Power Loss + * %PON_RTC: PON triggered by RTC alarm + * %PON_DC_CHG: PON triggered by insertion of DC charger + * %PON_USB_CHG: PON triggered by insertion of USB + * %PON_PON1: PON triggered by other PMIC (multi-PMIC option) + * %PON_CBLPWR_N: PON triggered by power-cable insertion + * %PON_KPDPWR_N: PON triggered by long press of the power-key + */ +enum pon_trigger_source { + PON_SMPL = 1, + PON_RTC, + PON_DC_CHG, + PON_USB_CHG, + PON_PON1, + PON_CBLPWR_N, + PON_KPDPWR_N, +}; + +/** + * enum pon_power_off_type: Possible power off actions to perform + * %PON_POWER_OFF_RESERVED: Reserved, not used + * %PON_POWER_OFF_WARM_RESET: Reset the MSM but not all PMIC peripherals + * %PON_POWER_OFF_SHUTDOWN: Shutdown the MSM and PMIC completely + * %PON_POWER_OFF_HARD_RESET: Reset the MSM and all PMIC peripherals + */ +enum pon_power_off_type { + PON_POWER_OFF_RESERVED = 0x00, + PON_POWER_OFF_WARM_RESET = 0x01, + PON_POWER_OFF_SHUTDOWN = 0x04, + PON_POWER_OFF_HARD_RESET = 0x07, + PON_POWER_OFF_MAX_TYPE = 0x10, +}; + +enum pon_restart_reason { + PON_RESTART_REASON_UNKNOWN = 0x00, + PON_RESTART_REASON_RECOVERY = 0x01, + PON_RESTART_REASON_BOOTLOADER = 0x02, + PON_RESTART_REASON_RTC = 0x03, + PON_RESTART_REASON_DMVERITY_CORRUPTED = 0x04, + PON_RESTART_REASON_DMVERITY_ENFORCE = 0x05, + PON_RESTART_REASON_KEYS_CLEAR = 0x06, +}; + +#ifdef CONFIG_INPUT_QPNP_POWER_ON +int qpnp_pon_system_pwr_off(enum pon_power_off_type type); +int qpnp_pon_is_warm_reset(void); +int qpnp_pon_trigger_config(enum pon_trigger_source pon_src, bool enable); +int qpnp_pon_wd_config(bool enable); +int qpnp_pon_set_restart_reason(enum pon_restart_reason reason); +bool qpnp_pon_check_hard_reset_stored(void); + +#else +static int qpnp_pon_system_pwr_off(enum pon_power_off_type type) +{ + return -ENODEV; +} +static inline int qpnp_pon_is_warm_reset(void) { return -ENODEV; } +static inline int qpnp_pon_trigger_config(enum pon_trigger_source pon_src, + bool enable) +{ + return -ENODEV; +} +int qpnp_pon_wd_config(bool enable) +{ + return -ENODEV; +} +static inline int qpnp_pon_set_restart_reason(enum pon_restart_reason reason) +{ + return -ENODEV; +} +static inline bool qpnp_pon_check_hard_reset_stored(void) +{ + return false; +} +#endif + +#endif diff --git a/include/linux/input/synaptics_dsx_v2.h b/include/linux/input/synaptics_dsx_v2.h new file mode 100644 index 000000000000..9df212c3cdfe --- /dev/null +++ b/include/linux/input/synaptics_dsx_v2.h @@ -0,0 +1,108 @@ +/* + * Synaptics DSX touchscreen driver + * + * Copyright (C) 2012 Synaptics Incorporated + * + * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> + * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> + * Copyright (c) 2015-2016, The Linux Foundation. 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 _SYNAPTICS_DSX_H_ +#define _SYNAPTICS_DSX_H_ + +#define PLATFORM_DRIVER_NAME "synaptics_dsx" +#define I2C_DRIVER_NAME "synaptics_dsx_i2c" +#define SPI_DRIVER_NAME "synaptics_dsx_spi" + +/* + * struct synaptics_dsx_cap_button_map - 0d button map + * @nbuttons: number of 0d buttons + * @map: pointer to array of button types + */ +struct synaptics_dsx_cap_button_map { + unsigned char nbuttons; + unsigned char *map; +}; + +/* + * struct synaptics_virtual_key_map - 2d button map + * @nkeys: number of virtual keys + * @map: pointer to array of virtual keys + */ +struct synaptics_rmi4_virtual_key_map { + unsigned char nkeys; + unsigned int *map; +}; + +/* + * struct synaptics_dsx_board_data - dsx board data + * @x_flip: x flip flag + * @y_flip: y flip flag + * @irq_gpio: attention interrupt gpio + * @power_gpio: power switch gpio + * @power_on_state: power switch active state + * @reset_gpio: reset gpio + * @reset_on_state: reset active state + * @irq_flags: irq flags + * @panel_x: x-axis resolution of display panel + * @panel_y: y-axis resolution of display panel + * @power_delay_ms: delay time to wait after power-on + * @reset_delay_ms: delay time to wait after reset + * @reset_active_ms: reset active time + * @byte_delay_us: delay time between two bytes of SPI data + * @block_delay_us: delay time between two SPI transfers + * @regulator_name: pointer to name of regulator + * @gpio_config: pointer to gpio configuration function + * @cap_button_map: pointer to 0d button map + */ +struct synaptics_dsx_board_data { + bool x_flip; + bool y_flip; + bool swap_axes; + int irq_gpio; + u32 irq_flags; + int power_gpio; + int power_on_state; + int reset_gpio; + u32 reset_flags; + int reset_on_state; + unsigned int panel_x; + unsigned int panel_y; + unsigned int power_delay_ms; + unsigned int reset_delay_ms; + unsigned int reset_active_ms; + unsigned int byte_delay_us; + unsigned int block_delay_us; + unsigned char *regulator_name; + unsigned int package_id; + int (*gpio_config)(int gpio, bool configure, int dir, int state); + struct synaptics_dsx_cap_button_map *cap_button_map; + struct synaptics_rmi4_virtual_key_map *virtual_key_map; + u32 panel_minx; + u32 panel_miny; + u32 panel_maxx; + u32 panel_maxy; + u32 disp_minx; + u32 disp_miny; + u32 disp_maxx; + u32 disp_maxy; + u32 config_id; + bool disable_gpios; + bool detect_device; + bool bypass_packrat_id_check; + bool resume_in_workqueue; + const char *fw_name; +}; + +#endif |