linux/drivers/usb/fotg210/fotg210-udc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * FOTG210 UDC Driver supports Bulk transfer so far
 *
 * Copyright (C) 2013 Faraday Technology Corporation
 *
 * Author : Yuan-Hsin Chen <[email protected]>
 */

#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
#include <linux/usb/phy.h>

#include "fotg210.h"
#include "fotg210-udc.h"

#define DRIVER_DESC
#define DRIVER_VERSION

static const char udc_name[] =;
static const char * const fotg210_ep_name[] =;

static void fotg210_ack_int(struct fotg210_udc *fotg210, u32 offset, u32 mask)
{}

static void fotg210_disable_fifo_int(struct fotg210_ep *ep)
{}

static void fotg210_enable_fifo_int(struct fotg210_ep *ep)
{}

static void fotg210_set_cxdone(struct fotg210_udc *fotg210)
{}

static void fotg210_done(struct fotg210_ep *ep, struct fotg210_request *req,
			int status)
{}

static void fotg210_fifo_ep_mapping(struct fotg210_ep *ep, u32 epnum,
				u32 dir_in)
{}

static void fotg210_set_fifo_dir(struct fotg210_ep *ep, u32 epnum, u32 dir_in)
{}

static void fotg210_set_tfrtype(struct fotg210_ep *ep, u32 epnum, u32 type)
{}

static void fotg210_set_mps(struct fotg210_ep *ep, u32 epnum, u32 mps,
				u32 dir_in)
{}

static int fotg210_config_ep(struct fotg210_ep *ep,
		     const struct usb_endpoint_descriptor *desc)
{}

static int fotg210_ep_enable(struct usb_ep *_ep,
			  const struct usb_endpoint_descriptor *desc)
{}

static void fotg210_reset_tseq(struct fotg210_udc *fotg210, u8 epnum)
{}

static int fotg210_ep_release(struct fotg210_ep *ep)
{}

static int fotg210_ep_disable(struct usb_ep *_ep)
{}

static struct usb_request *fotg210_ep_alloc_request(struct usb_ep *_ep,
						gfp_t gfp_flags)
{}

static void fotg210_ep_free_request(struct usb_ep *_ep,
					struct usb_request *_req)
{}

static void fotg210_enable_dma(struct fotg210_ep *ep,
			      dma_addr_t d, u32 len)
{}

static void fotg210_disable_dma(struct fotg210_ep *ep)
{}

static void fotg210_wait_dma_done(struct fotg210_ep *ep)
{}

static void fotg210_start_dma(struct fotg210_ep *ep,
			struct fotg210_request *req)
{}

static void fotg210_ep0_queue(struct fotg210_ep *ep,
				struct fotg210_request *req)
{}

static int fotg210_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
				gfp_t gfp_flags)
{}

static int fotg210_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{}

static void fotg210_set_epnstall(struct fotg210_ep *ep)
{}

static void fotg210_clear_epnstall(struct fotg210_ep *ep)
{}

static int fotg210_set_halt_and_wedge(struct usb_ep *_ep, int value, int wedge)
{}

static int fotg210_ep_set_halt(struct usb_ep *_ep, int value)
{}

static int fotg210_ep_set_wedge(struct usb_ep *_ep)
{}

static void fotg210_ep_fifo_flush(struct usb_ep *_ep)
{}

static const struct usb_ep_ops fotg210_ep_ops =;

static void fotg210_clear_tx0byte(struct fotg210_udc *fotg210)
{}

static void fotg210_clear_rx0byte(struct fotg210_udc *fotg210)
{}

/* read 8-byte setup packet only */
static void fotg210_rdsetupp(struct fotg210_udc *fotg210,
		   u8 *buffer)
{}

static void fotg210_set_configuration(struct fotg210_udc *fotg210)
{}

static void fotg210_set_dev_addr(struct fotg210_udc *fotg210, u32 addr)
{}

static void fotg210_set_cxstall(struct fotg210_udc *fotg210)
{}

static void fotg210_request_error(struct fotg210_udc *fotg210)
{}

static void fotg210_set_address(struct fotg210_udc *fotg210,
				struct usb_ctrlrequest *ctrl)
{}

static void fotg210_set_feature(struct fotg210_udc *fotg210,
				struct usb_ctrlrequest *ctrl)
{}

static void fotg210_clear_feature(struct fotg210_udc *fotg210,
				struct usb_ctrlrequest *ctrl)
{}

static int fotg210_is_epnstall(struct fotg210_ep *ep)
{}

/* For EP0 requests triggered by this driver (currently GET_STATUS response) */
static void fotg210_ep0_complete(struct usb_ep *_ep, struct usb_request *req)
{}

static void fotg210_get_status(struct fotg210_udc *fotg210,
				struct usb_ctrlrequest *ctrl)
{}

static int fotg210_setup_packet(struct fotg210_udc *fotg210,
				struct usb_ctrlrequest *ctrl)
{}

static void fotg210_ep0out(struct fotg210_udc *fotg210)
{}

static void fotg210_ep0in(struct fotg210_udc *fotg210)
{}

static void fotg210_in_fifo_handler(struct fotg210_ep *ep)
{}

static void fotg210_out_fifo_handler(struct fotg210_ep *ep)
{}

static irqreturn_t fotg210_irq(int irq, void *_fotg210)
{}

static void fotg210_disable_unplug(struct fotg210_udc *fotg210)
{}

static int fotg210_udc_start(struct usb_gadget *g,
		struct usb_gadget_driver *driver)
{}

static void fotg210_init(struct fotg210_udc *fotg210)
{}

static int fotg210_udc_stop(struct usb_gadget *g)
{}

/**
 * fotg210_vbus_session - Called by external transceiver to enable/disable udc
 * @g: usb gadget
 * @is_active: 0 if should disable UDC VBUS, 1 if should enable
 *
 * Returns: %0
 */
static int fotg210_vbus_session(struct usb_gadget *g, int is_active)
{}

static const struct usb_gadget_ops fotg210_gadget_ops =;

/**
 * fotg210_phy_event - Called by phy upon VBus event
 * @nb: notifier block
 * @action: phy action, is vbus connect or disconnect
 * @data: the usb_gadget structure in fotg210
 *
 * Called by the USB Phy when a cable connect or disconnect is sensed.
 *
 * Returns: NOTIFY_OK or NOTIFY_DONE
 */
static int fotg210_phy_event(struct notifier_block *nb, unsigned long action,
			     void *data)
{}

static struct notifier_block fotg210_phy_notifier =;

int fotg210_udc_remove(struct platform_device *pdev)
{}

int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg)
{}