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

// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for the NXP ISP1761 device controller
 *
 * Copyright 2021 Linaro, Rui Miguel Silva
 * Copyright 2014 Ideas on Board Oy
 *
 * Contacts:
 *	Laurent Pinchart <[email protected]>
 *	Rui Miguel Silva <[email protected]>
 */

#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/usb.h>

#include "isp1760-core.h"
#include "isp1760-regs.h"
#include "isp1760-udc.h"

#define ISP1760_VBUS_POLL_INTERVAL

struct isp1760_request {};

static inline struct isp1760_udc *gadget_to_udc(struct usb_gadget *gadget)
{}

static inline struct isp1760_ep *ep_to_udc_ep(struct usb_ep *ep)
{}

static inline struct isp1760_request *req_to_udc_req(struct usb_request *req)
{}

static u32 isp1760_udc_read(struct isp1760_udc *udc, u16 field)
{}

static void isp1760_udc_write(struct isp1760_udc *udc, u16 field, u32 val)
{}

static u32 isp1760_udc_read_raw(struct isp1760_udc *udc, u16 reg)
{}

static u16 isp1760_udc_read_raw16(struct isp1760_udc *udc, u16 reg)
{}

static void isp1760_udc_write_raw(struct isp1760_udc *udc, u16 reg, u32 val)
{}

static void isp1760_udc_write_raw16(struct isp1760_udc *udc, u16 reg, u16 val)
{}

static void isp1760_udc_set(struct isp1760_udc *udc, u32 field)
{}

static void isp1760_udc_clear(struct isp1760_udc *udc, u32 field)
{}

static bool isp1760_udc_is_set(struct isp1760_udc *udc, u32 field)
{}
/* -----------------------------------------------------------------------------
 * Endpoint Management
 */

static struct isp1760_ep *isp1760_udc_find_ep(struct isp1760_udc *udc,
					      u16 index)
{}

static void __isp1760_udc_select_ep(struct isp1760_udc *udc,
				    struct isp1760_ep *ep, int dir)
{}

/**
 * isp1760_udc_select_ep - Select an endpoint for register access
 * @ep: The endpoint
 * @udc: Reference to the device controller
 *
 * The ISP1761 endpoint registers are banked. This function selects the target
 * endpoint for banked register access. The selection remains valid until the
 * next call to this function, the next direct access to the EPINDEX register
 * or the next reset, whichever comes first.
 *
 * Called with the UDC spinlock held.
 */
static void isp1760_udc_select_ep(struct isp1760_udc *udc,
				  struct isp1760_ep *ep)
{}

/* Called with the UDC spinlock held. */
static void isp1760_udc_ctrl_send_status(struct isp1760_ep *ep, int dir)
{}

/* Called without the UDC spinlock held. */
static void isp1760_udc_request_complete(struct isp1760_ep *ep,
					 struct isp1760_request *req,
					 int status)
{}

static void isp1760_udc_ctrl_send_stall(struct isp1760_ep *ep)
{}

/* -----------------------------------------------------------------------------
 * Data Endpoints
 */

/* Called with the UDC spinlock held. */
static bool isp1760_udc_receive(struct isp1760_ep *ep,
				struct isp1760_request *req)
{}

static void isp1760_udc_transmit(struct isp1760_ep *ep,
				 struct isp1760_request *req)
{}

static void isp1760_ep_rx_ready(struct isp1760_ep *ep)
{}

static void isp1760_ep_tx_complete(struct isp1760_ep *ep)
{}

static int __isp1760_udc_set_halt(struct isp1760_ep *ep, bool halt)
{}

/* -----------------------------------------------------------------------------
 * Control Endpoint
 */

static int isp1760_udc_get_status(struct isp1760_udc *udc,
				  const struct usb_ctrlrequest *req)
{}

static int isp1760_udc_set_address(struct isp1760_udc *udc, u16 addr)
{}

static bool isp1760_ep0_setup_standard(struct isp1760_udc *udc,
				       struct usb_ctrlrequest *req)
{}

static void isp1760_ep0_setup(struct isp1760_udc *udc)
{}

/* -----------------------------------------------------------------------------
 * Gadget Endpoint Operations
 */

static int isp1760_ep_enable(struct usb_ep *ep,
			     const struct usb_endpoint_descriptor *desc)
{}

static int isp1760_ep_disable(struct usb_ep *ep)
{}

static struct usb_request *isp1760_ep_alloc_request(struct usb_ep *ep,
						    gfp_t gfp_flags)
{}

static void isp1760_ep_free_request(struct usb_ep *ep, struct usb_request *_req)
{}

static int isp1760_ep_queue(struct usb_ep *ep, struct usb_request *_req,
			    gfp_t gfp_flags)
{}

static int isp1760_ep_dequeue(struct usb_ep *ep, struct usb_request *_req)
{}

static int __isp1760_ep_set_halt(struct isp1760_ep *uep, bool stall, bool wedge)
{}

static int isp1760_ep_set_halt(struct usb_ep *ep, int value)
{}

static int isp1760_ep_set_wedge(struct usb_ep *ep)
{}

static void isp1760_ep_fifo_flush(struct usb_ep *ep)
{}

static const struct usb_ep_ops isp1760_ep_ops =;

/* -----------------------------------------------------------------------------
 * Device States
 */

/* Called with the UDC spinlock held. */
static void isp1760_udc_connect(struct isp1760_udc *udc)
{}

/* Called with the UDC spinlock held. */
static void isp1760_udc_disconnect(struct isp1760_udc *udc)
{}

static void isp1760_udc_init_hw(struct isp1760_udc *udc)
{}

static void isp1760_udc_reset(struct isp1760_udc *udc)
{}

static void isp1760_udc_suspend(struct isp1760_udc *udc)
{}

static void isp1760_udc_resume(struct isp1760_udc *udc)
{}

/* -----------------------------------------------------------------------------
 * Gadget Operations
 */

static int isp1760_udc_get_frame(struct usb_gadget *gadget)
{}

static int isp1760_udc_wakeup(struct usb_gadget *gadget)
{}

static int isp1760_udc_set_selfpowered(struct usb_gadget *gadget,
				       int is_selfpowered)
{}

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

static int isp1760_udc_start(struct usb_gadget *gadget,
			     struct usb_gadget_driver *driver)
{}

static int isp1760_udc_stop(struct usb_gadget *gadget)
{}

static const struct usb_gadget_ops isp1760_udc_ops =;

/* -----------------------------------------------------------------------------
 * Interrupt Handling
 */

static u32 isp1760_udc_irq_get_status(struct isp1760_udc *udc)
{}

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

static void isp1760_udc_vbus_poll(struct timer_list *t)
{}

/* -----------------------------------------------------------------------------
 * Registration
 */

static void isp1760_udc_init_eps(struct isp1760_udc *udc)
{}

static int isp1760_udc_init(struct isp1760_udc *udc)
{}

int isp1760_udc_register(struct isp1760_device *isp, int irq,
			 unsigned long irqflags)
{}

void isp1760_udc_unregister(struct isp1760_device *isp)
{}