Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Synchronize codes for OP3_O2_Open_29 && OP3T_O2_Open_20
The changes list:
System
- No need to confirm after using PIN to unlock
- Added OTG toggle in Quick Settings
- Added notification when 3rd party apps delete contacts
- Updated Android security patch to December
- General bug fixes and improvement

Change-Id: I54428f08039d80d9eae01498e7996658caf282f0
  • Loading branch information
andersonchen committed Dec 28, 2017
1 parent 189f8d0 commit 990cc74
Show file tree
Hide file tree
Showing 23 changed files with 251 additions and 352 deletions.
9 changes: 3 additions & 6 deletions Documentation/filesystems/proc.txt
Expand Up @@ -335,7 +335,7 @@ address perms offset dev inode pathname
a7cb1000-a7cb2000 ---p 00000000 00:00 0
a7cb2000-a7eb2000 rw-p 00000000 00:00 0
a7eb2000-a7eb3000 ---p 00000000 00:00 0
a7eb3000-a7ed5000 rw-p 00000000 00:00 0 [stack:1001]
a7eb3000-a7ed5000 rw-p 00000000 00:00 0
a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6
a8008000-a800a000 r--p 00133000 03:00 4222 /lib/libc.so.6
a800a000-a800b000 rw-p 00135000 03:00 4222 /lib/libc.so.6
Expand Down Expand Up @@ -367,7 +367,6 @@ is not associated with a file:

[heap] = the heap of the program
[stack] = the stack of the main process
[stack:1001] = the stack of the thread with tid 1001
[vdso] = the "virtual dynamic shared object",
the kernel system call handler
[anon:<name>] = an anonymous mapping that has been
Expand All @@ -377,10 +376,8 @@ is not associated with a file:

The /proc/PID/task/TID/maps is a view of the virtual memory from the viewpoint
of the individual tasks of a process. In this file you will see a mapping marked
as [stack] if that task sees it as a stack. This is a key difference from the
content of /proc/PID/maps, where you will see all mappings that are being used
as stack by all of those tasks. Hence, for the example above, the task-level
map, i.e. /proc/PID/task/TID/maps for thread 1001 will look like this:
as [stack] if that task sees it as a stack. Hence, for the example above, the
task-level map, i.e. /proc/PID/task/TID/maps for thread 1001 will look like this:

08048000-08049000 r-xp 00000000 03:00 8312 /opt/test
08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/15801_DVT/msm8996.dtsi
Expand Up @@ -1034,7 +1034,7 @@
"cdc-vddpx-1";

qcom,cdc-micbias1-mv = <1800>;
qcom,cdc-micbias2-mv = <1800>;
qcom,cdc-micbias2-mv = <2700>;
qcom,cdc-micbias3-mv = <1800>;
qcom,cdc-micbias4-mv = <1800>;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/15801_PVT/msm8996.dtsi
Expand Up @@ -1034,7 +1034,7 @@
"cdc-vddpx-1";

qcom,cdc-micbias1-mv = <1800>;
qcom,cdc-micbias2-mv = <1800>;
qcom,cdc-micbias2-mv = <2700>;
qcom,cdc-micbias3-mv = <1800>;
qcom,cdc-micbias4-mv = <1800>;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/15811_PVT/msm8996.dtsi
Expand Up @@ -1034,7 +1034,7 @@
"cdc-vddpx-1";

qcom,cdc-micbias1-mv = <1800>;
qcom,cdc-micbias2-mv = <1800>;
qcom,cdc-micbias2-mv = <2700>;
qcom,cdc-micbias3-mv = <1800>;
qcom,cdc-micbias4-mv = <1800>;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/15811_PVT2/msm8996.dtsi
Expand Up @@ -1034,7 +1034,7 @@
"cdc-vddpx-1";

qcom,cdc-micbias1-mv = <1800>;
qcom,cdc-micbias2-mv = <1800>;
qcom,cdc-micbias2-mv = <2700>;
qcom,cdc-micbias3-mv = <1800>;
qcom,cdc-micbias4-mv = <1800>;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/15811_PVT3/msm8996.dtsi
Expand Up @@ -1034,7 +1034,7 @@
"cdc-vddpx-1";

qcom,cdc-micbias1-mv = <1800>;
qcom,cdc-micbias2-mv = <1800>;
qcom,cdc-micbias2-mv = <2700>;
qcom,cdc-micbias3-mv = <1800>;
qcom,cdc-micbias4-mv = <1800>;

