mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 07:12:08 +02:00
gpio: fix init for BH edition PinePhone
BH PinePhone don't have the modem's `STATUS` pin connected to the SoC, and as such require using `libusb` for checking the modem power state. We didn't handle this case previously due to lack of on-device testing, causing BH phones to fail with newer versions. This patch ignores the `status` GPIO for devices relying on `libusb`, which are only pre-CE PinePhones.
This commit is contained in:
committed by
Arnaud Ferraris
parent
a3c51fc513
commit
19eb488e29
@@ -144,7 +144,7 @@ int gpio_init(struct EG25Manager *manager, toml_table_t *config[])
|
||||
if (!gpio_config[EG25_CONFIG_SYS])
|
||||
g_error("Default config file lacks the 'gpio' section!");
|
||||
|
||||
/*
|
||||
/*
|
||||
* The system config could have the `chips` key, but the user one
|
||||
* could still use the old format! In order to avoid problems, we
|
||||
* should use the new format only if:
|
||||
@@ -196,8 +196,13 @@ int gpio_init(struct EG25Manager *manager, toml_table_t *config[])
|
||||
for (i = 0; i < GPIO_IN_COUNT; i++) {
|
||||
toml_table_t *table;
|
||||
toml_datum_t chip, line;
|
||||
if (!config_get_table(gpio_config, gpio_in_names[i], &table))
|
||||
|
||||
if (!config_get_table(gpio_config, gpio_in_names[i], &table)) {
|
||||
// BH edition don't have the STATUS line connected, ignore it
|
||||
if (manager->use_libusb && g_strcmp0(gpio_in_names[i], "status") == 0)
|
||||
continue;
|
||||
g_error("Unable to get config for input GPIO '%s'", gpio_in_names[i]);
|
||||
}
|
||||
|
||||
chip = toml_int_in(table, "chip");
|
||||
if (!chip.ok || chip.u.i < 0 || chip.u.i > 2)
|
||||
|
Reference in New Issue
Block a user