@@ -140,11 +140,12 @@ struct mdm_control_pinconfig {
140
140
char * dev_name ;
141
141
gpio_pin_t pin ;
142
142
gpio_flags_t config ;
143
+ gpio_flags_t irq_config ;
143
144
};
144
145
145
- #define PINCONFIG (name_ , pin_ , config_ ) \
146
- { \
147
- .dev_name = name_, .pin = pin_, .config = config_ \
146
+ #define PINCONFIG (name_ , pin_ , config_ , irq_config_ ) \
147
+ { \
148
+ .dev_name = name_, .pin = pin_, .config = config_, .irq_config = irq_config_ \
148
149
}
149
150
150
151
/* pin settings */
@@ -193,44 +194,37 @@ struct xmodem_packet {
193
194
194
195
static const struct mdm_control_pinconfig pinconfig [] = {
195
196
/* MDM_RESET */
196
- PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_reset_gpios ),
197
- DT_INST_GPIO_PIN (0 , mdm_reset_gpios ),
198
- (GPIO_OUTPUT | GPIO_OPEN_DRAIN )),
197
+ PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_reset_gpios ), DT_INST_GPIO_PIN (0 , mdm_reset_gpios ),
198
+ (GPIO_OUTPUT | GPIO_OPEN_DRAIN ), 0 ),
199
199
200
200
/* MDM_WAKE */
201
- PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_wake_gpios ),
202
- DT_INST_GPIO_PIN (0 , mdm_wake_gpios ),
203
- (GPIO_OUTPUT | GPIO_OPEN_SOURCE )),
201
+ PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_wake_gpios ), DT_INST_GPIO_PIN (0 , mdm_wake_gpios ),
202
+ (GPIO_OUTPUT | GPIO_OPEN_SOURCE ), 0 ),
204
203
205
204
/* MDM_PWR_ON */
206
- PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_pwr_on_gpios ),
207
- DT_INST_GPIO_PIN (0 , mdm_pwr_on_gpios ),
208
- (GPIO_OUTPUT | GPIO_OPEN_DRAIN )),
205
+ PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_pwr_on_gpios ), DT_INST_GPIO_PIN (0 , mdm_pwr_on_gpios ),
206
+ (GPIO_OUTPUT | GPIO_OPEN_DRAIN ), 0 ),
209
207
210
208
/* MDM_FAST_SHUTD */
211
209
PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_fast_shutd_gpios ),
212
- DT_INST_GPIO_PIN (0 , mdm_fast_shutd_gpios ),
213
- ( GPIO_OUTPUT | GPIO_OPEN_DRAIN ) ),
210
+ DT_INST_GPIO_PIN (0 , mdm_fast_shutd_gpios ), ( GPIO_OUTPUT | GPIO_OPEN_DRAIN ),
211
+ 0 ),
214
212
215
213
/* MDM_VGPIO */
216
- PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_vgpio_gpios ),
217
- DT_INST_GPIO_PIN (0 , mdm_vgpio_gpios ),
218
- (GPIO_INPUT | GPIO_INT_EDGE_BOTH )),
214
+ PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_vgpio_gpios ), DT_INST_GPIO_PIN (0 , mdm_vgpio_gpios ),
215
+ GPIO_INPUT , GPIO_INT_EDGE_BOTH ),
219
216
220
217
/* MDM_UART_DSR */
221
218
PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_uart_dsr_gpios ),
222
- DT_INST_GPIO_PIN (0 , mdm_uart_dsr_gpios ),
223
- (GPIO_INPUT | GPIO_INT_EDGE_BOTH )),
219
+ DT_INST_GPIO_PIN (0 , mdm_uart_dsr_gpios ), GPIO_INPUT , GPIO_INT_EDGE_BOTH ),
224
220
225
221
/* MDM_UART_CTS */
226
222
PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_uart_cts_gpios ),
227
- DT_INST_GPIO_PIN (0 , mdm_uart_cts_gpios ),
228
- (GPIO_INPUT | GPIO_INT_EDGE_BOTH )),
223
+ DT_INST_GPIO_PIN (0 , mdm_uart_cts_gpios ), GPIO_INPUT , GPIO_INT_EDGE_BOTH ),
229
224
230
225
/* MDM_GPIO6 */
231
- PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_gpio6_gpios ),
232
- DT_INST_GPIO_PIN (0 , mdm_gpio6_gpios ),
233
- (GPIO_INPUT | GPIO_INT_EDGE_BOTH )),
226
+ PINCONFIG (DT_INST_GPIO_LABEL (0 , mdm_gpio6_gpios ), DT_INST_GPIO_PIN (0 , mdm_gpio6_gpios ),
227
+ GPIO_INPUT , GPIO_INT_EDGE_BOTH ),
234
228
};
235
229
236
230
#define MDM_UART_DEV DEVICE_DT_GET(DT_INST_BUS(0))
@@ -5753,16 +5747,11 @@ static int hl7800_init(const struct device *dev)
5753
5747
return - ENODEV ;
5754
5748
}
5755
5749
5756
- if ((pinconfig [i ].config & GPIO_INT_ENABLE ) == 0 ) {
5757
- ret = gpio_pin_configure (ictx .gpio_port_dev [i ], pinconfig [i ].pin ,
5758
- pinconfig [i ].config );
5759
- } else {
5760
- ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [i ], pinconfig [i ].pin ,
5761
- pinconfig [i ].config );
5762
- }
5750
+ ret = gpio_pin_configure (ictx .gpio_port_dev [i ], pinconfig [i ].pin ,
5751
+ pinconfig [i ].config );
5763
5752
if (ret ) {
5764
- LOG_ERR ("Error configuring io %s %d err: %d!" ,
5765
- pinconfig [i ].dev_name , pinconfig [ i ]. pin , ret );
5753
+ LOG_ERR ("Error configuring IO %s %d err: %d!" , pinconfig [ i ]. dev_name ,
5754
+ pinconfig [i ].pin , ret );
5766
5755
return ret ;
5767
5756
}
5768
5757
}
@@ -5792,7 +5781,7 @@ static int hl7800_init(const struct device *dev)
5792
5781
}
5793
5782
ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_VGPIO ],
5794
5783
pinconfig [MDM_VGPIO ].pin ,
5795
- pinconfig [MDM_VGPIO ].config );
5784
+ pinconfig [MDM_VGPIO ].irq_config );
5796
5785
if (ret ) {
5797
5786
LOG_ERR ("Error config vgpio interrupt! (%d)" , ret );
5798
5787
return ret ;
@@ -5809,7 +5798,7 @@ static int hl7800_init(const struct device *dev)
5809
5798
}
5810
5799
ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_UART_DSR ],
5811
5800
pinconfig [MDM_UART_DSR ].pin ,
5812
- pinconfig [MDM_UART_DSR ].config );
5801
+ pinconfig [MDM_UART_DSR ].irq_config );
5813
5802
if (ret ) {
5814
5803
LOG_ERR ("Error config uart dsr interrupt! (%d)" , ret );
5815
5804
return ret ;
@@ -5826,7 +5815,7 @@ static int hl7800_init(const struct device *dev)
5826
5815
}
5827
5816
ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_GPIO6 ],
5828
5817
pinconfig [MDM_GPIO6 ].pin ,
5829
- pinconfig [MDM_GPIO6 ].config );
5818
+ pinconfig [MDM_GPIO6 ].irq_config );
5830
5819
if (ret ) {
5831
5820
LOG_ERR ("Error config gpio6 interrupt! (%d)" , ret );
5832
5821
return ret ;
@@ -5843,7 +5832,7 @@ static int hl7800_init(const struct device *dev)
5843
5832
}
5844
5833
ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_UART_CTS ],
5845
5834
pinconfig [MDM_UART_CTS ].pin ,
5846
- pinconfig [MDM_UART_CTS ].config );
5835
+ pinconfig [MDM_UART_CTS ].irq_config );
5847
5836
if (ret ) {
5848
5837
LOG_ERR ("Error config uart cts interrupt! (%d)" , ret );
5849
5838
return ret ;
0 commit comments