If we are talking about jailbreak then you can write a SpringBoard tweak that does this (iOS 7 only)
[[objc_getClass("SBBacklightController") sharedInstance] turnOnScreenFullyWithBacklightSource:0];
[[objc_getClass("SBLockScreenManager") sharedInstance] unlockUIFromSource:0 withOptions:nil];
Without passcode lock the code will turn on the screen and unlock the device. With passcode it will turn on the screen and request passcode.