Select Git revision
fotg210-hcd.c
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
fotg210-hcd.c 163.88 KiB
/*
* Faraday FOTG210 EHCI-like driver
*
* Copyright (c) 2013 Faraday Technology Corporation
*
* Author: Yuan-Hsin Chen <yhchen@faraday-tech.com>
* Feng-Hsin Chiang <john453@faraday-tech.com>
* Po-Yu Chuang <ratbert.chuang@gmail.com>
*
* Most of code borrowed from the Linux-3.7 EHCI driver
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/module.h>
#include <linux/device.h>
#include <linux/dmapool.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/vmalloc.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/hrtimer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include <linux/moduleparam.h>
#include <linux/dma-mapping.h>
#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
#include <asm/unaligned.h>
/*-------------------------------------------------------------------------*/
#define DRIVER_AUTHOR "Yuan-Hsin Chen"
#define DRIVER_DESC "FOTG210 Host Controller (EHCI) Driver"
static const char hcd_name[] = "fotg210_hcd";
#undef VERBOSE_DEBUG
#undef FOTG210_URB_TRACE
#ifdef DEBUG
#define FOTG210_STATS
#endif
/* magic numbers that can affect system performance */
#define FOTG210_TUNE_CERR 3 /* 0-3 qtd retries; 0 == don't stop */
#define FOTG210_TUNE_RL_HS 4 /* nak throttle; see 4.9 */
#define FOTG210_TUNE_RL_TT 0
#define FOTG210_TUNE_MULT_HS 1 /* 1-3 transactions/uframe; 4.10.3 */