Skip to content

Commit

Permalink
Merge pull request OnePlusOSS#3 from OnePlusOSS/oneplus/SM8250_Q_10.0
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
acuicultor authored Jun 14, 2020
2 parents 6d73151 + f894022 commit 18f55bc
Show file tree
Hide file tree
Showing 64 changed files with 2,557 additions and 663 deletions.
52 changes: 28 additions & 24 deletions arch/arm64/boot/dts/vendor/qcom/dsi-panel-samsung_ana6706_dsc.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -402,16 +402,17 @@
qcom,mdss-dsi-panel-gamma-change-write-command = [
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 AA
39 01 00 00 00 00 09 C7 2B 14 C1 2C 0F AE 10 FB
15 01 00 00 00 00 02 B0 B5
15 01 00 00 00 00 02 C7 00
39 01 00 00 00 00 0D C7 2B 14 C1 2C 0F AE 10 FB 01 9A 97 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 A7
39 01 00 00 00 00 09 C9 01 04 3D AE 01 36 00 A5
15 01 00 00 00 00 02 B0 B2
15 01 00 00 00 00 02 C9 00
39 01 00 00 00 00 0D C9 01 04 3D AE 01 36 00 A5 01 14 16 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 1A
39 01 00 00 00 00 0D C9 C5 44 D8 14 B1 CA 10 04 4D 4D 9C 40
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
];
Expand Down Expand Up @@ -824,16 +825,17 @@
qcom,mdss-dsi-panel-gamma-change-write-command = [
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 AA
39 01 00 00 00 00 09 C7 2B 14 C1 2C 0F AE 10 FB
15 01 00 00 00 00 02 B0 B5
15 01 00 00 00 00 02 C7 00
39 01 00 00 00 00 0D C7 2B 14 C1 2C 0F AE 10 FB 01 9A 97 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 A7
39 01 00 00 00 00 09 C9 01 04 3D AE 01 36 00 A5
15 01 00 00 00 00 02 B0 B2
15 01 00 00 00 00 02 C9 00
39 01 00 00 00 00 0D C9 01 04 3D AE 01 36 00 A5 01 14 16 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 1A
39 01 00 00 00 00 0D C9 C5 44 D8 14 B1 CA 10 04 4D 4D 9C 40
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
];
Expand Down Expand Up @@ -1238,16 +1240,17 @@
qcom,mdss-dsi-panel-gamma-change-write-command = [
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 AA
39 01 00 00 00 00 09 C7 2B 14 C1 2C 0F AE 10 FB
15 01 00 00 00 00 02 B0 B5
15 01 00 00 00 00 02 C7 00
39 01 00 00 00 00 0D C7 2B 14 C1 2C 0F AE 10 FB 01 9A 97 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 A7
39 01 00 00 00 00 09 C9 01 04 3D AE 01 36 00 A5
15 01 00 00 00 00 02 B0 B2
15 01 00 00 00 00 02 C9 00
39 01 00 00 00 00 0D C9 01 04 3D AE 01 36 00 A5 01 14 16 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 1A
39 01 00 00 00 00 0D C9 C5 44 D8 14 B1 CA 10 04 4D 4D 9C 40
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
];
Expand Down Expand Up @@ -1653,16 +1656,17 @@
qcom,mdss-dsi-panel-gamma-change-write-command = [
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 AA
39 01 00 00 00 00 09 C7 2B 14 C1 2C 0F AE 10 FB
15 01 00 00 00 00 02 B0 B5
15 01 00 00 00 00 02 C7 00
39 01 00 00 00 00 0D C7 2B 14 C1 2C 0F AE 10 FB 01 9A 97 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 A7
39 01 00 00 00 00 09 C9 01 04 3D AE 01 36 00 A5
15 01 00 00 00 00 02 B0 B2
15 01 00 00 00 00 02 C9 00
39 01 00 00 00 00 0D C9 01 04 3D AE 01 36 00 A5 01 14 16 00
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
39 01 00 00 00 00 03 F0 5A 5A
15 01 00 00 00 00 02 B0 1A
39 01 00 00 00 00 0D C9 C5 44 D8 14 B1 CA 10 04 4D 4D 9C 40
15 01 00 00 00 00 02 F7 0F
39 01 00 00 00 00 03 F0 A5 A5
];
Expand Down
10 changes: 8 additions & 2 deletions arch/arm64/boot/dts/vendor/qcom/kona.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@

removed_mem: removed_region@80b00000 {
no-map;
reg = <0x0 0x80b00000 0x0 0x5300000>;
reg = <0x0 0x80b00000 0x0 0x5700000>;
};

