PlatformInterfaceI2C_Mapped.h [plain text]
#ifndef __PLATFORMINTERFACE_I2C_Mapped__
#define __PLATFORMINTERFACE_I2C_Mapped__
#include <IOKit/i2c/PPCI2CInterface.h>
#include <IOKit/IOService.h>
#include "AudioHardwareConstants.h"
#include "PlatformInterfaceI2C.h"
#include "PlatformInterfaceSupportMappedCommon.h"
class PlatformInterfaceI2C_Mapped : public PlatformInterfaceI2C {
OSDeclareDefaultStructors ( PlatformInterfaceI2C_Mapped );
public:
virtual bool init ( IOService* device, AppleOnboardAudio* provider, UInt32 inDBDMADeviceIndex );
virtual void free();
virtual IOReturn performPowerStateChange ( IOService * device, UInt32 currentPowerState, UInt32 pendingPowerState );
virtual IOReturn readCodecRegister ( UInt32 codecRef, UInt8 subAddress, UInt8 *data, UInt32 dataLength );
virtual IOReturn WriteCodecRegister ( UInt32 codecRef, UInt8 subAddress, UInt8 *data, UInt32 dataLength );
virtual IOReturn setMAP ( UInt32 codecRef, UInt8 subAddress );
protected:
virtual IOReturn setupForI2CTransaction ( UInt32 codecRef, UInt8 * i2cDeviceAddress, UInt8 * i2cBusProtocol, bool direction );
virtual bool findAndAttachI2C();
virtual bool detachFromI2C();
virtual bool openI2C();
virtual void closeI2C();
virtual bool codecHasMAP ( UInt32 codecRef );
UInt32 mI2CPort;
bool mI2C_lastTransactionResult;
PPCI2CInterface * mI2CInterface;
IOService * mKeyLargoService;
const OSSymbol * mKLI2SPowerSymbolName;
void * mSoundConfigSpace; void * mIOBaseAddress; void * mIOConfigurationBaseAddress; void * mI2SBaseAddress; IODeviceMemory * mIOBaseAddressMemory; IODeviceMemory * mIOI2SBaseAddressMemory;
I2SCell mI2SInterfaceNumber;
static const UInt16 kAPPLE_IO_CONFIGURATION_SIZE;
static const UInt16 kI2S_IO_CONFIGURATION_SIZE;
static const UInt32 kI2S0BaseOffset;
static const UInt32 kI2S1BaseOffset;
};
#endif