3 Commits
0.5.1 ... 0.5.2

Author SHA1 Message Date
Aren Moynihan
99aa7e2bf7 gpio: remove handling of W_DISABLE pin
The PinePhone has circuitry that makes this pin active-high, but the
PinePhone Pro doesn't appear to, which means we would need read active
high / active low from the config file. Since the modem works fine
without setting this pin, remove the logic to handle the W_DISBALE pin.
2024-10-28 16:08:37 -04:00
Aren Moynihan
ce0fc25892 at: don't clear the resetting state on sequence end
If the reset sequence fails, we don't want to transition to the powered
state, instead we should stay in the resetting state so we eventually
timeout and try a gpio reset. If the reset command succeeds the modem
will eventually send RDY and transition the state to STARTED.

Since this might take longer to change the modem state, add 15 seconds
(for a total of 45) to the at reset timeout just in case. It looks like
the modem typically takes about 20 between sending "AT+CFUN=1,1" and
receiving "RDY", so this should be plenty.
2024-10-28 12:48:08 -04:00
Aren Moynihan
ec96153b0f at: fix indentation
A few tabs slipped in here, convert them to spaces.
2024-10-28 12:47:24 -04:00
3 changed files with 6 additions and 12 deletions

View File

@@ -73,10 +73,10 @@ gboolean at_send_command(struct EG25Manager *manager)
int ret, len = 0, pos = 0;
if (at_cmd) {
/* Wake up the modem from soft sleep before sending an AT command */
gpio_sequence_wake(manager);
/* Wake up the modem from soft sleep before sending an AT command */
gpio_sequence_wake(manager);
/* Send AT command */
/* Send AT command */
if (at_cmd->subcmd == NULL && at_cmd->value == NULL && at_cmd->expected == NULL)
len = snprintf(command, sizeof(command), "AT+%s\r\n", at_cmd->cmd);
else if (at_cmd->subcmd == NULL && at_cmd->value == NULL)
@@ -126,8 +126,8 @@ gboolean at_send_command(struct EG25Manager *manager)
g_message("Successfully sent command: %s", g_strstrip(command));
} else {
/* Allow the modem to enter soft sleep again when we sent the AT command*/
gpio_sequence_sleep(manager);
/* Allow the modem to enter soft sleep again when we sent the AT command*/
gpio_sequence_sleep(manager);
if (manager->modem_state < EG25_STATE_CONFIGURED) {
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
@@ -146,8 +146,6 @@ gboolean at_send_command(struct EG25Manager *manager)
}
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
modem_suspend_post(manager);
} else if (manager->modem_state == EG25_STATE_RESETTING) {
manager->modem_state = EG25_STATE_POWERED;
}
}

View File

@@ -74,10 +74,6 @@ int gpio_line_set_value(struct EG25Manager *manager, int line, enum gpiod_line_v
int gpio_sequence_poweron(struct EG25Manager *manager)
{
/* Disable airplane mode in case it was enabled by other software. The
* W_DISABLE pin is active-low, so we set it to high here. */
gpio_line_set_value(manager, GPIO_OUT_DISABLE, GPIOD_LINE_VALUE_ACTIVE);
/*
* Force the modem to poweroff using the RESET_N pin before attempting to
* boot in case the it got into a bad state.

View File

@@ -271,7 +271,7 @@ error:
at_sequence_reset(manager);
// Setup timer for making sure we don't queue other reset commands
manager->complete_reset_timer = g_timeout_add_seconds(30, G_SOURCE_FUNC(modem_at_reset_done), manager);
manager->complete_reset_timer = g_timeout_add_seconds(45, G_SOURCE_FUNC(modem_at_reset_done), manager);
return G_SOURCE_REMOVE;
}