linux/drivers/usb/gadget/udc/mv_u3d_core.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2011 Marvell International Ltd. All rights reserved.
 */

#include <linux/module.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/notifier.h>
#include <linux/interrupt.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/pm.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/platform_data/mv_usb.h>
#include <linux/clk.h>

#include "mv_u3d.h"

#define DRIVER_DESC

static const char driver_name[] =;

static void mv_u3d_nuke(struct mv_u3d_ep *ep, int status);
static void mv_u3d_stop_activity(struct mv_u3d *u3d,
			struct usb_gadget_driver *driver);

/* for endpoint 0 operations */
static const struct usb_endpoint_descriptor mv_u3d_ep0_desc =;

static void mv_u3d_ep0_reset(struct mv_u3d *u3d)
{}

static void mv_u3d_ep0_stall(struct mv_u3d *u3d)
{}

static int mv_u3d_process_ep_req(struct mv_u3d *u3d, int index,
	struct mv_u3d_req *curr_req)
{}

/*
 * mv_u3d_done() - retire a request; caller blocked irqs
 * @status : request status to be set, only works when
 * request is still in progress.
 */
static
void mv_u3d_done(struct mv_u3d_ep *ep, struct mv_u3d_req *req, int status)
	__releases(&ep->udc->lock)
	__acquires(&ep->udc->lock)
{}

static int mv_u3d_queue_trb(struct mv_u3d_ep *ep, struct mv_u3d_req *req)
{}

static struct mv_u3d_trb *mv_u3d_build_trb_one(struct mv_u3d_req *req,
				unsigned *length, dma_addr_t *dma)
{}

static int mv_u3d_build_trb_chain(struct mv_u3d_req *req, unsigned *length,
		struct mv_u3d_trb *trb, int *is_last)
{}

/* generate TRB linked list for a request
 * usb controller only supports continous trb chain,
 * that trb structure physical address should be continous.
 */
static int mv_u3d_req_to_trb(struct mv_u3d_req *req)
{}

static int
mv_u3d_start_queue(struct mv_u3d_ep *ep)
{}

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

static int  mv_u3d_ep_disable(struct usb_ep *_ep)
{}

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

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

static void mv_u3d_ep_fifo_flush(struct usb_ep *_ep)
{}

/* queues (submits) an I/O request to an endpoint */
static int
mv_u3d_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
{}

/* dequeues (cancels, unlinks) an I/O request from an endpoint */
static int mv_u3d_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
{}

static void
mv_u3d_ep_set_stall(struct mv_u3d *u3d, u8 ep_num, u8 direction, int stall)
{}

static int mv_u3d_ep_set_halt_wedge(struct usb_ep *_ep, int halt, int wedge)
{}

static int mv_u3d_ep_set_halt(struct usb_ep *_ep, int halt)
{}

static int mv_u3d_ep_set_wedge(struct usb_ep *_ep)
{}

static const struct usb_ep_ops mv_u3d_ep_ops =;

static void mv_u3d_controller_stop(struct mv_u3d *u3d)
{}

static void mv_u3d_controller_start(struct mv_u3d *u3d)
{}

static int mv_u3d_controller_reset(struct mv_u3d *u3d)
{}

static int mv_u3d_enable(struct mv_u3d *u3d)
{}

static void mv_u3d_disable(struct mv_u3d *u3d)
{}

static int mv_u3d_vbus_session(struct usb_gadget *gadget, int is_active)
{}

/* constrain controller's VBUS power usage
 * This call is used by gadget drivers during SET_CONFIGURATION calls,
 * reporting how much power the device may consume.  For example, this
 * could affect how quickly batteries are recharged.
 *
 * Returns zero on success, else negative errno.
 */
static int mv_u3d_vbus_draw(struct usb_gadget *gadget, unsigned mA)
{}

static int mv_u3d_pullup(struct usb_gadget *gadget, int is_on)
{}

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

static int mv_u3d_stop(struct usb_gadget *g)
{}

/* device controller usb_gadget_ops structure */
static const struct usb_gadget_ops mv_u3d_ops =;

static int mv_u3d_eps_init(struct mv_u3d *u3d)
{}

/* delete all endpoint requests, called with spinlock held */
static void mv_u3d_nuke(struct mv_u3d_ep *ep, int status)
{}

/* stop all USB activities */
static
void mv_u3d_stop_activity(struct mv_u3d *u3d, struct usb_gadget_driver *driver)
{}

static void mv_u3d_irq_process_error(struct mv_u3d *u3d)
{}

static void mv_u3d_irq_process_link_change(struct mv_u3d *u3d)
{}

static void mv_u3d_ch9setaddress(struct mv_u3d *u3d,
				struct usb_ctrlrequest *setup)
{}

static int mv_u3d_is_set_configuration(struct usb_ctrlrequest *setup)
{}

static void mv_u3d_handle_setup_packet(struct mv_u3d *u3d, u8 ep_num,
	struct usb_ctrlrequest *setup)
	__releases(&u3c->lock)
	__acquires(&u3c->lock)
{}

static void mv_u3d_get_setup_data(struct mv_u3d *u3d, u8 ep_num, u8 *buffer_ptr)
{}

static void mv_u3d_irq_process_setup(struct mv_u3d *u3d)
{}

static void mv_u3d_irq_process_tr_complete(struct mv_u3d *u3d)
{}

static irqreturn_t mv_u3d_irq(int irq, void *dev)
{}

static void mv_u3d_remove(struct platform_device *dev)
{}

static int mv_u3d_probe(struct platform_device *dev)
{}

#ifdef CONFIG_PM_SLEEP
static int mv_u3d_suspend(struct device *dev)
{}

static int mv_u3d_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(mv_u3d_pm_ops, mv_u3d_suspend, mv_u3d_resume);

static void mv_u3d_shutdown(struct platform_device *dev)
{}

static struct platform_driver mv_u3d_driver =;

module_platform_driver();
MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();