drivers/mfd/sec-common.c

Source file repositories/reference/linux-study-clean/drivers/mfd/sec-common.c

File Facts

System
Linux kernel
Corpus path
drivers/mfd/sec-common.c
Extension
.c
Size
9960 bytes
Lines
363
Domain
Driver Families
Bucket
drivers/mfd
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2012 Samsung Electronics Co., Ltd
 *                http://www.samsung.com
 * Copyright 2025 Linaro Ltd.
 *
 * Samsung SxM core driver
 */

#include <linux/device.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/mfd/samsung/core.h>
#include <linux/mfd/samsung/irq.h>
#include <linux/mfd/samsung/s2mps11.h>
#include <linux/mfd/samsung/s2mps13.h>
#include <linux/mfd/samsung/s2mu005.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include "sec-core.h"

static const struct resource s5m8767_rtc_resources[] = {
	DEFINE_RES_IRQ_NAMED(S5M8767_IRQ_RTCA1, "alarm"),
};

static const struct mfd_cell s5m8767_devs[] = {
	MFD_CELL_NAME("s5m8767-pmic"),
	MFD_CELL_RES("s5m-rtc", s5m8767_rtc_resources),
	MFD_CELL_OF("s5m8767-clk", NULL, NULL, 0, 0, "samsung,s5m8767-clk"),
};

static const struct mfd_cell s2dos05_devs[] = {
	MFD_CELL_NAME("s2dos05-regulator"),
};

static const struct resource s2mpg10_rtc_resources[] = {
	DEFINE_RES_IRQ_NAMED(S2MPG10_IRQ_RTCA0, "alarm"),
};

static const struct mfd_cell s2mpg10_devs[] = {
	MFD_CELL_NAME("s2mpg10-meter"),
	MFD_CELL_NAME("s2mpg10-regulator"),
	MFD_CELL_RES("s2mpg10-rtc", s2mpg10_rtc_resources),
	MFD_CELL_OF("s2mpg10-clk", NULL, NULL, 0, 0, "samsung,s2mpg10-clk"),
	MFD_CELL_OF("s2mpg10-gpio", NULL, NULL, 0, 0, "samsung,s2mpg10-gpio"),
};

static const struct mfd_cell s2mpg11_devs[] = {
	MFD_CELL_NAME("s2mpg11-meter"),
	MFD_CELL_NAME("s2mpg11-regulator"),
	MFD_CELL_OF("s2mpg11-gpio", NULL, NULL, 0, 0, "samsung,s2mpg11-gpio"),
};

static const struct resource s2mps11_rtc_resources[] = {
	DEFINE_RES_IRQ_NAMED(S2MPS11_IRQ_RTCA0, "alarm"),
};

static const struct mfd_cell s2mps11_devs[] = {
	MFD_CELL_NAME("s2mps11-regulator"),
	MFD_CELL_RES("s2mps14-rtc", s2mps11_rtc_resources),
	MFD_CELL_OF("s2mps11-clk", NULL, NULL, 0, 0, "samsung,s2mps11-clk"),
};

static const struct resource s2mps14_rtc_resources[] = {
	DEFINE_RES_IRQ_NAMED(S2MPS14_IRQ_RTCA0, "alarm"),
};

static const struct mfd_cell s2mps13_devs[] = {
	MFD_CELL_NAME("s2mps13-regulator"),
	MFD_CELL_RES("s2mps13-rtc", s2mps14_rtc_resources),
	MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"),
};

static const struct mfd_cell s2mps14_devs[] = {
	MFD_CELL_NAME("s2mps14-regulator"),
	MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources),
	MFD_CELL_OF("s2mps14-clk", NULL, NULL, 0, 0, "samsung,s2mps14-clk"),
};

static const struct mfd_cell s2mps15_devs[] = {
	MFD_CELL_NAME("s2mps15-regulator"),
	MFD_CELL_RES("s2mps15-rtc", s2mps14_rtc_resources),
	MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"),
};

Annotation

Implementation Notes