mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
synced 2026-04-05 00:08:32 -04:00
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/ [1]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
43 lines
973 B
C
43 lines
973 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* SpacemiT reset controller driver - common definitions
|
|
*/
|
|
|
|
#ifndef _RESET_SPACEMIT_COMMON_H_
|
|
#define _RESET_SPACEMIT_COMMON_H_
|
|
|
|
#include <linux/auxiliary_bus.h>
|
|
#include <linux/regmap.h>
|
|
#include <linux/reset-controller.h>
|
|
#include <linux/types.h>
|
|
|
|
struct ccu_reset_data {
|
|
u32 offset;
|
|
u32 assert_mask;
|
|
u32 deassert_mask;
|
|
};
|
|
|
|
struct ccu_reset_controller_data {
|
|
const struct ccu_reset_data *reset_data; /* array */
|
|
size_t count;
|
|
};
|
|
|
|
struct ccu_reset_controller {
|
|
struct reset_controller_dev rcdev;
|
|
const struct ccu_reset_controller_data *data;
|
|
struct regmap *regmap;
|
|
};
|
|
|
|
#define RESET_DATA(_offset, _assert_mask, _deassert_mask) \
|
|
{ \
|
|
.offset = (_offset), \
|
|
.assert_mask = (_assert_mask), \
|
|
.deassert_mask = (_deassert_mask), \
|
|
}
|
|
|
|
/* Common probe function */
|
|
int spacemit_reset_probe(struct auxiliary_device *adev,
|
|
const struct auxiliary_device_id *id);
|
|
|
|
#endif /* _RESET_SPACEMIT_COMMON_H_ */
|