]> git.saurik.com Git - apple/xnu.git/blob - iokit/Drivers/hidsystem/drvAppleADBDevices/AppleADBDisplay.h
xnu-123.5.tar.gz
[apple/xnu.git] / iokit / Drivers / hidsystem / drvAppleADBDevices / AppleADBDisplay.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Copyright (c) 1997-1998 Apple Computer, Inc.
24 *
25 *
26 * HISTORY
27 *
28 * sdouglas 22 Oct 97 - first checked in.
29 * sdouglas 23 Jul 98 - start IOKit
30 * suurballe 17 Nov 98 - ported to C++
31 */
32
33 #include <IOKit/adb/IOADBDevice.h>
34 #include <IOKit/graphics/IODisplay.h>
35
36
37 #define kOrgDisplayAddr 0x7 // Original display ADB address
38
39 #define kTelecasterADBHandlerID 0x03
40 #define kSmartDisplayADBHandlerID 0xc0
41
42 #define kADBReg0 0x0 // Device register zero
43 #define kADBReg1 0x1 // Device register one
44 #define kADBReg2 0x2 // Device register two
45 #define kADBReg3 0x3 // Device register three
46
47 #define kReg2DataRdy 0xFD // data (to be read) ready
48 #define kReg2DataAck 0xFE // data (just written) OK
49 #define kWiggleLADAddr 0x04 // 0x0f on Telecaster & Sousa?
50
51 #if 0
52
53 #define kNoDevice -1
54 #define kTelecaster 0
55 #define kSousaSoundUnit 1
56 #define kHammerhead 2
57 #define kOrca 3
58 #define kWhaler 4
59 #define kWarriorEZ 5
60 #define kManta 6
61 #define kLastDeviceType kManta
62
63 #define kDisplayLocalRemoteLADAddr 0x02 // lad address used in SetDisplayRemoteMode
64 #define kAudioKeypadEnableLADAddr 0x7D
65
66 #define kUnknown -1
67 #define kLocal 0
68 #define kRemote 1
69
70 #endif
71
72 class AppleADBDisplay: public IODisplay
73 {
74 OSDeclareDefaultStructors(AppleADBDisplay)
75
76 private:
77
78 IOADBDevice * adbDevice;
79 volatile UInt8 waitAckValue;
80 UInt8 wiggleLADAddr;
81 SInt16 avDisplayID;
82 int numModes;
83 UInt32 * modeList;
84
85 virtual IOReturn findADBDisplayInfoForType( UInt16 deviceType );
86 virtual IOReturn getConnectFlagsForDisplayMode(
87 IODisplayModeID mode, UInt32 * flags );
88 virtual IOReturn doConnect( void );
89 virtual IOReturn writeWithAcknowledge( UInt8 regNum, UInt16 data,
90 UInt8 ackValue );
91 virtual IOReturn setLogicalRegister( UInt16 address, UInt16 data );
92 virtual IOReturn getLogicalRegister( UInt16 address, UInt16 * data );
93 virtual void setWiggle( bool active );
94 virtual bool tryAttach( IODisplayConnect * connect );
95
96 public:
97
98 virtual bool start( IOService * nub );
99 virtual IOService * probe( IOService * nub, SInt32 * score );
100
101 virtual void packet( UInt8 adbCommand,
102 IOByteCount length, UInt8 * data );
103
104 };