drivers/extcon/extcon-max77693.c
Source file repositories/reference/linux-study-clean/drivers/extcon/extcon-max77693.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/extcon/extcon-max77693.c- Extension
.c- Size
- 37501 bytes
- Lines
- 1281
- Domain
- Driver Families
- Bucket
- drivers/extcon
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/devm-helpers.hlinux/kernel.hlinux/module.hlinux/i2c.hlinux/slab.hlinux/input.hlinux/interrupt.hlinux/err.hlinux/platform_device.hlinux/mfd/max77693.hlinux/mfd/max77693-common.hlinux/mfd/max77693-private.hlinux/extcon-provider.hlinux/regmap.hlinux/irqdomain.h
Detected Declarations
struct max77693_muic_infostruct max77693_muic_irqenum max77693_muic_adc_debounce_timeenum max77693_muic_cable_groupenum max77693_muic_charger_typeenum max77693_muic_acc_typefunction max77693_muic_set_debounce_timefunction max77693_muic_set_pathfunction max77693_muic_get_cable_typefunction max77693_muic_dock_handlerfunction max77693_muic_dock_button_handlerfunction max77693_muic_adc_ground_handlerfunction max77693_muic_jig_handlerfunction max77693_muic_adc_handlerfunction max77693_muic_chg_handlerfunction max77693_muic_irq_workfunction max77693_muic_irq_handlerfunction max77693_muic_detect_accessoryfunction max77693_muic_detect_cable_wqfunction max77693_muic_probe
Annotated Snippet
struct max77693_muic_info {
struct device *dev;
struct max77693_dev *max77693;
struct extcon_dev *edev;
int prev_cable_type;
int prev_cable_type_gnd;
int prev_chg_type;
int prev_button_type;
u8 status[2];
int irq;
struct work_struct irq_work;
struct mutex mutex;
/*
* Use delayed workqueue to detect cable state and then
* notify cable state to notifiee/platform through uevent.
* After completing the booting of platform, the extcon provider
* driver should notify cable state to upper layer.
*/
struct delayed_work wq_detcable;
/* Button of dock device */
struct input_dev *dock;
/*
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
* h/w path of COMP2/COMN1 on CONTROL1 register.
*/
int path_usb;
int path_uart;
};
enum max77693_muic_cable_group {
MAX77693_CABLE_GROUP_ADC = 0,
MAX77693_CABLE_GROUP_ADC_GND,
MAX77693_CABLE_GROUP_CHG,
MAX77693_CABLE_GROUP_VBVOLT,
};
enum max77693_muic_charger_type {
MAX77693_CHARGER_TYPE_NONE = 0,
MAX77693_CHARGER_TYPE_USB,
MAX77693_CHARGER_TYPE_DOWNSTREAM_PORT,
MAX77693_CHARGER_TYPE_DEDICATED_CHG,
MAX77693_CHARGER_TYPE_APPLE_500MA,
MAX77693_CHARGER_TYPE_APPLE_1A_2A,
MAX77693_CHARGER_TYPE_DEAD_BATTERY = 7,
};
/**
* struct max77693_muic_irq
* @irq: the index of irq list of MUIC device.
* @name: the name of irq.
* @virq: the virtual irq to use irq domain
*/
struct max77693_muic_irq {
unsigned int irq;
const char *name;
unsigned int virq;
};
static struct max77693_muic_irq muic_irqs[] = {
{ MAX77693_MUIC_IRQ_INT1_ADC, "muic-ADC" },
{ MAX77693_MUIC_IRQ_INT1_ADC_LOW, "muic-ADCLOW" },
{ MAX77693_MUIC_IRQ_INT1_ADC_ERR, "muic-ADCError" },
{ MAX77693_MUIC_IRQ_INT1_ADC1K, "muic-ADC1K" },
{ MAX77693_MUIC_IRQ_INT2_CHGTYP, "muic-CHGTYP" },
{ MAX77693_MUIC_IRQ_INT2_CHGDETREUN, "muic-CHGDETREUN" },
{ MAX77693_MUIC_IRQ_INT2_DCDTMR, "muic-DCDTMR" },
{ MAX77693_MUIC_IRQ_INT2_DXOVP, "muic-DXOVP" },
{ MAX77693_MUIC_IRQ_INT2_VBVOLT, "muic-VBVOLT" },
{ MAX77693_MUIC_IRQ_INT2_VIDRM, "muic-VIDRM" },
{ MAX77693_MUIC_IRQ_INT3_EOC, "muic-EOC" },
{ MAX77693_MUIC_IRQ_INT3_CGMBC, "muic-CGMBC" },
{ MAX77693_MUIC_IRQ_INT3_OVP, "muic-OVP" },
{ MAX77693_MUIC_IRQ_INT3_MBCCHG_ERR, "muic-MBCCHG_ERR" },
{ MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, "muic-CHG_ENABLED" },
{ MAX77693_MUIC_IRQ_INT3_BAT_DET, "muic-BAT_DET" },
};
/* Define supported accessory type */
enum max77693_muic_acc_type {
MAX77693_MUIC_ADC_GROUND = 0x0,
MAX77693_MUIC_ADC_SEND_END_BUTTON,
MAX77693_MUIC_ADC_REMOTE_S1_BUTTON,
MAX77693_MUIC_ADC_REMOTE_S2_BUTTON,
MAX77693_MUIC_ADC_REMOTE_S3_BUTTON,
MAX77693_MUIC_ADC_REMOTE_S4_BUTTON,
MAX77693_MUIC_ADC_REMOTE_S5_BUTTON,
Annotation
- Immediate include surface: `linux/devm-helpers.h`, `linux/kernel.h`, `linux/module.h`, `linux/i2c.h`, `linux/slab.h`, `linux/input.h`, `linux/interrupt.h`, `linux/err.h`.
- Detected declarations: `struct max77693_muic_info`, `struct max77693_muic_irq`, `enum max77693_muic_adc_debounce_time`, `enum max77693_muic_cable_group`, `enum max77693_muic_charger_type`, `enum max77693_muic_acc_type`, `function max77693_muic_set_debounce_time`, `function max77693_muic_set_path`, `function max77693_muic_get_cable_type`, `function max77693_muic_dock_handler`.
- Atlas domain: Driver Families / drivers/extcon.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.