Linux Kernel
3.7.1
|
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include "core.h"
#include "gadget.h"
#include "io.h"
Go to the source code of this file.
Functions | |
int | dwc3_gadget_set_test_mode (struct dwc3 *dwc, int mode) |
int | dwc3_gadget_set_link_state (struct dwc3 *dwc, enum dwc3_link_state state) |
int | dwc3_gadget_resize_tx_fifos (struct dwc3 *dwc) |
void | dwc3_gadget_giveback (struct dwc3_ep *dep, struct dwc3_request *req, int status) |
int | dwc3_send_gadget_generic_command (struct dwc3 *dwc, int cmd, u32 param) |
int | dwc3_send_gadget_ep_cmd (struct dwc3 *dwc, unsigned ep, unsigned cmd, struct dwc3_gadget_ep_cmd_params *params) |
int | __dwc3_gadget_ep_set_halt (struct dwc3_ep *dep, int value) |
int __devinit | dwc3_gadget_init (struct dwc3 *dwc) |
void | dwc3_gadget_exit (struct dwc3 *dwc) |
dwc3_gadget_resize_tx_fifos - reallocate fifo spaces for current use-case : pointer to our context structure
This function will a best effort FIFO allocation in order to improve FIFO usage and throughput, while still allowing us to enable as many endpoints as possible.
Keep in mind that this operation will be highly dependent on the configured size for RAM1 - which contains TxFifo -, the amount of endpoints enabled on coreConsultant tool, and the width of the Master Bus.
In the ideal world, we would always be able to satisfy the following equation:
((512 + 2 * MDWIDTH-Bytes) + (Number of IN Endpoints - 1) * \ (3 * (1024 + MDWIDTH-Bytes) + MDWIDTH-Bytes)) / MDWIDTH-Bytes
Unfortunately, due to many variables that's not always the case.
int dwc3_gadget_set_link_state | ( | struct dwc3 * | dwc, |
enum dwc3_link_state | state | ||
) |
gadget.c - DesignWare USB3 DRD Controller Gadget Framework Link
Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
Authors: Felipe Balbi balbi, Sebastian Andrzej Siewior @ti. combigea sy@l inutr onix .de
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
ALTERNATIVELY, this software may be distributed under the terms of the GNU General Public License ("GPL") version 2, as published by the Free Software Foundation.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dwc3_gadget_set_test_mode - Enables USB2 Test Modes : pointer to our context structure : the mode to set (J, K SE0 NAK, Force Enable)
Caller should take care of locking. This function will return 0 on success or -EINVAL if wrong Test Selector is passed
int dwc3_send_gadget_ep_cmd | ( | struct dwc3 * | dwc, |
unsigned | ep, | ||
unsigned | cmd, | ||
struct dwc3_gadget_ep_cmd_params * | params | ||
) |