blob: 1b1f2e04e1ae76ba311a2fdd78f0936c4682face [file] [log] [blame]
/*
* Copyright (C) 2018 Synaptics Incorporated. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED "AS-IS," AND
* SYNAPTICS EXPRESSLY DISCLAIMS ALL EXPRESS AND IMPLIED WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE, AND ANY WARRANTIES OF NON-INFRINGEMENT OF ANY
* INTELLECTUAL PROPERTY RIGHTS. IN NO EVENT SHALL SYNAPTICS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE, OR
* CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE
* OF THE INFORMATION CONTAINED IN THIS DOCUMENT, HOWEVER CAUSED AND
* BASED ON ANY THEORY OF LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, AND EVEN IF SYNAPTICS WAS
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. IF A TRIBUNAL OF
* COMPETENT JURISDICTION DOES NOT PERMIT THE DISCLAIMER OF DIRECT
* DAMAGES OR ANY OTHER DAMAGES, SYNAPTICS' TOTAL CUMULATIVE LIABILITY
* TO ANY PARTY SHALL NOT EXCEED ONE HUNDRED U.S. DOLLARS.
*/
#ifndef _USB_TYPEDEFS_
#define _USB_TYPEDEFS_
#define __packed __attribute__((packed))
#define __LITTLE_ENDIAN 0
#define __BYTE_ORDER __LITTLE_ENDIAN
typedef int bool;
typedef unsigned char uint_8;
typedef unsigned long uint_32;
#define _PTR_ *
#define pointer void*
typedef unsigned char uchar;
typedef unsigned char * uchar_ptr;
typedef unsigned int boolean;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed char s8;
typedef short s16;
typedef int s32;
typedef u8 __u8;
typedef u16 __u16;
typedef u32 __u32;
typedef u16 __le16;
typedef u32 __le32;
# define cpu_to_le16(x) (x)
# define cpu_to_le32(x) (x)
# define cpu_to_le64(x) (x)
# define le16_to_cpu(x) (x)
# define le32_to_cpu(x) (x)
# define le64_to_cpu(x) (x)
#ifdef AARCH64
typedef unsigned long u64;
typedef unsigned long ulong;
typedef unsigned long fdt_addr_t;
#else
typedef unsigned long long u64;
typedef unsigned long long ulong;
typedef unsigned long long fdt_addr_t;
#endif
#define FAIL (-1)
#define SUCCESS 0
#define EIO 1
#define ETIMEOUT 2
#define EUNALIGN 3
#define ENODEV 4
#define ENOMEM 5
#define EINVAL 6
#define EFAULTCONTENT 7
#define EBUSY 8
#define ENO_PRD_ENTRY 9
#define ENOACK 10
#define EUNDEF_BOARD 11
#define EDEFAULT 12
#define ECMP 13
#define ENOINIT 14
#define EPERM 15 /* Operation not permitted */
#define ENOEXEC 16 /* Exec format error */
#define EXDEV 18 /* Cross-device link */
#define ENOSPC 28 /* No space left on device, bandwidth error */
#define EPIPE 32 /* Broken pipe */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOMSG 42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ENODATA 61 /* No data available */
#define ENOSR 63 /* Out of streams resources */
#define ECOMM 70 /* Communication error on send */
#define EPROTO 71 /* Protocol error */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define EILSEQ 84 /* Illegal byte sequence */
#define EMSGSIZE 90 /* Message too long */
#define ECONNRESET 104 /* Connection reset by peer */
#define ENOTCONN 107 /* Transport endpoint is not connected */
#define ESHUTDOWN 108 /* cannot send after transport endpoint shutdown */
#define ENOENT 109 /* No such file or directory */
#define EHOSTUNREACH 113 /* No route to host */
#define EINPROGRESS 115 /* Operation now in progress */
#define EREMOTEIO 121 /* Remote I/O error */
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif