8000 GPIO Driver Class by TristanCM347 · Pull Request #387 · au-ts/sddf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

GPIO Driver Class #387

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

Closed
wants to merge 9 commits into from
Closed

GPIO Driver Class #387

wants to merge 9 commits into from

Conversation

TristanCM347
Copy link
Contributor

Includes:

  • GPIO driver class communication protocol
  • Meson GPIO driver
  • IMX GPIO driver
  • Example using the Meson GPIO driver

Signed-off-by: Tristan Clinton-Muehr <tristocm@gmail.com>
… to multiple client channels, added logic for configuring a pin to an irq in the hardware registers
Comment on lines 37 to 48
case IMX_GPIO_IRQ_AH_GPIO1_7:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;
case IMX_GPIO_IRQ_AH_GPIO1_6:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;
case IMX_GPIO_IRQ_AH_GPIO1_5:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the code in each is exactly the same, you can fold them into one case statement:

Suggested change
case IMX_GPIO_IRQ_AH_GPIO1_7:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;
case IMX_GPIO_IRQ_AH_GPIO1_6:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;
case IMX_GPIO_IRQ_AH_GPIO1_5:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;
case IMX_GPIO_IRQ_AH_GPIO1_7:
case IMX_GPIO_IRQ_AH_GPIO1_6:
case IMX_GPIO_IRQ_AH_GPIO1_5:
microkit_irq_ack(ch);
microkit_notify(driver_to_client_channel_mappings[ch - IMX_GPIO_IRQ_CHANNEL_START]);
break;

@TristanCM347 TristanCM347 marked this pull request as draft March 26, 2025 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0