[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230923073959.86660-8-alkuor@gmail.com>
Date: Sat, 23 Sep 2023 03:39:52 -0400
From: Abdel Alkuor <alkuor@...il.com>
To: heikki.krogerus@...ux.intel.com, krzysztof.kozlowski+dt@...aro.org,
bryan.odonoghue@...aro.org
Cc: gregkh@...uxfoundation.org, robh+dt@...nel.org,
linux-usb@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, conor+dt@...nel.org,
ryan.eleceng@...il.com, Abdel Alkuor <abdelalkuor@...tab.com>
Subject: [PATCH v6 07/14] USB: typec: Apply patch again after power resume
From: Abdel Alkuor <abdelalkuor@...tab.com>
TPS25750 PD controller might be powered off externally at power suspend,
after resuming PD controller power back, apply the patch again.
Signed-off-by: Abdel Alkuor <abdelalkuor@...tab.com>
---
Changes in v6:
- Check tps25750 using is_compatiable device node
Changes in v5:
- Incorporating tps25750 into tps6598x driver
drivers/usb/typec/tipd/core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 148b237d0df5..d77481f78100 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -1192,6 +1192,18 @@ static int __maybe_unused tps6598x_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct tps6598x *tps = i2c_get_clientdata(client);
+ struct device_node *np = client->dev.of_node;
+ int ret;
+
+ ret = tps6598x_check_mode(tps);
+ if (ret < 0)
+ return ret;
+
+ if (of_device_is_compatible(np, "ti,tps25750") && ret == TPS_MODE_PTCH) {
+ ret = tps25750_apply_patch(tps);
+ if (ret)
+ return ret;
+ }
if (tps->wakeup) {
disable_irq_wake(client->irq);
--
2.34.1
Powered by blists - more mailing lists