File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -391,13 +391,20 @@ static int ht16k33_init(struct device *dev)
391391 }
392392
393393 err = gpio_pin_configure (irq_dev , config -> irq_pin ,
394- GPIO_DIR_IN | GPIO_INT |
395- GPIO_INT_EDGE | config -> irq_flags );
394+ GPIO_INPUT | config -> irq_flags );
396395 if (err ) {
397396 LOG_ERR ("Failed to configure IRQ pin (err %d)" , err );
398397 return - EINVAL ;
399398 }
400399
400+ err = gpio_pin_interrupt_configure (irq_dev , config -> irq_pin ,
401+ GPIO_INT_EDGE_FALLING );
402+ if (err ) {
403+ LOG_ERR ("Failed to configure IRQ pin flags (err %d)" ,
404+ err );
405+ return - EINVAL ;
406+ }
407+
401408 gpio_init_callback (& data -> irq_cb , & ht16k33_irq_callback ,
402409 BIT (config -> irq_pin ));
403410
@@ -408,12 +415,7 @@ static int ht16k33_init(struct device *dev)
408415 }
409416
410417 /* Enable interrupt pin */
411- cmd [0 ] = HT16K33_CMD_ROW_INT_SET ;
412- if (config -> irq_flags & GPIO_INT_ACTIVE_HIGH ) {
413- cmd [0 ] |= HT16K33_OPT_INT_HIGH ;
414- } else {
415- cmd [0 ] |= HT16K33_OPT_INT_LOW ;
416- }
418+ cmd [0 ] = HT16K33_CMD_ROW_INT_SET | HT16K33_OPT_INT_LOW ;
417419 if (i2c_write (data -> i2c , cmd , 1 , config -> i2c_addr )) {
418420 LOG_ERR ("Enabling HT16K33 IRQ output failed" );
419421 return - EIO ;
You can’t perform that action at this time.
0 commit comments