drivers/reset/reset-imx8mp-audiomix.c

Source file repositories/reference/linux-study-clean/drivers/reset/reset-imx8mp-audiomix.c

File Facts

System
Linux kernel
Corpus path
drivers/reset/reset-imx8mp-audiomix.c
Extension
.c
Size
6397 bytes
Lines
244
Domain
Driver Families
Bucket
drivers/reset
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct imx8mp_reset_map {
	unsigned int offset;
	unsigned int mask;
	bool active_low;
};

struct imx8mp_reset_info {
	const struct imx8mp_reset_map *map;
	int num_lines;
};

static const struct imx8mp_reset_map imx8mp_reset_map[] = {
	[IMX8MP_AUDIOMIX_EARC_RESET] = {
		.offset	= IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
		.mask = BIT(0),
		.active_low = true,
	},
	[IMX8MP_AUDIOMIX_EARC_PHY_RESET] = {
		.offset	= IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
		.mask = BIT(1),
		.active_low = true,
	},
	[IMX8MP_AUDIOMIX_DSP_RUNSTALL] = {
		.offset	= IMX8MP_AUDIOMIX_DSP_RUNSTALL_OFFSET,
		.mask = BIT(5),
		.active_low = false,
	},
};

static const struct imx8mp_reset_info imx8mp_reset_info = {
	.map = imx8mp_reset_map,
	.num_lines = ARRAY_SIZE(imx8mp_reset_map),
};

static const struct imx8mp_reset_map imx8ulp_reset_map[] = {
	[IMX8ULP_SIM_LPAV_HIFI4_DSP_DBG_RST] = {
		.offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
		.mask = BIT(25),
		.active_low = false,
	},
	[IMX8ULP_SIM_LPAV_HIFI4_DSP_RST] = {
		.offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
		.mask = BIT(16),
		.active_low = false,
	},
	[IMX8ULP_SIM_LPAV_HIFI4_DSP_STALL] = {
		.offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
		.mask = BIT(13),
		.active_low = false,
	},
	[IMX8ULP_SIM_LPAV_DSI_RST_BYTE_N] = {
		.offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
		.mask = BIT(5),
		.active_low = true,
	},
	[IMX8ULP_SIM_LPAV_DSI_RST_ESC_N] = {
		.offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
		.mask = BIT(4),
		.active_low = true,
	},
	[IMX8ULP_SIM_LPAV_DSI_RST_DPI_N] = {
		.offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
		.mask = BIT(3),
		.active_low = true,
	},
};

static const struct imx8mp_reset_info imx8ulp_reset_info = {
	.map = imx8ulp_reset_map,
	.num_lines = ARRAY_SIZE(imx8ulp_reset_map),
};

struct imx8mp_audiomix_reset {
	struct reset_controller_dev rcdev;
	struct regmap *regmap;
	const struct imx8mp_reset_map *map;
};

static struct imx8mp_audiomix_reset *to_imx8mp_audiomix_reset(struct reset_controller_dev *rcdev)
{
	return container_of(rcdev, struct imx8mp_audiomix_reset, rcdev);
}

static int imx8mp_audiomix_update(struct reset_controller_dev *rcdev,
				  unsigned long id, bool assert)
{
	struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev);
	const struct imx8mp_reset_map *reset_map = priv->map;
	unsigned int mask, offset, active_low, val;

Annotation

Implementation Notes