Greg Kroah-Hartman | 5fd54ac | 2017-11-03 11:28:30 +0100 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Support for the Maxtor OneTouch USB hard drive's button |
| 4 | * |
| 5 | * Current development and maintenance by: |
| 6 | * Copyright (c) 2005 Nick Sillik <n.sillik@temple.edu> |
| 7 | * |
| 8 | * Initial work by: |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 9 | * Copyright (c) 2003 Erik Thyren <erth7411@student.uu.se> |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 10 | * |
| 11 | * Based on usbmouse.c (Vojtech Pavlik) and xpad.c (Marko Friedemann) |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | /* |
| 16 | * This program is free software; you can redistribute it and/or modify |
| 17 | * it under the terms of the GNU General Public License as published by |
| 18 | * the Free Software Foundation; either version 2 of the License, or |
| 19 | * (at your option) any later version. |
| 20 | * |
| 21 | * This program is distributed in the hope that it will be useful, |
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | * GNU General Public License for more details. |
| 25 | * |
| 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with this program; if not, write to the Free Software |
| 28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 29 | * |
| 30 | */ |
| 31 | |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 32 | #include <linux/kernel.h> |
| 33 | #include <linux/input.h> |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 34 | #include <linux/slab.h> |
| 35 | #include <linux/module.h> |
David Brownell | ae0dadc | 2006-06-13 10:04:34 -0700 | [diff] [blame] | 36 | #include <linux/usb/input.h> |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 37 | #include "usb.h" |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 38 | #include "debug.h" |
Akinobu Mita | aa519be | 2015-05-06 18:24:21 +0900 | [diff] [blame] | 39 | #include "scsiglue.h" |
| 40 | |
| 41 | #define DRV_NAME "ums-onetouch" |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 42 | |
Maciej Grela | 4246b06 | 2009-02-28 12:39:20 -0800 | [diff] [blame] | 43 | MODULE_DESCRIPTION("Maxtor USB OneTouch hard drive button driver"); |
| 44 | MODULE_AUTHOR("Nick Sillik <n.sillik@temple.edu>"); |
| 45 | MODULE_LICENSE("GPL"); |
| 46 | |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 47 | #define ONETOUCH_PKT_LEN 0x02 |
| 48 | #define ONETOUCH_BUTTON KEY_PROG1 |
| 49 | |
| 50 | static int onetouch_connect_input(struct us_data *ss); |
Adrian Bunk | 43c1e98 | 2008-04-28 18:39:37 +0300 | [diff] [blame] | 51 | static void onetouch_release_input(void *onetouch_); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 52 | |
| 53 | struct usb_onetouch { |
| 54 | char name[128]; |
| 55 | char phys[64]; |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 56 | struct input_dev *dev; /* input device interface */ |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 57 | struct usb_device *udev; /* usb device */ |
| 58 | |
| 59 | struct urb *irq; /* urb for interrupt in report */ |
| 60 | unsigned char *data; /* input data */ |
| 61 | dma_addr_t data_dma; |
Matthew Dharm | 7931e1c | 2005-12-04 21:56:51 -0800 | [diff] [blame] | 62 | unsigned int is_open:1; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 65 | |
| 66 | /* |
| 67 | * The table of devices |
| 68 | */ |
| 69 | #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ |
| 70 | vendorName, productName, useProtocol, useTransport, \ |
| 71 | initFunction, flags) \ |
| 72 | { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ |
Sebastian Andrzej Siewior | f61870e | 2012-08-28 22:37:13 +0200 | [diff] [blame] | 73 | .driver_info = (flags) } |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 74 | |
Felipe Balbi | e2c83f0 | 2011-11-15 09:53:36 +0200 | [diff] [blame] | 75 | static struct usb_device_id onetouch_usb_ids[] = { |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 76 | # include "unusual_onetouch.h" |
| 77 | { } /* Terminating entry */ |
| 78 | }; |
| 79 | MODULE_DEVICE_TABLE(usb, onetouch_usb_ids); |
| 80 | |
| 81 | #undef UNUSUAL_DEV |
| 82 | |
| 83 | /* |
| 84 | * The flags table |
| 85 | */ |
| 86 | #define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \ |
| 87 | vendor_name, product_name, use_protocol, use_transport, \ |
| 88 | init_function, Flags) \ |
| 89 | { \ |
| 90 | .vendorName = vendor_name, \ |
| 91 | .productName = product_name, \ |
| 92 | .useProtocol = use_protocol, \ |
| 93 | .useTransport = use_transport, \ |
| 94 | .initFunction = init_function, \ |
| 95 | } |
| 96 | |
| 97 | static struct us_unusual_dev onetouch_unusual_dev_list[] = { |
| 98 | # include "unusual_onetouch.h" |
| 99 | { } /* Terminating entry */ |
| 100 | }; |
| 101 | |
| 102 | #undef UNUSUAL_DEV |
| 103 | |
| 104 | |
David Howells | 7d12e78 | 2006-10-05 14:55:46 +0100 | [diff] [blame] | 105 | static void usb_onetouch_irq(struct urb *urb) |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 106 | { |
| 107 | struct usb_onetouch *onetouch = urb->context; |
| 108 | signed char *data = onetouch->data; |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 109 | struct input_dev *dev = onetouch->dev; |
Greg Kroah-Hartman | 62e5a33 | 2007-07-18 10:58:02 -0700 | [diff] [blame] | 110 | int status = urb->status; |
| 111 | int retval; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 112 | |
Greg Kroah-Hartman | 62e5a33 | 2007-07-18 10:58:02 -0700 | [diff] [blame] | 113 | switch (status) { |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 114 | case 0: /* success */ |
| 115 | break; |
| 116 | case -ECONNRESET: /* unlink */ |
| 117 | case -ENOENT: |
| 118 | case -ESHUTDOWN: |
| 119 | return; |
| 120 | /* -EPIPE: should clear the halt */ |
| 121 | default: /* error */ |
| 122 | goto resubmit; |
| 123 | } |
| 124 | |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 125 | input_report_key(dev, ONETOUCH_BUTTON, data[0] & 0x02); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 126 | input_sync(dev); |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 127 | |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 128 | resubmit: |
Greg Kroah-Hartman | 62e5a33 | 2007-07-18 10:58:02 -0700 | [diff] [blame] | 129 | retval = usb_submit_urb (urb, GFP_ATOMIC); |
| 130 | if (retval) |
Greg Kroah-Hartman | 802f389 | 2008-08-14 09:37:34 -0700 | [diff] [blame] | 131 | dev_err(&dev->dev, "can't resubmit intr, %s-%s/input0, " |
| 132 | "retval %d\n", onetouch->udev->bus->bus_name, |
Greg Kroah-Hartman | 62e5a33 | 2007-07-18 10:58:02 -0700 | [diff] [blame] | 133 | onetouch->udev->devpath, retval); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | static int usb_onetouch_open(struct input_dev *dev) |
| 137 | { |
Dmitry Torokhov | 09b7002 | 2007-05-08 00:31:30 -0400 | [diff] [blame] | 138 | struct usb_onetouch *onetouch = input_get_drvdata(dev); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 139 | |
Matthew Dharm | 7931e1c | 2005-12-04 21:56:51 -0800 | [diff] [blame] | 140 | onetouch->is_open = 1; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 141 | onetouch->irq->dev = onetouch->udev; |
| 142 | if (usb_submit_urb(onetouch->irq, GFP_KERNEL)) { |
Greg Kroah-Hartman | 802f389 | 2008-08-14 09:37:34 -0700 | [diff] [blame] | 143 | dev_err(&dev->dev, "usb_submit_urb failed\n"); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 144 | return -EIO; |
| 145 | } |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | |
| 150 | static void usb_onetouch_close(struct input_dev *dev) |
| 151 | { |
Dmitry Torokhov | 09b7002 | 2007-05-08 00:31:30 -0400 | [diff] [blame] | 152 | struct usb_onetouch *onetouch = input_get_drvdata(dev); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 153 | |
| 154 | usb_kill_urb(onetouch->irq); |
Matthew Dharm | 7931e1c | 2005-12-04 21:56:51 -0800 | [diff] [blame] | 155 | onetouch->is_open = 0; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 156 | } |
| 157 | |
Matthew Dharm | 7931e1c | 2005-12-04 21:56:51 -0800 | [diff] [blame] | 158 | #ifdef CONFIG_PM |
| 159 | static void usb_onetouch_pm_hook(struct us_data *us, int action) |
| 160 | { |
| 161 | struct usb_onetouch *onetouch = (struct usb_onetouch *) us->extra; |
| 162 | |
| 163 | if (onetouch->is_open) { |
| 164 | switch (action) { |
| 165 | case US_SUSPEND: |
| 166 | usb_kill_urb(onetouch->irq); |
| 167 | break; |
| 168 | case US_RESUME: |
Oliver Neukum | e5dc8ae | 2009-08-26 19:56:12 +0200 | [diff] [blame] | 169 | if (usb_submit_urb(onetouch->irq, GFP_NOIO) != 0) |
Greg Kroah-Hartman | 802f389 | 2008-08-14 09:37:34 -0700 | [diff] [blame] | 170 | dev_err(&onetouch->irq->dev->dev, |
| 171 | "usb_submit_urb failed\n"); |
Matthew Dharm | 7931e1c | 2005-12-04 21:56:51 -0800 | [diff] [blame] | 172 | break; |
| 173 | default: |
| 174 | break; |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | #endif /* CONFIG_PM */ |
| 179 | |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 180 | static int onetouch_connect_input(struct us_data *ss) |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 181 | { |
| 182 | struct usb_device *udev = ss->pusb_dev; |
| 183 | struct usb_host_interface *interface; |
| 184 | struct usb_endpoint_descriptor *endpoint; |
| 185 | struct usb_onetouch *onetouch; |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 186 | struct input_dev *input_dev; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 187 | int pipe, maxp; |
Dmitry Torokhov | 17efe15 | 2006-08-01 22:45:28 -0400 | [diff] [blame] | 188 | int error = -ENOMEM; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 189 | |
| 190 | interface = ss->pusb_intf->cur_altsetting; |
| 191 | |
Nick Sillik | d6450e1 | 2005-08-17 13:37:34 -0400 | [diff] [blame] | 192 | if (interface->desc.bNumEndpoints != 3) |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 193 | return -ENODEV; |
Nick Sillik | d6450e1 | 2005-08-17 13:37:34 -0400 | [diff] [blame] | 194 | |
| 195 | endpoint = &interface->endpoint[2].desc; |
Luiz Fernando N. Capitulino | 66722a1 | 2006-10-26 13:02:55 -0300 | [diff] [blame] | 196 | if (!usb_endpoint_is_int_in(endpoint)) |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 197 | return -ENODEV; |
| 198 | |
| 199 | pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); |
| 200 | maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); |
Dan Carpenter | bba90ae | 2013-03-01 08:14:19 +0300 | [diff] [blame] | 201 | maxp = min(maxp, ONETOUCH_PKT_LEN); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 202 | |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 203 | onetouch = kzalloc(sizeof(struct usb_onetouch), GFP_KERNEL); |
| 204 | input_dev = input_allocate_device(); |
| 205 | if (!onetouch || !input_dev) |
| 206 | goto fail1; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 207 | |
Daniel Mack | 997ea58 | 2010-04-12 13:17:25 +0200 | [diff] [blame] | 208 | onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN, |
| 209 | GFP_KERNEL, &onetouch->data_dma); |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 210 | if (!onetouch->data) |
| 211 | goto fail1; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 212 | |
| 213 | onetouch->irq = usb_alloc_urb(0, GFP_KERNEL); |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 214 | if (!onetouch->irq) |
| 215 | goto fail2; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 216 | |
| 217 | onetouch->udev = udev; |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 218 | onetouch->dev = input_dev; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 219 | |
| 220 | if (udev->manufacturer) |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 221 | strlcpy(onetouch->name, udev->manufacturer, |
| 222 | sizeof(onetouch->name)); |
| 223 | if (udev->product) { |
| 224 | if (udev->manufacturer) |
| 225 | strlcat(onetouch->name, " ", sizeof(onetouch->name)); |
| 226 | strlcat(onetouch->name, udev->product, sizeof(onetouch->name)); |
| 227 | } |
| 228 | |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 229 | if (!strlen(onetouch->name)) |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 230 | snprintf(onetouch->name, sizeof(onetouch->name), |
| 231 | "Maxtor Onetouch %04x:%04x", |
| 232 | le16_to_cpu(udev->descriptor.idVendor), |
| 233 | le16_to_cpu(udev->descriptor.idProduct)); |
| 234 | |
| 235 | usb_make_path(udev, onetouch->phys, sizeof(onetouch->phys)); |
| 236 | strlcat(onetouch->phys, "/input0", sizeof(onetouch->phys)); |
| 237 | |
| 238 | input_dev->name = onetouch->name; |
| 239 | input_dev->phys = onetouch->phys; |
| 240 | usb_to_input_id(udev, &input_dev->id); |
Dmitry Torokhov | 09b7002 | 2007-05-08 00:31:30 -0400 | [diff] [blame] | 241 | input_dev->dev.parent = &udev->dev; |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 242 | |
| 243 | set_bit(EV_KEY, input_dev->evbit); |
| 244 | set_bit(ONETOUCH_BUTTON, input_dev->keybit); |
| 245 | clear_bit(0, input_dev->keybit); |
| 246 | |
Dmitry Torokhov | 09b7002 | 2007-05-08 00:31:30 -0400 | [diff] [blame] | 247 | input_set_drvdata(input_dev, onetouch); |
| 248 | |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 249 | input_dev->open = usb_onetouch_open; |
| 250 | input_dev->close = usb_onetouch_close; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 251 | |
Dan Carpenter | bba90ae | 2013-03-01 08:14:19 +0300 | [diff] [blame] | 252 | usb_fill_int_urb(onetouch->irq, udev, pipe, onetouch->data, maxp, |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 253 | usb_onetouch_irq, onetouch, endpoint->bInterval); |
| 254 | onetouch->irq->transfer_dma = onetouch->data_dma; |
| 255 | onetouch->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
| 256 | |
| 257 | ss->extra_destructor = onetouch_release_input; |
| 258 | ss->extra = onetouch; |
Matthew Dharm | 7931e1c | 2005-12-04 21:56:51 -0800 | [diff] [blame] | 259 | #ifdef CONFIG_PM |
| 260 | ss->suspend_resume_hook = usb_onetouch_pm_hook; |
| 261 | #endif |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 262 | |
Dmitry Torokhov | 17efe15 | 2006-08-01 22:45:28 -0400 | [diff] [blame] | 263 | error = input_register_device(onetouch->dev); |
| 264 | if (error) |
| 265 | goto fail3; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 266 | |
| 267 | return 0; |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 268 | |
Dmitry Torokhov | 17efe15 | 2006-08-01 22:45:28 -0400 | [diff] [blame] | 269 | fail3: usb_free_urb(onetouch->irq); |
Daniel Mack | 997ea58 | 2010-04-12 13:17:25 +0200 | [diff] [blame] | 270 | fail2: usb_free_coherent(udev, ONETOUCH_PKT_LEN, |
| 271 | onetouch->data, onetouch->data_dma); |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 272 | fail1: kfree(onetouch); |
| 273 | input_free_device(input_dev); |
Dmitry Torokhov | 17efe15 | 2006-08-01 22:45:28 -0400 | [diff] [blame] | 274 | return error; |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Adrian Bunk | 43c1e98 | 2008-04-28 18:39:37 +0300 | [diff] [blame] | 277 | static void onetouch_release_input(void *onetouch_) |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 278 | { |
| 279 | struct usb_onetouch *onetouch = (struct usb_onetouch *) onetouch_; |
| 280 | |
| 281 | if (onetouch) { |
| 282 | usb_kill_urb(onetouch->irq); |
Dmitry Torokhov | 8878967 | 2005-09-15 02:01:43 -0500 | [diff] [blame] | 283 | input_unregister_device(onetouch->dev); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 284 | usb_free_urb(onetouch->irq); |
Daniel Mack | 997ea58 | 2010-04-12 13:17:25 +0200 | [diff] [blame] | 285 | usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN, |
| 286 | onetouch->data, onetouch->data_dma); |
Matthew Dharm | 34008db | 2005-07-28 14:49:01 -0700 | [diff] [blame] | 287 | } |
| 288 | } |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 289 | |
Akinobu Mita | aa519be | 2015-05-06 18:24:21 +0900 | [diff] [blame] | 290 | static struct scsi_host_template onetouch_host_template; |
| 291 | |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 292 | static int onetouch_probe(struct usb_interface *intf, |
| 293 | const struct usb_device_id *id) |
| 294 | { |
| 295 | struct us_data *us; |
| 296 | int result; |
| 297 | |
| 298 | result = usb_stor_probe1(&us, intf, id, |
Akinobu Mita | aa519be | 2015-05-06 18:24:21 +0900 | [diff] [blame] | 299 | (id - onetouch_usb_ids) + onetouch_unusual_dev_list, |
| 300 | &onetouch_host_template); |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 301 | if (result) |
| 302 | return result; |
| 303 | |
| 304 | /* Use default transport and protocol */ |
| 305 | |
| 306 | result = usb_stor_probe2(us); |
| 307 | return result; |
| 308 | } |
| 309 | |
| 310 | static struct usb_driver onetouch_driver = { |
Akinobu Mita | aa519be | 2015-05-06 18:24:21 +0900 | [diff] [blame] | 311 | .name = DRV_NAME, |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 312 | .probe = onetouch_probe, |
| 313 | .disconnect = usb_stor_disconnect, |
| 314 | .suspend = usb_stor_suspend, |
| 315 | .resume = usb_stor_resume, |
| 316 | .reset_resume = usb_stor_reset_resume, |
| 317 | .pre_reset = usb_stor_pre_reset, |
| 318 | .post_reset = usb_stor_post_reset, |
| 319 | .id_table = onetouch_usb_ids, |
| 320 | .soft_unbind = 1, |
Huajun Li | e73b2db | 2012-01-14 10:15:21 +0800 | [diff] [blame] | 321 | .no_dynamic_id = 1, |
Alan Stern | 9cfb95e | 2009-02-12 14:48:33 -0500 | [diff] [blame] | 322 | }; |
| 323 | |
Akinobu Mita | aa519be | 2015-05-06 18:24:21 +0900 | [diff] [blame] | 324 | module_usb_stor_driver(onetouch_driver, onetouch_host_template, DRV_NAME); |