Linux Audio

Check our new training course

Loading...
v3.1
 
  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 receive
 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);
 98int usb_ftdi_elan_read_pcimem(struct platform_device *pdev, int mem_offset,
 99			      u8 width, u32 *data);
100int usb_ftdi_elan_write_pcimem(struct platform_device *pdev, int mem_offset,
101			       u8 width, u32 data);
v5.4
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3* Common Header File for the Elan Digital Systems U132 adapter
 4* this file should be included by both the "ftdi-u132" and
 5* the "u132-hcd" modules.
 6*
 7* Copyright(C) 2006 Elan Digital Systems Limited
 8*(http://www.elandigitalsystems.com)
 9*
10* Author and Maintainer - Tony Olech - Elan Digital Systems
11*(tony.olech@elandigitalsystems.com)
 
 
 
 
 
12*
13* The driver was written by Tony Olech(tony.olech@elandigitalsystems.com)
14* based on various USB client drivers in the 2.6.15 linux kernel
15* with constant reference to the 3rd Edition of Linux Device Drivers
16* published by O'Reilly
17*
18* The U132 adapter is a USB to CardBus adapter specifically designed
19* for PC cards that contain an OHCI host controller. Typical PC cards
20* are the Orange Mobile 3G Option GlobeTrotter Fusion card.
21*
22* The U132 adapter will *NOT *work with PC cards that do not contain
23* an OHCI controller. A simple way to test whether a PC card has an
24* OHCI controller as an interface is to insert the PC card directly
25* into a laptop(or desktop) with a CardBus slot and if "lspci" shows
26* a new USB controller and "lsusb -v" shows a new OHCI Host Controller
27* then there is a good chance that the U132 adapter will support the
28* PC card.(you also need the specific client driver for the PC card)
29*
30* Please inform the Author and Maintainer about any PC cards that
31* contain OHCI Host Controller and work when directly connected to
32* an embedded CardBus slot but do not work when they are connected
33* via an ELAN U132 adapter.
34*
35* The driver consists of two modules, the "ftdi-u132" module is
36* a USB client driver that interfaces to the FTDI chip within
37* the U132 adapter manufactured by Elan Digital Systems, and the
38* "u132-hcd" module is a USB host controller driver that talks
39* to the OHCI controller within CardBus card that are inserted
40* in the U132 adapter.
41*
42* The "ftdi-u132" module should be loaded automatically by the
43* hot plug system when the U132 adapter is plugged in. The module
44* initialises the adapter which mostly consists of synchronising
45* the FTDI chip, before continuously polling the adapter to detect
46* PC card insertions. As soon as a PC card containing a recognised
47* OHCI controller is seen the "ftdi-u132" module explicitly requests
48* the kernel to load the "u132-hcd" module.
49*
50* The "ftdi-u132" module provides the interface to the inserted
51* PC card and the "u132-hcd" module uses the API to send and receive
52* data. The API features call-backs, so that part of the "u132-hcd"
53* module code will run in the context of one of the kernel threads
54* of the "ftdi-u132" module.
55*
56*/
57int ftdi_elan_switch_on_diagnostics(int number);
58void ftdi_elan_gone_away(struct platform_device *pdev);
59void start_usb_lock_device_tracing(void);
60struct u132_platform_data {
61        u16 vendor;
62        u16 device;
63        u8 potpg;
64        void (*port_power) (struct device *dev, int is_on);
65        void (*reset) (struct device *dev);
66};
67int usb_ftdi_elan_edset_single(struct platform_device *pdev, u8 ed_number,
68        void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
69        void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
70        int toggle_bits, int error_count, int condition_code, int repeat_number,
71         int halted, int skipped, int actual, int non_null));
72int usb_ftdi_elan_edset_output(struct platform_device *pdev, u8 ed_number,
73        void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
74        void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
75        int toggle_bits, int error_count, int condition_code, int repeat_number,
76         int halted, int skipped, int actual, int non_null));
77int usb_ftdi_elan_edset_empty(struct platform_device *pdev, u8 ed_number,
78        void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
79        void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
80        int toggle_bits, int error_count, int condition_code, int repeat_number,
81         int halted, int skipped, int actual, int non_null));
82int usb_ftdi_elan_edset_input(struct platform_device *pdev, u8 ed_number,
83        void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
84        void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
85        int toggle_bits, int error_count, int condition_code, int repeat_number,
86         int halted, int skipped, int actual, int non_null));
87int usb_ftdi_elan_edset_setup(struct platform_device *pdev, u8 ed_number,
88        void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
89        void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
90        int toggle_bits, int error_count, int condition_code, int repeat_number,
91         int halted, int skipped, int actual, int non_null));
92int usb_ftdi_elan_edset_flush(struct platform_device *pdev, u8 ed_number,
93        void *endp);
94int usb_ftdi_elan_read_pcimem(struct platform_device *pdev, int mem_offset,
95			      u8 width, u32 *data);
96int usb_ftdi_elan_write_pcimem(struct platform_device *pdev, int mem_offset,
97			       u8 width, u32 data);