diff options
author | Ulrich Huber | 2022-09-21 22:22:53 +0200 |
---|---|---|
committer | Ulrich Huber | 2022-09-21 22:24:35 +0200 |
commit | 778a33aea26bdc9b92b9681980e2081c4899ddb9 (patch) | |
tree | 96bffb72ec28614e08a89141c26dca1da39031f4 /0006-ucsi.patch | |
parent | 3b45b83f896a7e2fa1d88201c4f561c9decabc2e (diff) | |
download | aur-linux-yoga9.tar.gz |
Update to 5.19.9-arch1 with adapted fixes from Philipp Jungkamp
Diffstat (limited to '0006-ucsi.patch')
-rw-r--r-- | 0006-ucsi.patch | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/0006-ucsi.patch b/0006-ucsi.patch deleted file mode 100644 index 3012ed114502..000000000000 --- a/0006-ucsi.patch +++ /dev/null @@ -1,107 +0,0 @@ - - -Polling also the PDOs, just like the alt modes. - -After this ucsi_handle_connector_change() doesn't execute -any commands. - -Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> ---- - drivers/usb/typec/ucsi/ucsi.c | 30 +++++++++++++++++------------- - 1 file changed, 17 insertions(+), 13 deletions(-) - -diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c -index 188181737acf0..e7267e47c3e4d 100644 ---- a/drivers/usb/typec/ucsi/ucsi.c -+++ b/drivers/usb/typec/ucsi/ucsi.c -@@ -571,7 +571,7 @@ static int ucsi_get_pdos(struct ucsi_connector *con, int is_partner, - command |= UCSI_GET_PDOS_SRC_PDOS; - ret = ucsi_send_command(ucsi, command, pdos + offset, - num_pdos * sizeof(u32)); -- if (ret < 0) -+ if (ret < 0 && ret != -ETIMEDOUT) - dev_err(ucsi->dev, "UCSI_GET_PDOS failed (%d)\n", ret); - if (ret == 0 && offset == 0) - dev_warn(ucsi->dev, "UCSI_GET_PDOS returned 0 bytes\n"); -@@ -579,26 +579,30 @@ static int ucsi_get_pdos(struct ucsi_connector *con, int is_partner, - return ret; - } - --static void ucsi_get_src_pdos(struct ucsi_connector *con, int is_partner) -+static int ucsi_get_src_pdos(struct ucsi_connector *con) - { - int ret; - - /* UCSI max payload means only getting at most 4 PDOs at a time */ - ret = ucsi_get_pdos(con, 1, con->src_pdos, 0, UCSI_MAX_PDOS); - if (ret < 0) -- return; -+ return ret; - - con->num_pdos = ret / sizeof(u32); /* number of bytes to 32-bit PDOs */ - if (con->num_pdos < UCSI_MAX_PDOS) -- return; -+ return 0; - - /* get the remaining PDOs, if any */ - ret = ucsi_get_pdos(con, 1, con->src_pdos, UCSI_MAX_PDOS, - PDO_MAX_OBJECTS - UCSI_MAX_PDOS); - if (ret < 0) -- return; -+ return ret; - - con->num_pdos += ret / sizeof(u32); -+ -+ ucsi_port_psy_changed(con); -+ -+ return 0; - } - - static int ucsi_check_altmodes(struct ucsi_connector *con) -@@ -626,7 +630,7 @@ static void ucsi_pwr_opmode_change(struct ucsi_connector *con) - case UCSI_CONSTAT_PWR_OPMODE_PD: - con->rdo = con->status.request_data_obj; - typec_set_pwr_opmode(con->port, TYPEC_PWR_MODE_PD); -- ucsi_get_src_pdos(con, 1); -+ ucsi_partner_task(con, ucsi_get_src_pdos, 30, 0); - ucsi_partner_task(con, ucsi_check_altmodes, 30, 0); - break; - case UCSI_CONSTAT_PWR_OPMODE_TYPEC1_5: -@@ -844,12 +848,6 @@ static void ucsi_handle_connector_change(struct work_struct *work) - - role = !!(con->status.flags & UCSI_CONSTAT_PWR_DIR); - -- if (con->status.change & UCSI_CONSTAT_POWER_OPMODE_CHANGE || -- con->status.change & UCSI_CONSTAT_POWER_LEVEL_CHANGE) { -- ucsi_pwr_opmode_change(con); -- ucsi_port_psy_changed(con); -- } -- - if (con->status.change & UCSI_CONSTAT_POWER_DIR_CHANGE) { - typec_set_pwr_role(con->port, role); - -@@ -900,6 +898,10 @@ static void ucsi_handle_connector_change(struct work_struct *work) - con->num, u_role); - } - -+ if (con->status.change & UCSI_CONSTAT_POWER_OPMODE_CHANGE || -+ con->status.change & UCSI_CONSTAT_POWER_LEVEL_CHANGE) -+ ucsi_pwr_opmode_change(con); -+ - if (con->status.change & UCSI_CONSTAT_PARTNER_CHANGE) - ucsi_partner_change(con); - -@@ -1248,8 +1250,10 @@ static int ucsi_register_port(struct ucsi *ucsi, int index) - ret = 0; - } - -- if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) == UCSI_CONSTAT_PWR_OPMODE_PD) -+ if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) == UCSI_CONSTAT_PWR_OPMODE_PD) { -+ ucsi_get_src_pdos(con); - ucsi_check_altmodes(con); -+ } - - trace_ucsi_register_port(con->num, &con->status); - --- -2.32.0 |