Skip to content

Commit 5bfa00f

Browse files
Merge pull request #1 from SeppoTakalo/dtr-ri
fixup! app: Add overlay for mdm-power-gpios
2 parents da7e09c + 4f30d6d commit 5bfa00f

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

app/src/sm_ctrl_pin.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
LOG_MODULE_REGISTER(sm_ctrl_pin, CONFIG_SM_LOG_LEVEL);
2020

2121
#define SM_DTR_GPIOS DT_NODE_HAS_PROP(DT_CHOSEN(ncs_sm_uart), dtr_gpios)
22-
#define SM_MDM_PWR_GPIOS DT_NODE_HAS_PROP(DT_CHOSEN(ncs_sm_power_gpios), power_gpios)
22+
#define SLM_HAS_PWR_KEY DT_HAS_CHOSEN(ncs_sm_power_key)
2323

2424
#if SM_DTR_GPIOS
2525
static const struct gpio_dt_spec dtr_gpio =
2626
GPIO_DT_SPEC_GET_OR(DT_CHOSEN(ncs_sm_uart), dtr_gpios, {0});
2727

2828
static struct gpio_callback dtr_gpio_cb;
2929
#endif
30-
#if SM_MDM_PWR_GPIOS
30+
#if SLM_HAS_PWR_KEY
3131
static const struct gpio_dt_spec mdm_pwr_gpio =
32-
GPIO_DT_SPEC_GET_OR(DT_CHOSEN(ncs_sm_power_gpios), power_gpios, {0});
32+
GPIO_DT_SPEC_GET_OR(DT_CHOSEN(ncs_sm_power_key), gpios, {0});
3333

3434
static struct gpio_callback mdm_pwr_gpio_cb;
3535
#endif
@@ -102,7 +102,7 @@ int sm_ctrl_pin_ready(void)
102102

103103
void sm_ctrl_pin_enter_sleep_no_uninit(bool at_host_power_off)
104104
{
105-
#if SM_DTR_GPIOS || SM_MDM_PWR_GPIOS
105+
#if SM_DTR_GPIOS || SLM_HAS_PWR_KEY
106106
if (at_host_power_off) {
107107
sm_at_host_power_off();
108108
}
@@ -119,7 +119,7 @@ void sm_ctrl_pin_enter_sleep_no_uninit(bool at_host_power_off)
119119

120120
void sm_ctrl_pin_enter_sleep(void)
121121
{
122-
#if SM_DTR_GPIOS || SM_MDM_PWR_GPIOS
122+
#if SM_DTR_GPIOS || SLM_HAS_PWR_KEY
123123

124124
/* Stop threads, uninitialize host and disable DTR UART. */
125125
sm_at_host_uninit();
@@ -171,7 +171,7 @@ void sm_ctrl_pin_enter_shutdown(void)
171171

172172
void sm_ctrl_pin_init_gpios(void)
173173
{
174-
#if SM_MDM_PWR_GPIOS
174+
#if SLM_HAS_PWR_KEY
175175
/* Configure Modem Power GPIO */
176176
if (!gpio_is_ready_dt(&mdm_pwr_gpio)) {
177177
LOG_ERR("Modem Power GPIO not ready");
@@ -198,7 +198,7 @@ int sm_ctrl_pin_init(void)
198198
#if SM_DTR_GPIOS
199199
nrf_gpio_cfg_sense_set(dtr_gpio.pin, NRF_GPIO_PIN_SENSE_LOW);
200200
#endif
201-
#if SM_MDM_PWR_GPIOS
201+
#if SLM_HAS_PWR_KEY
202202
err = gpio_pin_interrupt_configure_dt(&mdm_pwr_gpio, GPIO_INT_EDGE_TO_ACTIVE);
203203
if (err) {
204204
LOG_ERR("Failed to configure Modem Power GPIO interrupt (%d).", err);

dts/bindings/sm/nordic,sm-power-gpios.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
description: |
55
Serial Modem power pin for Zephyr Modem.
66
7-
compatible: "nordic,sm-power-gpios"
7+
compatible: "nordic,sm-power-key"
88

99
properties:
10-
power-gpios:
10+
gpios:
1111
type: phandle-array
1212
description: Input. Power GPIO pin.
1313
required: true

0 commit comments

Comments
 (0)