#include <string.h>
+#define kAppleAudioVideoJackStateKey "AppleAudioVideoJackState"
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class IOATINDRV : public IONDRVFramebuffer
if( kIOReturnSuccess == err) do {
+ // find out about onboard audio/video jack state
+ // OSObject * notify =
+ addNotification( gIOPublishNotification,
+ resourceMatching(kAppleAudioVideoJackStateKey),
+ _videoJackStateChangeHandler, this, 0 );
+
ignore_zero_fault( true );
err = checkDriver();
ignore_zero_fault( false );
return( err);
}
+bool IONDRVFramebuffer::_videoJackStateChangeHandler( void * target, void * ref,
+ IOService * resourceService )
+{
+ IONDRVFramebuffer * self = (IONDRVFramebuffer *) target;
+ IOReturn err;
+ UInt32 jackData;
+
+ OSObject * jackValue = resourceService->getProperty(kAppleAudioVideoJackStateKey);
+ if( !jackValue)
+ return( true );
+
+ jackData = (jackValue == kOSBooleanTrue);
+
+ self->nub->setProperty( kAppleAudioVideoJackStateKey, &jackData, sizeof(jackData) );
+ resourceService->removeProperty(kAppleAudioVideoJackStateKey);
+
+ return( true );
+}
+
IODeviceMemory * IONDRVFramebuffer::getVRAMRange( void )
{
if( vramMemory)