data: add PinePhone Pro config

The PinePhone Pro uses the same EG25 modem as the OG PinePhone, but with
a different SoC. It also uses an ALC5616 audio codec directly hooked up
to the modem (which is I2S master in this case).

The config is therefore almost identical to the PinePhone rev1.2 except
for the gpios, UART port used and `AT+QDAI` config (to account for the
different audio setup).
This commit is contained in:
Arnaud Ferraris
2021-11-24 01:18:21 +01:00
parent abf60b793a
commit b21c4b0fa4
3 changed files with 106 additions and 10 deletions

View File

@@ -170,6 +170,8 @@ int gpio_init(struct EG25Manager *manager, toml_table_t *config[])
if (!data.ok)
continue;
manager->gpiochip[i] = gpiod_chip_open_by_label(data.u.s);
if (!manager->gpiochip[i])
g_error("Unable to find GPIO chip '%s'", data.u.s);
}
for (i = 0; i < GPIO_OUT_COUNT; i++) {
@@ -184,7 +186,7 @@ int gpio_init(struct EG25Manager *manager, toml_table_t *config[])
line = toml_int_in(table, "line");
if (!line.ok || line.u.i < 0 || line.u.i > gpiod_chip_num_lines(manager->gpiochip[chip.u.i]))
g_error("Wrong chip ID for output GPIO '%s'", gpio_out_names[i]);
g_error("Wrong line ID for output GPIO '%s'", gpio_out_names[i]);
manager->gpio_out[i] = gpio_get_output_line(manager, chip.u.i, line.u.i);
if (!manager->gpio_out[i])
@@ -203,7 +205,7 @@ int gpio_init(struct EG25Manager *manager, toml_table_t *config[])
line = toml_int_in(table, "line");
if (!line.ok || line.u.i < 0 || line.u.i > gpiod_chip_num_lines(manager->gpiochip[chip.u.i]))
g_error("Wrong chip ID for input GPIO '%s'", gpio_in_names[i]);
g_error("Wrong line ID for input GPIO '%s'", gpio_in_names[i]);
manager->gpio_in[i] = gpio_get_input_line(manager, chip.u.i, line.u.i);
if (!manager->gpio_in[i])
@@ -214,16 +216,12 @@ int gpio_init(struct EG25Manager *manager, toml_table_t *config[])
/* Legacy config file, only used on the OG PinePhone */
manager->gpiochip[0] = gpiod_chip_open_by_label(GPIO_CHIP1_LABEL);
if (!manager->gpiochip[0]) {
g_critical("Unable to open GPIO chip " GPIO_CHIP1_LABEL);
return 1;
}
if (!manager->gpiochip[0])
g_error("Unable to open GPIO chip " GPIO_CHIP1_LABEL);
manager->gpiochip[1] = gpiod_chip_open_by_label(GPIO_CHIP2_LABEL);
if (!manager->gpiochip[1]) {
g_critical("Unable to open GPIO chip " GPIO_CHIP2_LABEL);
return 1;
}
if (!manager->gpiochip[1])
g_error("Unable to open GPIO chip " GPIO_CHIP2_LABEL);
for (i = 0; i < GPIO_OUT_COUNT; i++) {
if (!config_get_uint(gpio_config, gpio_out_names[i], &gpio_idx))