Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TOPIC-GPIO] drivers: gpio_mchp_xec: update to use new GPIO API #19555

Merged
merged 3 commits into from
Oct 9, 2019

Conversation

dcpleung
Copy link
Member

@dcpleung dcpleung commented Oct 2, 2019

Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung [email protected]

@dcpleung dcpleung requested review from nashif and galak October 2, 2019 20:19
@galak galak changed the title drivers: gpio_mchp_xec: update to use new GPIO API [TOPIC-GPIO] drivers: gpio_mchp_xec: update to use new GPIO API Oct 2, 2019
drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcpleung have you run the updated tests/drivers/gpio/gpio_basic_api?

u32_t gpio_interrupt = 0;
u32_t pcr1 = 0U;
u32_t mask = 0U;
__IO u32_t *gpio_base = (__IO u32_t *)(GPIO_PAROUT_BASE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAL has MCHP_GPIO_PAROUT_ADDR(n) where n is the port number 0 <= port num < NUM_MCHP_GPIO_PORTS

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MCHP_GPIO_BASE_ADDR is not defined so those macros cannot be used.

drivers/gpio/gpio_mchp_xec.c Show resolved Hide resolved
@dcpleung
Copy link
Member Author

dcpleung commented Oct 2, 2019

@dcpleung have you run the updated tests/drivers/gpio/gpio_basic_api?

Yes, the test passed. I also tried manually with the sample samples/drivers/gpio/.

This adds an overlay file for board mec15xxevb_assy6853 for
the gpio_basic_api test.

Signed-off-by: Daniel Leung <[email protected]>
This adds LEDs into the DTS file so various GPIO tests can utilize
this definitions.

Signed-off-by: Daniel Leung <[email protected]>
@zephyrbot zephyrbot added area: Boards area: Tests Issues related to a particular existing or missing test labels Oct 7, 2019
@dcpleung
Copy link
Member Author

dcpleung commented Oct 7, 2019

Rebased to latest topic-gpio and tested with both gpio_basic_api and gpio_api_1pin.

drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_mchp_xec.c Show resolved Hide resolved
drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_mchp_xec.c Outdated Show resolved Hide resolved
boards/arm/mec15xxevb_assy6853/mec15xxevb_assy6853.dts Outdated Show resolved Hide resolved
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <[email protected]>
@mnkp mnkp added the area: GPIO label Oct 8, 2019
Copy link
Member

@mnkp mnkp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good. Since the driver supports simultaneous input/output configuration could you also run the tests/drivers/gpio/gpio_api_1pin test? All the test_gpio_port_* test cases are unfortunately going to fail on your board (I'm working on the fix), please ignore. The remaining should pass.

@dcpleung
Copy link
Member Author

dcpleung commented Oct 8, 2019

The code looks good. Since the driver supports simultaneous input/output configuration could you also run the tests/drivers/gpio/gpio_api_1pin test? All the test_gpio_port_* test cases are unfortunately going to fail on your board (I'm working on the fix), please ignore. The remaining should pass.

I ran it too and it passed.

@MaureenHelm MaureenHelm merged commit 8d78539 into zephyrproject-rtos:topic-gpio Oct 9, 2019
@dcpleung dcpleung deleted the xec_gpio_api branch October 9, 2019 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Boards area: GPIO area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants