2017-11-03 11:28:30 +01:00
// SPDX-License-Identifier: GPL-2.0+
2005-09-22 22:31:15 -07:00
/*
* EHCI HCD ( Host Controller Driver ) PCI Bus Glue .
*
* Copyright ( c ) 2000 - 2004 by David Brownell
*/
2012-11-01 11:13:04 -04:00
# include <linux/kernel.h>
# include <linux/module.h>
# include <linux/pci.h>
# include <linux/usb.h>
# include <linux/usb/hcd.h>
# include "ehci.h"
# include "pci-quirks.h"
# define DRIVER_DESC "EHCI PCI platform driver"
static const char hcd_name [ ] = " ehci-pci " ;
2005-09-22 22:31:15 -07:00
2010-11-17 07:43:09 -08:00
/* defined here to avoid adding to pci_ids.h for single instance use */
# define PCI_DEVICE_ID_INTEL_CE4100_USB 0x2e70
2005-09-22 22:31:15 -07:00
/*-------------------------------------------------------------------------*/
2014-07-02 01:58:18 -07:00
# define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC 0x0939
static inline bool is_intel_quark_x1000 ( struct pci_dev * pdev )
{
return pdev - > vendor = = PCI_VENDOR_ID_INTEL & &
pdev - > device = = PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC ;
}
2015-02-03 18:08:39 +02:00
/*
* This is the list of PCI IDs for the devices that have EHCI USB class and
* specific drivers for that . One of the example is a ChipIdea device installed
* on some Intel MID platforms .
*/
static const struct pci_device_id bypass_pci_id_table [ ] = {
/* ChipIdea on Intel MID platform */
2015-01-28 20:04:06 +02:00
{ PCI_DEVICE ( PCI_VENDOR_ID_INTEL , 0x0811 ) , } ,
{ PCI_DEVICE ( PCI_VENDOR_ID_INTEL , 0x0829 ) , } ,
{ PCI_DEVICE ( PCI_VENDOR_ID_INTEL , 0xe006 ) , } ,
{ }
} ;
2015-02-03 18:08:39 +02:00
static inline bool is_bypassed_id ( struct pci_dev * pdev )
2015-01-28 20:04:06 +02:00
{
2015-02-03 18:08:39 +02:00
return ! ! pci_match_id ( bypass_pci_id_table , pdev ) ;
2015-01-28 20:04:06 +02:00
}
2014-07-02 01:58:18 -07:00
/*
* 0x84 is the offset of in / out threshold register ,
* and it is the same offset as the register of ' hostpc ' .
*/
# define intel_quark_x1000_insnreg01 hostpc
/* Maximum usable threshold value is 0x7f dwords for both IN and OUT */
# define INTEL_QUARK_X1000_EHCI_MAX_THRESHOLD 0x007f007f
2005-09-22 22:31:15 -07:00
2005-11-23 15:45:37 -08:00
/* called after powerup, by probe or system-pm "wakeup" */
static int ehci_pci_reinit ( struct ehci_hcd * ehci , struct pci_dev * pdev )
{
int retval ;
2006-01-24 07:15:30 -08:00
/* we expect static quirk code to handle the "extended capabilities"
* ( currently just BIOS handoff ) allowed starting with EHCI 0.96
*/
2005-11-23 15:45:37 -08:00
/* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */
retval = pci_set_mwi ( pdev ) ;
if ( ! retval )
ehci_dbg ( ehci , " MWI active \n " ) ;
2014-07-02 01:58:18 -07:00
/* Reset the threshold limit */
if ( is_intel_quark_x1000 ( pdev ) ) {
/*
* For the Intel QUARK X1000 , raise the I / O threshold to the
* maximum usable value in order to improve performance .
*/
ehci_writel ( ehci , INTEL_QUARK_X1000_EHCI_MAX_THRESHOLD ,
ehci - > regs - > intel_quark_x1000_insnreg01 ) ;
}
2005-11-23 15:45:37 -08:00
return 0 ;
}
2005-11-28 08:40:38 -08:00
/* called during probe() after chip reset completes */
static int ehci_pci_setup ( struct usb_hcd * hcd )
2005-09-22 22:31:15 -07:00
{
2005-11-23 15:45:32 -08:00
struct ehci_hcd * ehci = hcd_to_ehci ( hcd ) ;
struct pci_dev * pdev = to_pci_dev ( hcd - > self . controller ) ;
2005-09-22 22:31:15 -07:00
u32 temp ;
2005-11-23 15:45:37 -08:00
int retval ;
2005-09-22 22:31:15 -07:00
2012-07-09 15:55:14 -04:00
ehci - > caps = hcd - > regs ;
/*
* ehci_init ( ) causes memory for DMA transfers to be
* allocated . Thus , any vendor - specific workarounds based on
* limiting the type of memory used for DMA transfers must
* happen before ehci_setup ( ) is called .
*
* Most other workarounds can be done either before or after
* init and reset ; they are located here too .
*/
2006-12-15 06:54:08 +11:00
switch ( pdev - > vendor ) {
case PCI_VENDOR_ID_TOSHIBA_2 :
/* celleb's companion chip */
if ( pdev - > device = = 0x01b5 ) {
# ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
ehci - > big_endian_mmio = 1 ;
# else
ehci_warn ( ehci ,
" unsupported big endian Toshiba quirk \n " ) ;
# endif
}
break ;
2006-06-07 10:23:38 -07:00
case PCI_VENDOR_ID_NVIDIA :
/* NVidia reports that certain chips don't handle
* QH , ITD , or SITD addresses above 2 GB . ( But TD ,
* data buffer , and periodic schedule are normal . )
*/
switch ( pdev - > device ) {
case 0x003c : /* MCP04 */
case 0x005b : /* CK804 */
case 0x00d8 : /* CK8 */
case 0x00e8 : /* CK8S */
USB: Remove pci-dma-compat wrapper APIs.
The legacy API wrappers in include/linux/pci-dma-compat.h
should go away as it creates unnecessary midlayering
for include/linux/dma-mapping.h APIs, instead use dma-mapping.h
APIs directly.
The patch has been generated with the coccinelle script below
and compile-tested.
@@@@
- PCI_DMA_BIDIRECTIONAL
+ DMA_BIDIRECTIONAL
@@@@
- PCI_DMA_TODEVICE
+ DMA_TO_DEVICE
@@@@
- PCI_DMA_FROMDEVICE
+ DMA_FROM_DEVICE
@@@@
- PCI_DMA_NONE
+ DMA_NONE
@@ expression E1, E2, E3; @@
- pci_alloc_consistent(E1, E2, E3)
+ dma_alloc_coherent(&E1->dev, E2, E3, GFP_)
@@ expression E1, E2, E3; @@
- pci_zalloc_consistent(E1, E2, E3)
+ dma_alloc_coherent(&E1->dev, E2, E3, GFP_)
@@ expression E1, E2, E3, E4; @@
- pci_free_consistent(E1, E2, E3, E4)
+ dma_free_coherent(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_map_single(E1, E2, E3, E4)
+ dma_map_single(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_unmap_single(E1, E2, E3, E4)
+ dma_unmap_single(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4, E5; @@
- pci_map_page(E1, E2, E3, E4, E5)
+ dma_map_page(&E1->dev, E2, E3, E4, E5)
@@ expression E1, E2, E3, E4; @@
- pci_unmap_page(E1, E2, E3, E4)
+ dma_unmap_page(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_map_sg(E1, E2, E3, E4)
+ dma_map_sg(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_unmap_sg(E1, E2, E3, E4)
+ dma_unmap_sg(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_single_for_cpu(E1, E2, E3, E4)
+ dma_sync_single_for_cpu(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_single_for_device(E1, E2, E3, E4)
+ dma_sync_single_for_device(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_sg_for_cpu(E1, E2, E3, E4)
+ dma_sync_sg_for_cpu(&E1->dev, E2, E3, E4)
@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_sg_for_device(E1, E2, E3, E4)
+ dma_sync_sg_for_device(&E1->dev, E2, E3, E4)
@@ expression E1, E2; @@
- pci_dma_mapping_error(E1, E2)
+ dma_mapping_error(&E1->dev, E2)
@@ expression E1, E2; @@
- pci_set_consistent_dma_mask(E1, E2)
+ dma_set_coherent_mask(&E1->dev, E2)
@@ expression E1, E2; @@
- pci_set_dma_mask(E1, E2)
+ dma_set_mask(&E1->dev, E2)
Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Link: https://lore.kernel.org/r/20200714115249.GA8563@blackclown
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-14 17:22:49 +05:30
if ( dma_set_coherent_mask ( & pdev - > dev , DMA_BIT_MASK ( 31 ) ) < 0 )
2006-06-07 10:23:38 -07:00
ehci_warn ( ehci , " can't enable NVidia "
" workaround for >2GB RAM \n " ) ;
break ;
2005-09-22 22:31:15 -07:00
2012-07-09 15:55:14 -04:00
/* Some NForce2 chips have problems with selective suspend;
* fixed in newer silicon .
2010-11-08 17:58:35 +08:00
*/
2012-07-09 15:55:14 -04:00
case 0x0068 :
if ( pdev - > revision < 0xa4 )
ehci - > no_selective_suspend = 1 ;
break ;
}
2010-04-06 18:26:03 -07:00
break ;
2009-07-13 17:30:41 +08:00
case PCI_VENDOR_ID_INTEL :
2012-07-09 15:55:14 -04:00
if ( pdev - > device = = PCI_DEVICE_ID_INTEL_CE4100_USB )
2010-11-17 07:43:09 -08:00
hcd - > has_tt = 1 ;
2009-07-13 17:30:41 +08:00
break ;
2005-11-23 15:45:32 -08:00
case PCI_VENDOR_ID_TDI :
2012-07-09 15:55:14 -04:00
if ( pdev - > device = = PCI_DEVICE_ID_TDI_EHCI )
2008-04-03 18:02:56 -04:00
hcd - > has_tt = 1 ;
2005-11-23 15:45:32 -08:00
break ;
case PCI_VENDOR_ID_AMD :
2011-03-01 14:57:05 +08:00
/* AMD PLL quirk */
2019-07-04 11:35:29 -04:00
if ( usb_amd_quirk_pll_check ( ) )
2011-03-01 14:57:05 +08:00
ehci - > amd_pll_fix = 1 ;
2005-11-23 15:45:32 -08:00
/* AMD8111 EHCI doesn't work, according to AMD errata */
if ( pdev - > device = = 0x7463 ) {
ehci_info ( ehci , " ignoring AMD8111 (errata) \n " ) ;
2005-11-28 08:40:38 -08:00
retval = - EIO ;
goto done ;
2005-11-23 15:45:32 -08:00
}
2010-11-21 21:15:52 -08:00
2012-07-09 15:55:14 -04:00
/*
* EHCI controller on AMD SB700 / SB800 / Hudson - 2 / 3 platforms may
* read / write memory space which does not belong to it when
* there is NULL pointer with T - bit set to 1 in the frame list
* table . To avoid the issue , the frame list link pointer
* should always contain a valid pointer to a inactive qh .
2010-11-21 21:15:52 -08:00
*/
2012-07-09 15:55:14 -04:00
if ( pdev - > device = = 0x7808 ) {
ehci - > use_dummy_qh = 1 ;
ehci_info ( ehci , " applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaround \n " ) ;
2005-09-22 22:31:15 -07:00
}
2005-11-23 15:45:32 -08:00
break ;
2008-03-20 00:58:16 -07:00
case PCI_VENDOR_ID_VIA :
if ( pdev - > device = = 0x3104 & & ( pdev - > revision & 0xf0 ) = = 0x60 ) {
u8 tmp ;
/* The VT6212 defaults to a 1 usec EHCI sleep time which
* hogs the PCI bus * badly * . Setting bit 5 of 0x4B makes
* that sleep time use the conventional 10 usec .
*/
pci_read_config_byte ( pdev , 0x4b , & tmp ) ;
if ( tmp & 0x20 )
break ;
pci_write_config_byte ( pdev , 0x4b , tmp | 0x20 ) ;
}
break ;
2008-11-14 11:42:29 +08:00
case PCI_VENDOR_ID_ATI :
2011-03-01 14:57:05 +08:00
/* AMD PLL quirk */
2019-07-04 11:35:29 -04:00
if ( usb_amd_quirk_pll_check ( ) )
2011-03-01 14:57:05 +08:00
ehci - > amd_pll_fix = 1 ;
2012-07-09 15:55:14 -04:00
/*
* EHCI controller on AMD SB700 / SB800 / Hudson - 2 / 3 platforms may
* read / write memory space which does not belong to it when
* there is NULL pointer with T - bit set to 1 in the frame list
* table . To avoid the issue , the frame list link pointer
* should always contain a valid pointer to a inactive qh .
*/
if ( pdev - > device = = 0x4396 ) {
ehci - > use_dummy_qh = 1 ;
ehci_info ( ehci , " applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaround \n " ) ;
}
2008-11-25 15:12:33 +08:00
/* SB600 and old version of SB700 have a bug in EHCI controller,
2008-11-14 11:42:29 +08:00
* which causes usb devices lose response in some cases .
*/
2013-10-03 23:37:12 +08:00
if ( ( pdev - > device = = 0x4386 | | pdev - > device = = 0x4396 ) & &
usb_amd_hang_symptom_quirk ( ) ) {
u8 tmp ;
ehci_info ( ehci , " applying AMD SB600/SB700 USB freeze workaround \n " ) ;
pci_read_config_byte ( pdev , 0x53 , & tmp ) ;
pci_write_config_byte ( pdev , 0x53 , tmp | ( 1 < < 3 ) ) ;
2008-11-14 11:42:29 +08:00
}
break ;
2011-10-12 10:39:14 -04:00
case PCI_VENDOR_ID_NETMOS :
/* MosChip frame-index-register bug */
ehci_info ( ehci , " applying MosChip frame-index workaround \n " ) ;
ehci - > frame_index_bug = 1 ;
break ;
2020-06-08 11:46:59 +08:00
case PCI_VENDOR_ID_HUAWEI :
/* Synopsys HC bug */
if ( pdev - > device = = 0xa239 ) {
ehci_info ( ehci , " applying Synopsys HC workaround \n " ) ;
ehci - > has_synopsys_hc_bug = 1 ;
}
break ;
2005-11-23 15:45:32 -08:00
}
2005-09-22 22:31:15 -07:00
2012-12-19 16:15:56 +00:00
/* optional debug port, normally in the first BAR */
temp = pci_find_capability ( pdev , PCI_CAP_ID_DBG ) ;
if ( temp ) {
pci_read_config_dword ( pdev , temp , & temp ) ;
temp > > = 16 ;
if ( ( ( temp > > 13 ) & 7 ) = = 1 ) {
u32 hcs_params = ehci_readl ( ehci ,
& ehci - > caps - > hcs_params ) ;
temp & = 0x1fff ;
ehci - > debug = hcd - > regs + temp ;
temp = ehci_readl ( ehci , & ehci - > debug - > control ) ;
ehci_info ( ehci , " debug port %d%s \n " ,
HCS_DEBUG_PORT ( hcs_params ) ,
( temp & DBGP_ENABLED ) ? " IN USE " : " " ) ;
if ( ! ( temp & DBGP_ENABLED ) )
ehci - > debug = NULL ;
}
}
2012-07-09 15:55:14 -04:00
retval = ehci_setup ( hcd ) ;
if ( retval )
return retval ;
/* These workarounds need to be applied after ehci_setup() */
switch ( pdev - > vendor ) {
case PCI_VENDOR_ID_NEC :
case PCI_VENDOR_ID_INTEL :
2016-10-23 01:02:02 +02:00
case PCI_VENDOR_ID_AMD :
2012-07-09 15:55:14 -04:00
ehci - > need_io_watchdog = 0 ;
break ;
case PCI_VENDOR_ID_NVIDIA :
switch ( pdev - > device ) {
/* MCP89 chips on the MacBookAir3,1 give EPROTO when
* fetching device descriptors unless LPM is disabled .
* There are also intermittent problems enumerating
* devices with PPCD enabled .
*/
case 0x0d9d :
2012-10-31 13:12:11 -04:00
ehci_info ( ehci , " disable ppcd for nvidia mcp89 \n " ) ;
2012-07-09 15:55:14 -04:00
ehci - > has_ppcd = 0 ;
ehci - > command & = ~ CMD_PPCEE ;
break ;
}
break ;
}
2005-09-22 22:31:15 -07:00
/* at least the Genesys GL880S needs fixup here */
temp = HCS_N_CC ( ehci - > hcs_params ) * HCS_N_PCC ( ehci - > hcs_params ) ;
temp & = 0x0f ;
if ( temp & & HCS_N_PORTS ( ehci - > hcs_params ) > temp ) {
2005-11-23 15:45:32 -08:00
ehci_dbg ( ehci , " bogus port configuration: "
2005-09-22 22:31:15 -07:00
" cc=%d x pcc=%d < ports=%d \n " ,
HCS_N_CC ( ehci - > hcs_params ) ,
HCS_N_PCC ( ehci - > hcs_params ) ,
HCS_N_PORTS ( ehci - > hcs_params ) ) ;
2005-11-23 15:45:32 -08:00
switch ( pdev - > vendor ) {
case 0x17a0 : /* GENESYS */
/* GL880S: should be PORTS=2 */
temp | = ( ehci - > hcs_params & ~ 0xf ) ;
ehci - > hcs_params = temp ;
break ;
case PCI_VENDOR_ID_NVIDIA :
/* NF4: should be PCC=10 */
break ;
2005-09-22 22:31:15 -07:00
}
}
2005-11-23 15:45:32 -08:00
/* Serial Bus Release Number is at PCI 0x60 offset */
2012-01-06 13:33:28 +01:00
if ( pdev - > vendor = = PCI_VENDOR_ID_STMICRO
& & pdev - > device = = PCI_DEVICE_ID_STMICRO_USB_HOST )
2012-07-09 15:55:14 -04:00
; /* ConneXT has no sbrn register */
else
pci_read_config_byte ( pdev , 0x60 , & ehci - > sbrn ) ;
2005-09-22 22:31:15 -07:00
2008-12-17 17:20:38 -05:00
/* Keep this around for a while just in case some EHCI
* implementation uses legacy PCI PM support . This test
* can be removed on 17 Dec 2009 if the dev_warn ( ) hasn ' t
* been triggered by then .
2005-11-07 15:24:46 -08:00
*/
if ( ! device_can_wakeup ( & pdev - > dev ) ) {
u16 port_wake ;
pci_read_config_word ( pdev , 0x62 , & port_wake ) ;
2008-12-17 17:20:38 -05:00
if ( port_wake & 0x0001 ) {
dev_warn ( & pdev - > dev , " Enabling legacy PCI PM \n " ) ;
2009-01-13 11:35:54 -05:00
device_set_wakeup_capable ( & pdev - > dev , 1 ) ;
2008-12-17 17:20:38 -05:00
}
2005-11-07 15:24:46 -08:00
}
2005-09-22 22:31:15 -07:00
2014-11-29 23:47:05 +01:00
# ifdef CONFIG_PM
2006-01-20 13:55:14 -08:00
if ( ehci - > no_selective_suspend & & device_can_wakeup ( & pdev - > dev ) )
ehci_warn ( ehci , " selective suspend/wakeup unavailable \n " ) ;
# endif
2005-11-23 15:45:37 -08:00
retval = ehci_pci_reinit ( ehci , pdev ) ;
2005-11-28 08:40:38 -08:00
done :
return retval ;
2005-09-22 22:31:15 -07:00
}
/*-------------------------------------------------------------------------*/
# ifdef CONFIG_PM
/* suspend/resume, section 4.3 */
2005-11-23 15:45:28 -08:00
/* These routines rely on the PCI bus glue
2005-09-22 22:31:15 -07:00
* to handle powerdown and wakeup , and currently also on
* transceivers that don ' t need any software attention to set up
* the right sort of wakeup .
2005-11-23 15:45:28 -08:00
* Also they depend on separate root hub suspend / resume .
2005-09-22 22:31:15 -07:00
*/
2009-04-27 13:33:41 -04:00
static int ehci_pci_resume ( struct usb_hcd * hcd , bool hibernated )
2005-09-22 22:31:15 -07:00
{
2005-11-23 15:45:32 -08:00
struct ehci_hcd * ehci = hcd_to_ehci ( hcd ) ;
2005-11-23 15:45:37 -08:00
struct pci_dev * pdev = to_pci_dev ( hcd - > self . controller ) ;
2005-09-22 22:31:15 -07:00
2012-06-28 11:19:02 -04:00
if ( ehci_resume ( hcd , hibernated ) ! = 0 )
( void ) ehci_pci_reinit ( ehci , pdev ) ;
2006-11-09 14:42:16 -05:00
return 0 ;
2005-09-22 22:31:15 -07:00
}
2012-11-01 11:13:04 -04:00
# else
2005-09-22 22:31:15 -07:00
2012-11-01 11:13:04 -04:00
# define ehci_suspend NULL
# define ehci_pci_resume NULL
# endif /* CONFIG_PM */
2005-09-22 22:31:15 -07:00
2012-11-01 11:13:04 -04:00
static struct hc_driver __read_mostly ehci_pci_hc_driver ;
2005-09-22 22:31:15 -07:00
2013-04-22 09:44:56 -07:00
static const struct ehci_driver_overrides pci_overrides __initconst = {
2012-11-01 11:13:04 -04:00
. reset = ehci_pci_setup ,
2005-09-22 22:31:15 -07:00
} ;
/*-------------------------------------------------------------------------*/
2015-01-28 20:04:06 +02:00
static int ehci_pci_probe ( struct pci_dev * pdev , const struct pci_device_id * id )
{
2015-02-03 18:08:39 +02:00
if ( is_bypassed_id ( pdev ) )
2015-01-28 20:04:06 +02:00
return - ENODEV ;
2020-05-14 17:50:36 +05:30
return usb_hcd_pci_probe ( pdev , id , & ehci_pci_hc_driver ) ;
2015-01-28 20:04:06 +02:00
}
2016-01-04 16:14:29 +08:00
static void ehci_pci_remove ( struct pci_dev * pdev )
{
pci_clear_mwi ( pdev ) ;
2020-05-14 17:50:36 +05:30
usb_hcd_pci_remove ( pdev ) ;
2016-01-04 16:14:29 +08:00
}
2005-09-22 22:31:15 -07:00
/* PCI driver selection metadata; PCI hotplugging uses this */
static const struct pci_device_id pci_ids [ ] = { {
/* handle any USB 2.0 EHCI controller */
2006-04-09 20:07:35 +02:00
PCI_DEVICE_CLASS ( PCI_CLASS_SERIAL_USB_EHCI , ~ 0 ) ,
2012-01-06 13:33:28 +01:00
} , {
PCI_VDEVICE ( STMICRO , PCI_DEVICE_ID_STMICRO_USB_HOST ) ,
2005-09-22 22:31:15 -07:00
} ,
{ /* end: all zeroes */ }
} ;
2005-11-23 15:45:32 -08:00
MODULE_DEVICE_TABLE ( pci , pci_ids ) ;
2005-09-22 22:31:15 -07:00
/* pci driver glue; this is a "new style" PCI driver module */
static struct pci_driver ehci_pci_driver = {
2020-02-18 19:32:58 +00:00
. name = hcd_name ,
2005-09-22 22:31:15 -07:00
. id_table = pci_ids ,
2015-01-28 20:04:06 +02:00
. probe = ehci_pci_probe ,
2016-01-04 16:14:29 +08:00
. remove = ehci_pci_remove ,
2009-04-27 13:33:24 -04:00
. shutdown = usb_hcd_pci_shutdown ,
2005-09-22 22:31:15 -07:00
2013-09-24 15:45:25 -04:00
# ifdef CONFIG_PM
2009-04-27 13:33:24 -04:00
. driver = {
. pm = & usb_hcd_pci_pm_ops
} ,
2005-09-22 22:31:15 -07:00
# endif
} ;
2012-11-01 11:13:04 -04:00
static int __init ehci_pci_init ( void )
{
if ( usb_disabled ( ) )
return - ENODEV ;
pr_info ( " %s: " DRIVER_DESC " \n " , hcd_name ) ;
2012-11-07 16:12:47 -05:00
ehci_init_driver ( & ehci_pci_hc_driver , & pci_overrides ) ;
2012-11-01 11:13:04 -04:00
/* Entries for the PCI suspend/resume callbacks are special */
ehci_pci_hc_driver . pci_suspend = ehci_suspend ;
ehci_pci_hc_driver . pci_resume = ehci_pci_resume ;
return pci_register_driver ( & ehci_pci_driver ) ;
}
module_init ( ehci_pci_init ) ;
static void __exit ehci_pci_cleanup ( void )
{
pci_unregister_driver ( & ehci_pci_driver ) ;
}
module_exit ( ehci_pci_cleanup ) ;
MODULE_DESCRIPTION ( DRIVER_DESC ) ;
MODULE_AUTHOR ( " David Brownell " ) ;
MODULE_AUTHOR ( " Alan Stern " ) ;
MODULE_LICENSE ( " GPL " ) ;