linux/drivers/usb/renesas_usbhs/common.c

// SPDX-License-Identifier: GPL-1.0+
/*
 * Renesas USB driver
 *
 * Copyright (C) 2011 Renesas Solutions Corp.
 * Copyright (C) 2019 Renesas Electronics Corporation
 * Kuninori Morimoto <[email protected]>
 */
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include "common.h"
#include "rcar2.h"
#include "rcar3.h"
#include "rza.h"

/*
 *		image of renesas_usbhs
 *
 * ex) gadget case

 * mod.c
 * mod_gadget.c
 * mod_host.c		pipe.c		fifo.c
 *
 *			+-------+	+-----------+
 *			| pipe0 |------>| fifo pio  |
 * +------------+	+-------+	+-----------+
 * | mod_gadget |=====> | pipe1 |--+
 * +------------+	+-------+  |	+-----------+
 *			| pipe2 |  |  +-| fifo dma0 |
 * +------------+	+-------+  |  |	+-----------+
 * | mod_host   |	| pipe3 |<-|--+
 * +------------+	+-------+  |	+-----------+
 *			| ....  |  +--->| fifo dma1 |
 *			| ....  |	+-----------+
 */

/*
 * platform call back
 *
 * renesas usb support platform callback function.
 * Below macro call it.
 * if platform doesn't have callback, it return 0 (no error)
 */
#define usbhs_platform_call(priv, func, args...)

/*
 *		common functions
 */
u16 usbhs_read(struct usbhs_priv *priv, u32 reg)
{}

void usbhs_write(struct usbhs_priv *priv, u32 reg, u16 data)
{}

void usbhs_bset(struct usbhs_priv *priv, u32 reg, u16 mask, u16 data)
{}

struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev)
{}

int usbhs_get_id_as_gadget(struct platform_device *pdev)
{}

/*
 *		syscfg functions
 */
static void usbhs_sys_clock_ctrl(struct usbhs_priv *priv, int enable)
{}

void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable)
{}

void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)
{}

void usbhs_sys_function_pullup(struct usbhs_priv *priv, int enable)
{}

void usbhs_sys_set_test_mode(struct usbhs_priv *priv, u16 mode)
{}

/*
 *		frame functions
 */
int usbhs_frame_get_num(struct usbhs_priv *priv)
{}

/*
 *		usb request functions
 */
void usbhs_usbreq_get_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
{}

void usbhs_usbreq_set_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
{}

/*
 *		bus/vbus functions
 */
void usbhs_bus_send_sof_enable(struct usbhs_priv *priv)
{}

void usbhs_bus_send_reset(struct usbhs_priv *priv)
{}

int usbhs_bus_get_speed(struct usbhs_priv *priv)
{}

int usbhs_vbus_ctrl(struct usbhs_priv *priv, int enable)
{}

static void usbhsc_bus_init(struct usbhs_priv *priv)
{}

/*
 *		device configuration
 */
int usbhs_set_device_config(struct usbhs_priv *priv, int devnum,
			   u16 upphub, u16 hubport, u16 speed)
{}

/*
 *		interrupt functions
 */
void usbhs_xxxsts_clear(struct usbhs_priv *priv, u16 sts_reg, u16 bit)
{}

/*
 *		local functions
 */
static void usbhsc_set_buswait(struct usbhs_priv *priv)
{}

static bool usbhsc_is_multi_clks(struct usbhs_priv *priv)
{}

static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv)
{}

static void usbhsc_clk_put(struct usbhs_priv *priv)
{}

static int usbhsc_clk_prepare_enable(struct usbhs_priv *priv)
{}

static void usbhsc_clk_disable_unprepare(struct usbhs_priv *priv)
{}

/*
 *		platform default param
 */

/* commonly used on old SH-Mobile and RZ/G2L family SoCs */
static struct renesas_usbhs_driver_pipe_config usbhsc_default_pipe[] =;

/* commonly used on newer SH-Mobile and R-Car SoCs */
static struct renesas_usbhs_driver_pipe_config usbhsc_new_pipe[] =;

/*
 *		power control
 */
static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable)
{}

/*
 *		hotplug
 */
static void usbhsc_hotplug(struct usbhs_priv *priv)
{}

/*
 *		notify hotplug
 */
static void usbhsc_notify_hotplug(struct work_struct *work)
{}

int usbhsc_schedule_notify_hotplug(struct platform_device *pdev)
{}

/*
 *		platform functions
 */
static const struct of_device_id usbhs_of_match[] =;
MODULE_DEVICE_TABLE(of, usbhs_of_match);

static int usbhs_probe(struct platform_device *pdev)
{}

static void usbhs_remove(struct platform_device *pdev)
{}

static __maybe_unused int usbhsc_suspend(struct device *dev)
{}

static __maybe_unused int usbhsc_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(usbhsc_pm_ops, usbhsc_suspend, usbhsc_resume);

static struct platform_driver renesas_usbhs_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();