drivers/platform/x86/intel/chtwc_int33fe.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/chtwc_int33fe.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/intel/chtwc_int33fe.c- Extension
.c- Size
- 12611 bytes
- Lines
- 449
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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/dmi.hlinux/i2c.hlinux/interrupt.hlinux/pci.hlinux/platform_device.hlinux/property.hlinux/regulator/consumer.hlinux/slab.hlinux/usb/pd.h
Detected Declarations
struct cht_int33fe_datafunction devicefunction cht_int33fe_setup_dpfunction cht_int33fe_remove_nodesfunction cht_int33fe_put_swnodefunction cht_int33fe_add_nodesfunction cht_int33fe_register_max17047function cht_int33fe_typec_probefunction cht_int33fe_typec_remove
Annotated Snippet
struct cht_int33fe_data {
struct i2c_client *battery_fg;
struct i2c_client *fusb302;
struct i2c_client *pi3usb30532;
struct fwnode_handle *dp;
};
/*
* Grrr, I severely dislike buggy BIOS-es. At least one BIOS enumerates
* the max17047 both through the INT33FE ACPI device (it is right there
* in the resources table) as well as through a separate MAX17047 device.
*
* These helpers are used to work around this by checking if an I²C client
* for the max17047 has already been registered.
*/
static int cht_int33fe_check_for_max17047(struct device *dev, void *data)
{
struct i2c_client **max17047 = data;
struct acpi_device *adev;
adev = ACPI_COMPANION(dev);
if (!adev)
return 0;
/* The MAX17047 ACPI node doesn't have an UID, so we don't check that */
if (!acpi_dev_hid_uid_match(adev, "MAX17047", NULL))
return 0;
*max17047 = to_i2c_client(dev);
return 1;
}
static const char * const max17047_suppliers[] = { "bq24190-charger" };
static const struct property_entry max17047_properties[] = {
PROPERTY_ENTRY_STRING_ARRAY("supplied-from", max17047_suppliers),
{ }
};
static const struct software_node max17047_node = {
.name = "max17047",
.properties = max17047_properties,
};
/*
* We are not using inline property here because those are constant,
* and we need to adjust this one at runtime to point to real
* software node.
*/
static struct software_node_ref_args fusb302_mux_refs[] = {
SOFTWARE_NODE_REFERENCE(NULL),
};
static const struct property_entry fusb302_properties[] = {
PROPERTY_ENTRY_STRING("linux,extcon-name", "cht_wcove_pwrsrc"),
PROPERTY_ENTRY_REF_ARRAY("usb-role-switch", fusb302_mux_refs),
{ }
};
static const struct software_node fusb302_node = {
.name = "fusb302",
.properties = fusb302_properties,
};
#define PDO_FIXED_FLAGS \
(PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM)
static const u32 src_pdo[] = {
PDO_FIXED(5000, 1500, PDO_FIXED_FLAGS),
};
static const u32 snk_pdo[] = {
PDO_FIXED(5000, 400, PDO_FIXED_FLAGS),
PDO_VAR(5000, 12000, 3000),
};
static const struct software_node pi3usb30532_node = {
.name = "pi3usb30532",
};
static const struct software_node displayport_node = {
.name = "displayport",
};
static const struct property_entry usb_connector_properties[] = {
PROPERTY_ENTRY_STRING("data-role", "dual"),
PROPERTY_ENTRY_STRING("power-role", "dual"),
PROPERTY_ENTRY_STRING("try-power-role", "sink"),
PROPERTY_ENTRY_U32_ARRAY("source-pdos", src_pdo),
PROPERTY_ENTRY_U32_ARRAY("sink-pdos", snk_pdo),
Annotation
- Immediate include surface: `linux/dmi.h`, `linux/i2c.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/property.h`, `linux/regulator/consumer.h`, `linux/slab.h`.
- Detected declarations: `struct cht_int33fe_data`, `function device`, `function cht_int33fe_setup_dp`, `function cht_int33fe_remove_nodes`, `function cht_int33fe_put_swnode`, `function cht_int33fe_add_nodes`, `function cht_int33fe_register_max17047`, `function cht_int33fe_typec_probe`, `function cht_int33fe_typec_remove`.
- Atlas domain: Driver Families / drivers/platform.
- 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.