pil_camera_mem: pil_camera_region@86200000 {
Expand Down Expand Up @@ -1356,6 +1356,11 @@
#address-cells = <1>;
#size-cells = <1>;

download_mode@0 {
compatible = "qcom,msm-imem-download_mode";
reg = <0x658 4>;
};

mem_dump_table@10 {
compatible = "qcom,msm-imem-mem_dump_table";
reg = <0x10 0x8>;
Expand Down Expand Up @@ -2358,7 +2363,7 @@

qcom_seecom: qseecom@82400000 {
compatible = "qcom,qseecom";
reg = <0x82400000 0x3A00000>;
reg = <0x82400000 0x3E00000>;
reg-names = "secapp-region";
memory-region = <&qseecom_mem>;
qcom,hlos-num-ce-hw-instances = <1>;
Expand Down Expand Up @@ -3524,6 +3529,7 @@
compatible = "qcom,ipa-smmu-wlan-cb";
iommus = <&apps_smmu 0x5C1 0x0>;
qcom,iommu-dma = "fastmap";
dma-coherent;
};

ipa_smmu_uc: ipa_smmu_uc {
Expand Down
15 changes: 11 additions & 4 deletions drivers/esoc/esoc-mdm-4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,16 @@ static void mdm_get_restart_reason(struct work_struct *work)
}
mdm->get_restart_reason = false;

if (get_esoc_ssr_state() == 1) {
// oem twice or fusion modemdump checkpoint
if (get_esoc_ssr_state() || oem_get_twice_modemdump_state()) {
if (oem_get_download_mode()) {
char detial_buf[] = "\r\nSDX5x esoc0 modem crash";
strlcat(sfr_buf, detial_buf, RD_BUF_SIZE);
char fusion_buf[] = "\r\nSDX5x esoc0 modem crash";
char twice_buf[] = "\r\nTwice Dump To Get Modem Dump\r\n";

if (oem_get_modemdump_mode())
strlcat(sfr_buf, twice_buf, RD_BUF_SIZE);
else
strlcat(sfr_buf, fusion_buf, RD_BUF_SIZE);
esoc_mdm_log("Trigger panic by OEM to get SDX5x dump!\n");
dev_err(dev, "Trigger panic by OEM to get SDX5x dump!\n");
msleep(5000);
Expand Down Expand Up @@ -641,7 +647,8 @@ static irqreturn_t mdm_status_change(int irq, void *dev_id)
esoc_clink_evt_notify(ESOC_BOOT_STATE, esoc);
mdm_trigger_dbg(mdm);
queue_work(mdm->mdm_queue, &mdm->mdm_status_work);
if (mdm->get_restart_reason)
/* OEM : get_restart_reason if twice modemdump is triggered */
if (mdm->get_restart_reason || oem_get_twice_modemdump_state())
queue_work(mdm->mdm_queue, &mdm->restart_reason_work);
if (esoc->auto_boot)
esoc->clink_ops->notify(ESOC_BOOT_DONE, esoc);
Expand Down
14 changes: 14 additions & 0 deletions drivers/esoc/esoc-mdm-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ struct mdm_drv {

#define S3_RESET_DELAY_MS 1000

bool oem_twice_modemdump_en;
bool oem_get_twice_modemdump_state(void)
{
return oem_twice_modemdump_en;
}
EXPORT_SYMBOL(oem_get_twice_modemdump_state);

static void esoc_client_link_power_off(struct esoc_clink *esoc_clink,
unsigned int flags);
static void esoc_client_link_mdm_crash(struct esoc_clink *esoc_clink);
Expand Down Expand Up @@ -456,6 +463,7 @@ static int mdm_subsys_powerup(const struct subsys_desc *crashed_subsys)
const struct esoc_clink_ops * const clink_ops = esoc_clink->clink_ops;
int timeout = INT_MAX;
u8 pon_trial = 0;
oem_twice_modemdump_en = false;

esoc_mdm_log("Powerup request from SSR\n");

Expand Down Expand Up @@ -526,6 +534,12 @@ static int mdm_subsys_powerup(const struct subsys_desc *crashed_subsys)
"Boot failed. Doing cleanup and attempting to retry\n");
pon_trial++;
mdm_subsys_retry_powerup_cleanup(esoc_clink, 0);
// oem sdx5x modem dump checkpoint
if (oem_get_download_mode() && oem_get_modemdump_mode()) {
pr_err("[MDM] Trigger oem twice modemdump\n");
esoc_mdm_log("[MDM] Trigger oem twice modemdump\n");
oem_twice_modemdump_en = true;
}
} else if (mdm_drv->pon_state == PON_SUCCESS) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/esoc/esoc-mdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define DEF_RAMDUMP_DELAY 2000
#define DEF_SHUTDOWN_TIMEOUT 10000
#define DEF_MDM9X55_RESET_TIME 203
#define RD_BUF_SIZE 100
#define RD_BUF_SIZE 256
#define SFR_MAX_RETRIES 10
#define SFR_RETRY_INTERVAL 1000
#define MDM_DBG_OFFSET 0x934
Expand Down
41 changes: 41 additions & 0 deletions drivers/input/keyboard/gpio_keys.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct gpio_button_data {
unsigned int release_delay; /* in msecs, for IRQ-only buttons */

struct delayed_work work;
struct delayed_work press_vol_up;
unsigned int software_debounce; /* in msecs, for GPIO-driven buttons */

unsigned int irq;
Expand Down Expand Up @@ -396,9 +397,33 @@ static void gpio_keys_gpio_work_func(struct work_struct *work)
pm_relax(bdata->input->dev.parent);
}

static void gpio_vol_up_work_func(struct work_struct *work)
{
struct gpio_button_data *bdata =
container_of(work, struct gpio_button_data, press_vol_up.work);
const struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
int state;

state = gpiod_get_value_cansleep(bdata->gpiod);
if (state < 0) {
dev_err(input->dev.parent,
"failed to get gpio state: %d\n", state);
return;
}

if (state && button->code == KEY_VOLUMEUP) {
set_vol_up_status(KEY_PRESSED);
compound_key_to_get_trace("system_server");
}
}

static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
{
struct gpio_button_data *bdata = dev_id;
const struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
int state;

BUG_ON(irq != bdata->irq);

Expand All @@ -421,6 +446,21 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
&bdata->work,
msecs_to_jiffies(bdata->software_debounce));

if (button->code == KEY_VOLUMEUP) {
state = gpiod_get_value(bdata->gpiod);
if (state < 0) {
dev_err(input->dev.parent,
"failed to get gpio state: %d\n", state);
return IRQ_NONE;
}

if (state)
schedule_delayed_work(&bdata->press_vol_up, msecs_to_jiffies(6000));
else {
set_vol_up_status(KEY_RELEASED);
cancel_delayed_work(&bdata->press_vol_up);
}
}
return IRQ_HANDLED;
}

Expand Down Expand Up @@ -571,6 +611,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
}

INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);
INIT_DELAYED_WORK(&bdata->press_vol_up, gpio_vol_up_work_func);

isr = gpio_keys_gpio_isr;
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
Expand Down
37 changes: 37 additions & 0 deletions drivers/input/misc/qpnp-power-on.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -961,13 +961,16 @@ static int qpnp_pon_input_dispatch(struct qpnp_pon *pon, u32 pon_type)
pon_rt_bit = QPNP_PON_KPDPWR_N_SET;
if ((pon_rt_sts & pon_rt_bit) == 0) {
pr_info("Power-Key UP\n");
set_pwr_status(KEY_RELEASED);
schedule_work(&pon->up_work);
cancel_delayed_work(&pon->press_work);
cancel_delayed_work(&pon->press_pwr);
cancel_delayed_work(&pon->press_work_flush);
panic_flush_device_cache_circled_off();
} else {
pr_info("Power-Key DOWN\n");
schedule_delayed_work(&pon->press_work, msecs_to_jiffies(4000));
schedule_delayed_work(&pon->press_pwr, msecs_to_jiffies(6000));
schedule_delayed_work(&pon->press_work_flush, msecs_to_jiffies(7000));
}
break;
Expand Down Expand Up @@ -1235,6 +1238,7 @@ static void press_work_func(struct work_struct *work)
if (display_bl == 0 && boot_mode == MSM_BOOT_MODE_NORMAL) {
oem_force_minidump_mode();
show_state_filter(TASK_UNINTERRUPTIBLE);
send_sig_to_get_trace("system_server");
panic("power key still pressed\n");
}
}
Expand All @@ -1244,6 +1248,38 @@ static void press_work_func(struct work_struct *work)
return;
}

