From cf3df2b840e3e52ae701fb43fd469b0f9f3accea Mon Sep 17 00:00:00 2001 From: Andrei Hutanu Date: Fri, 21 Apr 2023 10:45:31 +0200 Subject: [PATCH] drivers: modem: quectel-bg9x: fix for bg95 pinout The BG95 pin configuration does not internally ever use the reset pin. Because of this, there is no need to make reset pin mandatory. Commit removes reset pin dependency [e.g. in case of BG95]. Signed-off-by: Andrei Hutanu --- drivers/modem/quectel-bg9x.c | 4 ++++ dts/bindings/modem/quectel,bg9x.yaml | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/modem/quectel-bg9x.c b/drivers/modem/quectel-bg9x.c index b18f928d7d5d3c..2513a8fae385fb 100644 --- a/drivers/modem/quectel-bg9x.c +++ b/drivers/modem/quectel-bg9x.c @@ -22,7 +22,9 @@ static K_KERNEL_STACK_DEFINE(modem_workq_stack, CONFIG_MODEM_QUECTEL_BG9X_RX_WOR NET_BUF_POOL_DEFINE(mdm_recv_pool, MDM_RECV_MAX_BUF, MDM_RECV_BUF_SIZE, 0, NULL); static const struct gpio_dt_spec power_gpio = GPIO_DT_SPEC_INST_GET(0, mdm_power_gpios); +#if DT_INST_NODE_HAS_PROP(0, mdm_reset_gpios) static const struct gpio_dt_spec reset_gpio = GPIO_DT_SPEC_INST_GET(0, mdm_reset_gpios); +#endif #if DT_INST_NODE_HAS_PROP(0, mdm_dtr_gpios) static const struct gpio_dt_spec dtr_gpio = GPIO_DT_SPEC_INST_GET(0, mdm_dtr_gpios); #endif @@ -1203,11 +1205,13 @@ static int modem_init(const struct device *dev) goto error; } +#if DT_INST_NODE_HAS_PROP(0, mdm_reset_gpios) ret = gpio_pin_configure_dt(&reset_gpio, GPIO_OUTPUT_LOW); if (ret < 0) { LOG_ERR("Failed to configure %s pin", "reset"); goto error; } +#endif #if DT_INST_NODE_HAS_PROP(0, mdm_dtr_gpios) ret = gpio_pin_configure_dt(&dtr_gpio, GPIO_OUTPUT_LOW); diff --git a/dts/bindings/modem/quectel,bg9x.yaml b/dts/bindings/modem/quectel,bg9x.yaml index 1526769821714a..836df0ba36e56a 100644 --- a/dts/bindings/modem/quectel,bg9x.yaml +++ b/dts/bindings/modem/quectel,bg9x.yaml @@ -14,7 +14,6 @@ properties: mdm-reset-gpios: type: phandle-array - required: true mdm-dtr-gpios: type: phandle-array