You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (39 commits) USB: at91-ohci, handle extra at91sam9261 ahb clock USB: another id for cp2101 driver USB: ueagle-atm.c needs sched.h USB: at91_udc, shrink runtime footprint usbnet: add missing Kconfig for KC2190 cables usbnet: init fault (oops) cleanup, whitespace fixes usbnet: recognize SiteCom CN-124 usb: Remove Airprime device from option.c USB: change __init to __devinit for isp116x_probe USB: ps3: don't call ps3_system_bus_driver_register on other platforms USB: hid-core.c: Removes GTCO CalComp Interwrite IPanel PIDs from blacklist USB: kernel-doc fixes USB: quirky device for cdc-acm USB: cdc-acm: fix incorrect throtteling, make set_control optional USB: unconfigure devices which have config 0 USB: make usb_iso_packet_descriptor.status signed USB: fix g_serial small error USB: use __u32 rather than u32 in userspace ioctls in usbdevice_fs.h USB Storage: US_FL_IGNORE_RESIDUE needed for Aiptek MP3 Player USB: Fix misspelled "USBNET_MII" kernel config option. ...
This commit is contained in:
+10
-1
@@ -1269,9 +1269,18 @@ repeat:
|
||||
|
||||
/* Some devices return the total number of sectors, not the
|
||||
* highest sector number. Make the necessary adjustment. */
|
||||
if (sdp->fix_capacity)
|
||||
if (sdp->fix_capacity) {
|
||||
--sdkp->capacity;
|
||||
|
||||
/* Some devices have version which report the correct sizes
|
||||
* and others which do not. We guess size according to a heuristic
|
||||
* and err on the side of lowering the capacity. */
|
||||
} else {
|
||||
if (sdp->guess_capacity)
|
||||
if (sdkp->capacity & 0x01) /* odd sizes are odd */
|
||||
--sdkp->capacity;
|
||||
}
|
||||
|
||||
got_data:
|
||||
if (sector_size == 0) {
|
||||
sector_size = 512;
|
||||
|
||||
@@ -51,6 +51,7 @@ obj-$(CONFIG_USB_SERIAL) += serial/
|
||||
obj-$(CONFIG_USB_ADUTUX) += misc/
|
||||
obj-$(CONFIG_USB_APPLEDISPLAY) += misc/
|
||||
obj-$(CONFIG_USB_AUERSWALD) += misc/
|
||||
obj-$(CONFIG_USB_BERRY_CHARGE) += misc/
|
||||
obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/
|
||||
obj-$(CONFIG_USB_CYTHERM) += misc/
|
||||
obj-$(CONFIG_USB_EMI26) += misc/
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include <linux/usb.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
+22
-11
@@ -326,10 +326,16 @@ static void acm_rx_tasklet(unsigned long _acm)
|
||||
struct tty_struct *tty = acm->tty;
|
||||
struct acm_ru *rcv;
|
||||
unsigned long flags;
|
||||
int i = 0;
|
||||
unsigned char throttled;
|
||||
dbg("Entering acm_rx_tasklet");
|
||||
|
||||
if (!ACM_READY(acm) || acm->throttle)
|
||||
if (!ACM_READY(acm))
|
||||
return;
|
||||
|
||||
spin_lock(&acm->throttle_lock);
|
||||
throttled = acm->throttle;
|
||||
spin_unlock(&acm->throttle_lock);
|
||||
if (throttled)
|
||||
return;
|
||||
|
||||
next_buffer:
|
||||
@@ -346,22 +352,20 @@ next_buffer:
|
||||
dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
|
||||
|
||||
tty_buffer_request_room(tty, buf->size);
|
||||
if (!acm->throttle)
|
||||
spin_lock(&acm->throttle_lock);
|
||||
throttled = acm->throttle;
|
||||
spin_unlock(&acm->throttle_lock);
|
||||
if (!throttled)
|
||||
tty_insert_flip_string(tty, buf->base, buf->size);
|
||||
tty_flip_buffer_push(tty);
|
||||
|
||||
spin_lock(&acm->throttle_lock);
|
||||
if (acm->throttle) {
|
||||
dbg("Throtteling noticed");
|
||||
memmove(buf->base, buf->base + i, buf->size - i);
|
||||
buf->size -= i;
|
||||
spin_unlock(&acm->throttle_lock);
|
||||
if (throttled) {
|
||||
dbg("Throttling noticed");
|
||||
spin_lock_irqsave(&acm->read_lock, flags);
|
||||
list_add(&buf->list, &acm->filled_read_bufs);
|
||||
spin_unlock_irqrestore(&acm->read_lock, flags);
|
||||
return;
|
||||
}
|
||||
spin_unlock(&acm->throttle_lock);
|
||||
|
||||
spin_lock_irqsave(&acm->read_lock, flags);
|
||||
list_add(&buf->list, &acm->spare_read_bufs);
|
||||
@@ -467,7 +471,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
|
||||
goto bail_out;
|
||||
}
|
||||
|
||||
if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS))
|
||||
if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS) &&
|
||||
(acm->ctrl_caps & USB_CDC_CAP_LINE))
|
||||
goto full_bailout;
|
||||
|
||||
INIT_LIST_HEAD(&acm->spare_read_urbs);
|
||||
@@ -480,6 +485,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
|
||||
list_add(&(acm->rb[i].list), &acm->spare_read_bufs);
|
||||
}
|
||||
|
||||
acm->throttle = 0;
|
||||
|
||||
tasklet_schedule(&acm->urb_task);
|
||||
|
||||
done:
|
||||
@@ -1092,6 +1099,10 @@ static struct usb_device_id acm_ids[] = {
|
||||
{ USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
|
||||
.driver_info = SINGLE_RX_URB, /* firmware bug */
|
||||
},
|
||||
{ USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */
|
||||
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
|
||||
},
|
||||
|
||||
/* control interfaces with various AT-command sets */
|
||||
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
|
||||
USB_CDC_ACM_PROTO_AT_V25TER) },
|
||||
|
||||
@@ -604,10 +604,6 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct
|
||||
lock_kernel();
|
||||
if (!st) {
|
||||
st = kmalloc(sizeof(struct usb_device_status), GFP_KERNEL);
|
||||
if (!st) {
|
||||
unlock_kernel();
|
||||
return POLLIN;
|
||||
}
|
||||
|
||||
/* we may have dropped BKL - need to check for having lost the race */
|
||||
if (file->private_data) {
|
||||
@@ -615,6 +611,11 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct
|
||||
st = file->private_data;
|
||||
goto lost_race;
|
||||
}
|
||||
/* we haven't lost - check for allocation failure now */
|
||||
if (!st) {
|
||||
unlock_kernel();
|
||||
return POLLIN;
|
||||
}
|
||||
|
||||
/*
|
||||
* need to prevent the module from being unloaded, since
|
||||
|
||||
@@ -857,11 +857,11 @@ static int proc_setintf(struct dev_state *ps, void __user *arg)
|
||||
|
||||
static int proc_setconfig(struct dev_state *ps, void __user *arg)
|
||||
{
|
||||
unsigned int u;
|
||||
int u;
|
||||
int status = 0;
|
||||
struct usb_host_config *actconfig;
|
||||
|
||||
if (get_user(u, (unsigned int __user *)arg))
|
||||
if (get_user(u, (int __user *)arg))
|
||||
return -EFAULT;
|
||||
|
||||
actconfig = ps->dev->actconfig;
|
||||
|
||||
@@ -743,6 +743,7 @@ EXPORT_SYMBOL_GPL(usb_deregister_device_driver);
|
||||
* usb_register_driver - register a USB interface driver
|
||||
* @new_driver: USB operations for the interface driver
|
||||
* @owner: module owner of this driver.
|
||||
* @mod_name: module name string
|
||||
*
|
||||
* Registers a USB interface driver with the USB core. The list of
|
||||
* unattached interfaces will be rescanned whenever a new driver is
|
||||
|
||||
@@ -229,7 +229,7 @@ static int init_endpoint_class(void)
|
||||
kref_init(&ep_class->kref);
|
||||
ep_class->class = class_create(THIS_MODULE, "usb_endpoint");
|
||||
if (IS_ERR(ep_class->class)) {
|
||||
result = IS_ERR(ep_class->class);
|
||||
result = PTR_ERR(ep_class->class);
|
||||
goto class_create_error;
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ static void generic_disconnect(struct usb_device *udev)
|
||||
/* if this is only an unbind, not a physical disconnect, then
|
||||
* unconfigure the device */
|
||||
if (udev->actconfig)
|
||||
usb_set_configuration(udev, 0);
|
||||
usb_set_configuration(udev, -1);
|
||||
|
||||
usb_remove_sysfs_dev_files(udev);
|
||||
}
|
||||
|
||||
+17
-16
@@ -44,6 +44,7 @@ struct usb_hub {
|
||||
struct usb_hub_status hub;
|
||||
struct usb_port_status port;
|
||||
} *status; /* buffer for status reports */
|
||||
struct mutex status_mutex; /* for the status buffer */
|
||||
|
||||
int error; /* last reported error */
|
||||
int nerrors; /* track consecutive errors */
|
||||
@@ -535,6 +536,7 @@ static int hub_hub_status(struct usb_hub *hub,
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&hub->status_mutex);
|
||||
ret = get_hub_status(hub->hdev, &hub->status->hub);
|
||||
if (ret < 0)
|
||||
dev_err (hub->intfdev,
|
||||
@@ -544,6 +546,7 @@ static int hub_hub_status(struct usb_hub *hub,
|
||||
*change = le16_to_cpu(hub->status->hub.wHubChange);
|
||||
ret = 0;
|
||||
}
|
||||
mutex_unlock(&hub->status_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -617,6 +620,7 @@ static int hub_configure(struct usb_hub *hub,
|
||||
ret = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
mutex_init(&hub->status_mutex);
|
||||
|
||||
hub->descriptor = kmalloc(sizeof(*hub->descriptor), GFP_KERNEL);
|
||||
if (!hub->descriptor) {
|
||||
@@ -1396,6 +1400,7 @@ static int hub_port_status(struct usb_hub *hub, int port1,
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&hub->status_mutex);
|
||||
ret = get_port_status(hub->hdev, port1, &hub->status->port);
|
||||
if (ret < 4) {
|
||||
dev_err (hub->intfdev,
|
||||
@@ -1407,6 +1412,7 @@ static int hub_port_status(struct usb_hub *hub, int port1,
|
||||
*change = le16_to_cpu(hub->status->port.wPortChange);
|
||||
ret = 0;
|
||||
}
|
||||
mutex_unlock(&hub->status_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1904,6 +1910,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
|
||||
struct usb_hub *hub = usb_get_intfdata (intf);
|
||||
struct usb_device *hdev = hub->hdev;
|
||||
unsigned port1;
|
||||
int status = 0;
|
||||
|
||||
/* fail if children aren't already suspended */
|
||||
for (port1 = 1; port1 <= hdev->maxchild; port1++) {
|
||||
@@ -1927,24 +1934,18 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
|
||||
|
||||
dev_dbg(&intf->dev, "%s\n", __FUNCTION__);
|
||||
|
||||
/* "global suspend" of the downstream HC-to-USB interface */
|
||||
if (!hdev->parent) {
|
||||
struct usb_bus *bus = hdev->bus;
|
||||
if (bus) {
|
||||
int status = hcd_bus_suspend (bus);
|
||||
|
||||
if (status != 0) {
|
||||
dev_dbg(&hdev->dev, "'global' suspend %d\n",
|
||||
status);
|
||||
return status;
|
||||
}
|
||||
} else
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* stop khubd and related activity */
|
||||
hub_quiesce(hub);
|
||||
return 0;
|
||||
|
||||
/* "global suspend" of the downstream HC-to-USB interface */
|
||||
if (!hdev->parent) {
|
||||
status = hcd_bus_suspend(hdev->bus);
|
||||
if (status != 0) {
|
||||
dev_dbg(&hdev->dev, "'global' suspend %d\n", status);
|
||||
hub_activate(hub);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
static int hub_resume(struct usb_interface *intf)
|
||||
|
||||
@@ -1316,6 +1316,14 @@ static void release_interface(struct device *dev)
|
||||
* use this kind of configurability; many devices only have one
|
||||
* configuration.
|
||||
*
|
||||
* @configuration is the value of the configuration to be installed.
|
||||
* According to the USB spec (e.g. section 9.1.1.5), configuration values
|
||||
* must be non-zero; a value of zero indicates that the device in
|
||||
* unconfigured. However some devices erroneously use 0 as one of their
|
||||
* configuration values. To help manage such devices, this routine will
|
||||
* accept @configuration = -1 as indicating the device should be put in
|
||||
* an unconfigured state.
|
||||
*
|
||||
* USB device configurations may affect Linux interoperability,
|
||||
* power consumption and the functionality available. For example,
|
||||
* the default configuration is limited to using 100mA of bus power,
|
||||
@@ -1347,10 +1355,15 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
|
||||
struct usb_interface **new_interfaces = NULL;
|
||||
int n, nintf;
|
||||
|
||||
for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
|
||||
if (dev->config[i].desc.bConfigurationValue == configuration) {
|
||||
cp = &dev->config[i];
|
||||
break;
|
||||
if (configuration == -1)
|
||||
configuration = 0;
|
||||
else {
|
||||
for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
|
||||
if (dev->config[i].desc.bConfigurationValue ==
|
||||
configuration) {
|
||||
cp = &dev->config[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((!cp && configuration != 0))
|
||||
@@ -1359,6 +1372,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
|
||||
/* The USB spec says configuration 0 means unconfigured.
|
||||
* But if a device includes a configuration numbered 0,
|
||||
* we will accept it as a correctly configured state.
|
||||
* Use -1 if you really want to unconfigure the device.
|
||||
*/
|
||||
if (cp && configuration == 0)
|
||||
dev_warn(&dev->dev, "config 0 descriptor??\n");
|
||||
|
||||
@@ -31,7 +31,7 @@ static struct usb_device_id whitelist_table [] = {
|
||||
{ USB_DEVICE_INFO(7, 1, 3) },
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_CDCETHER
|
||||
#ifdef CONFIG_USB_NET_CDCETHER
|
||||
/* Linux-USB CDC Ethernet gadget */
|
||||
{ USB_DEVICE(0x0525, 0xa4a1), },
|
||||
/* Linux-USB CDC Ethernet + RNDIS gadget */
|
||||
|
||||
@@ -63,7 +63,7 @@ set_bConfigurationValue(struct device *dev, struct device_attribute *attr,
|
||||
struct usb_device *udev = to_usb_device(dev);
|
||||
int config, value;
|
||||
|
||||
if (sscanf(buf, "%u", &config) != 1 || config > 255)
|
||||
if (sscanf(buf, "%d", &config) != 1 || config < -1 || config > 255)
|
||||
return -EINVAL;
|
||||
usb_lock_device(udev);
|
||||
value = usb_set_configuration(udev, config);
|
||||
|
||||
@@ -784,7 +784,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value)
|
||||
return status;
|
||||
}
|
||||
|
||||
static struct usb_ep_ops at91_ep_ops = {
|
||||
static const struct usb_ep_ops at91_ep_ops = {
|
||||
.enable = at91_ep_enable,
|
||||
.disable = at91_ep_disable,
|
||||
.alloc_request = at91_ep_alloc_request,
|
||||
@@ -1651,7 +1651,7 @@ static void at91udc_shutdown(struct platform_device *dev)
|
||||
pullup(platform_get_drvdata(dev), 0);
|
||||
}
|
||||
|
||||
static int __devinit at91udc_probe(struct platform_device *pdev)
|
||||
static int __init at91udc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct at91_udc *udc;
|
||||
@@ -1762,7 +1762,7 @@ fail0:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int __devexit at91udc_remove(struct platform_device *pdev)
|
||||
static int __exit at91udc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct at91_udc *udc = platform_get_drvdata(pdev);
|
||||
struct resource *res;
|
||||
@@ -1836,8 +1836,7 @@ static int at91udc_resume(struct platform_device *pdev)
|
||||
#endif
|
||||
|
||||
static struct platform_driver at91_udc = {
|
||||
.probe = at91udc_probe,
|
||||
.remove = __devexit_p(at91udc_remove),
|
||||
.remove = __exit_p(at91udc_remove),
|
||||
.shutdown = at91udc_shutdown,
|
||||
.suspend = at91udc_suspend,
|
||||
.resume = at91udc_resume,
|
||||
@@ -1847,13 +1846,13 @@ static struct platform_driver at91_udc = {
|
||||
},
|
||||
};
|
||||
|
||||
static int __devinit udc_init_module(void)
|
||||
static int __init udc_init_module(void)
|
||||
{
|
||||
return platform_driver_register(&at91_udc);
|
||||
return platform_driver_probe(&at91_udc, at91udc_probe);
|
||||
}
|
||||
module_init(udc_init_module);
|
||||
|
||||
static void __devexit udc_exit_module(void)
|
||||
static void __exit udc_exit_module(void)
|
||||
{
|
||||
platform_driver_unregister(&at91_udc);
|
||||
}
|
||||
|
||||
@@ -1699,6 +1699,7 @@ static int gs_setup_class(struct usb_gadget *gadget,
|
||||
memcpy(&port->port_line_coding, req->buf, ret);
|
||||
spin_unlock(&port->port_lock);
|
||||
}
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
case USB_CDC_REQ_GET_LINE_CODING:
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
#include <asm/irq.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/unaligned.h>
|
||||
#ifdef CONFIG_PPC_PS3
|
||||
#include <asm/firmware.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -299,6 +302,19 @@ static void ehci_watchdog (unsigned long param)
|
||||
spin_unlock_irqrestore (&ehci->lock, flags);
|
||||
}
|
||||
|
||||
/* On some systems, leaving remote wakeup enabled prevents system shutdown.
|
||||
* The firmware seems to think that powering off is a wakeup event!
|
||||
* This routine turns off remote wakeup and everything else, on all ports.
|
||||
*/
|
||||
static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
|
||||
{
|
||||
int port = HCS_N_PORTS(ehci->hcs_params);
|
||||
|
||||
while (port--)
|
||||
ehci_writel(ehci, PORT_RWC_BITS,
|
||||
&ehci->regs->port_status[port]);
|
||||
}
|
||||
|
||||
/* ehci_shutdown kick in for silicon on any bus (not just pci, etc).
|
||||
* This forcibly disables dma and IRQs, helping kexec and other cases
|
||||
* where the next system software may expect clean state.
|
||||
@@ -310,9 +326,13 @@ ehci_shutdown (struct usb_hcd *hcd)
|
||||
|
||||
ehci = hcd_to_ehci (hcd);
|
||||
(void) ehci_halt (ehci);
|
||||
ehci_turn_off_all_ports(ehci);
|
||||
|
||||
/* make BIOS/etc use companion controller during reboot */
|
||||
ehci_writel(ehci, 0, &ehci->regs->configured_flag);
|
||||
|
||||
/* unblock posted writes */
|
||||
ehci_readl(ehci, &ehci->regs->configured_flag);
|
||||
}
|
||||
|
||||
static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
|
||||
@@ -951,15 +971,18 @@ static int __init ehci_hcd_init(void)
|
||||
#endif
|
||||
|
||||
#ifdef PS3_SYSTEM_BUS_DRIVER
|
||||
retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (retval < 0) {
|
||||
if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
|
||||
retval = ps3_system_bus_driver_register(
|
||||
&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (retval < 0) {
|
||||
#ifdef PLATFORM_DRIVER
|
||||
platform_driver_unregister(&PLATFORM_DRIVER);
|
||||
platform_driver_unregister(&PLATFORM_DRIVER);
|
||||
#endif
|
||||
#ifdef PCI_DRIVER
|
||||
pci_unregister_driver(&PCI_DRIVER);
|
||||
pci_unregister_driver(&PCI_DRIVER);
|
||||
#endif
|
||||
return retval;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -976,7 +999,8 @@ static void __exit ehci_hcd_cleanup(void)
|
||||
pci_unregister_driver(&PCI_DRIVER);
|
||||
#endif
|
||||
#ifdef PS3_SYSTEM_BUS_DRIVER
|
||||
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (firmware_has_feature(FW_FEATURE_PS3_LV1))
|
||||
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
|
||||
#endif
|
||||
}
|
||||
module_exit(ehci_hcd_cleanup);
|
||||
|
||||
@@ -36,6 +36,8 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
|
||||
int port;
|
||||
int mask;
|
||||
|
||||
ehci_dbg(ehci, "suspend root hub\n");
|
||||
|
||||
if (time_before (jiffies, ehci->next_statechange))
|
||||
msleep(5);
|
||||
|
||||
|
||||
@@ -1577,7 +1577,7 @@ static int isp116x_remove(struct platform_device *pdev)
|
||||
|
||||
#define resource_len(r) (((r)->end - (r)->start) + 1)
|
||||
|
||||
static int __init isp116x_probe(struct platform_device *pdev)
|
||||
static int __devinit isp116x_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct usb_hcd *hcd;
|
||||
struct isp116x *isp116x;
|
||||
|
||||
@@ -18,19 +18,38 @@
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/board.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
|
||||
#ifndef CONFIG_ARCH_AT91
|
||||
#error "CONFIG_ARCH_AT91 must be defined."
|
||||
#endif
|
||||
|
||||
/* interface and function clocks */
|
||||
static struct clk *iclk, *fclk;
|
||||
/* interface and function clocks; sometimes also an AHB clock */
|
||||
static struct clk *iclk, *fclk, *hclk;
|
||||
static int clocked;
|
||||
|
||||
extern int usb_disabled(void);
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static void at91_start_clock(void)
|
||||
{
|
||||
if (cpu_is_at91sam9261())
|
||||
clk_enable(hclk);
|
||||
clk_enable(iclk);
|
||||
clk_enable(fclk);
|
||||
clocked = 1;
|
||||
}
|
||||
|
||||
static void at91_stop_clock(void)
|
||||
{
|
||||
clk_disable(fclk);
|
||||
clk_disable(iclk);
|
||||
if (cpu_is_at91sam9261())
|
||||
clk_disable(hclk);
|
||||
clocked = 0;
|
||||
}
|
||||
|
||||
static void at91_start_hc(struct platform_device *pdev)
|
||||
{
|
||||
struct usb_hcd *hcd = platform_get_drvdata(pdev);
|
||||
@@ -41,9 +60,7 @@ static void at91_start_hc(struct platform_device *pdev)
|
||||
/*
|
||||
* Start the USB clocks.
|
||||
*/
|
||||
clk_enable(iclk);
|
||||
clk_enable(fclk);
|
||||
clocked = 1;
|
||||
at91_start_clock();
|
||||
|
||||
/*
|
||||
* The USB host controller must remain in reset.
|
||||
@@ -66,9 +83,7 @@ static void at91_stop_hc(struct platform_device *pdev)
|
||||
/*
|
||||
* Stop the USB clocks.
|
||||
*/
|
||||
clk_disable(fclk);
|
||||
clk_disable(iclk);
|
||||
clocked = 0;
|
||||
at91_stop_clock();
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +141,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
|
||||
|
||||
iclk = clk_get(&pdev->dev, "ohci_clk");
|
||||
fclk = clk_get(&pdev->dev, "uhpck");
|
||||
if (cpu_is_at91sam9261())
|
||||
hclk = clk_get(&pdev->dev, "hck0");
|
||||
|
||||
at91_start_hc(pdev);
|
||||
ohci_hcd_init(hcd_to_ohci(hcd));
|
||||
@@ -137,6 +154,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
|
||||
/* Error handling */
|
||||
at91_stop_hc(pdev);
|
||||
|
||||
if (cpu_is_at91sam9261())
|
||||
clk_put(hclk);
|
||||
clk_put(fclk);
|
||||
clk_put(iclk);
|
||||
|
||||
@@ -171,9 +190,11 @@ static int usb_hcd_at91_remove(struct usb_hcd *hcd,
|
||||
iounmap(hcd->regs);
|
||||
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
|
||||
|
||||
if (cpu_is_at91sam9261())
|
||||
clk_put(hclk);
|
||||
clk_put(fclk);
|
||||
clk_put(iclk);
|
||||
fclk = iclk = NULL;
|
||||
fclk = iclk = hclk = NULL;
|
||||
|
||||
dev_set_drvdata(&pdev->dev, NULL);
|
||||
return 0;
|
||||
@@ -280,9 +301,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
|
||||
*/
|
||||
if (at91_suspend_entering_slow_clock()) {
|
||||
ohci_usb_reset (ohci);
|
||||
clk_disable(fclk);
|
||||
clk_disable(iclk);
|
||||
clocked = 0;
|
||||
at91_stop_clock();
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -295,11 +314,8 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
|
||||
if (device_may_wakeup(&pdev->dev))
|
||||
disable_irq_wake(hcd->irq);
|
||||
|
||||
if (!clocked) {
|
||||
clk_enable(iclk);
|
||||
clk_enable(fclk);
|
||||
clocked = 1;
|
||||
}
|
||||
if (!clocked)
|
||||
at91_start_clock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
#include <asm/system.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <asm/byteorder.h>
|
||||
#ifdef CONFIG_PPC_PS3
|
||||
#include <asm/firmware.h>
|
||||
#endif
|
||||
|
||||
#include "../core/hcd.h"
|
||||
|
||||
@@ -944,9 +947,12 @@ static int __init ohci_hcd_mod_init(void)
|
||||
sizeof (struct ed), sizeof (struct td));
|
||||
|
||||
#ifdef PS3_SYSTEM_BUS_DRIVER
|
||||
retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (retval < 0)
|
||||
goto error_ps3;
|
||||
if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
|
||||
retval = ps3_system_bus_driver_register(
|
||||
&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (retval < 0)
|
||||
goto error_ps3;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_DRIVER
|
||||
@@ -992,7 +998,8 @@ static int __init ohci_hcd_mod_init(void)
|
||||
error_platform:
|
||||
#endif
|
||||
#ifdef PS3_SYSTEM_BUS_DRIVER
|
||||
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (firmware_has_feature(FW_FEATURE_PS3_LV1))
|
||||
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
|
||||
error_ps3:
|
||||
#endif
|
||||
return retval;
|
||||
@@ -1014,7 +1021,8 @@ static void __exit ohci_hcd_mod_exit(void)
|
||||
platform_driver_unregister(&PLATFORM_DRIVER);
|
||||
#endif
|
||||
#ifdef PS3_SYSTEM_BUS_DRIVER
|
||||
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
|
||||
if (firmware_has_feature(FW_FEATURE_PS3_LV1))
|
||||
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
|
||||
#endif
|
||||
}
|
||||
module_exit(ohci_hcd_mod_exit);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user