summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2023-02-05 19:45:54 -0800
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2023-02-05 19:45:54 -0800
commit30540b635e67ec9729c247cc9d302c4e43537bcf (patch)
tree2cafec52055eeff44add820e9db63d9b540dd24c
parent8659a8d15015d690732185fc2d9f002a23747442 (diff)
parent40318349dd9a54290a0388ca18cb6ad700abb97b (diff)
downloadtangorpro-30540b635e67ec9729c247cc9d302c4e43537bcf.tar.gz
Merge android13-gs-pixel-5.10-tm-qpr2 into android13-gs-pixel-5.10-tm-qpr3
SBMerger: 478053055 Change-Id: I7097d9d2393f65ed59ad6f21e2ee8b6cb53049f8 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--display/panel-boe-ts110f5mlg0.c21
-rw-r--r--display/panel-csot-ppa957db2d.c22
-rw-r--r--dts/gs201-tangorpro-display.dtsi2
-rw-r--r--dts/gs201-tangorpro-thermal.dtsi24
-rw-r--r--dts/gs201-tangorpro-typec.dtsi1
-rw-r--r--dts/gs201-tangorpro-usb.dtsi5
-rw-r--r--pogo/pogo_transport.c89
7 files changed, 151 insertions, 13 deletions
diff --git a/display/panel-boe-ts110f5mlg0.c b/display/panel-boe-ts110f5mlg0.c
index fa1cc52..6070240 100644
--- a/display/panel-boe-ts110f5mlg0.c
+++ b/display/panel-boe-ts110f5mlg0.c
@@ -137,6 +137,24 @@ static const struct exynos_dsi_cmd ts110f5mlg0_init_cmds[] = {
EXYNOS_DSI_CMD_SEQ(0x53, 0x24),
/* CABC initial OFF */
EXYNOS_DSI_CMD_SEQ(0x55, 0x00),
+ /* CMD2, Page2 */
+ EXYNOS_DSI_CMD_SEQ(0xFF, 0x22),
+ EXYNOS_DSI_CMD_SEQ(0xFB, 0x01),
+ /* Set IE parameter */
+ EXYNOS_DSI_CMD_SEQ(0x1A, 0x00),
+ EXYNOS_DSI_CMD_SEQ(0x68, 0x00),
+ EXYNOS_DSI_CMD_SEQ(0xA2, 0x20),
+ EXYNOS_DSI_CMD_SEQ(0x56, 0x77),
+ /* Set IE dark fine tune parameter */
+ EXYNOS_DSI_CMD_SEQ(0x58, 0x10),
+ /* Set IE bright fine tune parameter */
+ EXYNOS_DSI_CMD_SEQ(0x59, 0x1F),
+ /* Set IE dimming mode */
+ EXYNOS_DSI_CMD_SEQ(0x6A, 0x21),
+
+ /* CMD1 */
+ EXYNOS_DSI_CMD_SEQ(0xFF, 0x10),
+ EXYNOS_DSI_CMD_SEQ(0xFB, 0x01),
/* BBh (MIPI via/bypass RAM) */
EXYNOS_DSI_CMD_SEQ(0xBB, 0x13),
/* VBP + VFP = 200 + 26 = 226 */
@@ -245,7 +263,8 @@ static void ts110f5mlg0_set_cabc_mode(struct exynos_panel *ctx,
mode = 0x02;
break;
case CABC_MOVIE_MODE:
- mode = 0x03;
+ /* CABC MOVING MODE & IE */
+ mode = 0x83;
break;
default:
mode = 0x00;
diff --git a/display/panel-csot-ppa957db2d.c b/display/panel-csot-ppa957db2d.c
index 83da9ad..d5f6a10 100644
--- a/display/panel-csot-ppa957db2d.c
+++ b/display/panel-csot-ppa957db2d.c
@@ -137,6 +137,25 @@ static const struct exynos_dsi_cmd ppa957db2d_init_cmds[] = {
EXYNOS_DSI_CMD_SEQ(0x53, 0x24),
/* CABC initial OFF */
EXYNOS_DSI_CMD_SEQ(0x55, 0x00),
+
+ /* CMD2, Page2 */
+ EXYNOS_DSI_CMD_SEQ(0xFF, 0x22),
+ EXYNOS_DSI_CMD_SEQ(0xFB, 0x01),
+ /* Set IE parameter */
+ EXYNOS_DSI_CMD_SEQ(0x1A, 0x00),
+ EXYNOS_DSI_CMD_SEQ(0x68, 0x00),
+ EXYNOS_DSI_CMD_SEQ(0xA2, 0x20),
+ EXYNOS_DSI_CMD_SEQ(0x56, 0x77),
+ /* Set IE dark fine tune parameter */
+ EXYNOS_DSI_CMD_SEQ(0x58, 0x10),
+ /* Set IE bright fine tune parameter */
+ EXYNOS_DSI_CMD_SEQ(0x59, 0x1F),
+ /* Set IE dimming mode */
+ EXYNOS_DSI_CMD_SEQ(0x6A, 0x21),
+
+ /* CMD1 */
+ EXYNOS_DSI_CMD_SEQ(0xFF, 0x10),
+ EXYNOS_DSI_CMD_SEQ(0xFB, 0x01),
/* BBh (MIPI via/bypass RAM) */
EXYNOS_DSI_CMD_SEQ(0xBB, 0x13),
/* VBP + VFP = 200 + 26 = 226 */
@@ -232,7 +251,8 @@ static void ts110f5mlg0_set_cabc_mode(struct exynos_panel *ctx,
mode = 0x02;
break;
case CABC_MOVIE_MODE:
- mode = 0x03;
+ /* CABC MOVING MODE & IE */
+ mode = 0x83;
break;
default:
mode = 0x00;
diff --git a/dts/gs201-tangorpro-display.dtsi b/dts/gs201-tangorpro-display.dtsi
index 178390b..cf9923a 100644
--- a/dts/gs201-tangorpro-display.dtsi
+++ b/dts/gs201-tangorpro-display.dtsi
@@ -104,7 +104,6 @@
* If bootloader probed rt4801_bias successfully, it will change
* tps65132_bias to status = "disabled"
*/
- status = "okay";
compatible = "ti,tps65132";
reg = <0x3e>;
@@ -129,7 +128,6 @@
* If bootloader probed tps65132_bias successfully, it will change
* rt4801_bias to status = "disabled"
*/
- status = "okay";
compatible = "richtek,rt4801";
reg = <0x73>;
enable-gpios = <&gpp23 1 GPIO_ACTIVE_HIGH>;
diff --git a/dts/gs201-tangorpro-thermal.dtsi b/dts/gs201-tangorpro-thermal.dtsi
index 7ba2c6f..dd1e38d 100644
--- a/dts/gs201-tangorpro-thermal.dtsi
+++ b/dts/gs201-tangorpro-thermal.dtsi
@@ -40,10 +40,20 @@
thermal-sensors = <&gs201_tm1 1>;
trips {
trip_config1: trip-config1 {
- temperature = <125000>;
+ temperature = <62000>;
hysteresis = <1000>;
type = "passive";
};
+ backup_shutdown_sw1: backup-shutdown-sw1 {
+ temperature = <64000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ backup_shutdown_hw1: backup-shutdown-hw1 {
+ temperature = <66000>;
+ hysteresis = <1000>;
+ type = "hot";
+ };
};
};
charger_skin_therm {
@@ -92,10 +102,20 @@
thermal-sensors = <&gs201_tm1 5>;
trips {
trip_config5: trip-config5 {
- temperature = <125000>;
+ temperature = <55000>;
hysteresis = <1000>;
type = "passive";
};
+ backup_shutdown_sw2: backup-shutdown-sw2 {
+ temperature = <57000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ backup_shutdown_hw2: backup-shutdown-hw2 {
+ temperature = <59000>;
+ hysteresis = <1000>;
+ type = "hot";
+ };
};
};
therm_6 {
diff --git a/dts/gs201-tangorpro-typec.dtsi b/dts/gs201-tangorpro-typec.dtsi
index 0251f6d..4cec095 100644
--- a/dts/gs201-tangorpro-typec.dtsi
+++ b/dts/gs201-tangorpro-typec.dtsi
@@ -14,5 +14,6 @@
PDO_FIXED_HIGHER_CAP |
PDO_FIXED_DUAL_ROLE)
PDO_FIXED(9000, 2200, 0)>;
+ /delete-property/ new-source-frs-typec-current;
};
};
diff --git a/dts/gs201-tangorpro-usb.dtsi b/dts/gs201-tangorpro-usb.dtsi
index 5e1eaf6..f512a5d 100644
--- a/dts/gs201-tangorpro-usb.dtsi
+++ b/dts/gs201-tangorpro-usb.dtsi
@@ -42,4 +42,9 @@
&udc {
extcon = <&max77759tcpc &google_pogo>;
+ force_gen1;
+};
+
+&usbdrd_dwc3 {
+ maximum-speed = "super-speed";
};
diff --git a/pogo/pogo_transport.c b/pogo/pogo_transport.c
index d8baeff..b070ac2 100644
--- a/pogo/pogo_transport.c
+++ b/pogo/pogo_transport.c
@@ -40,6 +40,7 @@
#define KEEP_HUB_PATH 2
#define POGO_VOTER "POGO"
+#define SSPHY_RESTART_EL "SSPHY_RESTART"
enum pogo_event_type {
/* Reported when docking status changes */
@@ -67,6 +68,8 @@ enum pogo_event_type {
/* Bypass the accessory detection and enable POGO Vout and POGO USB capability */
/* This event is for debug only and never used in normal operations. */
EVENT_FORCE_ACC_CONNECT,
+ /* Reported when CC orientation has changed */
+ EVENT_ORIENTATION_CHANGED,
};
static bool modparam_force_usb;
@@ -160,12 +163,16 @@ struct pogo_transport {
/* When true, disable voltage based detection of pogo partners */
bool disable_voltage_detection;
struct gvotable_election *charger_mode_votable;
+ struct gvotable_election *ssphy_restart_votable;
/* Used for cancellable work such as pogo debouncing */
struct kthread_delayed_work pogo_accessory_debounce_work;
/* Pogo accessory detection status */
enum pogo_accessory_detection accessory_detection_enabled;
+
+ /* Orientation of USB-C, 0:TYPEC_POLARITY_CC1 1:TYPEC_POLARITY_CC2 */
+ enum typec_cc_polarity polarity;
};
static const unsigned int pogo_extcon_cable[] = {
@@ -202,6 +209,21 @@ static void update_extcon_dev(struct pogo_transport *pogo_transport, bool docked
dev_err(pogo_transport->dev, "%s Failed to clear EXTCON_USB\n", __func__);
}
+static void ssphy_restart_control(struct pogo_transport *pogo_transport, bool enable)
+{
+ if (!pogo_transport->ssphy_restart_votable)
+ pogo_transport->ssphy_restart_votable =
+ gvotable_election_get_handle(SSPHY_RESTART_EL);
+
+ if (IS_ERR_OR_NULL(pogo_transport->ssphy_restart_votable)) {
+ logbuffer_log(pogo_transport->log, "SSPHY_RESTART get failed %ld\n",
+ PTR_ERR(pogo_transport->ssphy_restart_votable));
+ return;
+ }
+
+ gvotable_cast_long_vote(pogo_transport->ssphy_restart_votable, POGO_VOTER, enable, enable);
+}
+
static void disable_and_bypass_hub(struct pogo_transport *pogo_transport)
{
int ret;
@@ -215,6 +237,12 @@ static void disable_and_bypass_hub(struct pogo_transport *pogo_transport)
gpio_get_value(pogo_transport->pogo_hub_sel_gpio));
pogo_transport->pogo_hub_active = false;
+ /*
+ * No further action in the callback of the votable if it is disabled. Disable it here for
+ * the bookkeeping purpose in the dumpstate.
+ */
+ ssphy_restart_control(pogo_transport, false);
+
if (pogo_transport->hub_ldo && regulator_is_enabled(pogo_transport->hub_ldo) > 0) {
ret = regulator_disable(pogo_transport->hub_ldo);
if (ret)
@@ -445,8 +473,28 @@ static void update_pogo_transport(struct pogo_transport *pogo_transport,
}
break;
case EVENT_MOVE_DATA_TO_USB:
- if (pogo_transport->pogo_usb_active)
+ if (pogo_transport->pogo_usb_active) {
switch_to_usbc_locked(pogo_transport);
+
+ /*
+ * During the function call "switch_to_usbc_locked", the USB controller
+ * restarted and the orientation of the USB phy was reset to the default
+ * value CC1 because Type-C drivers had no chance to update the real
+ * orientation. Update and restart the superspeed phy if CC2 is connected.
+ */
+ if (pogo_transport->polarity == TYPEC_POLARITY_CC2) {
+ union extcon_property_value prop;
+ prop.intval = (int)TYPEC_POLARITY_CC2;
+ ret = extcon_set_property_sync(chip->extcon, EXTCON_USB_HOST,
+ EXTCON_PROP_USB_TYPEC_POLARITY,
+ prop);
+ if (ret)
+ logbuffer_log(pogo_transport->log,
+ "Failed to set polarity, ret %d", ret);
+
+ ssphy_restart_control(pogo_transport, true);
+ }
+ }
break;
case EVENT_MOVE_DATA_TO_POGO:
/* Currently this event is bundled to force_pogo. This case is unreachable. */
@@ -605,6 +653,20 @@ static void update_pogo_transport(struct pogo_transport *pogo_transport,
pogo_transport->pogo_usb_capable = true;
break;
#endif
+ case EVENT_ORIENTATION_CHANGED:
+ /* Update the orientation and restart the ssphy if hub is enabled */
+ if (pogo_transport->pogo_hub_active) {
+ union extcon_property_value prop;
+ prop.intval = (int)pogo_transport->polarity;
+ ret = extcon_set_property_sync(chip->extcon, EXTCON_USB_HOST,
+ EXTCON_PROP_USB_TYPEC_POLARITY, prop);
+ if (ret)
+ logbuffer_log(pogo_transport->log, "Failed to set polarity, ret %d",
+ ret);
+
+ ssphy_restart_control(pogo_transport, true);
+ }
+ break;
default:
break;
}
@@ -749,6 +811,17 @@ static void data_active_changed(void *data)
pogo_transport_event(pogo_transport, EVENT_DATA_ACTIVE_CHANGED, 0);
}
+static void orientation_changed(void *data)
+{
+ struct pogo_transport *pogo_transport = data;
+ struct max77759_plat *chip = pogo_transport->chip;
+
+ if (pogo_transport->polarity != chip->polarity) {
+ pogo_transport->polarity = chip->polarity;
+ pogo_transport_event(pogo_transport, EVENT_ORIENTATION_CHANGED, 0);
+ }
+}
+
static irqreturn_t pogo_isr(int irq, void *dev_id)
{
struct pogo_transport *pogo_transport = dev_id;
@@ -1236,6 +1309,9 @@ static int pogo_transport_probe(struct platform_device *pdev)
#endif
register_data_active_callback(data_active_changed, pogo_transport);
+ register_orientation_callback(orientation_changed, pogo_transport);
+ /* run once in case orientation has changed before registering the callback */
+ orientation_changed((void *)pogo_transport);
dev_info(&pdev->dev, "force usb:%d\n", modparam_force_usb ? 1 : 0);
put_device(&data_client->dev);
of_node_put(data_np);
@@ -1364,8 +1440,8 @@ static ssize_t enable_hub_store(struct device *dev, struct device_attribute *att
else
pogo_transport->force_hub_enabled = false;
- logbuffer_log(pogo_transport->log, "%s: %sable hub, force_hub_enabled %u", __func__,
- enable_hub ? "en" : "dis", pogo_transport->force_hub_enabled);
+ dev_info(pogo_transport->dev, "hub %u, force_hub_enabled %u\n", enable_hub,
+ pogo_transport->force_hub_enabled);
if (enable_hub)
pogo_transport_event(pogo_transport, EVENT_ENABLE_HUB, 0);
else
@@ -1391,8 +1467,7 @@ static ssize_t hall1_s_store(struct device *dev, struct device_attribute *attr,
return size;
if (!pogo_transport->accessory_detection_enabled) {
- logbuffer_log(pogo_transport->log, "%s:Accessory detection disabled ? skipping",
- __func__);
+ dev_info(pogo_transport->dev, "Accessory detection disabled\n");
return size;
}
@@ -1413,8 +1488,8 @@ static ssize_t hall1_s_store(struct device *dev, struct device_attribute *attr,
else
pogo_transport->mfg_acc_test = false;
- logbuffer_log(pogo_transport->log, "%s: %sable accessory detection, mfg %u", __func__,
- enable_acc_detect ? "en" : "dis", pogo_transport->mfg_acc_test);
+ dev_info(pogo_transport->dev, "accessory detection %u, mfg %u\n", enable_acc_detect,
+ pogo_transport->mfg_acc_test);
if (enable_acc_detect)
pogo_transport_event(pogo_transport, EVENT_HALL_SENSOR_ACC_DETECTED, 0);
else