Expand Down
1 change: 0 additions & 1 deletion drivers/cpufreq/cpufreq.c
Expand Up @@ -2324,7 +2324,6 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,

policy->min = new_policy->min;
policy->max = new_policy->max;
policy->oneplus_max = policy->max;
trace_cpu_frequency_limits(policy->max, policy->min, policy->cpu);

pr_debug("new min and max freqs are %u - %u kHz\n",
Expand Down
67 changes: 12 additions & 55 deletions drivers/cpufreq/cpufreq_interactive.c
Expand Up @@ -694,17 +694,14 @@ static void cpufreq_interactive_timer(unsigned long data)
if (new_freq >= ppol->policy->max && !jump_to_max_no_ts)
ppol->max_freq_hyst_start_time = now;

if (ppol->target_freq == new_freq &&
ppol->target_freq <= ppol->policy->cur && ppol->target_freq <= ppol->policy->oneplus_max) {
trace_cpufreq_interactive_already(
max_cpu, pol_load, ppol->target_freq,
ppol->policy->cur, new_freq);
spin_unlock_irqrestore(&ppol->target_freq_lock, flags);
goto rearm;
}
trace_printk("new_freq %d oneplus_max %d\n", new_freq, ppol->policy->oneplus_max);
if(new_freq > ppol->policy->oneplus_max)
new_freq = ppol->policy->oneplus_max;
if (ppol->target_freq == new_freq &&
ppol->target_freq <= ppol->policy->cur) {
trace_cpufreq_interactive_already(
max_cpu, pol_load, ppol->target_freq,
ppol->policy->cur, new_freq);
spin_unlock_irqrestore(&ppol->target_freq_lock, flags);
goto rearm;
}

trace_cpufreq_interactive_target(max_cpu, pol_load, ppol->target_freq,
ppol->policy->cur, new_freq);
Expand Down Expand Up @@ -777,10 +774,10 @@ static int cpufreq_interactive_speedchange_task(void *data)
continue;
}

if (ppol->target_freq != ppol->policy->cur)
__cpufreq_driver_target(ppol->policy,
ppol->target_freq,
CPUFREQ_RELATION_H);
if (ppol->target_freq != ppol->policy->cur)
__cpufreq_driver_target(ppol->policy,
ppol->target_freq,
CPUFREQ_RELATION_H);
trace_cpufreq_interactive_setspeed(cpu,
ppol->target_freq,
ppol->policy->cur);
Expand Down Expand Up @@ -833,44 +830,6 @@ static void cpufreq_interactive_boost(struct cpufreq_interactive_tunables *tunab
wake_up_process_no_notif(speedchange_task);
}

extern unsigned int ux_notify;
#define DEFAULT_MAX_FREQ_BIG 2342400
#define DEFAULT_MAX_FREQ_SMALL 1593600

#define LIMIT_FREQ_BIG 1209600
#define LIMIT_FREQ_SMALL 1056000


void reset_cpu_max_freq(void)
{
struct cpufreq_interactive_policyinfo *ppol = per_cpu(polinfo, 0);
ppol->policy->oneplus_max = ppol->policy->max;
ppol = per_cpu(polinfo, 2);
ppol->policy->oneplus_max = ppol->policy->max;
}

