max3421-hcd.c (0d9b6d49fe39bd397f1d5913b1bfb8c4fdef0255) max3421-hcd.c (ffeb1e9e897b8d36b197275592d121c96d3bdb95)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * MAX3421 Host Controller driver for USB.
4 *
5 * Author: David Mosberger-Tang <davidm@egauge.net>
6 *
7 * (C) Copyright 2014 David Mosberger-Tang <davidm@egauge.net>
8 *
9 * MAX3421 is a chip implementing a USB 2.0 Full-/Low-Speed host
10 * controller on a SPI bus.
11 *
12 * Based on:
13 * o MAX3421E datasheet
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * MAX3421 Host Controller driver for USB.
4 *
5 * Author: David Mosberger-Tang <davidm@egauge.net>
6 *
7 * (C) Copyright 2014 David Mosberger-Tang <davidm@egauge.net>
8 *
9 * MAX3421 is a chip implementing a USB 2.0 Full-/Low-Speed host
10 * controller on a SPI bus.
11 *
12 * Based on:
13 * o MAX3421E datasheet
14 * http://datasheets.maximintegrated.com/en/ds/MAX3421E.pdf
14 * https://datasheets.maximintegrated.com/en/ds/MAX3421E.pdf
15 * o MAX3421E Programming Guide
15 * o MAX3421E Programming Guide
16 * http://www.hdl.co.jp/ftpdata/utl-001/AN3785.pdf
16 * https://www.hdl.co.jp/ftpdata/utl-001/AN3785.pdf
17 * o gadget/dummy_hcd.c
18 * For USB HCD implementation.
19 * o Arduino MAX3421 driver
20 * https://github.com/felis/USB_Host_Shield_2.0/blob/master/Usb.cpp
21 *
22 * This file is licenced under the GPL v2.
23 *
24 * Important note on worst-case (full-speed) packet size constraints

--- 287 unchanged lines hidden (view full) ---

312 [MAX3421_HRSL_CRCERR] = -EILSEQ,
313 [MAX3421_HRSL_KERR] = -EIO,
314 [MAX3421_HRSL_JERR] = -EIO,
315 [MAX3421_HRSL_TIMEOUT] = -ETIME,
316 [MAX3421_HRSL_BABBLE] = -EOVERFLOW
317};
318
319/*
17 * o gadget/dummy_hcd.c
18 * For USB HCD implementation.
19 * o Arduino MAX3421 driver
20 * https://github.com/felis/USB_Host_Shield_2.0/blob/master/Usb.cpp
21 *
22 * This file is licenced under the GPL v2.
23 *
24 * Important note on worst-case (full-speed) packet size constraints

--- 287 unchanged lines hidden (view full) ---

312 [MAX3421_HRSL_CRCERR] = -EILSEQ,
313 [MAX3421_HRSL_KERR] = -EIO,
314 [MAX3421_HRSL_JERR] = -EIO,
315 [MAX3421_HRSL_TIMEOUT] = -ETIME,
316 [MAX3421_HRSL_BABBLE] = -EOVERFLOW
317};
318
319/*
320 * See http://www.beyondlogic.org/usbnutshell/usb4.shtml#Control for a
320 * See https://www.beyondlogic.org/usbnutshell/usb4.shtml#Control for a
321 * reasonable overview of how control transfers use the the IN/OUT
322 * tokens.
323 */
324#define MAX3421_HXFR_BULK_IN(ep) (0x00 | (ep)) /* bulk or interrupt */
325#define MAX3421_HXFR_SETUP 0x10
326#define MAX3421_HXFR_BULK_OUT(ep) (0x20 | (ep)) /* bulk or interrupt */
327#define MAX3421_HXFR_ISO_IN(ep) (0x40 | (ep))
328#define MAX3421_HXFR_ISO_OUT(ep) (0x60 | (ep))

--- 1674 unchanged lines hidden ---
321 * reasonable overview of how control transfers use the the IN/OUT
322 * tokens.
323 */
324#define MAX3421_HXFR_BULK_IN(ep) (0x00 | (ep)) /* bulk or interrupt */
325#define MAX3421_HXFR_SETUP 0x10
326#define MAX3421_HXFR_BULK_OUT(ep) (0x20 | (ep)) /* bulk or interrupt */
327#define MAX3421_HXFR_ISO_IN(ep) (0x40 | (ep))
328#define MAX3421_HXFR_ISO_OUT(ep) (0x60 | (ep))

--- 1674 unchanged lines hidden ---