aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usb_u132.h
diff options
context:
space:
mode:
authorTony Olech <tony.olech@elandigitalsystems.com>2006-09-13 06:26:04 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:59 -0400
commita5c66e4b2418278786a025a5bd9625f485b2087a (patch)
treef089d9a7350c9c154f46b2537eba7b6a3849a2fe /drivers/usb/misc/usb_u132.h
parent8fd801339350b63cbb90730ff8b2be349fb3dc67 (diff)
USB: ftdi-elan: client driver for ELAN Uxxx adapters
This "ftdi-elan" module is one half of the "driver" for ELAN's Uxxx series adapters which are USB to PCMCIA CardBus adapters. Currently only the U132 adapter is available and it's module is called "u132-hcd". When the USB hot plug subsystem detects a Uxxx series adapter it should load this module. Upon a successful device probe() the jtag device file interface is created and the status workqueue started up. The jtag device file interface exists for the purpose of updating the firmware in the Uxxx series adapter, but as yet it had never been used. The status workqueue initializes the Uxxx and then sits there polling the Uxxx until a supported PCMCIA CardBus device is detected it will start the command and respond workqueues and then load the module that handles the device. This will initially be only the u132-hcd module. The status workqueue then just polls the Uxxx looking for card ejects. The command and respond workqueues implement a command sequencer for communicating with the firmware on the other side of the FTDI chip in the Uxxx. This "ftdi-elan" module exports some functions to interface with the sequencer. Note that this module is a USB client driver. Note that the "u132-hcd" module is a (cut-down OHCI) host controller. Thus we have a topology with the parent of a host controller being a USB client! This really stresses the USB subsystem semaphore/mutex handling in the module removal. Signed-off-by: Tony Olech <tony.olech@elandigitalsystems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/usb_u132.h')
-rw-r--r--drivers/usb/misc/usb_u132.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/drivers/usb/misc/usb_u132.h b/drivers/usb/misc/usb_u132.h
new file mode 100644
index 000000000000..551ba8906d62
--- /dev/null
+++ b/drivers/usb/misc/usb_u132.h
@@ -0,0 +1,97 @@
1/*
2* Common Header File for the Elan Digital Systems U132 adapter
3* this file should be included by both the "ftdi-u132" and
4* the "u132-hcd" modules.
5*
6* Copyright(C) 2006 Elan Digital Systems Limited
7*(http://www.elandigitalsystems.com)
8*
9* Author and Maintainer - Tony Olech - Elan Digital Systems
10*(tony.olech@elandigitalsystems.com)
11*
12* This program is free software;you can redistribute it and/or
13* modify it under the terms of the GNU General Public License as
14* published by the Free Software Foundation, version 2.
15*
16*
17* The driver was written by Tony Olech(tony.olech@elandigitalsystems.com)
18* based on various USB client drivers in the 2.6.15 linux kernel
19* with constant reference to the 3rd Edition of Linux Device Drivers
20* published by O'Reilly
21*
22* The U132 adapter is a USB to CardBus adapter specifically designed
23* for PC cards that contain an OHCI host controller. Typical PC cards
24* are the Orange Mobile 3G Option GlobeTrotter Fusion card.
25*
26* The U132 adapter will *NOT *work with PC cards that do not contain
27* an OHCI controller. A simple way to test whether a PC card has an
28* OHCI controller as an interface is to insert the PC card directly
29* into a laptop(or desktop) with a CardBus slot and if "lspci" shows
30* a new USB controller and "lsusb -v" shows a new OHCI Host Controller
31* then there is a good chance that the U132 adapter will support the
32* PC card.(you also need the specific client driver for the PC card)
33*
34* Please inform the Author and Maintainer about any PC cards that
35* contain OHCI Host Controller and work when directly connected to
36* an embedded CardBus slot but do not work when they are connected
37* via an ELAN U132 adapter.
38*
39* The driver consists of two modules, the "ftdi-u132" module is
40* a USB client driver that interfaces to the FTDI chip within
41* the U132 adapter manufactured by Elan Digital Systems, and the
42* "u132-hcd" module is a USB host controller driver that talks
43* to the OHCI controller within CardBus card that are inserted
44* in the U132 adapter.
45*
46* The "ftdi-u132" module should be loaded automatically by the
47* hot plug system when the U132 adapter is plugged in. The module
48* initialises the adapter which mostly consists of synchronising
49* the FTDI chip, before continuously polling the adapter to detect
50* PC card insertions. As soon as a PC card containing a recognised
51* OHCI controller is seen the "ftdi-u132" module explicitly requests
52* the kernel to load the "u132-hcd" module.
53*
54* The "ftdi-u132" module provides the interface to the inserted
55* PC card and the "u132-hcd" module uses the API to send and recieve
56* data. The API features call-backs, so that part of the "u132-hcd"
57* module code will run in the context of one of the kernel threads
58* of the "ftdi-u132" module.
59*
60*/
61int ftdi_elan_switch_on_diagnostics(int number);
62void ftdi_elan_gone_away(struct platform_device *pdev);
63void start_usb_lock_device_tracing(void);
64struct u132_platform_data {
65 u16 vendor;
66 u16 device;
67 u8 potpg;
68 void (*port_power) (struct device *dev, int is_on);
69 void (*reset) (struct device *dev);
70};
71int usb_ftdi_elan_edset_single(struct platform_device *pdev, u8 ed_number,
72 void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
73 void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
74 int toggle_bits, int error_count, int condition_code, int repeat_number,
75 int halted, int skipped, int actual, int non_null));
76int usb_ftdi_elan_edset_output(struct platform_device *pdev, u8 ed_number,
77 void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
78 void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
79 int toggle_bits, int error_count, int condition_code, int repeat_number,
80 int halted, int skipped, int actual, int non_null));
81int usb_ftdi_elan_edset_empty(struct platform_device *pdev, u8 ed_number,
82 void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
83 void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
84 int toggle_bits, int error_count, int condition_code, int repeat_number,
85 int halted, int skipped, int actual, int non_null));
86int usb_ftdi_elan_edset_input(struct platform_device *pdev, u8 ed_number,
87 void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
88 void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
89 int toggle_bits, int error_count, int condition_code, int repeat_number,
90 int halted, int skipped, int actual, int non_null));
91int usb_ftdi_elan_edset_setup(struct platform_device *pdev, u8 ed_number,
92 void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
93 void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
94 int toggle_bits, int error_count, int condition_code, int repeat_number,
95 int halted, int skipped, int actual, int non_null));
96int usb_ftdi_elan_edset_flush(struct platform_device *pdev, u8 ed_number,
97 void *endp);