summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/elliptic/elliptic_data_io.h162
-rw-r--r--include/elliptic/elliptic_mixer_controls.h188
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/input/qpnp-power-on.h18
-rw-r--r--include/linux/input/synaptics_dsx.h214
-rw-r--r--include/linux/input/synaptics_tcm.h74
-rw-r--r--include/linux/input/tp_common.h15
-rw-r--r--include/linux/mdss_io_util.h16
-rw-r--r--include/linux/mfd/spk-id.h33
-rw-r--r--include/linux/power_supply.h7
-rw-r--r--include/media/Kbuild1
-rw-r--r--include/media/msm_cam_sensor.h11
-rw-r--r--include/soc/qcom/camera2.h50
-rw-r--r--include/sound/apr_audio-v2.h65
-rw-r--r--include/sound/apr_elliptic.h49
-rw-r--r--include/sound/q6afe-v2.h3
-rw-r--r--include/uapi/linux/input-event-codes.h4
-rw-r--r--include/uapi/media/msm_cam_sensor.h32
-rw-r--r--include/uapi/media/msm_camera.h4
-rw-r--r--include/uapi/media/msm_camsensor_sdk.h52
-rw-r--r--include/uapi/media/msmb_camera.h4
21 files changed, 1005 insertions, 0 deletions
diff --git a/include/elliptic/elliptic_data_io.h b/include/elliptic/elliptic_data_io.h
new file mode 100644
index 000000000000..f48c1bc497ee
--- /dev/null
+++ b/include/elliptic/elliptic_data_io.h
@@ -0,0 +1,162 @@
+/**
+* Copyright Elliptic Labs 2015-2016
+* Copyright (C) 2019 XiaoMi, Inc.
+*
+*/
+
+#pragma once
+
+#include <linux/types.h>
+#include <linux/kfifo.h>
+#include <linux/spinlock.h>
+#include <linux/wait.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/workqueue.h>
+
+#define ELLIPTIC_DATA_IO_AP_TO_DSP 0
+#define ELLIPTIC_DATA_IO_DSP_TO_AP 1
+
+#define ELLIPTIC_DATA_IO_READ_OK 0
+#define ELLIPTIC_DATA_IO_READ_BUSY 1
+#define ELLIPTIC_DATA_IO_READ_CANCEL 2
+
+#define ELLIPTIC_MSG_BUF_SIZE 512
+
+/* wake source timeout in ms*/
+#define ELLIPTIC_WAKEUP_TIMEOUT 250
+
+#define ELLIPTIC_DATA_FIFO_SIZE (PAGE_SIZE)
+
+#define ULTRASOUND_RX_PORT_ID 0
+#define ULTRASOUND_TX_PORT_ID 1
+
+/* Elliptic Labs UltraSound Module */
+#define ELLIPTIC_ULTRASOUND_DISABLE 0
+#define ELLIPTIC_ULTRASOUND_ENABLE 1
+#define ELLIPTIC_ULTRASOUND_SET_PARAMS 2
+#define ELLIPTIC_ULTRASOUND_GET_PARAMS 3
+#define ELLIPTIC_ULTRASOUND_RAMP_DOWN 4
+
+/** Param ID definition */
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_ENGINE_DATA 3
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_CALIBRATION_DATA 11
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_ENGINE_VERSION 12
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_BUILD_BRANCH 14
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_CALIBRATION_V2_DATA 15
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_SENSORHUB 16
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_DIAGNOSTICS_DATA 17
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_TAG 18
+#define ELLIPTIC_ULTRASOUND_PARAM_ID_ML_DATA 19
+
+#define ELLIPTIC_DATA_READ_BUSY 0
+#define ELLIPTIC_DATA_READ_OK 1
+#define ELLIPTIC_DATA_READ_CANCEL 2
+
+#define ELLIPTIC_ALL_DEVICES -1
+#define ELLIPTIC_DEVICE_0 0
+#define ELLIPTIC_DEVICE_1 1
+
+/** 512 byte APR payload */
+#define ELLIPTIC_GET_PARAMS_SIZE 128
+/** System config size is 96 bytes */
+/* #define ELLIPTIC_SET_PARAMS_SIZE 128 */
+#define ELLIPTIC_SET_PARAMS_SIZE 114
+
+enum elliptic_message_id {
+ ELLIPTIC_MESSAGE_PAYLOAD, /* Input to AP*/
+ ELLIPTIC_MESSAGE_RAW, /* Output from AP*/
+ ELLIPTIC_MESSAGE_CALIBRATION,
+ ELLIPTIC_MESSAGE_CALIBRATION_V2,
+ ELLIPTIC_MESSAGE_DIAGNOSTICS,
+ ELLIPTIC_MAX_MESSAGE_IDS
+};
+
+typedef enum {
+ ELLIPTIC_DATA_PUSH_FROM_KERNEL,
+ ELLIPTIC_DATA_PUSH_FROM_USERSPACE
+} elliptic_data_push_t;
+
+struct elliptic_data {
+ /* wake lock timeout */
+ unsigned int wakeup_timeout;
+
+ /* members for top half interrupt handling */
+ struct kfifo fifo_isr;
+ spinlock_t fifo_isr_spinlock;
+ wait_queue_head_t fifo_isr_not_empty;
+ struct mutex user_buffer_lock;
+
+ /* buffer to swap data from isr fifo to userspace */
+ uint8_t isr_swap_buffer[ELLIPTIC_MSG_BUF_SIZE];
+
+ atomic_t abort_io;
+
+ /* debug counters, reset between open/close */
+ uint32_t isr_fifo_discard;
+
+ /* debug counters, persistent */
+ uint32_t isr_fifo_discard_total;
+ uint32_t userspace_read_total;
+ uint32_t isr_write_total;
+
+};
+
+/* Elliptic IO module API (implemented by IO module)*/
+
+int elliptic_data_io_initialize(void);
+int elliptic_data_io_cleanup(void);
+
+int32_t elliptic_data_io_write(uint32_t message_id, const char *data,
+ size_t data_size);
+
+int32_t elliptic_data_io_transact(uint32_t message_id, const char *data,
+ size_t data_size, char *output_data, size_t output_data_size);
+
+
+/* Elliptic driver API (implemented by main driver)*/
+int elliptic_data_initialize(struct elliptic_data *,
+ size_t max_queue_size, unsigned int wakeup_timeout, int id);
+
+int elliptic_data_cleanup(struct elliptic_data *);
+
+void elliptic_data_reset_debug_counters(struct elliptic_data *);
+void elliptic_data_update_debug_counters(struct elliptic_data *);
+void elliptic_data_print_debug_counters(struct elliptic_data *);
+
+/* Called from elliptic device read */
+size_t elliptic_data_pop(struct elliptic_data *,
+ char __user *buffer, size_t buffer_size);
+
+/* Used for cancelling a blocking read */
+void elliptic_data_cancel(struct elliptic_data *);
+
+/* Called from IO module*/
+int elliptic_data_push(int deviceid, const char *buffer, size_t buffer_size, elliptic_data_push_t);
+
+/* Writes to io module and user space control */
+int32_t elliptic_data_write(uint32_t message_id,
+ const char *data, size_t data_size);
+
+/* Opens port */
+int elliptic_open_port(int portid);
+
+/* Closes port */
+int elliptic_close_port(int portid);
+
+/* Opens port */
+int elliptic_io_open_port(int portid);
+
+/* Closes port */
+int elliptic_io_close_port(int portid);
+
+/* Create device node for userspace io driver*/
+int elliptic_userspace_io_driver_init(void);
+void elliptic_userspace_io_driver_exit(void);
+
+/* Create device node for userspace io driver*/
+int elliptic_userspace_ctrl_driver_init(void);
+void elliptic_userspace_ctrl_driver_exit(void);
+int32_t elliptic_userspace_ctrl_write(uint32_t message_id,
+ const char *data, size_t data_size);
+
diff --git a/include/elliptic/elliptic_mixer_controls.h b/include/elliptic/elliptic_mixer_controls.h
new file mode 100644
index 000000000000..771d3aea9c11
--- /dev/null
+++ b/include/elliptic/elliptic_mixer_controls.h
@@ -0,0 +1,188 @@
+#pragma once
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <linux/types.h>
+
+
+#define ELLIPTIC_OBJ_ID_CALIBRATION_DATA 1
+#define ELLIPTIC_OBJ_ID_VERSION_INFO 2
+#define ELLIPTIC_OBJ_ID_BRANCH_INFO 3
+#define ELLIPTIC_OBJ_ID_CALIBRATION_V2_DATA 4
+#define ELLIPTIC_OBJ_ID_DIAGNOSTICS_DATA 5
+#define ELLIPTIC_OBJ_ID_TAG_INFO 6
+#define ELLIPTIC_OBJ_ID_ML_DATA 7
+
+#define ELLIPTIC_SYSTEM_CONFIGURATION_SIZE 96
+#define ELLIPTIC_CALIBRATION_DATA_SIZE 64
+#define ELLIPTIC_CALIBRATION_V2_DATA_SIZE 448
+#define ELLIPTIC_DIAGNOSTICS_DATA_SIZE 448
+#define ELLIPTIC_DIAGNOSTICS_U32_DATA_VALUES (ELLIPTIC_DIAGNOSTICS_DATA_SIZE>>2)
+#define ELLIPTIC_SENSOR_DATA_SIZE 68
+#define ELLIPTIC_SENSOR_U32_DATA_VALUES (ELLIPTIC_SENSOR_DATA_SIZE>>2)
+#define ELLIPTIC_VERSION_INFO_SIZE 16
+#define ELLIPTIC_BRANCH_INFO_SIZE 32
+#define ELLIPTIC_BRANCH_INFO_MAX_SIZE 128
+#define ELLIPTIC_TAG_INFO_SIZE 32
+#define ELLIPTIC_ML_DATA_SIZE 432
+
+#define ELLIPTIC_ULTRASOUND_DISABLE 0
+#define ELLIPTIC_ULTRASOUND_ENABLE 1
+#define ELLIPTIC_ULTRASOUND_SET_PARAMS 2
+#define ELLIPTIC_ULTRASOUND_GET_PARAMS 3
+#define ELLIPTIC_ULTRASOUND_RAMP_DOWN 4
+
+/** register */
+#define ELLIPTIC_CALIBRATION 1
+/** bits */
+#define ELLIPTIC_CALIBRATION_STATE 0
+#define ELLIPTIC_CALIBRATION_PROFILE 1
+#define ELLIPTIC_ULTRASOUND_GAIN 2
+
+/** custom settings */
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_COUNT 16
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_MAX_VALUE 0x7FFFFFFF
+
+
+/** register */
+#define ELLIPTIC_SYSTEM_CONFIGURATION 0
+/** bits */
+#define ELLIPTIC_SYSTEM_CONFIGURATION_LATENCY 0
+#define ELLIPTIC_SYSTEM_CONFIGURATION_SENSITIVITY 1
+#define ELLIPTIC_SYSTEM_CONFIGURATION_SPEAKER_SCALING 2
+#define ELLIPTIC_SYSTEM_CONFIGURATION_MICROPHONE_INDEX 3
+#define ELLIPTIC_SYSTEM_CONFIGURATION_OPERATION_MODE 4
+#define ELLIPTIC_SYSTEM_CONFIGURATION_OPERATION_MODE_FLAGS 5
+#define ELLIPTIC_SYSTEM_CONFIGURATION_LOG_LEVEL 6
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_0 7
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_1 8
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_2 9
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_3 10
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_4 11
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_5 12
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_6 13
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_7 14
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_8 15
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_9 16
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_10 17
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_11 18
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_12 19
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_13 20
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_14 21
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_15 22
+
+#define ELLIPTIC_SYSTEM_CONFIGURATION_SUSPEND 23
+#define ELLIPTIC_SYSTEM_CONFIGURATION_INPUT_ENABLED 24
+#define ELLIPTIC_SYSTEM_CONFIGURATION_OUTPUT_ENABLED 25
+#define ELLIPTIC_SYSTEM_CONFIGURATION_EXTERNAL_EVENT 26
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CALIBRATION_METHOD 27
+#define ELLIPTIC_SYSTEM_CONFIGURATION_DEBUG_MODE 28
+#define ELLIPTIC_SYSTEM_CONFIGURATION_NUMBER_OF_RUNS 29
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CONTEXT 30
+#define ELLIPTIC_SYSTEM_CONFIGURATION_CAPTURE 31
+#define ELLIPTIC_SYSTEM_CONFIGURATION_INPUT_CHANNELS 32
+
+#define ELLIPTIC_SYSTEM_CONFIGURATION_MAX_CONTEXT_VALUE 0x7FFFFFFF
+
+
+struct elliptic_engine_version_info {
+ uint32_t major;
+ uint32_t minor;
+ uint32_t build;
+ uint32_t revision;
+};
+
+struct elliptic_shared_data_block {
+ uint32_t object_id;
+ size_t size;
+ void *buffer;
+};
+
+struct elliptic_shared_data_block *elliptic_get_shared_obj(uint32_t
+ object_id);
+
+unsigned int elliptic_add_platform_controls(void *platform);
+
+void elliptic_set_calibration_data(uint8_t *calib_data, size_t size);
+
+enum elliptic_system_configuration_parameter_type {
+
+ ESCPT_SPEAKER_SCALING = 1,
+ ESCPT_CHANNEL_SENSITIVITY,
+ ESCPT_LATENCY,
+ ESCPT_MICROPHONE_INDEX,
+ ESCPT_OPERATION_MODE,
+ ESCPT_OPERATION_MODE_FLAGS,
+ ESCPT_COMPONENT_GAIN_CHANGE,
+ ESCPT_CALIBRATION_STATE,
+ ESCPT_ENGINE_VERSION,
+ ESCPT_CALIBRATION_PROFILE,
+ ESCPT_ULTRASOUND_GAIN,
+ ESCPT_LOG_LEVEL,
+ ESCPT_BUILD_BRANCH,
+
+ ESCPT_FSELECTION,
+ ESCPT_ENGINE_DIAGNOSTICS,
+ ESCPT_ENGINE_CUSTOM_SETTING_0,
+ ESCPT_ENGINE_CUSTOM_SETTING_1,
+ ESCPT_ENGINE_CUSTOM_SETTING_2,
+ ESCPT_ENGINE_CUSTOM_SETTING_3,
+ ESCPT_ENGINE_CUSTOM_SETTING_4,
+ ESCPT_ENGINE_CUSTOM_SETTING_5,
+ ESCPT_ENGINE_CUSTOM_SETTING_6,
+ ESCPT_ENGINE_CUSTOM_SETTING_7,
+ ESCPT_ENGINE_CUSTOM_SETTING_8,
+ ESCPT_ENGINE_CUSTOM_SETTING_9,
+ ESCPT_ENGINE_CUSTOM_SETTING_10,
+ ESCPT_ENGINE_CUSTOM_SETTING_11,
+ ESCPT_ENGINE_CUSTOM_SETTING_12,
+ ESCPT_ENGINE_CUSTOM_SETTING_13,
+ ESCPT_ENGINE_CUSTOM_SETTING_14,
+ ESCPT_ENGINE_CUSTOM_SETTING_15,
+ ESCPT_SUSPEND,
+ ESCPT_INPUT_ENABLED,
+ ESCPT_OUTPUT_ENABLED,
+ ESCPT_EXTERNAL_EVENT,
+ ESCPT_ENGINE_TAG,
+ ESCPT_CALIBRATION_METHOD,
+ ESCPT_DEBUG_MODE,
+ ESCPT_NUMBER_OF_RUNS,
+ ESCPT_CONTEXT,
+ ESCPT_CAPTURE,
+ ESCPT_INPUT_CHANNELS,
+};
+
+struct elliptic_system_configuration_parameters_cache {
+ int32_t speaker_scaling[2];
+ int32_t sensitivity;
+ int32_t latency;
+ int32_t microphone_index;
+ int32_t operation_mode;
+ int32_t operation_mode_flags;
+ int32_t component_gain_change;
+ int32_t calibration_state;
+ int32_t engine_version;
+ int32_t calibration_profile;
+ int32_t ultrasound_gain;
+ int32_t log_level;
+ int32_t custom_settings[ELLIPTIC_SYSTEM_CONFIGURATION_CUSTOM_SETTING_COUNT];
+ int32_t engine_suspend;
+ int32_t input_enabled;
+ int32_t output_enabled;
+ int32_t external_event;
+ int32_t calibration_method;
+ int32_t debug_mode;
+ int32_t number_of_runs;
+ int32_t context;
+ int32_t capture;
+ int32_t input_channels;
+};
+
+
+int elliptic_trigger_version_msg(void);
+
+int elliptic_trigger_branch_msg(void);
+
+int elliptic_trigger_tag_msg(void);
+
+int elliptic_trigger_diagnostics_msg(void);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 479d6640cc6e..7ee5120609b4 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -506,6 +506,9 @@ struct fb_info {
} *apertures;
bool skip_vt_switch; /* no VT switch on suspend/resume required */
+#ifdef CONFIG_MACH_XIAOMI_SDM660
+ int blank;
+#endif
};
static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
diff --git a/include/linux/input/qpnp-power-on.h b/include/linux/input/qpnp-power-on.h
index 5944f0fd3414..179b1d5de323 100644
--- a/include/linux/input/qpnp-power-on.h
+++ b/include/linux/input/qpnp-power-on.h
@@ -62,6 +62,10 @@ enum pon_restart_reason {
/* 32 ~ 63 for OEMs/ODMs secific features */
PON_RESTART_REASON_OEM_MIN = 0x20,
+#ifdef CONFIG_MACH_LONGCHEER
+ PON_RESTART_REASON_PANIC = 0x21,
+ PON_RESTART_REASON_NORMAL = 0x22,
+#endif
PON_RESTART_REASON_OEM_MAX = 0x3f,
};
@@ -72,6 +76,10 @@ 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);
+#ifdef CONFIG_MACH_LONGCHEER
+int qpnp_pon_is_lpk(void);
+#endif
+int qpnp_pon_is_ps_hold_reset(void);
#else
static int qpnp_pon_system_pwr_off(enum pon_power_off_type type)
@@ -96,6 +104,16 @@ static inline bool qpnp_pon_check_hard_reset_stored(void)
{
return false;
}
+#ifdef CONFIG_MACH_LONGCHEER
+static inline int qpnp_pon_is_lpk(void)
+{
+ return -ENODEV;
+}
+static inline int qpnp_pon_is_ps_hold_reset(void)
+{
+ return -ENODEV;
+}
+#endif
#endif
#endif
diff --git a/include/linux/input/synaptics_dsx.h b/include/linux/input/synaptics_dsx.h
new file mode 100644
index 000000000000..cb3fe2274674
--- /dev/null
+++ b/include/linux/input/synaptics_dsx.h
@@ -0,0 +1,214 @@
+/*
+ * Synaptics DSX touchscreen driver
+ *
+ * Copyright (C) 2012-2016 Synaptics Incorporated. All rights reserved.
+ *
+ * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
+ * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.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.
+ *
+ * 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.
+ *
+ * INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED "AS-IS," AND SYNAPTICS
+ * EXPRESSLY DISCLAIMS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
+ * AND ANY WARRANTIES OF NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS.
+ * IN NO EVENT SHALL SYNAPTICS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OF THE INFORMATION CONTAINED IN THIS DOCUMENT, HOWEVER CAUSED
+ * AND BASED ON ANY THEORY OF LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, AND EVEN IF SYNAPTICS WAS ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE. IF A TRIBUNAL OF COMPETENT JURISDICTION DOES
+ * NOT PERMIT THE DISCLAIMER OF DIRECT DAMAGES OR ANY OTHER DAMAGES, SYNAPTICS'
+ * TOTAL CUMULATIVE LIABILITY TO ANY PARTY SHALL NOT EXCEED ONE HUNDRED U.S.
+ * DOLLARS.
+ */
+
+#ifndef _SYNAPTICS_DSX_H_
+#define _SYNAPTICS_DSX_H_
+
+#define PLATFORM_DRIVER_NAME "synaptics_dsx"
+#define STYLUS_DRIVER_NAME "synaptics_dsx_stylus"
+#define ACTIVE_PEN_DRIVER_NAME "synaptics_dsx_active_pen"
+#define PROXIMITY_DRIVER_NAME "synaptics_dsx_proximity"
+#define GESTURE_DRIVER_NAME "synaptics_dsx_gesture"
+#define I2C_DRIVER_NAME "synaptics_dsx_i2c"
+#define SPI_DRIVER_NAME "synaptics_dsx_spi"
+
+#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FORCE
+#define PLATFORM_DRIVER_FORCE "synaptics_force"
+#define I2C_DRIVER_FORCE "synaptics_dsx_force"
+#define CONFIG_SYNAPTICS_TOUCH_COUNT_DUMP
+
+struct synaptics_dsx_panel_power_seq {
+ int disp_pre_on_sleep;
+ int disp_post_on_sleep;
+ int disp_pre_off_sleep;
+ int disp_post_off_sleep;
+ int lab_pre_on_sleep;
+ int lab_post_on_sleep;
+ int lab_pre_off_sleep;
+ int lab_post_off_sleep;
+ int ibb_pre_on_sleep;
+ int ibb_post_on_sleep;
+ int ibb_pre_off_sleep;
+ int ibb_post_off_sleep;
+};
+
+struct synaptics_dsx_factory_param {
+ union {
+ struct {
+ int tddi_short_limit_b;
+ int tddi_noise_limit;
+
+ int tddi_extend_ee_short_reset_dur;
+ int tddi_extend_ee_short_int_dur;
+ int tddi_extend_ee_short_tx_on_count;
+ int tddi_extend_ee_short_rx_on_count;
+ int tddi_extend_ee_short_test_limit_part1;
+ int tddi_extend_ee_short_test_limit_part2;
+
+ int tddi_open_test_int_dur_one;
+ int tddi_open_test_int_dur_two;
+ int tddi_open_test_limit_phase2_lower;
+
+ int tddi_b7_open_test_int_dur_one;
+ int tddi_b7_open_test_int_dur_two;
+ int tddi_b7_open_test_limit_phase2_lower;
+ int tddi_b7_open_test_limit_phase2_upper;
+
+ int button_count;
+ int abs_0d_open_factor;
+ int abs_0d_open_test_limit;
+ } __packed;
+ unsigned int data[18];
+ };
+};
+
+struct synaptics_dsx_config_info {
+ int chip_id;
+ bool chip_is_tddi;
+ bool open_test_b7;
+ bool short_test_extend;
+ bool is_factory_param;
+ const char *chip_id_name;
+ unsigned char *tp_ids;
+ const char *fw_name;
+#ifdef CONFIG_SYNAPTICS_TOUCH_COUNT_DUMP
+ const char *clicknum_file_name;
+#endif
+ struct synaptics_dsx_panel_power_seq panel_power_seq;
+ struct synaptics_dsx_factory_param *factory_param;
+};
+
+enum synaptics_dsx_lockdown_area {
+ LOCKDOWN_AREA_PRODUCT_ID = 0,
+ LOCKDOWN_AREA_GUEST_SERIALIZATION = 1,
+ LOCKDOWN_AREA_UNKNOWN = 0xFF,
+};
+#endif
+
+/*
+ * struct synaptics_dsx_button_map - button map
+ * @nbuttons: number of buttons
+ * @map: pointer to array of button codes
+ */
+struct synaptics_dsx_button_map {
+ unsigned char nbuttons;
+ unsigned int *map;
+};
+
+/*
+ * struct synaptics_dsx_board_data - DSX board data
+ * @x_flip: x flip flag
+ * @y_flip: y flip flag
+ * @swap_axes: swap axes flag
+ * @irq_gpio: attention interrupt GPIO
+ * @irq_on_state: attention interrupt active state
+ * @power_gpio: power switch GPIO
+ * @power_on_state: power switch active state
+ * @reset_gpio: reset GPIO
+ * @reset_on_state: reset active state
+ * @max_y_for_2d: maximum y value for 2D area when virtual buttons are present
+ * @irq_flags: IRQ flags
+ * @i2c_addr: I2C slave address
+ * @ub_i2c_addr: microbootloader mode I2C slave address
+ * @device_descriptor_addr: HID device descriptor address
+ * @panel_x: x-axis resolution of display panel
+ * @panel_y: y-axis resolution of display panel
+ * @power_delay_ms: delay time to wait after powering up device
+ * @reset_delay_ms: delay time to wait after resetting device
+ * @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
+ * @addr_delay_us: delay time after sending address word
+ * @pwr_reg_name: pointer to name of regulator for power control
+ * @lab_reg_name: pointer to name of regulator for LCD lab control
+ * @ibb_reg_name: pointer to name of regulator for LCD ibb control
+ * @disp_reg_name: pointer to name of regulator for LCD vddio control
+ * @bus_reg_name: pointer to name of regulator for bus pullup control
+ * @cap_button_map: pointer to 0D button map
+ * @vir_button_map: pointer to virtual button map
+ */
+struct synaptics_dsx_board_data {
+ bool x_flip;
+ bool y_flip;
+ bool swap_axes;
+ int irq_gpio;
+ int irq_on_state;
+ int power_gpio;
+ int power_on_state;
+ int reset_gpio;
+ int reset_on_state;
+ int max_y_for_2d;
+ unsigned long irq_flags;
+ unsigned short i2c_addr;
+ unsigned short ub_i2c_addr;
+ unsigned short device_descriptor_addr;
+ 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;
+ const char *pwr_reg_name;
+ const char *bus_reg_name;
+ struct synaptics_dsx_button_map *cap_button_map;
+ struct synaptics_dsx_button_map *vir_button_map;
+#ifndef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FORCE
+ unsigned int addr_delay_us;
+#else
+ int mdss_reset;
+ int mdss_reset_state;
+ int config_array_size;
+ int tp_id_num;
+ unsigned char *tp_id_bytes;
+ bool cut_off_power;
+ bool power_ctrl;
+ bool panel_is_incell;
+ const char *lab_reg_name;
+ const char *ibb_reg_name;
+ const char *disp_reg_name;
+ const char *power_gpio_name;
+ const char *reset_gpio_name;
+ const char *irq_gpio_name;
+ const char *backup_fw_name;
+ const char *short_test25;
+ const char *short_test26;
+ struct synaptics_dsx_config_info *config_array;
+ enum synaptics_dsx_lockdown_area lockdown_area;
+#ifdef CONFIG_SYNAPTICS_TOUCH_COUNT_DUMP
+ bool dump_click_count;
+#endif
+#endif
+};
+
+#endif
diff --git a/include/linux/input/synaptics_tcm.h b/include/linux/input/synaptics_tcm.h
new file mode 100644
index 000000000000..7fd90abfc844
--- /dev/null
+++ b/include/linux/input/synaptics_tcm.h
@@ -0,0 +1,74 @@
+/*
+ * Synaptics TCM touchscreen driver
+ *
+ * Copyright (C) 2017-2018 Synaptics Incorporated. All rights reserved.
+ *
+ * Copyright (C) 2017-2018 Scott Lin <scott.lin@tw.synaptics.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.
+ *
+ * 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.
+ *
+ * INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED "AS-IS," AND SYNAPTICS
+ * EXPRESSLY DISCLAIMS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
+ * AND ANY WARRANTIES OF NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS.
+ * IN NO EVENT SHALL SYNAPTICS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OF THE INFORMATION CONTAINED IN THIS DOCUMENT, HOWEVER CAUSED
+ * AND BASED ON ANY THEORY OF LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, AND EVEN IF SYNAPTICS WAS ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE. IF A TRIBUNAL OF COMPETENT JURISDICTION DOES
+ * NOT PERMIT THE DISCLAIMER OF DIRECT DAMAGES OR ANY OTHER DAMAGES, SYNAPTICS'
+ * TOTAL CUMULATIVE LIABILITY TO ANY PARTY SHALL NOT EXCEED ONE HUNDRED U.S.
+ * DOLLARS.
+ */
+
+#ifndef _SYNAPTICS_TCM_H_
+#define _SYNAPTICS_TCM_H_
+
+#define I2C_MODULE_NAME "synaptics_tcm_i2c"
+#define SPI_MODULE_NAME "synaptics_tcm_spi"
+#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_D2T
+#define WAKEUP_GESTURE
+#endif
+
+struct syna_tcm_board_data {
+ bool x_flip;
+ bool y_flip;
+ bool swap_axes;
+ int irq_gpio;
+ int irq_on_state;
+ int power_gpio;
+ int power_on_state;
+ int reset_gpio;
+#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_D2T
+ int mdss_reset;
+#endif
+ int reset_on_state;
+ unsigned int spi_mode;
+ 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 int ubl_i2c_addr;
+ unsigned int ubl_max_freq;
+ unsigned int ubl_byte_delay_us;
+ unsigned long irq_flags;
+ const char *pwr_reg_name;
+ const char *bus_reg_name;
+#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_D2T
+ const char *i2c_reg_name;
+ const char *lab_reg_name;
+ const char *ibb_reg_name;
+#endif
+};
+
+#endif
diff --git a/include/linux/input/tp_common.h b/include/linux/input/tp_common.h
new file mode 100644
index 000000000000..4b038a579fe3
--- /dev/null
+++ b/include/linux/input/tp_common.h
@@ -0,0 +1,15 @@
+#include <linux/kobject.h>
+
+extern bool capacitive_keys_enabled;
+extern struct kobject *touchpanel_kobj;
+
+struct tp_common_ops {
+ ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
+ char *buf);
+ ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
+ const char *buf, size_t count);
+};
+
+int tp_common_set_capacitive_keys_ops(struct tp_common_ops *ops);
+int tp_common_set_double_tap_ops(struct tp_common_ops *ops);
+int tp_common_set_reversed_keys_ops(struct tp_common_ops *ops);
diff --git a/include/linux/mdss_io_util.h b/include/linux/mdss_io_util.h
index 3cca007e618c..a7e886a6085a 100644
--- a/include/linux/mdss_io_util.h
+++ b/include/linux/mdss_io_util.h
@@ -1,4 +1,5 @@
/* Copyright (c) 2012, 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2019 XiaoMi, Inc.
*
* 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
@@ -111,5 +112,20 @@ int mdss_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr,
uint8_t reg_offset, uint8_t *read_buf);
int mdss_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr,
uint8_t reg_offset, uint8_t *value);
+#ifdef CONFIG_MACH_MI
+bool mdss_panel_is_prim(void *fbinfo);
+bool mdss_prim_panel_is_dead(void);
+void mdss_panel_reset_skip_enable(bool enable);
+void mdss_dsi_ulps_enable(bool enable);
+void mdss_dsi_ulps_suspend_enable(bool enable);
+void mdss_fb_prim_panel_recover(void);
+
+int mdss_prim_panel_fb_unblank(int timeout);
+void mdss_fb_prim_panel_recover(void);
+#endif
+
+#ifdef CONFIG_MACH_XIAOMI_SDM660
+int mdss_prim_panel_fb_unblank(int timeout);
+#endif
#endif /* __MDSS_IO_UTIL_H__ */
diff --git a/include/linux/mfd/spk-id.h b/include/linux/mfd/spk-id.h
new file mode 100644
index 000000000000..2416f89bd23f
--- /dev/null
+++ b/include/linux/mfd/spk-id.h
@@ -0,0 +1,33 @@
+/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2019 XiaoMi, Inc.
+ *
+ * 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 __SPK_ID_H_
+#define __SPK_ID_H_
+
+#include <linux/types.h>
+#include <linux/of.h>
+
+#define PIN_PULL_DOWN 0
+#define PIN_PULL_UP 1
+#define PIN_FLOAT 2
+
+#define VENDOR_ID_NONE 0
+#define VENDOR_ID_AAC 1
+#define VENDOR_ID_SSI 2
+#define VENDOR_ID_GOER 3
+
+#define VENDOR_ID_UNKNOWN 4
+
+extern int spk_id_get_pin_3state(struct device_node *np);
+
+#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 4d2e20415071..09bc8c639252 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -276,6 +276,13 @@ enum power_supply_property {
POWER_SUPPLY_PROP_PARALLEL_FCC_MAX,
POWER_SUPPLY_PROP_MIN_ICL,
POWER_SUPPLY_PROP_FG_RESET_CLOCK,
+#ifdef CONFIG_MACH_XIAOMI_SDM660
+ POWER_SUPPLY_PROP_RERUN_APSD,
+#ifdef CONFIG_MACH_MI
+ POWER_SUPPLY_PROP_TYPE_RECHECK,
+ POWER_SUPPLY_PROP_CHARGER_TYPE,
+#endif
+#endif
/* Local extensions of type int64_t */
POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT,
/* Properties of type `const char *' */
diff --git a/include/media/Kbuild b/include/media/Kbuild
new file mode 100644
index 000000000000..47ab75cc8c2e
--- /dev/null
+++ b/include/media/Kbuild
@@ -0,0 +1 @@
+header-y += lirc.h
diff --git a/include/media/msm_cam_sensor.h b/include/media/msm_cam_sensor.h
index 2c8b651147e0..1bbb96124a93 100644
--- a/include/media/msm_cam_sensor.h
+++ b/include/media/msm_cam_sensor.h
@@ -37,11 +37,22 @@ struct msm_camera_sensor_slave_info32 {
enum i2c_freq_mode_t i2c_freq_mode;
enum msm_camera_i2c_reg_addr_type addr_type;
struct msm_sensor_id_info_t sensor_id_info;
+#if defined(CONFIG_MACH_XIAOMI_SDM660) && !defined(CONFIG_MACH_XIAOMI_WAYNE)
+ struct msm_vendor_id_info_t vendor_id_info;
+ struct msm_vcm_id_info_t vcm_id_info;
+#endif
+#ifdef CONFIG_MACH_XIAOMI_LAVENDER
+ struct msm_lens_id_info_t lens_id_info;
+#endif
struct msm_sensor_power_setting_array32 power_setting_array;
uint8_t is_init_params_valid;
struct msm_sensor_init_params sensor_init_params;
enum msm_sensor_output_format_t output_format;
uint8_t bypass_video_node_creation;
+#ifdef CONFIG_MACH_XIAOMI_WAYNE
+ struct msm_vendor_id_info_t vendor_id_info;
+ struct msm_vcm_id_info_t vcm_id_info;
+#endif
};
struct msm_camera_csid_lut_params32 {
diff --git a/include/soc/qcom/camera2.h b/include/soc/qcom/camera2.h
index 5a61d2b372c3..190ace1325ed 100644
--- a/include/soc/qcom/camera2.h
+++ b/include/soc/qcom/camera2.h
@@ -20,6 +20,49 @@
#include <linux/of_device.h>
#include <linux/of.h>
+#ifdef CONFIG_MACH_LONGCHEER
+enum __camera_vendor_module_id {
+ MID_NULL = 0,
+ MID_SUNNY,
+ MID_TRULY,
+ MID_A_KERR,
+ MID_LITEARRAY,
+ MID_DARLING,
+ MID_QTECH,
+ MID_OFILM,
+ MID_HUAQUAN,
+ MID_KINGCOM = MID_HUAQUAN,
+ MID_BOOYI,
+ MID_LAIMU,
+ MID_E7S = 21,
+ MID_WDSEN,
+ MID_SUNRISE,
+ MID_PRIMAX = 0x17,
+ MID_MAX
+};
+typedef enum __camera_vendor_module_id camera_vendor_module_id;
+
+enum camera_sensor_id {
+ SENSOR_NULL = 0,
+ SENSOR_S5K5E8 = 0x09,
+ SENSOR_MAX
+};
+
+enum camera_product_id {
+ PRODUCT_NULL = 0,
+ PRODUCT_E7S = 0x15,
+ PRODUCT_D2S = 0x17,
+ PRODUCT_MAX
+};
+
+struct vendor_eeprom {
+ char eeprom_name[128];
+ uint8_t module_id;
+};
+
+#define CAMERA_VENDOR_EEPROM_COUNT_MAX 14
+#endif
+
#define MAX_SPECIAL_SUPPORT_SIZE 10
enum msm_camera_device_type_t {
@@ -152,6 +195,13 @@ struct msm_camera_sensor_board_info {
const char *special_support_sensors[MAX_SPECIAL_SUPPORT_SIZE];
int32_t special_support_size;
struct msm_camera_slave_info *slave_info;
+#ifdef CONFIG_MACH_XIAOMI_SDM660
+ struct msm_vendor_id_info_t *vendor_id_info;
+ struct msm_vcm_id_info_t *vcm_id_info;
+#endif
+#ifdef CONFIG_MACH_XIAOMI_LAVENDER
+ struct msm_lens_id_info_t *lens_id_info;
+#endif
struct msm_camera_csi_lane_params *csi_lane_params;
struct msm_camera_sensor_strobe_flash_data *strobe_flash_data;
struct msm_actuator_info *actuator_info;
diff --git a/include/sound/apr_audio-v2.h b/include/sound/apr_audio-v2.h
index f312284024a9..99be9160d307 100644
--- a/include/sound/apr_audio-v2.h
+++ b/include/sound/apr_audio-v2.h
@@ -1979,6 +1979,32 @@ struct afe_port_cmd_set_param_v3 {
u8 param_data[0];
} __packed;
+#ifdef CONFIG_MACH_LONGCHEER
+struct afe_port_param_data_v2 {
+ u32 module_id;
+ /* ID of the module to be configured.
+ * Supported values: Valid module ID
+ */
+
+ u32 param_id;
+ /* ID of the parameter corresponding to the supported parameters
+ * for the module ID.
+ * Supported values: Valid parameter ID
+ */
+
+ u16 param_size;
+ /* Actual size of the data for the
+ * module_id/param_id pair. The size is a
+ * multiple of four bytes.
+ * Supported values: > 0
+ */
+
+ u16 reserved;
+ /* This field must be set to zero.
+ */
+} __packed;
+#endif
+
/* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
* which gets/sets loopback gain of a port to an Rx port.
* The Tx port ID of the loopback is part of the set_param command.
@@ -10042,6 +10068,36 @@ struct afe_spkr_prot_calib_get_resp {
struct asm_calib_res_cfg res_cfg;
} __packed;
+#ifdef CONFIG_SND_SOC_MAX98937
+/* Maxim DSM module and parameters IDs */
+#define AFE_RX_TOPOLOGY_ID_DSM 0x10001061
+#define AFE_TX_TOPOLOGY_ID_DSM 0x10001060
+#define AFE_MODULE_DSM_TX 0x10001068
+#define AFE_MODULE_DSM_RX 0x10001062
+#define AFE_PARAM_ID_DSM_ENABLE 0x10001063
+#define AFE_PARAM_ID_CALIB 0x10001065
+#define AFE_PARAM_ID_DSM_CFG 0x10001066
+#define AFE_PARAM_ID_DSM_INFO 0x10001067
+#define AFE_PARAM_ID_DSM_STAT 0x10001069
+
+#define DSM_RX_PORT_ID AFE_PORT_ID_PRIMARY_MI2S_RX
+#define DSM_TX_PORT_ID AFE_PORT_ID_PRIMARY_MI2S_TX
+
+struct afe_dsm_param_array {
+ uint32_t data[112];
+} __packed;
+
+struct afe_dsm_get_param {
+ struct param_hdr_v3 pdata;
+ struct afe_dsm_param_array param;
+} __packed;
+
+struct afe_dsm_get_resp {
+ uint32_t status;
+ struct param_hdr_v3 pdata;
+ struct afe_dsm_param_array param;
+} __packed;
+#endif
/* SRS TRUMEDIA start */
/* topology */
@@ -10741,6 +10797,15 @@ struct afe_digital_clk_cfg {
u16 reserved;
} __packed;
+#ifdef CONFIG_MACH_LONGCHEER
+struct afe_lpass_digital_clk_config_command {
+ struct apr_hdr hdr;
+ struct afe_port_cmd_set_param_v2 param;
+ struct afe_port_param_data_v2 pdata;
+ struct afe_digital_clk_cfg clk_cfg;
+} __packed;
+#endif
+
/*
* Opcode for AFE to start DTMF.
*/
diff --git a/include/sound/apr_elliptic.h b/include/sound/apr_elliptic.h
new file mode 100644
index 000000000000..5d42a37c7489
--- /dev/null
+++ b/include/sound/apr_elliptic.h
@@ -0,0 +1,49 @@
+#pragma once
+
+#include <linux/types.h>
+#include <sound/apr_audio-v2.h>
+#include <elliptic/elliptic_data_io.h>
+#include <linux/delay.h>
+
+
+
+#define ELLIPTIC_ULTRASOUND_MODULE_TX 0x0F010201
+#define ELLIPTIC_ULTRASOUND_MODULE_RX 0x0FF10202
+#define ULTRASOUND_OPCODE 0x0FF10204
+
+
+#define ELLIPTIC_PORT_ID SLIMBUS_1_TX
+
+/** Sequence of Elliptic Labs Ultrasound module parameters */
+struct afe_ultrasound_set_params_t {
+ uint32_t payload[ELLIPTIC_SET_PARAMS_SIZE];
+} __packed;
+
+struct afe_ultrasound_config_command {
+ struct apr_hdr hdr;
+ struct afe_port_cmd_set_param_v2 param;
+ struct afe_port_param_data_v2 pdata;
+ struct afe_ultrasound_set_params_t prot_config;
+} __packed;
+
+/** Sequence of Elliptic Labs Ultrasound module parameters */
+
+/** Elliptic APR public */
+
+int32_t ultrasound_apr_set_parameter(int32_t port_id, uint32_t param_id,
+ u8 *user_params, int32_t length);
+
+int32_t elliptic_process_apr_payload(uint32_t *payload);
+
+int elliptic_notify_gain_change_msg(int component_id, int gaindb);
+
+typedef struct afe_ultrasound_state {
+ atomic_t us_apr_state;
+ void **ptr_apr;
+ atomic_t *ptr_status;
+ atomic_t *ptr_state;
+ wait_queue_head_t *ptr_wait;
+ int timeout_ms;
+} afe_ultrasound_state_t;
+
+extern afe_ultrasound_state_t elus_afe;
diff --git a/include/sound/q6afe-v2.h b/include/sound/q6afe-v2.h
index e171028839f7..119c19d4a270 100644
--- a/include/sound/q6afe-v2.h
+++ b/include/sound/q6afe-v2.h
@@ -238,6 +238,9 @@ enum {
/* IDX 167 -> 168 */
IDX_RT_PROXY_PORT_002_RX,
IDX_RT_PROXY_PORT_002_TX,
+#ifdef CONFIG_MACH_LONGCHEER
+ IDX_AFE_PORT_ID_PSEUDOPORT_01,
+#endif
AFE_MAX_PORTS
};
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 0d9bac9f9ebb..40d128187478 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -336,6 +336,10 @@
#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
+#ifdef CONFIG_ANT_CHECK
+#define KEY_ANT_CONNECT 0x292
+#define KEY_ANT_UNCONNECT 0x293
+#endif
/* Code 255 is reserved for special needs of AT keyboard driver */
#define BTN_MISC 0x100
diff --git a/include/uapi/media/msm_cam_sensor.h b/include/uapi/media/msm_cam_sensor.h
index e4b4554dd690..545a69556656 100644
--- a/include/uapi/media/msm_cam_sensor.h
+++ b/include/uapi/media/msm_cam_sensor.h
@@ -33,6 +33,9 @@
#define MAX_AF_ITERATIONS 3
#define MAX_NUMBER_OF_STEPS 47
#define MAX_REGULATOR 5
+#ifdef CONFIG_MACH_MI
+#define NAME_SIZE_MAX 64
+#endif
/*msm_flash_query_data_t query types*/
#define FLASH_QUERY_CURRENT 1
@@ -582,6 +585,31 @@ struct sensor_init_cfg_data {
} cfg;
};
+#ifdef CONFIG_MACH_MI
+enum msm_actuator_cfg_download_type_t {
+ CFG_ACTUATOR_DOWNLOAD,
+ CFG_ACTUATOR_DATA_CONFIG,
+};
+
+struct msm_actuator_opcode {
+ uint32_t prog;
+ uint32_t coeff;
+ uint32_t pheripheral;
+ uint32_t memory;
+};
+
+struct msm_actuator_slave_info {
+ char actuator_name[NAME_SIZE_MAX];
+ uint32_t i2c_addr;
+ struct msm_actuator_opcode opcode;
+};
+
+struct msm_actuator_cfg_download_data {
+ int cfgtype;
+ struct msm_actuator_slave_info slave_info;
+};
+#endif
+
#define VIDIOC_MSM_SENSOR_CFG \
_IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct sensorb_cfg_data)
@@ -633,5 +661,9 @@ struct sensor_init_cfg_data {
#define VIDIOC_MSM_LASER_LED_CFG \
_IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_laser_led_cfg_data_t)
+#ifdef CONFIG_MACH_MI
+#define VIDIOC_MSM_ACTUATOR_CFG_DOWNLOAD \
+ _IOWR('V', BASE_VIDIOC_PRIVATE + 17, struct msm_actuator_cfg_download_data)
+#endif
#endif
diff --git a/include/uapi/media/msm_camera.h b/include/uapi/media/msm_camera.h
index 81e350ede6eb..5e3147fd9a31 100644
--- a/include/uapi/media/msm_camera.h
+++ b/include/uapi/media/msm_camera.h
@@ -263,7 +263,11 @@ struct msm_mctl_post_proc_cmd {
#define MSM_CAMERA_STROBE_FLASH_NONE 0
#define MSM_CAMERA_STROBE_FLASH_XENON 1
+#ifdef CONFIG_MACH_XIAOMI_LAVENDER
+#define MSM_MAX_CAMERA_SENSORS 7
+#else
#define MSM_MAX_CAMERA_SENSORS 6
+#endif
#define MAX_SENSOR_NAME 32
#define MAX_CAM_NAME_SIZE 32
#define MAX_ACT_MOD_NAME_SIZE 32
diff --git a/include/uapi/media/msm_camsensor_sdk.h b/include/uapi/media/msm_camsensor_sdk.h
index 40731a927ce5..8d499af5b01b 100644
--- a/include/uapi/media/msm_camsensor_sdk.h
+++ b/include/uapi/media/msm_camsensor_sdk.h
@@ -176,6 +176,9 @@ enum msm_actuator_write_type {
enum msm_actuator_i2c_operation {
MSM_ACT_WRITE = 0,
MSM_ACT_POLL,
+#ifdef CONFIG_MACH_MI
+ MSM_ACT_POLL_RESULT,
+#endif
};
enum actuator_type {
@@ -301,6 +304,43 @@ struct msm_sensor_id_info_t {
unsigned short sensor_id_mask;
};
+#ifdef CONFIG_MACH_XIAOMI_SDM660
+enum msm_cci_i2c_master_t {
+ MSM_MASTER_0,
+ MSM_MASTER_1,
+ MSM_MASTER_MAX,
+};
+
+struct msm_vendor_id_info_t {
+ unsigned short eeprom_slave_addr;
+ unsigned short vendor_id_addr;
+ enum msm_camera_i2c_reg_addr_type addr_type;
+ unsigned short vendor_id;
+ enum msm_camera_i2c_data_type data_type;
+ enum msm_cci_i2c_master_t cci_i2c_master;
+};
+
+struct msm_vcm_id_info_t {
+ unsigned short eeprom_slave_addr;
+ unsigned short vcm_id_addr;
+ enum msm_camera_i2c_reg_addr_type addr_type;
+ unsigned short vcm_id;
+ enum msm_camera_i2c_data_type data_type;
+ enum msm_cci_i2c_master_t cci_i2c_master;
+};
+#endif
+
+#if defined(CONFIG_MACH_XIAOMI_LAVENDER) || defined(CONFIG_MACH_XIAOMI_WAYNE)
+struct msm_lens_id_info_t {
+ unsigned short eeprom_slave_addr;
+ unsigned short lens_id_addr;
+ enum msm_camera_i2c_reg_addr_type addr_type;
+ unsigned short lens_id;
+ enum msm_camera_i2c_data_type data_type;
+ enum msm_cci_i2c_master_t cci_i2c_master;
+};
+#endif
+
struct msm_camera_sensor_slave_info {
char sensor_name[32];
char eeprom_name[32];
@@ -312,11 +352,23 @@ struct msm_camera_sensor_slave_info {
enum i2c_freq_mode_t i2c_freq_mode;
enum msm_camera_i2c_reg_addr_type addr_type;
struct msm_sensor_id_info_t sensor_id_info;
+#if defined(CONFIG_MACH_XIAOMI_SDM660) && !defined(CONFIG_MACH_XIAOMI_WAYNE)
+ struct msm_vendor_id_info_t vendor_id_info;
+ struct msm_vcm_id_info_t vcm_id_info;
+#endif
+#ifdef CONFIG_MACH_XIAOMI_LAVENDER
+ struct msm_lens_id_info_t lens_id_info;
+#endif
struct msm_sensor_power_setting_array power_setting_array;
unsigned char is_init_params_valid;
struct msm_sensor_init_params sensor_init_params;
enum msm_sensor_output_format_t output_format;
uint8_t bypass_video_node_creation;
+#ifdef CONFIG_MACH_XIAOMI_WAYNE
+ struct msm_vendor_id_info_t vendor_id_info;
+ struct msm_vcm_id_info_t vcm_id_info;
+ struct msm_lens_id_info_t lens_id_info;
+#endif
};
struct msm_camera_i2c_reg_array {
diff --git a/include/uapi/media/msmb_camera.h b/include/uapi/media/msmb_camera.h
index 0a2dd446ccc4..7373f56317de 100644
--- a/include/uapi/media/msmb_camera.h
+++ b/include/uapi/media/msmb_camera.h
@@ -53,7 +53,11 @@
#define MSM_CAMERA_SUBDEV_EXT 19
#define MSM_CAMERA_SUBDEV_TOF 20
#define MSM_CAMERA_SUBDEV_LASER_LED 21
+#ifdef CONFIG_MACH_XIAOMI_LAVENDER
+#define MSM_MAX_CAMERA_SENSORS 7
+#else
#define MSM_MAX_CAMERA_SENSORS 6
+#endif
/* The below macro is defined to put an upper limit on maximum
* number of buffer requested per stream. In case of extremely