diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-29 11:47:40 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-29 11:47:40 -0800 |
| commit | c41a190aa726016bc68b7cb6bfd1234887a990ad (patch) | |
| tree | a6ecd70e132860c9c88017b2fe4fad0fd2072aad | |
| parent | 0e08754673d187ffeade3fc3712f84f1f3820cdc (diff) | |
| download | patches-c41a190aa726016bc68b7cb6bfd1234887a990ad.tar.gz | |
2.6.29-rc3 and some more patches added
| -rw-r--r-- | driver-core/bus_id-rtc2.patch | 3 | ||||
| -rw-r--r-- | driver-core/uio-add-the-uio_aec-driver.patch | 247 | ||||
| -rw-r--r-- | series | 2 | ||||
| -rw-r--r-- | usb/usb-suspend-resume-support-for-option-driver.patch | 177 | ||||
| -rw-r--r-- | version | 2 |
5 files changed, 429 insertions, 2 deletions
diff --git a/driver-core/bus_id-rtc2.patch b/driver-core/bus_id-rtc2.patch index 8e2cff36dcdaa7..938ab06dc79e72 100644 --- a/driver-core/bus_id-rtc2.patch +++ b/driver-core/bus_id-rtc2.patch @@ -3,8 +3,9 @@ Subject: rtc: struct device - replace bus_id with dev_name(), dev_set_name() Cc: a.zummo@towertech.it Cc: rtc-linux@googlegroups.com -Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> +Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- drivers/rtc/rtc-at91sam9.c | 4 ++-- drivers/rtc/rtc-omap.c | 4 ++-- diff --git a/driver-core/uio-add-the-uio_aec-driver.patch b/driver-core/uio-add-the-uio_aec-driver.patch new file mode 100644 index 00000000000000..13ae950e4f1bd1 --- /dev/null +++ b/driver-core/uio-add-the-uio_aec-driver.patch @@ -0,0 +1,247 @@ +From brandon@ifup.org Thu Jan 29 11:20:40 2009 +From: Brandon Philips <brandon@ifup.org> +Date: Tue, 27 Jan 2009 13:00:04 -0800 +Subject: [PATCHv2] uio: add the uio_aec driver +To: "Hans J. Koch" <hjk@linutronix.de> +Cc: Greg KH <gregkh@suse.de>, linux-kernel@vger.kernel.org +Message-ID: <20090127210004.GE22420@jenkins.ifup.org> +Content-Disposition: inline + +From: Brandon Philips <brandon@ifup.org> + +UIO driver for the Adrienne Electronics Corporation PCI time code +device. + +This device differs from other UIO devices since it uses I/O ports instead of +memory mapped I/O. In order to make it possible for UIO to work with this +device a utility, uioport, can be used to read and write the ports. + +uioport is designed to be a setuid program and checks the permissions of +the /dev/uio* node and if the user has write permissions it will use +iopl and out*/in* to access the device. + +[1] git clone git://ifup.org/philips/uioport.git + +Signed-off-by: Brandon Philips <brandon@ifup.org> +Cc: Hans J. Koch <hjk@linutronix.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/uio/Kconfig | 18 +++++ + drivers/uio/Makefile | 1 + drivers/uio/uio_aec.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 194 insertions(+) + +--- a/drivers/uio/Kconfig ++++ b/drivers/uio/Kconfig +@@ -58,6 +58,24 @@ config UIO_SMX + + If you compile this as a module, it will be called uio_smx. + ++config UIO_AEC ++ tristate "AEC video timestamp device" ++ depends on PCI ++ default n ++ help ++ ++ UIO driver for the Adrienne Electronics Corporation PCI time ++ code device. ++ ++ This device differs from other UIO devices since it uses I/O ++ ports instead of memory mapped I/O. In order to make it ++ possible for UIO to work with this device a utility, uioport, ++ can be used to read and write the ports: ++ ++ git clone git://ifup.org/philips/uioport.git ++ ++ If you compile this as a module, it will be called uio_aec. ++ + config UIO_SERCOS3 + tristate "Automata Sercos III PCI card driver" + default n +--- a/drivers/uio/Makefile ++++ b/drivers/uio/Makefile +@@ -3,4 +3,5 @@ obj-$(CONFIG_UIO_CIF) += uio_cif.o + obj-$(CONFIG_UIO_PDRV) += uio_pdrv.o + obj-$(CONFIG_UIO_PDRV_GENIRQ) += uio_pdrv_genirq.o + obj-$(CONFIG_UIO_SMX) += uio_smx.o ++obj-$(CONFIG_UIO_AEC) += uio_aec.o + obj-$(CONFIG_UIO_SERCOS3) += uio_sercos3.o +--- /dev/null ++++ b/drivers/uio/uio_aec.c +@@ -0,0 +1,175 @@ ++/* ++ * uio_aec.c -- simple driver for Adrienne Electronics Corp time code PCI device ++ * ++ * Copyright (C) 2008 Brandon Philips <brandon@ifup.org> ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ * ++ * 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., 59 ++ * Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/pci.h> ++#include <linux/init.h> ++#include <linux/interrupt.h> ++#include <linux/cdev.h> ++#include <linux/fs.h> ++#include <linux/io.h> ++#include <linux/uaccess.h> ++#include <linux/uio_driver.h> ++ ++#define PCI_VENDOR_ID_AEC 0xaecb ++#define PCI_DEVICE_ID_AEC_VITCLTC 0x6250 ++ ++#define INT_ENABLE_ADDR 0xFC ++#define INT_ENABLE 0x10 ++#define INT_DISABLE 0x0 ++ ++#define INT_MASK_ADDR 0x2E ++#define INT_MASK_ALL 0x3F ++ ++#define INTA_DRVR_ADDR 0xFE ++#define INTA_ENABLED_FLAG 0x08 ++#define INTA_FLAG 0x01 ++ ++#define MAILBOX 0x0F ++ ++static struct pci_device_id ids[] = { ++ { PCI_DEVICE(PCI_VENDOR_ID_AEC, PCI_DEVICE_ID_AEC_VITCLTC), }, ++ { 0, } ++}; ++MODULE_DEVICE_TABLE(pci, ids); ++ ++static irqreturn_t aectc_irq(int irq, struct uio_info *dev_info) ++{ ++ void __iomem *int_flag = dev_info->priv + INTA_DRVR_ADDR; ++ unsigned char status = ioread8(int_flag); ++ ++ ++ if ((status & INTA_ENABLED_FLAG) && (status & INTA_FLAG)) { ++ /* application writes 0x00 to 0x2F to get next interrupt */ ++ status = ioread8(dev_info->priv + MAILBOX); ++ return IRQ_HANDLED; ++ } ++ ++ return IRQ_NONE; ++} ++ ++static void print_board_data(struct pci_dev *pdev, struct uio_info *i) ++{ ++ dev_info(&pdev->dev, "PCI-TC board vendor: %x%x number: %x%x" ++ " revision: %c%c\n", ++ ioread8(i->priv + 0x01), ++ ioread8(i->priv + 0x00), ++ ioread8(i->priv + 0x03), ++ ioread8(i->priv + 0x02), ++ ioread8(i->priv + 0x06), ++ ioread8(i->priv + 0x07)); ++} ++ ++static int __devinit probe(struct pci_dev *pdev, const struct pci_device_id *id) ++{ ++ struct uio_info *info; ++ int ret; ++ ++ info = kzalloc(sizeof(struct uio_info), GFP_KERNEL); ++ if (!info) ++ return -ENOMEM; ++ ++ if (pci_enable_device(pdev)) ++ goto out_free; ++ ++ if (pci_request_regions(pdev, "aectc")) ++ goto out_disable; ++ ++ info->name = "aectc"; ++ info->port[0].start = pci_resource_start(pdev, 0); ++ if (!info->port[0].start) ++ goto out_release; ++ info->priv = pci_iomap(pdev, 0, 0); ++ if (!info->priv) ++ goto out_release; ++ info->port[0].size = pci_resource_len(pdev, 0); ++ info->port[0].porttype = UIO_PORT_GPIO; ++ ++ info->version = "0.0.1"; ++ info->irq = pdev->irq; ++ info->irq_flags = IRQF_SHARED; ++ info->handler = aectc_irq; ++ ++ print_board_data(pdev, info); ++ ret = uio_register_device(&pdev->dev, info); ++ if (ret) ++ goto out_unmap; ++ ++ iowrite32(INT_ENABLE, info->priv + INT_ENABLE_ADDR); ++ iowrite8(INT_MASK_ALL, info->priv + INT_MASK_ADDR); ++ if (!(ioread8(info->priv + INTA_DRVR_ADDR) ++ & INTA_ENABLED_FLAG)) ++ dev_err(&pdev->dev, "aectc: interrupts not enabled\n"); ++ ++ pci_set_drvdata(pdev, info); ++ ++ return 0; ++ ++out_unmap: ++ pci_iounmap(pdev, info->priv); ++out_release: ++ pci_release_regions(pdev); ++out_disable: ++ pci_disable_device(pdev); ++out_free: ++ kfree(info); ++ return -ENODEV; ++} ++ ++static void remove(struct pci_dev *pdev) ++{ ++ struct uio_info *info = pci_get_drvdata(pdev); ++ ++ /* disable interrupts */ ++ iowrite8(INT_DISABLE, info->priv + INT_MASK_ADDR); ++ iowrite32(INT_DISABLE, info->priv + INT_ENABLE_ADDR); ++ /* read mailbox to ensure board drops irq */ ++ ioread8(info->priv + MAILBOX); ++ ++ uio_unregister_device(info); ++ pci_release_regions(pdev); ++ pci_disable_device(pdev); ++ pci_set_drvdata(pdev, NULL); ++ iounmap(info->priv); ++ ++ kfree(info); ++} ++ ++static struct pci_driver pci_driver = { ++ .name = "aectc", ++ .id_table = ids, ++ .probe = probe, ++ .remove = remove, ++}; ++ ++static int __init aectc_init(void) ++{ ++ return pci_register_driver(&pci_driver); ++} ++ ++static void __exit aectc_exit(void) ++{ ++ pci_unregister_driver(&pci_driver); ++} ++ ++MODULE_LICENSE("GPL"); ++ ++module_init(aectc_init); ++module_exit(aectc_exit); @@ -70,6 +70,7 @@ driver-core/sysfs-use-standard-magic.h-for-sysfs.patch driver-core/sysfs-take-sysfs_mutex-when-fetching-the-root-inode.patch driver-core/driver-core-check-bus-match-without-holding-device-lock.patch driver-core/uio-add-name-attributes-for-mappings-and-port-regions.patch +driver-core/uio-add-the-uio_aec-driver.patch driver-core/parisc-don-t-touch-driver-core-internals.patch driver-core/driver-core-create-a-private-portion-of-struct-device.patch @@ -99,6 +100,7 @@ usb/usb-imx_udc-fix-imx-udc-gadget-bugs.patch usb/usb-imx_udc-fix-imx-udc-gadget-code-style.patch usb/usb-imx_udc-fix-imx-udc-gadget-ep0-irq-handling.patch usb/usb-imx_udc-fix-imx-udc-gadget-general-irq-handling.patch +usb/usb-suspend-resume-support-for-option-driver.patch # stuff I want in my tree, but not to go into -next gregkh.post/usb-gotemp.patch diff --git a/usb/usb-suspend-resume-support-for-option-driver.patch b/usb/usb-suspend-resume-support-for-option-driver.patch new file mode 100644 index 00000000000000..e08696895d6a41 --- /dev/null +++ b/usb/usb-suspend-resume-support-for-option-driver.patch @@ -0,0 +1,177 @@ +From smurf@smurf.noris.de Thu Jan 29 11:21:16 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Tue, 27 Jan 2009 17:21:40 +0100 +Subject: USB: suspend/resume support for option driver +To: gregkh@suse.de +Message-ID: <20090127162140.GR8572@kiste.smurf.noris.de> +Content-Disposition: inline + + +From: Oliver Neukum <oliver@neukum.org> + +This patch implements suspend and resume methods for the +option driver. With my hardware I can even suspend the system +and keep up a connection for a short time. + +Signed-off-by: Oliver Neukum <oneukum@suse.de> +Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/serial/option.c | 88 ++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 81 insertions(+), 7 deletions(-) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -62,6 +62,8 @@ static int option_tiocmget(struct tty_s + static int option_tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear); + static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *port); ++static int option_suspend(struct usb_serial *serial, pm_message_t message); ++static int option_resume(struct usb_serial *serial); + + /* Vendor and product IDs */ + #define OPTION_VENDOR_ID 0x0AF0 +@@ -499,6 +501,8 @@ static struct usb_driver option_driver = + .name = "option", + .probe = usb_serial_probe, + .disconnect = usb_serial_disconnect, ++ .suspend = usb_serial_suspend, ++ .resume = usb_serial_resume, + .id_table = option_ids, + .no_dynamic_id = 1, + }; +@@ -527,6 +531,8 @@ static struct usb_serial_driver option_1 + .attach = option_startup, + .shutdown = option_shutdown, + .read_int_callback = option_instat_callback, ++ .suspend = option_suspend, ++ .resume = option_resume, + }; + + static int debug; +@@ -797,10 +803,10 @@ static void option_instat_callback(struc + req_pkt->bRequestType, req_pkt->bRequest); + } + } else +- dbg("%s: error %d", __func__, status); ++ err("%s: error %d", __func__, status); + + /* Resubmit urb so we continue receiving IRQ data */ +- if (status != -ESHUTDOWN) { ++ if (status != -ESHUTDOWN && status != -ENOENT) { + urb->dev = serial->dev; + err = usb_submit_urb(urb, GFP_ATOMIC); + if (err) +@@ -819,7 +825,6 @@ static int option_write_room(struct tty_ + + portdata = usb_get_serial_port_data(port); + +- + for (i = 0; i < N_OUT_URB; i++) { + this_urb = portdata->out_urbs[i]; + if (this_urb && !test_bit(i, &portdata->out_busy)) +@@ -1081,14 +1086,12 @@ bail_out_error: + return 1; + } + +-static void option_shutdown(struct usb_serial *serial) ++static void stop_read_write_urbs(struct usb_serial *serial) + { + int i, j; + struct usb_serial_port *port; + struct option_port_private *portdata; + +- dbg("%s", __func__); +- + /* Stop reading/writing urbs */ + for (i = 0; i < serial->num_ports; ++i) { + port = serial->port[i]; +@@ -1097,7 +1100,18 @@ static void option_shutdown(struct usb_s + usb_kill_urb(portdata->in_urbs[j]); + for (j = 0; j < N_OUT_URB; j++) + usb_kill_urb(portdata->out_urbs[j]); +- } ++ } ++} ++ ++static void option_shutdown(struct usb_serial *serial) ++{ ++ int i, j; ++ struct usb_serial_port *port; ++ struct option_port_private *portdata; ++ ++ dbg("%s", __func__); ++ ++ stop_read_write_urbs(serial); + + /* Now free them */ + for (i = 0; i < serial->num_ports; ++i) { +@@ -1128,6 +1142,66 @@ static void option_shutdown(struct usb_s + } + } + ++static int option_suspend(struct usb_serial *serial, pm_message_t message) ++{ ++ dbg("%s entered", __func__); ++ stop_read_write_urbs(serial); ++ ++ return 0; ++} ++ ++static int option_resume(struct usb_serial *serial) ++{ ++ int err, i, j; ++ struct usb_serial_port *port; ++ struct urb *urb; ++ struct option_port_private *portdata; ++ ++ dbg("%s entered", __func__); ++ /* get the interrupt URBs resubmitted unconditionally */ ++ for (i = 0; i < serial->num_ports; i++) { ++ port = serial->port[i]; ++ if (!port->interrupt_in_urb) { ++ dbg("%s: No interrupt URB for port %d\n", __func__, i); ++ continue; ++ } ++ port->interrupt_in_urb->dev = serial->dev; ++ err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); ++ dbg("Submitted interrupt URB for port %d (result %d)", i, err); ++ if (err < 0) { ++ err("%s: Error %d for interrupt URB of port%d", ++ __func__, err, i); ++ return err; ++ } ++ } ++ ++ for (i = 0; i < serial->num_ports; i++) { ++ /* walk all ports */ ++ port = serial->port[i]; ++ portdata = usb_get_serial_port_data(port); ++ mutex_lock(&port->mutex); ++ ++ /* skip closed ports */ ++ if (!port->port.count) { ++ mutex_unlock(&port->mutex); ++ continue; ++ } ++ ++ for (j = 0; j < N_IN_URB; j++) { ++ urb = portdata->in_urbs[j]; ++ err = usb_submit_urb(urb, GFP_NOIO); ++ if (err < 0) { ++ mutex_unlock(&port->mutex); ++ err("%s: Error %d for bulk URB %d", ++ __func__, err, i); ++ return err; ++ } ++ } ++ mutex_unlock(&port->mutex); ++ } ++ return 0; ++} ++ + MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_DESCRIPTION(DRIVER_DESC); + MODULE_VERSION(DRIVER_VERSION); @@ -1 +1 @@ -2.6.29-rc2-git4 +2.6.29-rc3 |
