Linux 4.16.11
[linux/fpc-iii.git] / drivers / staging / vt6655 / upc.h
blob61b3e568ff9aad96e8000e8354573077adc853fe
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4 * All rights reserved.
6 * File: upc.h
8 * Purpose: Macros to access device
10 * Author: Tevin Chen
12 * Date: Mar 17, 1997
16 #ifndef __UPC_H__
17 #define __UPC_H__
19 #include "device.h"
21 /*--------------------- Export Definitions -------------------------*/
24 /* For memory mapped IO */
27 #define VNSvInPortB(dwIOAddress, pbyData) \
28 (*(pbyData) = ioread8(dwIOAddress))
30 #define VNSvInPortW(dwIOAddress, pwData) \
31 (*(pwData) = ioread16(dwIOAddress))
33 #define VNSvInPortD(dwIOAddress, pdwData) \
34 (*(pdwData) = ioread32(dwIOAddress))
36 #define VNSvOutPortB(dwIOAddress, byData) \
37 iowrite8((u8)(byData), dwIOAddress)
39 #define VNSvOutPortW(dwIOAddress, wData) \
40 iowrite16((u16)(wData), dwIOAddress)
42 #define VNSvOutPortD(dwIOAddress, dwData) \
43 iowrite32((u32)(dwData), dwIOAddress)
45 #define PCAvDelayByIO(uDelayUnit) \
46 do { \
47 unsigned char byData; \
48 unsigned long ii; \
50 if (uDelayUnit <= 50) { \
51 udelay(uDelayUnit); \
52 } else { \
53 for (ii = 0; ii < (uDelayUnit); ii++) \
54 byData = inb(0x61); \
55 } \
56 } while (0)
58 /*--------------------- Export Classes ----------------------------*/
60 /*--------------------- Export Variables --------------------------*/
62 /*--------------------- Export Functions --------------------------*/
64 #endif /* __UPC_H__ */