Skip to content

drivers: gpio: davinci: fix gpio output #90316

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

natto1784
Copy link
Contributor

Currently to set/clear the pins, we do a logical OR of the value with the existing values in set/clear registers. However, reading these registers always returns the value in out_data register. This is undesirable as it can cause unnecessary complications. Consider the following scenario:

We need to set PIN 0:
set_data |= BIT(0)

We need to clear PIN 1:
clr_data |= BIT(1)

The latter would also clear the 0th bit due to the aforementioned behaviour.

This patch fixes this by writing the mask directly without ORing.

Currently to set/clear the pins, we do a logical OR of the value with the
existing values in set/clear registers. However, reading these registers
always returns the value in out_data register. This is undesirable as it
can cause unnecessary complications. Consider the following scenario:

We need to set PIN 0:
set_data |= BIT(0)

We need to clear PIN 1:
clr_data |= BIT(1)

The latter would also clear the 0th bit due to the aforementioned
behaviour.

This patch fixes this by writing the mask directly without ORing.

Signed-off-by: Amneesh Singh <[email protected]>
Copy link

@natto1784
Copy link
Contributor Author

CC: @Ayush1325

@kartben kartben merged commit 8eb075f into zephyrproject-rtos:main May 26, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO platform: TI K3 Texas Instruments Keystone 3 Processors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants