Skip to content

Commit ab97150

Browse files
rerickson1carlescufi
authored andcommitted
modem: hl7800: fix UART shutdown
Allow CTS line to determine UART shutdown for any sleep mode. This allows lower average current consumption for LITE HIBERNATE mode. Signed-off-by: Ryan Erickson <[email protected]>
1 parent fb9b3bc commit ab97150

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

drivers/modem/hl7800.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4698,8 +4698,6 @@ static void mdm_vgpio_work_cb(struct k_work *item)
46984698
ictx.desired_sleep_level == HL7800_SLEEP_LITE_HIBERNATE) {
46994699
if (ictx.sleep_state != ictx.desired_sleep_level) {
47004700
set_sleep_state(ictx.desired_sleep_level);
4701-
} else {
4702-
LOG_WRN("Unexpected sleep condition");
47034701
}
47044702
}
47054703
if (ictx.iface && ictx.initialized && net_if_is_up(ictx.iface) &&
@@ -4842,15 +4840,15 @@ void mdm_uart_cts_callback(const struct device *port, struct gpio_callback *cb,
48424840
}
48434841

48444842
#ifdef CONFIG_MODEM_HL7800_LOW_POWER_MODE
4845-
if (ictx.desired_sleep_level == HL7800_SLEEP_SLEEP) {
4846-
if (ictx.cts_state) {
4847-
/* HL7800 is not awake, shut down UART to save power */
4843+
if (ictx.cts_state) {
4844+
/* HL7800 is not awake, shut down UART to save power */
4845+
if (ictx.allow_sleep) {
48484846
shutdown_uart();
4849-
} else {
4850-
power_on_uart();
4851-
if (ictx.sleep_state == HL7800_SLEEP_SLEEP) {
4852-
allow_sleep(false);
4853-
}
4847+
}
4848+
} else {
4849+
power_on_uart();
4850+
if (ictx.sleep_state == HL7800_SLEEP_SLEEP) {
4851+
allow_sleep(false);
48544852
}
48554853
}
48564854
#endif

0 commit comments

Comments
 (0)