]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
reset: spacemit: Extract common K1 reset code
authorGuodong Xu <guodong@riscstar.com>
Tue, 20 Jan 2026 11:10:51 +0000 (19:10 +0800)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Sat, 24 Jan 2026 15:53:02 +0000 (16:53 +0100)
commitaba86f7bff0bfd6956aff9bbbfb0c6ea6d56809e
tree157fd4c2cc759cca15f4cbe8de14901ababfda47
parent2875b4b5d2657ff2fd979103d88e9afcae51481c
reset: spacemit: Extract common K1 reset code

Extract the common reset controller code from the K1 driver into
separate reset-spacemit-common.{c,h} files to prepare for additional
SpacemiT SoCs that share the same reset controller architecture.

The common code includes handlers for reset assert and deassert
operations and probing for auxiliary bus devices.

Changes during extraction:
- Module ownership: Use dev->driver->owner instead of THIS_MODULE in
  spacemit_reset_controller_register() to correctly reference the
  calling driver's module.
- Rename spacemit_reset_ids to spacemit_k1_reset_ids.
- Define new namespace "RESET_SPACEMIT" for the exported common
  functions (spacemit_reset_probe) and update K1 driver to import it.

This prepares for additional SpacemiT SoCs (K3) that share the same reset
controller architecture.

Reviewed-by: Alex Elder <elder@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Reviewed-by: Yixun Lan <dlan@kernel.org>
Link: https://lore.kernel.org/spacemit/20260114092742-GYC7933267@gentoo.org/
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/spacemit/Kconfig
drivers/reset/spacemit/Makefile
drivers/reset/spacemit/reset-spacemit-common.c [new file with mode: 0644]
drivers/reset/spacemit/reset-spacemit-common.h [new file with mode: 0644]
drivers/reset/spacemit/reset-spacemit-k1.c