drivers/mfd/max77686.c
Source file repositories/reference/linux-study-clean/drivers/mfd/max77686.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/max77686.c- Extension
.c- Size
- 7653 bytes
- Lines
- 279
- Domain
- Driver Families
- Bucket
- drivers/mfd
- 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.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/slab.hlinux/i2c.hlinux/irq.hlinux/interrupt.hlinux/pm_runtime.hlinux/module.hlinux/mfd/core.hlinux/mfd/max77686.hlinux/mfd/max77686-private.hlinux/err.hlinux/of.h
Detected Declarations
function max77802_pmic_is_accessible_regfunction max77802_rtc_is_accessible_regfunction max77802_is_accessible_regfunction max77802_pmic_is_precious_regfunction max77802_rtc_is_precious_regfunction max77802_is_precious_regfunction max77802_pmic_is_volatile_regfunction max77802_rtc_is_volatile_regfunction max77802_is_volatile_regfunction max77686_i2c_probefunction max77686_suspendfunction max77686_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
//
// max77686.c - mfd core driver for the Maxim 77686/802
//
// Copyright (C) 2012 Samsung Electronics
// Chiwoong Byun <woong.byun@samsung.com>
// Jonghwa Lee <jonghwa3.lee@samsung.com>
//
//This driver is based on max8997.c
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/pm_runtime.h>
#include <linux/module.h>
#include <linux/mfd/core.h>
#include <linux/mfd/max77686.h>
#include <linux/mfd/max77686-private.h>
#include <linux/err.h>
#include <linux/of.h>
static const struct mfd_cell max77686_devs[] = {
{ .name = "max77686-pmic", },
{ .name = "max77686-rtc", },
{ .name = "max77686-clk", },
};
static const struct mfd_cell max77802_devs[] = {
{ .name = "max77802-pmic", },
{ .name = "max77802-clk", },
{ .name = "max77802-rtc", },
};
static bool max77802_pmic_is_accessible_reg(struct device *dev,
unsigned int reg)
{
return reg < MAX77802_REG_PMIC_END;
}
static bool max77802_rtc_is_accessible_reg(struct device *dev,
unsigned int reg)
{
return (reg >= MAX77802_RTC_INT && reg < MAX77802_RTC_END);
}
static bool max77802_is_accessible_reg(struct device *dev, unsigned int reg)
{
return (max77802_pmic_is_accessible_reg(dev, reg) ||
max77802_rtc_is_accessible_reg(dev, reg));
}
static bool max77802_pmic_is_precious_reg(struct device *dev, unsigned int reg)
{
return (reg == MAX77802_REG_INTSRC || reg == MAX77802_REG_INT1 ||
reg == MAX77802_REG_INT2);
}
static bool max77802_rtc_is_precious_reg(struct device *dev, unsigned int reg)
{
return (reg == MAX77802_RTC_INT ||
reg == MAX77802_RTC_UPDATE0 ||
reg == MAX77802_RTC_UPDATE1);
}
static bool max77802_is_precious_reg(struct device *dev, unsigned int reg)
{
return (max77802_pmic_is_precious_reg(dev, reg) ||
max77802_rtc_is_precious_reg(dev, reg));
}
static bool max77802_pmic_is_volatile_reg(struct device *dev, unsigned int reg)
{
return (max77802_is_precious_reg(dev, reg) ||
reg == MAX77802_REG_STATUS1 || reg == MAX77802_REG_STATUS2 ||
reg == MAX77802_REG_PWRON);
}
static bool max77802_rtc_is_volatile_reg(struct device *dev, unsigned int reg)
{
return (max77802_rtc_is_precious_reg(dev, reg) ||
reg == MAX77802_RTC_SEC ||
reg == MAX77802_RTC_MIN ||
reg == MAX77802_RTC_HOUR ||
reg == MAX77802_RTC_WEEKDAY ||
reg == MAX77802_RTC_MONTH ||
reg == MAX77802_RTC_YEAR ||
reg == MAX77802_RTC_MONTHDAY);
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/slab.h`, `linux/i2c.h`, `linux/irq.h`, `linux/interrupt.h`, `linux/pm_runtime.h`, `linux/module.h`, `linux/mfd/core.h`.
- Detected declarations: `function max77802_pmic_is_accessible_reg`, `function max77802_rtc_is_accessible_reg`, `function max77802_is_accessible_reg`, `function max77802_pmic_is_precious_reg`, `function max77802_rtc_is_precious_reg`, `function max77802_is_precious_reg`, `function max77802_pmic_is_volatile_reg`, `function max77802_rtc_is_volatile_reg`, `function max77802_is_volatile_reg`, `function max77686_i2c_probe`.
- Atlas domain: Driver Families / drivers/mfd.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.