Skip to content

Lf 6.6.y#37

Draft
r4d10n wants to merge 2 commits intonxp-imx:lf-6.6.yfrom
r4d10n:lf-6.6.y
Draft

Lf 6.6.y#37
r4d10n wants to merge 2 commits intonxp-imx:lf-6.6.yfrom
r4d10n:lf-6.6.y

Conversation

@r4d10n
Copy link
Copy Markdown

@r4d10n r4d10n commented Nov 7, 2025

No description provided.

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>
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.

1 participant