Draft
Conversation
Overdr0ne
added a commit
to Overdr0ne/linux-imx
that referenced
this pull request
Apr 13, 2026
…nel (nxp-imx#37) * clocksource: add extclkin-gpio Audinate source and Kconfig entry This adds the driver as provided by Audinate in the DEP EVK 1.3 verbatim. The driver polls a GPIO pin for LRCLK edges and returns the raw timestamp via /dev/extclkin-gpio. * extclkin-gpio: add extclkin-gpio to the makefile * extclkin-gpio: convert to platform driver for dt instantiation Replace the bare module_init/module_exit pair with a proper platform driver using probe/remove callbacks and an of_match_table. The init and exit logic was moved verbatim into extclkingpio_probe() and extclkingpio_remove() respectively- no functional changes. * extclkin-gpio: use devm_ioremap_resource from device tree Replace the hardcoded GPIO1 base addr and bare ioremap() call with platform_get_resource() + devm_ioremap_resource(). The GPIO bank base address is now taken from the device tree node's reg property, removing the GPIO1_BASE–GPIO5_BASE and GPIO_MEM_SIZE defines. devm_ioremap_resource() also handles the iounmap() automatically on driver removal, so the explicit iounmap() in extclkingpio_remove() is dropped. * extclkin-gpio: fix class_create() for kernel >= 6.4 The THIS_MODULE argument was removed from class_create() in 6.4. * extclkin-gpio: make GPIO pin configurable via module parameter Replace hardcoded GPIO_PIN_USED and GPIO_REG_BIT_USED defines with a gpio_pin module parameter. The bit mask is now computed at runtime from gpio_pin, allowing the pin to be overridden at load time without recompiling. Also log pin number at probe time for easier diagnostics. * extclkin-gpio: clean up coding style Convert indentation to tabs throughout, matching kernel coding style and the style used in extclkin-gpt and other general cleanup of dead and obfuscated code. * extclkin-gpio: update author * arm64: dts: mt-connect: add extclkin-gpio node Add a device tree node for the extclkin-gpio driver with the LRCLK input on GPIO1_IO07 (pin 7, matching the driver default and the EVK reference design). * configs: mt-connect: enable extclkin-gpio as a module * extclkin-gpio: replace direct gpio mmio with dts gpio The driver previously bypassed the kernel GPIO subsystem by directly ioremap()ing the GPIO1 controller registers-- not portable. I switched that to the gpio descriptor api like everything else in modern Linux. * arm64: dts: mt-connect: convert extclkin-gpio to gpios property Now that the driver uses the gpio descriptor api, the node no longer needs a reg property pointing at the gpio controller's mmio base. * extclkin-gpio: fix incorrect edge in comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * clocksource: extclkin-gpio: use local buffer in device_read The shared buffer would risk a race. It’s not used anywhere else so just use a local buffer. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.