@@ -140,11 +140,12 @@ struct mdm_control_pinconfig {
140140 char * dev_name ;
141141 gpio_pin_t pin ;
142142 gpio_flags_t config ;
143+ gpio_flags_t irq_config ;
143144};
144145
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_ \
148149 }
149150
150151/* pin settings */
@@ -193,44 +194,37 @@ struct xmodem_packet {
193194
194195static const struct mdm_control_pinconfig pinconfig [] = {
195196 /* 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 ),
199199
200200 /* 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 ),
204203
205204 /* 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 ),
209207
210208 /* MDM_FAST_SHUTD */
211209 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 ),
214212
215213 /* 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 ),
219216
220217 /* MDM_UART_DSR */
221218 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 ),
224220
225221 /* MDM_UART_CTS */
226222 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 ),
229224
230225 /* 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 ),
234228};
235229
236230#define MDM_UART_DEV DEVICE_DT_GET(DT_INST_BUS(0))
@@ -5753,16 +5747,11 @@ static int hl7800_init(const struct device *dev)
57535747 return - ENODEV ;
57545748 }
57555749
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 );
57635752 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 );
57665755 return ret ;
57675756 }
57685757 }
@@ -5792,7 +5781,7 @@ static int hl7800_init(const struct device *dev)
57925781 }
57935782 ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_VGPIO ],
57945783 pinconfig [MDM_VGPIO ].pin ,
5795- pinconfig [MDM_VGPIO ].config );
5784+ pinconfig [MDM_VGPIO ].irq_config );
57965785 if (ret ) {
57975786 LOG_ERR ("Error config vgpio interrupt! (%d)" , ret );
57985787 return ret ;
@@ -5809,7 +5798,7 @@ static int hl7800_init(const struct device *dev)
58095798 }
58105799 ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_UART_DSR ],
58115800 pinconfig [MDM_UART_DSR ].pin ,
5812- pinconfig [MDM_UART_DSR ].config );
5801+ pinconfig [MDM_UART_DSR ].irq_config );
58135802 if (ret ) {
58145803 LOG_ERR ("Error config uart dsr interrupt! (%d)" , ret );
58155804 return ret ;
@@ -5826,7 +5815,7 @@ static int hl7800_init(const struct device *dev)
58265815 }
58275816 ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_GPIO6 ],
58285817 pinconfig [MDM_GPIO6 ].pin ,
5829- pinconfig [MDM_GPIO6 ].config );
5818+ pinconfig [MDM_GPIO6 ].irq_config );
58305819 if (ret ) {
58315820 LOG_ERR ("Error config gpio6 interrupt! (%d)" , ret );
58325821 return ret ;
@@ -5843,7 +5832,7 @@ static int hl7800_init(const struct device *dev)
58435832 }
58445833 ret = gpio_pin_interrupt_configure (ictx .gpio_port_dev [MDM_UART_CTS ],
58455834 pinconfig [MDM_UART_CTS ].pin ,
5846- pinconfig [MDM_UART_CTS ].config );
5835+ pinconfig [MDM_UART_CTS ].irq_config );
58475836 if (ret ) {
58485837 LOG_ERR ("Error config uart cts interrupt! (%d)" , ret );
58495838 return ret ;
0 commit comments