Skip to content

Conversation

@CkovMk
Copy link
Contributor

@CkovMk CkovMk commented Oct 29, 2025

Fixes #98542
There are two issues in this driver:

  1. gpio_pca_series_part_cfg_pca6416 is not using correct macros
  2. gpio_pca_series_interrupt_handler_standard not updating input when no interrupt configured

Fixing these issues.

Tested on imx8mm_evk/mimx8mm6/a53 with tests/drivers/gpio/gpio_basic_api.

Logs

I: pca6416@20 init ok
*** Booting Zephyr OS build v4.2.0-4271-g3db00489f131 ***
Running TESTSUITE after_flash_gpio_config_trigger
===================================================================
START - test_gpio_config_trigger
Open drain not supported.
 SKIP - test_gpio_config_trigger in 0.004 seconds
===================================================================
START - test_gpio_config_twice_trigger
Open drain not supported.
 SKIP - test_gpio_config_twice_trigger in 0.003 seconds
===================================================================
TESTSUITE after_flash_gpio_config_trigger succeeded
Running TESTSUITE gpio_port
===================================================================
START - test_gpio_port
Validate device pca6416@20 and pca6416@20
Check pca6416@20 output 10 connected to pca6416@20 input 13
NOTE: pull-up not supported; trying as output high
OUT 10 to IN 13 linkage works
- bits_physical
- pin_physical
- check_raw_output_levels
- check_logic_output_levels
- check_input_levels
- bits_logical
- check_pulls
pull-up not supported
 PASS - test_gpio_port in 0.112 seconds
===================================================================
TESTSUITE gpio_port succeeded
Running TESTSUITE gpio_port_cb_mgmt
===================================================================
START - test_gpio_callback_add_remove
callback_2 triggered: 1
callback_1 triggered: 1
callback_2 triggered: 1
 PASS - test_gpio_callback_add_remove in 3.605 seconds
===================================================================
START - test_gpio_callback_enable_disable
callback_2 triggered: 1
callback_1 triggered: 1
callback_2 triggered: 1
callback_1 triggered: 1
 PASS - test_gpio_callback_enable_disable in 3.605 seconds
===================================================================
START - test_gpio_callback_self_remove
callback_remove_self triggered: 1
callback_1 triggered: 1
callback_1 triggered: 1
 PASS - test_gpio_callback_self_remove in 2.505 seconds
===================================================================
TESTSUITE gpio_port_cb_mgmt succeeded
Running TESTSUITE gpio_port_cb_vari
===================================================================
START - test_gpio_callback_variants
callback triggered: 1
OUT init a0001, IN cfg 3400000, cnt 1
callback triggered: 1
OUT init 60000, IN cfg 5400000, cnt 1
callback triggered: 1
OUT init 60000, IN cfg 5c00000, cnt 1
callback triggered: 1
OUT init a0001, IN cfg 3c00000, cnt 1
Mode 4400000 not supported
Mode 2400000 not supported
Mode 4c00000 not supported
Mode 2c00000 not supported
callback triggered: 1
callback triggered: 2
OUT init a0001, IN cfg 7400000, cnt 2
 PASS - test_gpio_callback_variants in 5.541 seconds
===================================================================
TESTSUITE gpio_port_cb_vari succeeded

------ TESTSUITE SUMMARY START ------

SUITE SKIP -   0.00% [after_flash_gpio_config_trigger]: pass = 0, fail = 0, skip = 2, total = 2 duration = 0.007 seconds
 - SKIP - [after_flash_gpio_config_trigger.test_gpio_config_trigger] duration = 0.004 seconds
 - SKIP - [after_flash_gpio_config_trigger.test_gpio_config_twice_trigger] duration = 0.003 seconds

SUITE PASS - 100.00% [gpio_port]: pass = 1, fail = 0, skip = 0, total = 1 duration = 0.112 seconds
 - PASS - [gpio_port.test_gpio_port] duration = 0.112 seconds

SUITE PASS - 100.00% [gpio_port_cb_mgmt]: pass = 3, fail = 0, skip = 0, total = 3 duration = 9.715 seconds
 - PASS - [gpio_port_cb_mgmt.test_gpio_callback_add_remove] duration = 3.605 seconds
 - PASS - [gpio_port_cb_mgmt.test_gpio_callback_enable_disable] duration = 3.605 seconds
 - PASS - [gpio_port_cb_mgmt.test_gpio_callback_self_remove] duration = 2.505 seconds

SUITE PASS - 100.00% [gpio_port_cb_vari]: pass = 1, fail = 0, skip = 0, total = 1 duration = 5.541 seconds
 - PASS - [gpio_port_cb_vari.test_gpio_callback_variants] duration = 5.541 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION SUCCESSFUL

There are multiple issues in this driver:
1. gpio_pca_series_part_cfg_pca6416 is not using correct macros
2. gpio_pca_series_interrupt_handler_standard not updating input when
   no interrupt configured

Fixing these issues.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
@CkovMk CkovMk force-pushed the pr/fix-pca-driver-pca6416 branch from 94191cd to 7ef796b Compare October 29, 2025 12:57
@CkovMk CkovMk closed this Oct 29, 2025
@CkovMk CkovMk reopened this Oct 29, 2025
@CkovMk
Copy link
Contributor Author

CkovMk commented Oct 29, 2025

fix formatting and re trigger ci

@CkovMk
Copy link
Contributor Author

CkovMk commented Oct 30, 2025

CI failure due to #98494, not affected by this pr

@CkovMk
Copy link
Contributor Author

CkovMk commented Oct 30, 2025

re triggeri ci

@CkovMk CkovMk closed this Oct 30, 2025
@CkovMk CkovMk reopened this Oct 30, 2025
@sonarqubecloud
Copy link

@JiafeiPan JiafeiPan added the bug The issue is a bug, or the PR is fixing a bug label Oct 30, 2025
@JiafeiPan JiafeiPan added this to the v4.3.0 milestone Oct 30, 2025
@JiafeiPan
Copy link
Contributor

Verified on imx8mp_evk, it fixed the issue: #98542

@JiafeiPan JiafeiPan self-assigned this Oct 31, 2025
@cfriedt cfriedt merged commit f452249 into zephyrproject-rtos:main Oct 31, 2025
80 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: GPIO bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

imx8mp_evk: gpio expander on imx8mp can't work

5 participants