linux/drivers/usb/mtu3/mtu3_host.c

// SPDX-License-Identifier: GPL-2.0
/*
 * mtu3_dr.c - dual role switch and host glue layer
 *
 * Copyright (C) 2016 MediaTek Inc.
 *
 * Author: Chunfeng Yun <[email protected]>
 */

#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/regmap.h>

#include "mtu3.h"
#include "mtu3_dr.h"

/* mt8173 etc */
#define PERI_WK_CTRL1
#define WC1_IS_C(x)
#define WC1_IS_EN
#define WC1_IS_P

/* mt8183 */
#define PERI_WK_CTRL0
#define WC0_IS_C(x)
#define WC0_IS_P
#define WC0_IS_EN

/* mt8192 */
#define WC0_SSUSB0_CDEN
#define WC0_IS_SPM_EN

/* mt8195 */
#define PERI_WK_CTRL0_8195
#define WC0_IS_P_95
#define WC0_IS_C_95(x)
#define WC0_IS_EN_P3_95
#define WC0_IS_EN_P2_95

#define PERI_WK_CTRL1_8195
#define WC1_IS_C_95(x)
#define WC1_IS_P_95
#define WC1_IS_EN_P0_95

/* mt2712 etc */
#define PERI_SSUSB_SPM_CTRL
#define SSC_IP_SLEEP_EN
#define SSC_SPM_INT_EN

enum ssusb_uwk_vers {};

/*
 * ip-sleep wakeup mode:
 * all clocks can be turn off, but power domain should be kept on
 */
static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
{}

int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
				struct device_node *dn)
{}

void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable)
{}

static void host_ports_num_get(struct ssusb_mtk *ssusb)
{}

/* only configure ports will be used later */
static int ssusb_host_enable(struct ssusb_mtk *ssusb)
{}

static int ssusb_host_disable(struct ssusb_mtk *ssusb)
{}

int ssusb_host_resume(struct ssusb_mtk *ssusb, bool p0_skipped)
{}

/* here not skip port0 due to PDN can be set repeatedly */
int ssusb_host_suspend(struct ssusb_mtk *ssusb)
{}

static void ssusb_host_setup(struct ssusb_mtk *ssusb)
{}

static void ssusb_host_cleanup(struct ssusb_mtk *ssusb)
{}

/*
 * If host supports multiple ports, the VBUSes(5V) of ports except port0
 * which supports OTG are better to be enabled by default in DTS.
 * Because the host driver will keep link with devices attached when system
 * enters suspend mode, so no need to control VBUSes after initialization.
 */
int ssusb_host_init(struct ssusb_mtk *ssusb, struct device_node *parent_dn)
{}

void ssusb_host_exit(struct ssusb_mtk *ssusb)
{}