linux/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2023, 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/usb/pd.h>
#include <linux/usb/tcpm.h>
#include "qcom_pmic_typec.h"
#include "qcom_pmic_typec_pdphy.h"

/* PD PHY register offsets and bit fields */
#define USB_PDPHY_MSG_CONFIG_REG
#define MSG_CONFIG_PORT_DATA_ROLE
#define MSG_CONFIG_PORT_POWER_ROLE
#define MSG_CONFIG_SPEC_REV_MASK

#define USB_PDPHY_EN_CONTROL_REG
#define CONTROL_ENABLE

#define USB_PDPHY_RX_STATUS_REG
#define RX_FRAME_TYPE

#define USB_PDPHY_FRAME_FILTER_REG
#define FRAME_FILTER_EN_HARD_RESET
#define FRAME_FILTER_EN_SOP

#define USB_PDPHY_TX_SIZE_REG
#define TX_SIZE_MASK

#define USB_PDPHY_TX_CONTROL_REG
#define TX_CONTROL_RETRY_COUNT(n)
#define TX_CONTROL_FRAME_TYPE(n)
#define TX_CONTROL_FRAME_TYPE_CABLE_RESET
#define TX_CONTROL_SEND_SIGNAL
#define TX_CONTROL_SEND_MSG

#define USB_PDPHY_RX_SIZE_REG

#define USB_PDPHY_RX_ACKNOWLEDGE_REG
#define RX_BUFFER_TOKEN

#define USB_PDPHY_BIST_MODE_REG
#define BIST_MODE_MASK
#define BIST_ENABLE
#define PD_MSG_BIST
#define PD_BIST_TEST_DATA_MODE

#define USB_PDPHY_TX_BUFFER_HDR_REG
#define USB_PDPHY_TX_BUFFER_DATA_REG

#define USB_PDPHY_RX_BUFFER_REG

/* VDD regulator */
#define VDD_PDPHY_VOL_MIN
#define VDD_PDPHY_VOL_MAX
#define VDD_PDPHY_HPM_LOAD

/* Message Spec Rev field */
#define PD_MSG_HDR_REV(hdr)

/* timers */
#define RECEIVER_RESPONSE_TIME
#define HARD_RESET_COMPLETE_TIME

/* Interrupt numbers */
#define PMIC_PDPHY_SIG_TX_IRQ
#define PMIC_PDPHY_SIG_RX_IRQ
#define PMIC_PDPHY_MSG_TX_IRQ
#define PMIC_PDPHY_MSG_RX_IRQ
#define PMIC_PDPHY_MSG_TX_FAIL_IRQ
#define PMIC_PDPHY_MSG_TX_DISCARD_IRQ
#define PMIC_PDPHY_MSG_RX_DISCARD_IRQ
#define PMIC_PDPHY_FR_SWAP_IRQ


struct pmic_typec_pdphy_irq_data {};

struct pmic_typec_pdphy {};

static void qcom_pmic_typec_pdphy_reset_on(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static void qcom_pmic_typec_pdphy_reset_off(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static void qcom_pmic_typec_pdphy_sig_reset_work(struct work_struct *work)
{}

static int
qcom_pmic_typec_pdphy_clear_tx_control_reg(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static int
qcom_pmic_typec_pdphy_pd_transmit_signal(struct pmic_typec_pdphy *pmic_typec_pdphy,
					 enum tcpm_transmit_type type,
					 unsigned int negotiated_rev)
{}

static int
qcom_pmic_typec_pdphy_pd_transmit_payload(struct pmic_typec_pdphy *pmic_typec_pdphy,
					  enum tcpm_transmit_type type,
					  const struct pd_message *msg,
					  unsigned int negotiated_rev)
{}

static int qcom_pmic_typec_pdphy_pd_transmit(struct tcpc_dev *tcpc,
					     enum tcpm_transmit_type type,
					     const struct pd_message *msg,
					     unsigned int negotiated_rev)
{}

static void qcom_pmic_typec_pdphy_pd_receive(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static irqreturn_t qcom_pmic_typec_pdphy_isr(int irq, void *dev_id)
{}

static int qcom_pmic_typec_pdphy_set_pd_rx(struct tcpc_dev *tcpc, bool on)
{}

static int qcom_pmic_typec_pdphy_set_roles(struct tcpc_dev *tcpc, bool attached,
					   enum typec_role power_role,
					   enum typec_data_role data_role)
{}

static int qcom_pmic_typec_pdphy_enable(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static int qcom_pmic_typec_pdphy_disable(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static int pmic_typec_pdphy_reset(struct pmic_typec_pdphy *pmic_typec_pdphy)
{}

static int qcom_pmic_typec_pdphy_start(struct pmic_typec *tcpm,
				       struct tcpm_port *tcpm_port)
{}

static void qcom_pmic_typec_pdphy_stop(struct pmic_typec *tcpm)
{}

int qcom_pmic_typec_pdphy_probe(struct platform_device *pdev,
				struct pmic_typec *tcpm,
				const struct pmic_typec_pdphy_resources *res,
				struct regmap *regmap,
				u32 base)
{}

const struct pmic_typec_pdphy_resources pm8150b_pdphy_res =;