drivers/mfd/intel_soc_pmic_chtdc_ti.c
Source file repositories/reference/linux-study-clean/drivers/mfd/intel_soc_pmic_chtdc_ti.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/intel_soc_pmic_chtdc_ti.c- Extension
.c- Size
- 4672 bytes
- Lines
- 183
- 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/acpi.hlinux/interrupt.hlinux/i2c.hlinux/mfd/core.hlinux/mfd/intel_soc_pmic.hlinux/module.hlinux/regmap.h
Detected Declarations
function chtdc_ti_probefunction chtdc_ti_shutdownfunction chtdc_ti_suspendfunction chtdc_ti_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Device access for Dollar Cove TI PMIC
*
* Copyright (c) 2014, Intel Corporation.
* Author: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
*
* Cleanup and forward-ported
* Copyright (c) 2017 Takashi Iwai <tiwai@suse.de>
*/
#include <linux/acpi.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/mfd/core.h>
#include <linux/mfd/intel_soc_pmic.h>
#include <linux/module.h>
#include <linux/regmap.h>
#define CHTDC_TI_IRQLVL1 0x01
#define CHTDC_TI_MASK_IRQLVL1 0x02
/* Level 1 IRQs */
enum {
CHTDC_TI_PWRBTN = 0, /* power button */
CHTDC_TI_DIETMPWARN, /* thermal */
CHTDC_TI_ADCCMPL, /* ADC */
/* No IRQ 3 */
CHTDC_TI_VBATLOW = 4, /* battery */
CHTDC_TI_VBUSDET, /* power source */
/* No IRQ 6 */
CHTDC_TI_CCEOCAL = 7, /* battery */
};
static const struct resource power_button_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_PWRBTN),
};
static const struct resource thermal_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_DIETMPWARN),
};
static const struct resource adc_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_ADCCMPL),
};
static const struct resource pwrsrc_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_VBUSDET),
};
static const struct resource battery_resources[] = {
DEFINE_RES_IRQ(CHTDC_TI_VBATLOW),
DEFINE_RES_IRQ(CHTDC_TI_CCEOCAL),
};
static struct mfd_cell chtdc_ti_dev[] = {
{
.name = "chtdc_ti_pwrbtn",
.num_resources = ARRAY_SIZE(power_button_resources),
.resources = power_button_resources,
}, {
.name = "chtdc_ti_adc",
.num_resources = ARRAY_SIZE(adc_resources),
.resources = adc_resources,
}, {
.name = "chtdc_ti_thermal",
.num_resources = ARRAY_SIZE(thermal_resources),
.resources = thermal_resources,
}, {
.name = "chtdc_ti_pwrsrc",
.num_resources = ARRAY_SIZE(pwrsrc_resources),
.resources = pwrsrc_resources,
}, {
.name = "chtdc_ti_battery",
.num_resources = ARRAY_SIZE(battery_resources),
.resources = battery_resources,
},
{ .name = "chtdc_ti_region", },
};
static const struct regmap_config chtdc_ti_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0xff,
/* The hardware does not support reading multiple registers at once */
.use_single_read = true,
};
static const struct regmap_irq chtdc_ti_irqs[] = {
REGMAP_IRQ_REG(CHTDC_TI_PWRBTN, 0, BIT(CHTDC_TI_PWRBTN)),
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/interrupt.h`, `linux/i2c.h`, `linux/mfd/core.h`, `linux/mfd/intel_soc_pmic.h`, `linux/module.h`, `linux/regmap.h`.
- Detected declarations: `function chtdc_ti_probe`, `function chtdc_ti_shutdown`, `function chtdc_ti_suspend`, `function chtdc_ti_resume`.
- 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.