Skip to content
This repository has been archived by the owner on Nov 14, 2021. It is now read-only.

Commit

Permalink
treewide: Migrate custom ROM-specific patches to dedicated branch
Browse files Browse the repository at this point in the history
The fact that these exist in my primary branch at all is a remnant
of my attempt to facilitate a universal kernel image. Because this
is no longer feasible (thanks lineage), there's no reason to be
polluting the main tree with custom ROM shenanigans. These will be
reapplied exclusively on custom/neutrino-msm-kebab-4.19

This reverts the following commits:
c114d5e ("input: touchscreen: Expose every possible gesture")
e3526a4 ("Add toggle for disabling newly added USB devices")
9347063 ("msm/sde: prevent double register of input handler")
eb33123 ("drm: msm: Remove DMS internal mode flag after switching")
94294f7 ("drm: msm: Implement codepath variations for cont-splash DMS")
af81f6e ("power: smb5: Hardcode current max to 3000000 when DASH charging")
86bbacf ("qcom: smb5/qpnp-fg-gen4: Disable time to full now property on all devices")

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed Sep 3, 2021
1 parent f3db4f8 commit a78efa5
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 338 deletions.
11 changes: 0 additions & 11 deletions drivers/oneplus/input/touchscreen/touchpanel_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,6 @@
#define FingerprintDown 16
#define FingerprintUp 17

#define KEY_GESTURE_W 246
#define KEY_GESTURE_M 247
#define KEY_GESTURE_S 248
#define KEY_DOUBLE_TAP KEY_WAKEUP
#define KEY_GESTURE_CIRCLE 250
#define KEY_GESTURE_TWO_SWIPE 251
#define KEY_GESTURE_DOWN_ARROW 252
#define KEY_GESTURE_LEFT_ARROW 253
#define KEY_GESTURE_RIGHT_ARROW 254
#define KEY_GESTURE_SINGLE_TAP 255

#define BIT0 (0x1 << 0)
#define BIT1 (0x1 << 1)
#define BIT2 (0x1 << 2)
Expand Down
151 changes: 22 additions & 129 deletions drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ unsigned int tp_register_times = 0;
//unsigned int probe_time = 0;
struct touchpanel_data *g_tp = NULL;
struct point_info *pre_points = NULL;
int tp_1v8_power = 1;
int tp_1v8_power = 0;
static DECLARE_WAIT_QUEUE_HEAD(waiter);
static struct input_dev *ps_input_dev = NULL;
static int lcd_id = 0;
Expand All @@ -62,16 +62,16 @@ int pointx[2] = {0, 0};
int pointy[2] = {0, 0};
#define ABS(a,b) ((a - b > 0) ? a - b : b - a)

uint8_t DouTap_enable = 1; // double tap
uint8_t UpVee_enable = 1; // V
uint8_t LeftVee_enable = 1; // >
uint8_t RightVee_enable = 1; // <
uint8_t Circle_enable = 1; // O
uint8_t DouSwip_enable = 1; // ||
uint8_t Mgestrue_enable = 1; // M
uint8_t Wgestrue_enable = 1; // W
uint8_t Sgestrue_enable = 1; // S
uint8_t SingleTap_enable = 1; // single tap
uint8_t DouTap_enable = 0; // double tap
uint8_t UpVee_enable = 0; // V
uint8_t LeftVee_enable = 0; // >
uint8_t RightVee_enable = 0; // <
uint8_t Circle_enable = 0; // O
uint8_t DouSwip_enable = 0; // ||
uint8_t Mgestrue_enable = 0; // M
uint8_t Wgestrue_enable = 0; // W
uint8_t Sgestrue_enable = 0; // S
uint8_t SingleTap_enable = 0; // single tap
uint8_t Enable_gesture = 0;

