diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/Revert-usb-typec-tcpm-unregister-existing-source-caps-before-re.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/Revert-usb-typec-tcpm-unregister-existing-source-caps-before-re.patch index 10283b540f..383b82300d 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/Revert-usb-typec-tcpm-unregister-existing-source-caps-before-re.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/Revert-usb-typec-tcpm-unregister-existing-source-caps-before-re.patch @@ -1,4 +1,4 @@ -From d8739f5600dd1c3110dd72f77fb2bd9a4f36a17a Mon Sep 17 00:00:00 2001 +From 1ad5926ae83a3a17ac5dca6fbc9ef0247b97d4ae Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Tue, 7 May 2024 18:39:12 +0200 Subject: Revert "usb: typec: tcpm: unregister existing source caps before @@ -10,10 +10,10 @@ This reverts commit 230ecdf71a644c9c73e0e6735b33173074ae3f94. 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c -index aa2fa720af15..bc00bf2e6761 100644 +index 43e3dac5129f..ad77ad6f4bb0 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c -@@ -3058,7 +3058,7 @@ static int tcpm_register_source_caps(struct tcpm_port *port) +@@ -3059,7 +3059,7 @@ static int tcpm_register_source_caps(struct tcpm_port *port) { struct usb_power_delivery_desc desc = { port->negotiated_rev }; struct usb_power_delivery_capabilities_desc caps = { }; @@ -22,7 +22,7 @@ index aa2fa720af15..bc00bf2e6761 100644 if (!port->partner_pd) port->partner_pd = usb_power_delivery_register(NULL, &desc); -@@ -3068,11 +3068,6 @@ static int tcpm_register_source_caps(struct tcpm_port *port) +@@ -3069,11 +3069,6 @@ static int tcpm_register_source_caps(struct tcpm_port *port) memcpy(caps.pdo, port->source_caps, sizeof(u32) * port->nr_source_caps); caps.role = TYPEC_SOURCE; @@ -35,5 +35,5 @@ index aa2fa720af15..bc00bf2e6761 100644 if (IS_ERR(cap)) return PTR_ERR(cap); -- -2.43.0 +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Add-OF-extcon-support.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Add-OF-extcon-support.patch index 0b5be2b145..e9a08d446b 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Add-OF-extcon-support.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Add-OF-extcon-support.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0eafadad0a2e9ae9f369fbf19570051f2318e56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Sun, 14 Nov 2021 01:14:25 +0100 Subject: usb: typec: fusb302: Add OF extcon support @@ -13,10 +13,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 10 insertions(+) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index b8b8f0e96b63..74246d836019 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -518,6 +518,16 @@ static int tcpm_get_current_limit(struct tcpc_dev *dev) +@@ -520,6 +520,16 @@ static int tcpm_get_current_limit(struct tcpc_dev *dev) int current_limit = 0; unsigned long timeout; @@ -34,5 +34,5 @@ index 111111111111..222222222222 100644 return 0; -- -Armbian +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Clear-interrupts-before-we-start-toggling.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Clear-interrupts-before-we-start-toggling.patch index 399d3c6cbe..aa0621b3cb 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Clear-interrupts-before-we-start-toggling.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Clear-interrupts-before-we-start-toggling.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From da8fb02dbd1474ffee7a31b1db2a03b810954604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Sat, 20 Nov 2021 14:35:10 +0100 Subject: usb: typec: fusb302: Clear interrupts before we start toggling @@ -11,10 +11,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 7 insertions(+) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index 74246d836019..14678850290e 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -586,6 +586,7 @@ static int fusb302_set_toggling(struct fusb302_chip *chip, +@@ -588,6 +588,7 @@ static int fusb302_set_toggling(struct fusb302_chip *chip, enum toggling_mode mode) { int ret = 0; @@ -22,7 +22,7 @@ index 111111111111..222222222222 100644 /* first disable toggling */ ret = fusb302_i2c_clear_bits(chip, FUSB_REG_CONTROL2, -@@ -644,6 +645,12 @@ static int fusb302_set_toggling(struct fusb302_chip *chip, +@@ -646,6 +647,12 @@ static int fusb302_set_toggling(struct fusb302_chip *chip, } else { /* Datasheet says vconn MUST be off when toggling */ WARN(chip->vconn_on, "Vconn is on during toggle start"); @@ -36,5 +36,5 @@ index 111111111111..222222222222 100644 ret = fusb302_i2c_clear_bits(chip, FUSB_REG_MASKA, FUSB_REG_MASKA_TOGDONE); -- -Armbian +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Extend-debugging-interface-with-driver-state-.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Extend-debugging-interface-with-driver-state-.patch index 87cbb3fff5..25c845494d 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Extend-debugging-interface-with-driver-state-.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Extend-debugging-interface-with-driver-state-.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From c77aaa7abfebc6c0fa16d44dc2927e95bd556d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Sun, 7 Nov 2021 19:29:06 +0100 Subject: usb: typec: fusb302: Extend debugging interface with driver state @@ -8,14 +8,14 @@ This is useful for debugging. Signed-off-by: Ondrej Jirman --- - drivers/usb/typec/tcpm/fusb302.c | 78 ++++++++++ + drivers/usb/typec/tcpm/fusb302.c | 78 ++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index 5f4393b48c8a..0c4c9dad4553 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -207,6 +207,81 @@ static int fusb302_debug_show(struct seq_file *s, void *v) +@@ -209,6 +209,81 @@ static int fusb302_debug_show(struct seq_file *s, void *v) } DEFINE_SHOW_ATTRIBUTE(fusb302_debug); @@ -97,7 +97,7 @@ index 111111111111..222222222222 100644 static void fusb302_debugfs_init(struct fusb302_chip *chip) { char name[NAME_MAX]; -@@ -216,6 +291,9 @@ static void fusb302_debugfs_init(struct fusb302_chip *chip) +@@ -218,6 +293,9 @@ static void fusb302_debugfs_init(struct fusb302_chip *chip) chip->dentry = debugfs_create_dir(name, usb_debug_root); debugfs_create_file("log", S_IFREG | 0444, chip->dentry, chip, &fusb302_debug_fops); @@ -108,5 +108,5 @@ index 111111111111..222222222222 100644 static void fusb302_debugfs_exit(struct fusb302_chip *chip) -- -Armbian +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-More-useful-of-logging-status-on-interrupt.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-More-useful-of-logging-status-on-interrupt.patch index c9de6ee740..db07832efa 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-More-useful-of-logging-status-on-interrupt.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-More-useful-of-logging-status-on-interrupt.patch @@ -12,10 +12,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 104 insertions(+), 17 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index 86184475002f..8338954c2308 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -68,7 +68,7 @@ static const u8 rd_mda_value[] = { +@@ -69,7 +69,7 @@ static const u8 rd_mda_value[] = { }; #define LOG_BUFFER_ENTRIES 1024 @@ -24,7 +24,7 @@ index 111111111111..222222222222 100644 struct fusb302_chip { struct device *dev; -@@ -1598,6 +1598,84 @@ static irqreturn_t fusb302_irq_intn(int irq, void *dev_id) +@@ -1606,6 +1606,84 @@ static irqreturn_t fusb302_irq_intn(int irq, void *dev_id) return IRQ_HANDLED; } @@ -109,7 +109,7 @@ index 111111111111..222222222222 100644 static void fusb302_irq_work(struct work_struct *work) { struct fusb302_chip *chip = container_of(work, struct fusb302_chip, -@@ -1607,6 +1685,7 @@ static void fusb302_irq_work(struct work_struct *work) +@@ -1615,6 +1693,7 @@ static void fusb302_irq_work(struct work_struct *work) u8 interrupta; u8 interruptb; u8 status0; @@ -117,7 +117,7 @@ index 111111111111..222222222222 100644 bool vbus_present; bool comp_result; bool intr_togdone; -@@ -1632,9 +1711,10 @@ static void fusb302_irq_work(struct work_struct *work) +@@ -1640,9 +1719,10 @@ static void fusb302_irq_work(struct work_struct *work) ret = fusb302_i2c_read(chip, FUSB_REG_STATUS0, &status0); if (ret < 0) goto done; @@ -131,7 +131,7 @@ index 111111111111..222222222222 100644 if (interrupt & FUSB_REG_INTERRUPT_VBUSOK) { vbus_present = !!(status0 & FUSB_REG_STATUS0_VBUSOK); -@@ -1646,32 +1726,39 @@ static void fusb302_irq_work(struct work_struct *work) +@@ -1654,32 +1734,39 @@ static void fusb302_irq_work(struct work_struct *work) } } @@ -176,7 +176,7 @@ index 111111111111..222222222222 100644 + comp_result = !!(status0 & FUSB_REG_STATUS0_COMP); - fusb302_log(chip, "IRQ: COMP_CHNG, comp=%s", -- comp_result ? "true" : "false"); +- str_true_false(comp_result)); - if (comp_result) { + fusb302_log(chip, "IRQ: COMP_CHNG, cc* %s mdac (%u mV)", + comp_result ? ">" : "<", ((mda & 0x3f) + 1) * 42 * (mda & BIT(6) ? 10 : 1)); diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Retry-reading-of-CC-pins-status-if-activity-i.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Retry-reading-of-CC-pins-status-if-activity-i.patch index 495cc8841f..8ebb9baf56 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Retry-reading-of-CC-pins-status-if-activity-i.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Retry-reading-of-CC-pins-status-if-activity-i.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0367972a055b7cba6c13f1324e53d1dfd8e61896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Tue, 23 Nov 2021 17:53:27 +0100 Subject: usb: typec: fusb302: Retry reading of CC pins status if activity is @@ -9,14 +9,14 @@ also help when this happens. Signed-off-by: Ondrej Jirman --- - drivers/usb/typec/tcpm/fusb302.c | 34 +++++++++- + drivers/usb/typec/tcpm/fusb302.c | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index 0c4c9dad4553..86184475002f 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -1317,6 +1317,36 @@ static int fusb302_handle_togdone_snk(struct fusb302_chip *chip, +@@ -1325,6 +1325,36 @@ static int fusb302_handle_togdone_snk(struct fusb302_chip *chip, return ret; } @@ -53,7 +53,7 @@ index 111111111111..222222222222 100644 /* On error returns < 0, otherwise a typec_cc_status value */ static int fusb302_get_src_cc_status(struct fusb302_chip *chip, enum typec_cc_polarity cc_polarity, -@@ -1344,7 +1374,7 @@ static int fusb302_get_src_cc_status(struct fusb302_chip *chip, +@@ -1352,7 +1382,7 @@ static int fusb302_get_src_cc_status(struct fusb302_chip *chip, return ret; usleep_range(50, 100); @@ -62,7 +62,7 @@ index 111111111111..222222222222 100644 if (ret < 0) return ret; -@@ -1360,7 +1390,7 @@ static int fusb302_get_src_cc_status(struct fusb302_chip *chip, +@@ -1368,7 +1398,7 @@ static int fusb302_get_src_cc_status(struct fusb302_chip *chip, return ret; usleep_range(50, 100); @@ -72,5 +72,5 @@ index 111111111111..222222222222 100644 return ret; -- -Armbian +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Set-the-current-before-enabling-pullups.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Set-the-current-before-enabling-pullups.patch index bfdee839cc..a66194f739 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Set-the-current-before-enabling-pullups.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Set-the-current-before-enabling-pullups.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 1d0df315f346161b8551df9a9580671ee03ee2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Sun, 7 Nov 2021 19:28:27 +0100 Subject: usb: typec: fusb302: Set the current before enabling pullups @@ -8,14 +8,14 @@ current setting being applied to CC pin. Signed-off-by: Ondrej Jirman --- - drivers/usb/typec/tcpm/fusb302.c | 16 +++++----- + drivers/usb/typec/tcpm/fusb302.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index b68f53f70f9a..5f4393b48c8a 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -635,6 +635,14 @@ static int tcpm_set_cc(struct tcpc_dev *dev, enum typec_cc_status cc) +@@ -637,6 +637,14 @@ static int tcpm_set_cc(struct tcpc_dev *dev, enum typec_cc_status cc) goto done; } @@ -30,7 +30,7 @@ index 111111111111..222222222222 100644 ret = fusb302_i2c_mask_write(chip, FUSB_REG_SWITCHES0, switches0_mask, switches0_data); if (ret < 0) { -@@ -645,14 +653,6 @@ static int tcpm_set_cc(struct tcpc_dev *dev, enum typec_cc_status cc) +@@ -647,14 +655,6 @@ static int tcpm_set_cc(struct tcpc_dev *dev, enum typec_cc_status cc) chip->cc1 = TYPEC_CC_OPEN; chip->cc2 = TYPEC_CC_OPEN; @@ -46,5 +46,5 @@ index 111111111111..222222222222 100644 switch (cc) { case TYPEC_CC_RP_DEF: -- -Armbian +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Slightly-increase-wait-time-for-BC1.2-result.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Slightly-increase-wait-time-for-BC1.2-result.patch index 85e37f7c3a..af95d92c49 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Slightly-increase-wait-time-for-BC1.2-result.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Slightly-increase-wait-time-for-BC1.2-result.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 5664287d393c65479d5b99f7deeb98fea390a147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Sun, 30 Jan 2022 23:46:37 +0100 Subject: usb: typec: fusb302: Slightly increase wait time for BC1.2 result @@ -13,10 +13,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index 870a71f953f6..b68f53f70f9a 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -445,9 +445,9 @@ static int tcpm_get_current_limit(struct tcpc_dev *dev) +@@ -447,9 +447,9 @@ static int tcpm_get_current_limit(struct tcpc_dev *dev) /* * USB2 Charger detection may still be in progress when we get here, @@ -29,5 +29,5 @@ index 111111111111..222222222222 100644 if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_SDP) == 1) current_limit = 500; -- -Armbian +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Update-VBUS-state-even-if-VBUS-interrupt-is-n.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Update-VBUS-state-even-if-VBUS-interrupt-is-n.patch index c692b4df76..59d119c326 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Update-VBUS-state-even-if-VBUS-interrupt-is-n.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-fusb302-Update-VBUS-state-even-if-VBUS-interrupt-is-n.patch @@ -12,10 +12,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c -index 111111111111..222222222222 100644 +index 8338954c2308..b8b8f0e96b63 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c -@@ -1716,14 +1716,16 @@ static void fusb302_irq_work(struct work_struct *work) +@@ -1724,14 +1724,16 @@ static void fusb302_irq_work(struct work_struct *work) fusb302_print_state(chip); @@ -24,7 +24,7 @@ index 111111111111..222222222222 100644 + vbus_present = !!(status0 & FUSB_REG_STATUS0_VBUSOK); + if (interrupt & FUSB_REG_INTERRUPT_VBUSOK) fusb302_log(chip, "IRQ: VBUS_OK, vbus=%s", - vbus_present ? "On" : "Off"); + str_on_off(vbus_present)); - if (vbus_present != chip->vbus_present) { - chip->vbus_present = vbus_present; - tcpm_vbus_change(chip->tcpm_port); @@ -33,7 +33,7 @@ index 111111111111..222222222222 100644 + chip->vbus_present = vbus_present; + if (!(interrupt & FUSB_REG_INTERRUPT_VBUSOK)) + fusb302_log(chip, "IRQ: VBUS changed without interrupt, vbus=%s", -+ vbus_present ? "On" : "Off"); ++ str_on_off(vbus_present)); + tcpm_vbus_change(chip->tcpm_port); } diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Fix-PD-devices-capabilities-registration.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Fix-PD-devices-capabilities-registration.patch index 5de04aeae5..c2c3e5c8cc 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Fix-PD-devices-capabilities-registration.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Fix-PD-devices-capabilities-registration.patch @@ -1,4 +1,4 @@ -From 93ce0ca78914df9e1d90e082a838cf1f1535728c Mon Sep 17 00:00:00 2001 +From 0bc97969e975df063c38a3cb44c0accb9a7f9ff3 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Sat, 18 Feb 2023 00:38:44 +0100 Subject: usb: typec: tcpm: Fix PD devices/capabilities registration @@ -15,10 +15,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c -index 46c33ab30878..4581137a5498 100644 +index 5ef123cbfa49..b906fc8ad23c 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c -@@ -3062,15 +3062,22 @@ static int tcpm_register_source_caps(struct tcpm_port *port) +@@ -3063,15 +3063,22 @@ static int tcpm_register_source_caps(struct tcpm_port *port) struct usb_power_delivery_desc desc = { port->negotiated_rev }; struct usb_power_delivery_capabilities_desc caps = { }; struct usb_power_delivery_capabilities *cap; @@ -45,7 +45,7 @@ index 46c33ab30878..4581137a5498 100644 cap = usb_power_delivery_register_capabilities(port->partner_pd, &caps); if (IS_ERR(cap)) return PTR_ERR(cap); -@@ -3085,15 +3092,22 @@ static int tcpm_register_sink_caps(struct tcpm_port *port) +@@ -3086,15 +3093,22 @@ static int tcpm_register_sink_caps(struct tcpm_port *port) struct usb_power_delivery_desc desc = { port->negotiated_rev }; struct usb_power_delivery_capabilities_desc caps = { }; struct usb_power_delivery_capabilities *cap; @@ -72,7 +72,7 @@ index 46c33ab30878..4581137a5498 100644 cap = usb_power_delivery_register_capabilities(port->partner_pd, &caps); if (IS_ERR(cap)) return PTR_ERR(cap); -@@ -7085,10 +7099,17 @@ static int tcpm_port_register_pd(struct tcpm_port *port) +@@ -7086,10 +7100,17 @@ static int tcpm_port_register_pd(struct tcpm_port *port) port->pds[i] = usb_power_delivery_register(port->dev, &desc); if (IS_ERR(port->pds[i])) { ret = PTR_ERR(port->pds[i]); @@ -91,5 +91,5 @@ index 46c33ab30878..4581137a5498 100644 cap = usb_power_delivery_register_capabilities(port->pds[i], &port->pd_list[i]->source_desc); -- -2.43.0 +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Improve-logs.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Improve-logs.patch index d40ee711c1..e00a6518fd 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Improve-logs.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Improve-logs.patch @@ -1,4 +1,4 @@ -From 86ca1f17852ce6c6d716e1c46efde4640ece4d72 Mon Sep 17 00:00:00 2001 +From a0fdf7e8915d87aea2ee6a1a8fca9deb4fcdca8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= Date: Tue, 23 Nov 2021 17:58:05 +0100 Subject: usb: typec: tcpm: Improve logs @@ -11,10 +11,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c -index 4581137a5498..e4e331f5f53f 100644 +index b906fc8ad23c..b7c83dd73ca3 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c -@@ -967,10 +967,13 @@ static int tcpm_pd_transmit(struct tcpm_port *port, +@@ -968,10 +968,13 @@ static int tcpm_pd_transmit(struct tcpm_port *port, break; } @@ -30,7 +30,7 @@ index 4581137a5498..e4e331f5f53f 100644 reinit_completion(&port->tx_complete); ret = port->tcpc->pd_transmit(port->tcpc, tx_sop_type, msg, negotiated_rev); -@@ -3734,6 +3737,10 @@ void tcpm_pd_receive(struct tcpm_port *port, const struct pd_message *msg, +@@ -3735,6 +3738,10 @@ void tcpm_pd_receive(struct tcpm_port *port, const struct pd_message *msg, enum tcpm_transmit_type rx_sop_type) { struct pd_rx_event *event; @@ -41,7 +41,7 @@ index 4581137a5498..e4e331f5f53f 100644 event = kzalloc(sizeof(*event), GFP_ATOMIC); if (!event) -@@ -6032,7 +6039,7 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1, +@@ -6033,7 +6040,7 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1, static void _tcpm_pd_vbus_on(struct tcpm_port *port) { @@ -50,7 +50,7 @@ index 4581137a5498..e4e331f5f53f 100644 port->vbus_present = true; /* * When vbus_present is true i.e. Voltage at VBUS is greater than VSAFE5V implicitly -@@ -6122,7 +6129,7 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port) +@@ -6123,7 +6130,7 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port) static void _tcpm_pd_vbus_off(struct tcpm_port *port) { @@ -60,5 +60,5 @@ index 4581137a5498..e4e331f5f53f 100644 port->vbus_never_low = false; switch (port->state) { -- -2.43.0 +2.51.0 diff --git a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Unregister-altmodes-before-registering-new-ones.patch b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Unregister-altmodes-before-registering-new-ones.patch index d429043ebe..dcfecb5ba3 100644 --- a/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Unregister-altmodes-before-registering-new-ones.patch +++ b/patch/kernel/archive/sunxi-6.12/patches.megous/usb-typec-tcpm-Unregister-altmodes-before-registering-new-ones.patch @@ -1,4 +1,4 @@ -From 6280029c20f1ef77c09ad479fe09144cdcaff186 Mon Sep 17 00:00:00 2001 +From fe06d2ec26658fb9da152b83f7283381094b88c6 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Sun, 14 Aug 2022 16:23:28 +0200 Subject: usb: typec: tcpm: Unregister altmodes before registering new ones @@ -34,10 +34,10 @@ Signed-off-by: Ondrej Jirman 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c -index bc00bf2e6761..46c33ab30878 100644 +index ad77ad6f4bb0..5ef123cbfa49 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c -@@ -1811,6 +1811,9 @@ static void tcpm_register_partner_altmodes(struct tcpm_port *port) +@@ -1812,6 +1812,9 @@ static void tcpm_register_partner_altmodes(struct tcpm_port *port) return; for (i = 0; i < modep->altmodes; i++) { @@ -48,5 +48,5 @@ index bc00bf2e6761..46c33ab30878 100644 &modep->altmode_desc[i]); if (IS_ERR(altmode)) { -- -2.43.0 +2.51.0