drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c
Source file repositories/reference/linux-study-clean/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy_stub.c- Extension
.c- Size
- 2113 bytes
- Lines
- 82
- Domain
- Driver Families
- Bucket
- drivers/usb
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/interrupt.hlinux/kernel.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/regmap.hlinux/regulator/consumer.hlinux/slab.hlinux/string_choices.hlinux/usb/pd.hlinux/usb/tcpm.hqcom_pmic_typec.hqcom_pmic_typec_pdphy.h
Detected Declarations
function Copyrightfunction qcom_pmic_typec_pdphy_stub_set_pd_rxfunction qcom_pmic_typec_pdphy_stub_set_rolesfunction qcom_pmic_typec_pdphy_stub_startfunction qcom_pmic_typec_pdphy_stub_stop
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2024, Linaro Ltd. All rights reserved.
*/
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
#include <linux/usb/pd.h>
#include <linux/usb/tcpm.h>
#include "qcom_pmic_typec.h"
#include "qcom_pmic_typec_pdphy.h"
static int qcom_pmic_typec_pdphy_stub_pd_transmit(struct tcpc_dev *tcpc,
enum tcpm_transmit_type type,
const struct pd_message *msg,
unsigned int negotiated_rev)
{
struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc);
struct device *dev = tcpm->dev;
dev_dbg(dev, "pdphy_transmit: type=%d\n", type);
tcpm_pd_transmit_complete(tcpm->tcpm_port,
TCPC_TX_SUCCESS);
return 0;
}
static int qcom_pmic_typec_pdphy_stub_set_pd_rx(struct tcpc_dev *tcpc, bool on)
{
struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc);
struct device *dev = tcpm->dev;
dev_dbg(dev, "set_pd_rx: %s\n", str_on_off(on));
return 0;
}
static int qcom_pmic_typec_pdphy_stub_set_roles(struct tcpc_dev *tcpc, bool attached,
enum typec_role power_role,
enum typec_data_role data_role)
{
struct pmic_typec *tcpm = tcpc_to_tcpm(tcpc);
struct device *dev = tcpm->dev;
dev_dbg(dev, "pdphy_set_roles: data_role_host=%d power_role_src=%d\n",
data_role, power_role);
return 0;
}
static int qcom_pmic_typec_pdphy_stub_start(struct pmic_typec *tcpm,
struct tcpm_port *tcpm_port)
{
return 0;
}
static void qcom_pmic_typec_pdphy_stub_stop(struct pmic_typec *tcpm)
{
}
int qcom_pmic_typec_pdphy_stub_probe(struct platform_device *pdev,
struct pmic_typec *tcpm)
{
tcpm->tcpc.set_pd_rx = qcom_pmic_typec_pdphy_stub_set_pd_rx;
tcpm->tcpc.set_roles = qcom_pmic_typec_pdphy_stub_set_roles;
tcpm->tcpc.pd_transmit = qcom_pmic_typec_pdphy_stub_pd_transmit;
tcpm->pdphy_start = qcom_pmic_typec_pdphy_stub_start;
tcpm->pdphy_stop = qcom_pmic_typec_pdphy_stub_stop;
return 0;
}
Annotation
- Immediate include surface: `linux/err.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/regmap.h`, `linux/regulator/consumer.h`.
- Detected declarations: `function Copyright`, `function qcom_pmic_typec_pdphy_stub_set_pd_rx`, `function qcom_pmic_typec_pdphy_stub_set_roles`, `function qcom_pmic_typec_pdphy_stub_start`, `function qcom_pmic_typec_pdphy_stub_stop`.
- Atlas domain: Driver Families / drivers/usb.
- 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.