/*******Part2:declear Area********************************/
Expand Down Expand Up @@ -369,8 +369,6 @@ int sec_double_tap(struct gesture_info *gesture)
static void tp_gesture_handle(struct touchpanel_data *ts)
{
struct gesture_info gesture_info_temp;
bool enabled = false;
int key = -1;

if (project_code == 20801) {
if (!ts->ts_ops->enable_single_tap) {
Expand Down Expand Up @@ -414,59 +412,21 @@ static void tp_gesture_handle(struct touchpanel_data *ts)
gesture_info_temp.gesture_type == SingleTap ? "(single tap)" :
gesture_info_temp.gesture_type == Wgestrue ? "(W)" : "unknown");

switch (gesture_info_temp.gesture_type) {
case DouTap:
enabled = DouTap_enable;
key = KEY_DOUBLE_TAP;
break;
case UpVee:
enabled = UpVee_enable;
key = KEY_GESTURE_DOWN_ARROW;
break;
case LeftVee:
enabled = LeftVee_enable;
key = KEY_GESTURE_RIGHT_ARROW;
break;
case RightVee:
enabled = RightVee_enable;
key = KEY_GESTURE_LEFT_ARROW;
break;
case Circle:
enabled = Circle_enable;
key = KEY_GESTURE_CIRCLE;
break;
case DouSwip:
enabled = DouSwip_enable;
key = KEY_GESTURE_TWO_SWIPE;
break;
case Mgestrue:
enabled = Mgestrue_enable;
key = KEY_GESTURE_M;
break;
case Sgestrue:
enabled = Sgestrue_enable;
key = KEY_GESTURE_S;
break;
case SingleTap:
enabled = SingleTap_enable;
key = KEY_GESTURE_SINGLE_TAP;
break;
case Wgestrue:
enabled = Wgestrue_enable;
key = KEY_GESTURE_W;
break;
}

if (enabled) {
if ((gesture_info_temp.gesture_type == DouTap && DouTap_enable) ||
(gesture_info_temp.gesture_type == UpVee && UpVee_enable) ||
(gesture_info_temp.gesture_type == LeftVee&& LeftVee_enable) ||
(gesture_info_temp.gesture_type == RightVee && RightVee_enable) ||
(gesture_info_temp.gesture_type == Circle && Circle_enable) ||
(gesture_info_temp.gesture_type == DouSwip && DouSwip_enable) ||
(gesture_info_temp.gesture_type == Mgestrue && Mgestrue_enable) ||
(gesture_info_temp.gesture_type == Sgestrue && Sgestrue_enable) ||
(gesture_info_temp.gesture_type == SingleTap && SingleTap_enable) ||
(gesture_info_temp.gesture_type == Wgestrue && Wgestrue_enable)) {
memcpy(&ts->gesture, &gesture_info_temp, sizeof(struct gesture_info));
input_report_key(ts->input_dev, KEY_F4, 1);
input_sync(ts->input_dev);
input_report_key(ts->input_dev, KEY_F4, 0);
input_sync(ts->input_dev);
input_report_key(ts->input_dev, key, 1);
input_sync(ts->input_dev);
input_report_key(ts->input_dev, key, 0);
input_sync(ts->input_dev);
}
}

Expand Down Expand Up @@ -2610,52 +2570,6 @@ static ssize_t sec_update_fw_show(struct device *dev,

static DEVICE_ATTR(tp_fw_update, 0644, sec_update_fw_show, sec_update_fw_store);

#define GESTURE_ATTR(name, out) \
static ssize_t name##_enable_read_func(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) \
{ \
int ret = 0; \
char page[PAGESIZE]; \
ret = sprintf(page, "%d\n", out); \
ret = simple_read_from_buffer(user_buf, count, ppos, page, strlen(page)); \
return ret; \
} \
static ssize_t name##_enable_write_func(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) \
{ \
int enabled = 0; \
char page[PAGESIZE] = {0}; \
copy_from_user(page, user_buf, count); \
sscanf(page, "%d", &enabled); \
out = enabled > 0 ? 1 : 0; \
return count; \
} \
static const struct file_operations name##_enable_proc_fops = { \
.write = name##_enable_write_func, \
.read = name##_enable_read_func, \
.open = simple_open, \
.owner = THIS_MODULE, \
};

GESTURE_ATTR(single_tap, SingleTap_enable);
GESTURE_ATTR(double_tap, DouTap_enable);
GESTURE_ATTR(down_arrow, UpVee_enable);
GESTURE_ATTR(left_arrow, RightVee_enable);
GESTURE_ATTR(right_arrow, LeftVee_enable);
GESTURE_ATTR(double_swipe, DouSwip_enable);
GESTURE_ATTR(letter_o, Circle_enable);
GESTURE_ATTR(letter_w, Wgestrue_enable);
GESTURE_ATTR(letter_m, Mgestrue_enable);
GESTURE_ATTR(letter_s, Sgestrue_enable);

#define CREATE_PROC_NODE(PARENT, NAME, MODE) \
prEntry_tmp = proc_create(#NAME, MODE, PARENT, &NAME##_proc_fops); \
if (prEntry_tmp == NULL) { \
ret = -ENOMEM; \
TPD_INFO("%s: Couldn't create proc entry, %d\n", __func__, __LINE__); \
}

#define CREATE_GESTURE_NODE(NAME) \
CREATE_PROC_NODE(prEntry_tp, NAME##_enable, 0666)

static int init_touchpanel_proc(struct touchpanel_data *ts)
{
int ret = 0;
Expand Down Expand Up @@ -2715,17 +2629,6 @@ static int init_touchpanel_proc(struct touchpanel_data *ts)
ret = -ENOMEM;
TPD_INFO("%s: Couldn't create proc entry, %d\n", __func__, __LINE__);
}
CREATE_GESTURE_NODE(single_tap);
CREATE_GESTURE_NODE(double_tap);
CREATE_GESTURE_NODE(down_arrow);
CREATE_GESTURE_NODE(left_arrow);
CREATE_GESTURE_NODE(right_arrow);
CREATE_GESTURE_NODE(double_swipe);
CREATE_GESTURE_NODE(letter_o);
CREATE_GESTURE_NODE(letter_w);
CREATE_GESTURE_NODE(letter_m);
CREATE_GESTURE_NODE(letter_s);

prEntry_tmp = proc_create_data("coordinate", 0444, prEntry_tp, &proc_coordinate_fops, ts);
if (prEntry_tmp == NULL) {
ret = -ENOMEM;
Expand Down Expand Up @@ -4287,16 +4190,6 @@ static int init_input_device(struct touchpanel_data *ts)
set_bit(BTN_TOUCH, ts->input_dev->keybit);
if (ts->black_gesture_support) {
set_bit(KEY_F4, ts->input_dev->keybit);
set_bit(KEY_GESTURE_W, ts->input_dev->keybit);
set_bit(KEY_GESTURE_M, ts->input_dev->keybit);
set_bit(KEY_GESTURE_S, ts->input_dev->keybit);
set_bit(KEY_DOUBLE_TAP, ts->input_dev->keybit);
set_bit(KEY_GESTURE_CIRCLE, ts->input_dev->keybit);
set_bit(KEY_GESTURE_TWO_SWIPE, ts->input_dev->keybit);
set_bit(KEY_GESTURE_DOWN_ARROW, ts->input_dev->keybit);
set_bit(KEY_GESTURE_LEFT_ARROW, ts->input_dev->keybit);
set_bit(KEY_GESTURE_RIGHT_ARROW, ts->input_dev->keybit);
set_bit(KEY_GESTURE_SINGLE_TAP, ts->input_dev->keybit);
}

ts->kpd_input_dev->name = TPD_DEVICE"_kpd";
Expand Down Expand Up @@ -5392,7 +5285,7 @@ int register_common_touch_device(struct touchpanel_data *pdata)
ts->loading_fw = false;
ts->is_suspended = 0;
ts->suspend_state = TP_SPEEDUP_RESUME_COMPLETE;
ts->gesture_enable = 1;
ts->gesture_enable = 0;
ts->es_enable = 0;
ts->fd_enable = 0;
ts->palm_enable = 1;
Expand Down
4 changes: 0 additions & 4 deletions drivers/power/supply/qcom/qpnp-fg-gen4.c
Original file line number Diff line number Diff line change
Expand Up @@ -4692,7 +4692,6 @@ static int fg_psy_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG:
rc = ttf_get_time_to_empty(chip->ttf, &pval->intval);
break;
#if 0
case POWER_SUPPLY_PROP_TIME_TO_FULL_NOW:
if (fg->iskebab) {
if (fg->use_external_fg && external_fg
Expand All @@ -4705,7 +4704,6 @@ static int fg_psy_get_property(struct power_supply *psy,
rc = ttf_get_time_to_full(chip->ttf, &pval->intval);
pval->intval = pval->intval > 0 ? pval->intval : 1;
break;
#endif
case POWER_SUPPLY_PROP_CC_STEP:
if ((chip->ttf->cc_step.sel >= 0) &&
(chip->ttf->cc_step.sel < MAX_CC_STEPS)) {
Expand Down Expand Up @@ -4931,9 +4929,7 @@ static enum power_supply_property fg_psy_props[] = {
POWER_SUPPLY_PROP_DEBUG_BATTERY,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
#if 0
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
#endif
POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
POWER_SUPPLY_PROP_CC_STEP,
POWER_SUPPLY_PROP_CC_STEP_SEL,
Expand Down
9 changes: 1 addition & 8 deletions drivers/power/supply/qcom/qpnp-smb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1731,10 +1731,7 @@ static int smb5_usb_get_prop(struct power_supply *psy,
val->intval = get_client_vote(chg->usb_icl_votable, PD_VOTER);
break;
case POWER_SUPPLY_PROP_CURRENT_MAX:
if (chg->dash_on)
val->intval = 3000000;
else
rc = smblib_get_prop_input_current_max(chg, val);
rc = smblib_get_prop_input_current_max(chg, val);
break;
case POWER_SUPPLY_PROP_TYPE:
val->intval = POWER_SUPPLY_TYPE_USB_PD;
Expand Down Expand Up @@ -2644,9 +2641,7 @@ static enum power_supply_property smb5_batt_props[] = {
// POWER_SUPPLY_PROP_FCC_STEPPER_ENABLE,
POWER_SUPPLY_PROP_OP_DISABLE_CHARGE,
POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
#if 0
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
#endif
POWER_SUPPLY_PROP_COOL_DOWN,
POWER_SUPPLY_PROP_DUMP_REG,
};
Expand Down Expand Up @@ -2859,12 +2854,10 @@ static int smb5_batt_get_prop(struct power_supply *psy,
rc = smblib_get_prop_from_bms(chg,
POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, val);
break;
#if 0
case POWER_SUPPLY_PROP_TIME_TO_FULL_NOW:
rc = smblib_get_prop_from_bms(chg,
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, val);
break;
#endif
case POWER_SUPPLY_PROP_COOL_DOWN:
val->intval = chg->cool_down;
break;
Expand Down
8 changes: 0 additions & 8 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
#define USB_TP_TRANSMISSION_DELAY_MAX 65535 /* ns */
#define USB_PING_RESPONSE_TIME 400 /* ns */

int deny_new_usb __read_mostly = 0;

/* Protect struct usb_device->state and ->children members
* Note: Both are also protected by ->dev.sem, except that ->state can
* change to USB_STATE_NOTATTACHED even when the semaphore isn't held. */
Expand Down Expand Up @@ -5050,12 +5048,6 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
goto done;
return;
}

if (deny_new_usb) {
dev_err(&port_dev->dev, "denied insert of USB device on port %d\n", port1);
goto done;
}

if (hub_is_superspeed(hub->hdev))
unit_load = 150;
else
Expand Down
14 changes: 0 additions & 14 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@
#if defined(CONFIG_SYSCTL)

/* External variables not in a header file. */
#ifdef CONFIG_USB
extern int deny_new_usb;
#endif
extern int suid_dumpable;
#ifdef CONFIG_COREDUMP
extern int core_uses_pid;
Expand Down Expand Up @@ -1266,17 +1263,6 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero,
.extra2 = &two,
},
#endif
#ifdef CONFIG_USB
{
.procname = "deny_new_usb",
.data = &deny_new_usb,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax_sysadmin,
.extra1 = &zero,
.extra2 = &one,
},
#endif
{
.procname = "ngroups_max",
Expand Down
2 changes: 0 additions & 2 deletions techpack/display/msm/dsi/dsi_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ struct dsi_video_engine_cfg {
bool hsa_lp11_en;
bool eof_bllp_lp11_en;
bool bllp_lp11_en;
bool splash_dms;
enum dsi_video_traffic_mode traffic_mode;
u32 vc_id;
u32 dma_sched_line;
Expand Down Expand Up @@ -710,7 +709,6 @@ struct dsi_display_mode {
u32 dsi_mode_flags;
enum dsi_op_mode panel_mode;
bool is_preferred;
bool splash_dms;
struct dsi_display_mode_priv_info *priv_info;
};

Expand Down
Loading

0 comments on commit a78efa5

Please sign in to comment.