static void press_pwr_func(struct work_struct *work)
{
int rc;
uint pon_rt_sts = 0;
struct qpnp_pon_config *cfg;
struct qpnp_pon *pon =
container_of(work, struct qpnp_pon, press_pwr.work);

cfg = qpnp_get_cfg(pon, PON_KPDPWR);
if (!cfg) {
dev_err(pon->dev, "Invalid config pointer\n");
goto err_return;
}
/* check the RT status to get the current status of the line */
rc = regmap_read(pon->regmap, QPNP_PON_RT_STS(pon), &pon_rt_sts);
if (rc) {
dev_err(pon->dev, "Unable to read PON RT status\n");
goto err_return;
}

if ((pon_rt_sts & QPNP_PON_KPDPWR_N_SET) == 1) {
qpnp_powerkey_state_check(pon, 1);
dev_err(pon->dev, "after 6s Power-Key is still DOWN\n");
set_pwr_status(KEY_PRESSED);
compound_key_to_get_trace("system_server");
}
msleep(20);
ksys_sync();
err_return:
return;
}

static void press_work_flush_func(struct work_struct *work)
{
int rc;
Expand Down Expand Up @@ -2811,6 +2847,7 @@ static int qpnp_pon_probe(struct platform_device *pdev)

INIT_DELAYED_WORK(&pon->bark_work, bark_work_func);
INIT_DELAYED_WORK(&pon->press_work, press_work_func);
INIT_DELAYED_WORK(&pon->press_pwr, press_pwr_func);
INIT_DELAYED_WORK(&pon->press_work_flush, press_work_flush_func);
INIT_WORK(&pon->up_work, up_work_func);

Expand Down
Loading

0 comments on commit 18f55bc

Please sign in to comment.