void update_cpufreq_policy(int cpu)
{
struct cpufreq_interactive_policyinfo *ppol = per_cpu(polinfo, cpu);
struct sched_cluster *cluster = cpu_rq(cpu)->cluster;
if(ux_notify){
switch(cluster->governor_policy) {
case UX_GOVERNOR:
case UX_GROUP_GOVERNOR:
if(cpu < 2)
ppol->policy->oneplus_max = DEFAULT_MAX_FREQ_SMALL;
else
ppol->policy->oneplus_max = DEFAULT_MAX_FREQ_BIG;
break;
case NEGATIVE_GOVERNOR:
if(cpu < 2)
ppol->policy->oneplus_max = LIMIT_FREQ_SMALL;
else
ppol->policy->oneplus_max = LIMIT_FREQ_BIG;
break;
}
}
}
static int load_change_callback(struct notifier_block *nb, unsigned long val,
void *data)
{
Expand All @@ -896,8 +855,6 @@ static int load_change_callback(struct notifier_block *nb, unsigned long val,
ppol->notif_cpu = cpu;
spin_unlock_irqrestore(&ppol->target_freq_lock, flags);

update_cpufreq_policy(cpu);

if (!hrtimer_is_queued(&ppol->notif_timer))
__hrtimer_start_range_ns(&ppol->notif_timer, ms_to_ktime(1),
0, HRTIMER_MODE_REL, 0);
Expand Down
128 changes: 78 additions & 50 deletions drivers/input/touchscreen/synaptics_driver_s3320.c
Expand Up @@ -552,7 +552,7 @@ static int tpd_hw_pwron(struct synaptics_ts_data *ts)
TPD_DEBUG("synaptics:enable the enable2v8_gpio\n");
gpio_direction_output(ts->enable2v8_gpio, 1);
}

usleep_range(10*1000, 10*1000);
if (!IS_ERR(ts->vcc_i2c_1v8)) {
//regulator_set_optimum_mode(ts->vcc_i2c_1v8,100000);
rc = regulator_enable( ts->vcc_i2c_1v8 );
Expand All @@ -561,14 +561,12 @@ static int tpd_hw_pwron(struct synaptics_ts_data *ts)
//return rc;
}
}
msleep(10);
if( ts->reset_gpio > 0 ) {
usleep_range(10*1000, 10*1000);
if (ts->reset_gpio > 0) {
gpio_direction_output(ts->reset_gpio, 1);
msleep(20);
//usleep_range(10*1000, 10*1000);
usleep_range(10*1000, 10*1000);
gpio_direction_output(ts->reset_gpio, 0);
msleep(20);
//usleep_range(5*1000, 5*1000);
usleep_range(10*1000, 10*1000);
gpio_direction_output(ts->reset_gpio, 1);
TPD_DEBUG("synaptics:enable the reset_gpio\n");
}
Expand Down Expand Up @@ -2954,7 +2952,9 @@ static int tp_baseline_get(struct synaptics_ts_data *ts, bool flag)

mutex_lock(&ts->mutex);
if (ts->gesture_enable)
synaptics_enable_interrupt_for_gesture(ts,false);
synaptics_enable_interrupt_for_gesture(ts, false);
else
synaptics_mode_change(0x00);/*change getbase data*/
ret = synaptics_rmi4_i2c_write_byte(ts->client, 0xff, 0x1);

ret = i2c_smbus_write_byte_data(ts->client, F54_ANALOG_DATA_BASE, 0x03);//select report type 0x03
Expand Down Expand Up @@ -3080,9 +3080,9 @@ static ssize_t limit_enable_write(struct file *file, const char __user *buffer,
int limit_mode = 0;

if(version_is_s3508)
F51_CUSTOM_CTRL74 = 0x0437;
F51_CUSTOM_CTRL74 = 0x0438;
else
F51_CUSTOM_CTRL74 = 0x044D;
F51_CUSTOM_CTRL74 = 0x044E;

if( count > 2)
count = 2;
Expand Down Expand Up @@ -3680,13 +3680,15 @@ static void synaptics_tpedge_limitfunc(void)
int ret;

if(version_is_s3508)
F51_CUSTOM_CTRL74 = 0x0437;
F51_CUSTOM_CTRL74 = 0x0438;
else
F51_CUSTOM_CTRL74 = 0x044D;
F51_CUSTOM_CTRL74 = 0x044E;
msleep(60);
ret = i2c_smbus_write_byte_data(ts_g->client, 0xff, 0x4);
limit_mode = i2c_smbus_read_byte_data(ts_g->client, F51_CUSTOM_CTRL74);
TPD_ERR("%s limit_enable =%d,mode:0x%x !\n", __func__,limit_enable,limit_mode);
ret = i2c_smbus_write_byte_data(ts_g->client, 0xff, 0x4);
limit_mode = i2c_smbus_read_byte_data(ts_g->client,
F51_CUSTOM_CTRL74);
TPD_ERR("%s limit_enable =%d,mode:0x%x !\n",
__func__, limit_enable, limit_mode);
if(limit_mode){
i2c_smbus_write_byte_data(ts_g->client, 0xff, 0x4);
if(0 == limit_enable)
Expand Down Expand Up @@ -4367,8 +4369,9 @@ static int synaptics_i2c_resume(struct device *dev)
struct synaptics_ts_data *ts = dev_get_drvdata(dev);
int ret;
TPD_DEBUG("%s is called\n", __func__);
queue_delayed_work(synaptics_wq,&ts->speed_up_work, msecs_to_jiffies(5));
if (ts->gesture_enable == 1){
queue_delayed_work(synaptics_wq, &ts->speed_up_work,
msecs_to_jiffies(1));
if (ts->gesture_enable == 1) {
/*disable gpio wake system through intterrupt*/
disable_irq_wake(ts->irq);
synaptics_rmi4_i2c_write_byte(ts->client, 0xff, 0x00 );
Expand Down Expand Up @@ -4400,50 +4403,75 @@ static int fb_notifier_callback(struct notifier_block *self, unsigned long event
{
struct fb_event *evdata = data;
int *blank;
int ret;
static int gesture_flag;

struct synaptics_ts_data *ts = container_of(self, struct synaptics_ts_data, fb_notif);

if(FB_EARLY_EVENT_BLANK != event && FB_EVENT_BLANK != event)
return 0;
if((evdata) && (evdata->data) && (ts) && (ts->client))
{
if ((evdata) && (evdata->data) && (ts) && (ts->client)) {
blank = evdata->data;
TPD_DEBUG("%s blank[%d],event[0x%lx]\n", __func__,*blank,event);

if((*blank == FB_BLANK_UNBLANK /*|| *blank == FB_BLANK_VSYNC_SUSPEND || *blank == FB_BLANK_NORMAL*/)\
//&& (event == FB_EVENT_BLANK ))
&& (event == FB_EARLY_EVENT_BLANK ))
{
if (ts->is_suspended == 1)
{
TPD_DEBUG("%s going TP resume start\n", __func__);
TPD_DEBUG("%s blank[%d],event[0x%lx]\n",
__func__, *blank, event);

if ((*blank == FB_BLANK_UNBLANK)
&& (event == FB_EARLY_EVENT_BLANK)) {
if (gesture_flag == 1) {
ts->gesture_enable = 0;
DouTap_gesture = 0;
synaptics_enable_interrupt_for_gesture(ts, 0);
gesture_flag = 0;
} else if (gesture_flag == 2) {
DouTap_gesture = 0;
gesture_flag = 0;
}
if (ts->is_suspended == 1) {
TPD_DEBUG("%s going TP resume start\n",
__func__);
ts->is_suspended = 0;
if (ts->gesture_enable == 0) {
ret = synaptics_mode_change(0x00);
if (ret < 0) {
TPD_ERR("%s line%d ERROR %d!\n",
__func__, __LINE__, ret);
}
}
queue_delayed_work(get_base_report, &ts->base_work,msecs_to_jiffies(1));
queue_delayed_work(get_base_report,
&ts->base_work, msecs_to_jiffies(80));
synaptics_ts_resume(&ts->client->dev);
//atomic_set(&ts->is_stop,0);
TPD_DEBUG("%s going TP resume end\n", __func__);
}
}else if( *blank == FB_BLANK_POWERDOWN && (event == FB_EARLY_EVENT_BLANK ))
{
if (ts->is_suspended == 0)
{
TPD_DEBUG("%s : going TP suspend start\n", __func__);
ts->is_suspended = 1;
atomic_set(&ts->is_stop,1);
if(!(ts->gesture_enable)){
} else if (*blank == FB_BLANK_NORMAL) {
if (ts->gesture_enable == 0) {
DouTap_gesture = 1;
ts->gesture_enable = 1;
i2c_smbus_write_byte_data(ts->client,
0xff, 0x0);
synaptics_mode_change(0x80);
synaptics_ts_suspend(&ts->client->dev);
gesture_flag = 1;
} else if ((ts->gesture_enable == 1) &&
(DouTap_gesture == 0)) {
DouTap_gesture = 1;
gesture_flag = 2;
}
} else if (*blank == FB_BLANK_POWERDOWN &&
(event == FB_EARLY_EVENT_BLANK)) {
if (gesture_flag == 1) {
ts->gesture_enable = 0;
DouTap_gesture = 0;
synaptics_enable_interrupt_for_gesture(ts, 0);
ts->is_suspended = 0;
gesture_flag = 0;
} else if (gesture_flag == 2) {
DouTap_gesture = 0;
ts->is_suspended = 0;
gesture_flag = 0;
}
if (ts->is_suspended == 0) {
TPD_DEBUG("%s : going TP suspend start\n",
__func__);
ts->is_suspended = 1;
atomic_set(&ts->is_stop, 1);
if (!(ts->gesture_enable))
touch_disable(ts);
}
synaptics_ts_suspend(&ts->client->dev);
TPD_DEBUG("%s : going TP suspend end\n", __func__);
}
synaptics_ts_suspend(&ts->client->dev);
TPD_DEBUG("%s : going TP suspend end\n",
__func__);
}
}
}
return 0;
Expand Down

0 comments on commit 990cc74

Please sign in to comment.