IOService * ACPIBacklightPanel::probe( IOService * provider, SInt32 * score ) { DbgLog("%s::%s()\n", this->getName(),__FUNCTION__); bool hasFound = findDevices(provider); DbgLog("%s: probe(devices found : %s)\n", this->getName(), (hasFound ? "true" : "false") ); if (!hasFound) return NULL; DbgLog("%s: %s has backlight Methods\n", this->getName(), backLightDevice->getName()); return super::probe(provider, score); }
void Hw::SystemInit(int flags){ if(init_flags==0){ xenon_make_it_faster(XENON_SPEED_FULL); if(flags & INIT_SOUND){ } if(flags & INIT_VIDEO){ } if(flags & INIT_USB){ usb_init(); usb_do_poll(); } if(flags & INIT_NETWORK){ network_init(); } if(flags & INIT_ATA){ xenon_ata_init(); } if(flags & INIT_ATAPI){ xenon_atapi_init(); } if(flags & INIT_FILESYSTEM){ mount_all_devices(); findDevices(); } if(flags & INIT_SFCX){ sfcx_init(); } init_flags = flags; } }
bool ACPIBacklightPanel::start( IOService * provider ) { DbgLog("%s::%s()\n", this->getName(),__FUNCTION__); #if 0 if (!provider) return false; _provider = provider; _provider->retain(); #endif _lock = IORecursiveLockAlloc(); if (!_lock) return false; findDevices(provider); getDeviceControl(); hasSaveMethod = hasSAVEMethod(backLightDevice); min = 0; max = setupIndexedLevels(); if (min == max) { IOLog("ACPIBacklight: setupIndexedLevels failed (min==max)... aborting"); return false; } // add interrupt source for delayed actions... _workSource = IOInterruptEventSource::interruptEventSource(this, OSMemberFunctionCast(IOInterruptEventAction, this, &ACPIBacklightPanel::processWorkQueue)); if (!_workSource) return false; IOWorkLoop* workLoop = getWorkLoop(); if (!workLoop) { _workSource->release(); _workSource = NULL; return false; } workLoop->addEventSource(_workSource); _workPending = 0; // add timer for smooth fade ins if (_extended && !(_options & kDisableSmooth)) { _smoothTimer = IOTimerEventSource::timerEventSource(this, OSMemberFunctionCast(IOTimerEventSource::Action, this, &ACPIBacklightPanel::onSmoothTimer)); if (_smoothTimer) workLoop->addEventSource(_smoothTimer); } _cmdGate = IOCommandGate::commandGate(this); if (_cmdGate) workLoop->addEventSource(_cmdGate); // initialize from properties OSDictionary* dict = getPropertyTable(); setPropertiesGated(dict); // write current values from smoothData for (int i = 0; i < countof(smoothData); i++) { char buf[kSmoothBufSize]; snprintf(buf, sizeof(buf), kSmoothDelta, i); setProperty(buf, smoothData[i].delta, 32); snprintf(buf, sizeof(buf), kSmoothStep, i); setProperty(buf, smoothData[i].step, 32); snprintf(buf, sizeof(buf), kSmoothTimeout, i); setProperty(buf, smoothData[i].timeout, 32); } #ifdef DEBUG setProperty("CycleTest", 1, 32); setProperty("KLVX", 1, 32); #endif // make the service available for clients like 'ioio'... registerService(); // load and set default brightness level UInt32 value = loadFromNVRAM(); DbgLog("%s: loadFromNVRAM returns %d\n", this->getName(), value); // registerService above must be called before we wait for the BacklightHandler if (useBacklightHandler()) { DbgLog("%s: Waiting for BacklightHandler\n", this->getName()); waitForService(serviceMatching("BacklightHandler")); } // after backlight handler is in place, now we can manipulate backlight level UInt32 current = queryACPICurentBrightnessLevel(); setProperty(kRawBrightness, current, 32); #if 0 _provider->setProperty("AppleBacklightAtBoot", current, 32); _provider->setProperty("AppleMaxBrightness", BCLlevels[BCLlevelsCount-1], 32); #endif _committed_value = _value = _from_value = levelForValue(current); DbgLog("%s: current brightness: %d (%d)\n", this->getName(), _from_value, current); if (-1 != value) { _committed_value = value; DbgLog("%s: setting to value from nvram %d\n", this->getName(), value); setBrightnessLevelSmooth(value); } _saved_value = _committed_value; DbgLog("%s: min = %u, max = %u\n", this->getName(), min, max); // announce version extern kmod_info_t kmod_info; IOLog("ACPIBacklight: Version %s starting on OS X Darwin %d.%d.\n", kmod_info.version, version_major, version_minor); // place version/build info in ioreg properties RM,Build and RM,Version char buf[128]; snprintf(buf, sizeof(buf), "%s %s", kmod_info.name, kmod_info.version); setProperty("RM,Version", buf); #ifdef DEBUG setProperty("RM,Build", "Debug-" LOGNAME); #else setProperty("RM,Build", "Release-" LOGNAME); #endif return true; }
int main() { printf("main\n"); xenos_init(VIDEO_MODE_HDMI_720P); xenon_make_it_faster(XENON_SPEED_FULL); xenon_sound_init(); //xenos_init(VIDEO_MODE_YUV_720P); //console_init(); usb_init(); usb_do_poll(); xenon_ata_init(); xenon_atapi_init(); //fatInitDefault(); //char mount[10]; //sprintf(mount, "uda0"); //fatMount(mount, &usb2mass_ops_0, 0, 2, 64); ntfs_md *mounts; //ntfsMountAll (&mounts, NTFS_READ_ONLY); XTAFMount(); findDevices(); init_miss(); time_t rawtime; time ( &rawtime ); printf ( "The current local time is: %s", ctime (&rawtime) ); /* */ memset(&Config, 0, sizeof (PcsxConfig)); // network_init(); // network_print_config(); //console_close(); xenon_smc_start_bootanim(); // tell me that telnet or http are ready // telnet_console_init(); // mdelay(5000); //httpd_start(); // uart speed patch 115200 - jtag/freeboot // *(volatile uint32_t*)(0xea001000+0x1c) = 0xe6010000; //memset(&Config, 0, sizeof (PcsxConfig)); strcpy(Config.Net, "Disabled"); strcpy(Config.Cdr, "CDR"); strcpy(Config.Gpu, "GPU"); strcpy(Config.Spu, "SPU"); strcpy(Config.Pad1, "PAD1"); strcpy(Config.Pad2, "PAD2"); strcpy(Config.Bios, "SCPH1001.BIN"); // Use actual BIOS //strcpy(Config.Bios, "scph7502.bin"); // Use actual BIOS //strcpy(Config.Bios, "HLE"); // Use HLE strcpy(Config.BiosDir, "sda0:/devkit/pcsxr/bios"); strcpy(Config.PatchesDir, "sda0:/devkit/pcsxr/patches_/"); Config.PsxAuto = 1; // autodetect system Config.Cpu = CPU_DYNAREC; //Config.Cpu = CPU_INTERPRETER; strcpy(Config.Mcd1, "sda0:/devkit/pcsxr/memcards/card1.mcd"); strcpy(Config.Mcd2, "sda0:/devkit/pcsxr/memcards/card2.mcd"); // useSoftGpu(); /* strcpy(Config.Mcd1, "sda:/hdd1/xenon/memcards/card1.mcd"); strcpy(Config.Mcd2, "sda:/hdd1/xenon/memcards/card2.mcd"); */ //InitVideo(); SetIso(cdfile); if (LoadPlugins() == 0) { if (OpenPlugins() == 0) { if (SysInit() == -1) { printf("SysInit() Error!\n"); return -1; } SysReset(); // Check for hle ... if (Config.HLE == 1) { printf("Can't continue ... bios not found ...\r\n"); //exit(0); } CheckCdrom(); LoadCdrom(); psxCpu->Execute(); } } printf("Pcsx exit ...\r\n"); return 0; }