Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003 * Common Header File for the Elan Digital Systems U132 adapter
0004 * this file should be included by both the "ftdi-u132" and
0005 * the "u132-hcd" modules.
0006 *
0007 * Copyright(C) 2006 Elan Digital Systems Limited
0008 *(http://www.elandigitalsystems.com)
0009 *
0010 * Author and Maintainer - Tony Olech - Elan Digital Systems
0011 *(tony.olech@elandigitalsystems.com)
0012 *
0013 * The driver was written by Tony Olech(tony.olech@elandigitalsystems.com)
0014 * based on various USB client drivers in the 2.6.15 linux kernel
0015 * with constant reference to the 3rd Edition of Linux Device Drivers
0016 * published by O'Reilly
0017 *
0018 * The U132 adapter is a USB to CardBus adapter specifically designed
0019 * for PC cards that contain an OHCI host controller. Typical PC cards
0020 * are the Orange Mobile 3G Option GlobeTrotter Fusion card.
0021 *
0022 * The U132 adapter will *NOT *work with PC cards that do not contain
0023 * an OHCI controller. A simple way to test whether a PC card has an
0024 * OHCI controller as an interface is to insert the PC card directly
0025 * into a laptop(or desktop) with a CardBus slot and if "lspci" shows
0026 * a new USB controller and "lsusb -v" shows a new OHCI Host Controller
0027 * then there is a good chance that the U132 adapter will support the
0028 * PC card.(you also need the specific client driver for the PC card)
0029 *
0030 * Please inform the Author and Maintainer about any PC cards that
0031 * contain OHCI Host Controller and work when directly connected to
0032 * an embedded CardBus slot but do not work when they are connected
0033 * via an ELAN U132 adapter.
0034 *
0035 * The driver consists of two modules, the "ftdi-u132" module is
0036 * a USB client driver that interfaces to the FTDI chip within
0037 * the U132 adapter manufactured by Elan Digital Systems, and the
0038 * "u132-hcd" module is a USB host controller driver that talks
0039 * to the OHCI controller within CardBus card that are inserted
0040 * in the U132 adapter.
0041 *
0042 * The "ftdi-u132" module should be loaded automatically by the
0043 * hot plug system when the U132 adapter is plugged in. The module
0044 * initialises the adapter which mostly consists of synchronising
0045 * the FTDI chip, before continuously polling the adapter to detect
0046 * PC card insertions. As soon as a PC card containing a recognised
0047 * OHCI controller is seen the "ftdi-u132" module explicitly requests
0048 * the kernel to load the "u132-hcd" module.
0049 *
0050 * The "ftdi-u132" module provides the interface to the inserted
0051 * PC card and the "u132-hcd" module uses the API to send and receive
0052 * data. The API features call-backs, so that part of the "u132-hcd"
0053 * module code will run in the context of one of the kernel threads
0054 * of the "ftdi-u132" module.
0055 *
0056 */
0057 int ftdi_elan_switch_on_diagnostics(int number);
0058 void ftdi_elan_gone_away(struct platform_device *pdev);
0059 void start_usb_lock_device_tracing(void);
0060 struct u132_platform_data {
0061         u16 vendor;
0062         u16 device;
0063         u8 potpg;
0064         void (*port_power) (struct device *dev, int is_on);
0065         void (*reset) (struct device *dev);
0066 };
0067 int usb_ftdi_elan_edset_single(struct platform_device *pdev, u8 ed_number,
0068         void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
0069         void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
0070         int toggle_bits, int error_count, int condition_code, int repeat_number,
0071          int halted, int skipped, int actual, int non_null));
0072 int usb_ftdi_elan_edset_output(struct platform_device *pdev, u8 ed_number,
0073         void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
0074         void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
0075         int toggle_bits, int error_count, int condition_code, int repeat_number,
0076          int halted, int skipped, int actual, int non_null));
0077 int usb_ftdi_elan_edset_empty(struct platform_device *pdev, u8 ed_number,
0078         void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
0079         void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
0080         int toggle_bits, int error_count, int condition_code, int repeat_number,
0081          int halted, int skipped, int actual, int non_null));
0082 int usb_ftdi_elan_edset_input(struct platform_device *pdev, u8 ed_number,
0083         void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
0084         void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
0085         int toggle_bits, int error_count, int condition_code, int repeat_number,
0086          int halted, int skipped, int actual, int non_null));
0087 int usb_ftdi_elan_edset_setup(struct platform_device *pdev, u8 ed_number,
0088         void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits,
0089         void (*callback) (void *endp, struct urb *urb, u8 *buf, int len,
0090         int toggle_bits, int error_count, int condition_code, int repeat_number,
0091          int halted, int skipped, int actual, int non_null));
0092 int usb_ftdi_elan_edset_flush(struct platform_device *pdev, u8 ed_number,
0093         void *endp);
0094 int usb_ftdi_elan_read_pcimem(struct platform_device *pdev, int mem_offset,
0095                   u8 width, u32 *data);
0096 int usb_ftdi_elan_write_pcimem(struct platform_device *pdev, int mem_offset,
0097                    u8 width, u32 data);