build/patch/kernel/archive/sunxi-5.15/patches.megous/misc-modem-power-Fall-back-to-usbat-for-urcport-if-firmware-is-.patch

35 lines
1.2 KiB
Diff

From d600f8e5e6f6166e317db4b4b5681a0c8957950d Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Thu, 17 Sep 2020 00:02:52 +0200
Subject: [PATCH 267/478] misc: modem-power: Fall back to usbat for urcport if
firmware is too old
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/misc/modem-power.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/modem-power.c b/drivers/misc/modem-power.c
index 1c758517c04f..1a1ba4bf7841 100644
--- a/drivers/misc/modem-power.c
+++ b/drivers/misc/modem-power.c
@@ -584,8 +584,13 @@ static int mpwr_eg25_power_up(struct mpwr_dev* mpwr)
/* setup URC port */
ret = mpwr_serdev_at_cmd(mpwr, "AT+QURCCFG=\"urcport\",\"all\"", 2000);
- if (ret)
- dev_err(mpwr->dev, "Modem may not report URCs to the right port!\n");
+ if (ret) {
+ dev_info(mpwr->dev, "Your modem doesn't support AT+QURCCFG=\"urcport\",\"all\", consider upgrading the firmware.\n");
+
+ ret = mpwr_serdev_at_cmd(mpwr, "AT+QURCCFG=\"urcport\",\"usbat\"", 2000);
+ if (ret)
+ dev_err(mpwr->dev, "Modem may not report URCs to the right port!\n");
+ }
/* enable the modem to go to sleep when DTR is low */
ret = mpwr_serdev_at_cmd(mpwr, "AT+QSCLK=1", 2000);
--
2.35.3