Skip to content

Commit

Permalink
drivers: input: touchscreen: Bring in latest Xiaomi changes
Browse files Browse the repository at this point in the history
From dipper-q-oss source drop.

Change-Id: If6f4ef0f487034e5a472a0641343e833a6047b1b
Signed-off-by: Khusika Dhamar Gusti <mail@khusika.com>
  • Loading branch information
bgcngm authored and Khusika Dhamar Gusti committed May 27, 2021
1 parent c2b6d2e commit 79adc75
Show file tree
Hide file tree
Showing 29 changed files with 4,814 additions and 398 deletions.
12 changes: 11 additions & 1 deletion drivers/cpuidle/lpm-levels.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ module_param_named(print_parsed_dt, print_parsed_dt, bool, 0664);
static bool sleep_disabled;
module_param_named(sleep_disabled, sleep_disabled, bool, 0664);

static bool sleep_disabled_touch;
module_param_named(sleep_disabled_touch, sleep_disabled_touch, bool, 0664);

/**
* msm_cpuidle_get_deep_idle_latency - Get deep idle latency value
*
Expand All @@ -149,6 +152,13 @@ uint32_t register_system_pm_ops(struct system_pm_ops *pm_ops)
return 0;
}

void lpm_disable_for_input(bool on)
{
sleep_disabled_touch = !!on;
return;
}
EXPORT_SYMBOL(lpm_disable_for_input);

static uint32_t least_cluster_latency(struct lpm_cluster *cluster,
struct latency_level *lat_level)
{
Expand Down Expand Up @@ -621,7 +631,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
uint32_t *min_residency = get_per_cpu_min_residency(dev->cpu);
uint32_t *max_residency = get_per_cpu_max_residency(dev->cpu);

if ((sleep_disabled && !cpu_isolated(dev->cpu)) || sleep_us < 0)
if (((sleep_disabled || sleep_disabled_touch) && !cpu_isolated(dev->cpu)) || sleep_us < 0)
return best_level;

idx_restrict = cpu->nlevels + 1;
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/msm/dsi-staging/dsi_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ static const struct of_device_id dsi_display_dt_match[] = {
static struct dsi_display *primary_display;
static struct dsi_display *secondary_display;

const char *dsi_get_display_name(void)
{
if (primary_display)
return primary_display->name;
else
return NULL;
}

static void dsi_display_mask_ctrl_error_interrupts(struct dsi_display *display,
u32 mask, bool enable)
{
Expand Down
7 changes: 7 additions & 0 deletions drivers/input/touchscreen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1485,4 +1485,11 @@ config INPUT_PRESS_NDT_M65
help
Say Y here if you have a press ic ndt.

config SECURE_TOUCH
bool "Secure Touch"
depends on TOUCHSCREEN_ST_FTS_V521 || TOUCHSCREEN_SYNAPTICS_DSX_FORCE

config I2C_BY_DMA
bool "I2C BY DMA"

endif
10 changes: 9 additions & 1 deletion drivers/input/touchscreen/focaltech_touch/Kconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#
# Focaltech Touchscreen driver configuration
#
menuconfig TOUCHSCREEN_FTS

config TOUCHSCREEN_FTS
bool "Focaltech Touchscreen"
depends on I2C
default n
help
Say Y here if you have Focaltech touch panel.
If unsure, say N.

config TOUCHSCREEN_FTS_POWER_SUPPLY
bool "USB Power Supply"
default n
help
Say y here if phone type is perseus
If unsure, say N

config TOUCHSCREEN_FTS_DIRECTORY
string "Focaltech ts directory name"
default "focaltech_touch"
Expand Down
13 changes: 11 additions & 2 deletions drivers/input/touchscreen/focaltech_touch/focaltech_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* FocalTech fts TouchScreen driver.
*
* Copyright (c) 2010-2017, Focaltech Ltd. All rights reserved.
* Copyright (C) 2018 XiaoMi, Inc.
* Copyright (C) 2019 XiaoMi, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
Expand Down Expand Up @@ -55,7 +55,10 @@
#define FTS_CHIP_IDC ((FTS_CHIP_TYPE & FLAGBIT(FLAG_IDC_BIT)) == FLAGBIT(FLAG_IDC_BIT))
#define FTS_HID_SUPPORTTED ((FTS_CHIP_TYPE & FLAGBIT(FLAG_HID_BIT)) == FLAGBIT(FLAG_HID_BIT))

#define FTS_CHIP_TYPE_MAPPING {{0x0D,0x87, 0x19, 0x87, 0x19, 0x87, 0xA9, 0x87, 0xB9}}
#define FTS_CHIP_TYPE_MAPPING {\
{0x0D, 0x87, 0x19, 0x87, 0x19, 0x87, 0xA9, 0x87, 0xB9},\
{0x81, 0x54, 0x52, 0x54, 0x52, 0x00, 0x00, 0x54, 0x5c},\
}

#define I2C_BUFFER_LENGTH_MAXINUM 256
#define FILE_NAME_LENGTH 128
Expand Down Expand Up @@ -95,6 +98,12 @@
#define FTS_REG_MODULE_ID 0xE3
#define FTS_REG_LIC_VER 0xE4
#define FTS_REG_ESD_SATURATE 0xED
#define FTS_REG_SENSIVITY 0x81
#define FTS_REG_THDIFF 0x85
#define FTS_REG_MONITOR_MODE 0x86
#define FTS_REG_REPORT_RATE 0x88
#define FTS_REG_EDGE_FILTER_ORIENTATION 0x8C
#define FTS_REG_EDGE_FILTER_LEVEL 0x8D

#define FTS_SYSFS_ECHO_ON(buf) (buf[0] == '1')
#define FTS_SYSFS_ECHO_OFF(buf) (buf[0] == '0')
Expand Down
12 changes: 7 additions & 5 deletions drivers/input/touchscreen/focaltech_touch/focaltech_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* FocalTech TouchScreen driver.
*
* Copyright (c) 2010-2017, FocalTech Systems, Ltd., all rights reserved.
* Copyright (C) 2018 XiaoMi, Inc.
* Copyright (C) 2019 XiaoMi, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
Expand Down Expand Up @@ -114,7 +114,7 @@
* Report Pressure in multitouch
* 1:enable(default),0:disable
*/
#define FTS_REPORT_PRESSURE_EN 1
#define FTS_REPORT_PRESSURE_EN 0

/*
* Gesture function enable
Expand Down Expand Up @@ -142,7 +142,7 @@
* Charger enable
* 1: enable, 0:disable(default)
*/
#define FTS_CHARGER_EN 0
#define FTS_CHARGER_EN 1

/*
* Nodes for tools, please keep enable
Expand Down Expand Up @@ -181,7 +181,8 @@
* 0:No check vendor_id (default)
* 1/2/3: Check vendor_id for vendor compatibility
*/
#define FTS_GET_VENDOR_ID_NUM 0
#define FTS_PROJECT_NAME "e10"
#define FTS_PROJECT_NAME1 "e5"

/*
* vendor_id(s) for vendor(s) to be compatible with.
Expand All @@ -201,7 +202,8 @@
* define your own fw_file, the sample one to be replaced is invalid
* NOTE: if FTS_GET_VENDOR_ID_NUM > 1, it's the fw corresponding with FTS_VENDOR_ID
*/
#define FTS_UPGRADE_FW_FILE "include/firmware/fw_ft8719_e10.i"
#define FTS_UPGRADE_FW_FILE_E10 "include/firmware/fw_ft8719_e10.i"
#define FTS_UPGRADE_FW_FILE_E5 "include/firmware/fw_ft3518_e5.i"

/*
* if FTS_GET_VENDOR_ID_NUM >= 2, fw corrsponding with FTS_VENDOR_ID2
Expand Down
Loading

0 comments on commit 79adc75

Please sign in to comment.