@ -376,9 +376,13 @@ local KoboStorm = Kobo:extend{
} ,
-- NOTE: The Libra apparently suffers from a mysterious issue where completely innocuous WAIT_FOR_UPDATE_COMPLETE ioctls
-- will mysteriously fail with a timeout (5s)...
-- This obviously leads to *terrible* user experience, so, until more is understood about the issue,
-- bypass this ioctl on this device.
-- c.f., https://github.com/koreader/koreader/issues/7340
-- This obviously leads to *terrible* user experience,
-- so we've tried a few things over the years to attempt to deal with it.
-- c.f., https://github.com/koreader/koreader/issues/7340 for the genesis of all that.
-- NOTE: On a possibly related note, on NXP devices (even earlier ones), Nickel will *always* wait for markers in pairs:
-- the "expected" marker to wait for, and the *previous* one right before that.
-- Of course, that first wait will mostly always return early, because that refresh is usually much older and already dealt with.
-- This weird quirk was dropped on sunxi & MTK, FWIW.
hasReliableMxcWaitFor = no ,
}
@ -495,7 +499,7 @@ local KoboGoldfinch = Kobo:extend{
} ,
battery_sysfs = " /sys/class/power_supply/battery " ,
power_dev = " /dev/input/by-path/platform-bd71828-pwrkey-event " ,
-- Board is eerily similar to the Libra 2, which, unfortunately, means it's also buggy as hell ...
-- Board is eerily similar to the Libra 2, so, it inherits the same quirks ...
-- c.f., https://github.com/koreader/koreader/issues/9552#issuecomment-1293000313
hasReliableMxcWaitFor = no ,
}
@ -611,7 +615,7 @@ function Kobo:init()
-- No getter, so, keep track of our own state
self.hw_night_mode = toggle
-- Flip the global invert_fb flag
u til.writeToSysfs( toggle and " night_mode 4 " or " night_mode 0 " , " /proc/hwtcon/cmd " )
ffiU til.writeToSysfs( toggle and " night_mode 4 " or " night_mode 0 " , " /proc/hwtcon/cmd " )
end
function self . screen : getHWNightmode ( )
@ -1109,7 +1113,7 @@ function Kobo:standby(max_duration)
logger.dbg ( " Kobo standby: asking to enter standby . . . " )
local standby_time = time.boottime_or_realtime_coarse ( )
local ret = u til.writeToSysfs( " standby " , " /sys/power/state " )
local ret = ffiU til.writeToSysfs( " standby " , " /sys/power/state " )
self.last_standby_time = time.boottime_or_realtime_coarse ( ) - standby_time
self.total_standby_time = self.total_standby_time + self.last_standby_time
@ -1185,7 +1189,7 @@ function Kobo:suspend()
-- NOTE: Sets gSleep_Mode_Suspend to 1. Used as a flag throughout the
-- kernel to suspend/resume various subsystems
-- c.f., state_extended_store @ kernel/power/main.c
local ret = u til.writeToSysfs( " 1 " , " /sys/power/state-extended " )
local ret = ffiU til.writeToSysfs( " 1 " , " /sys/power/state-extended " )
if ret then
logger.dbg ( " Kobo suspend: successfully asked the kernel to put subsystems to sleep " )
else
@ -1219,7 +1223,7 @@ function Kobo:suspend()
logger.dbg ( " Kobo suspend: asking for a suspend to RAM . . . " )
local suspend_time = time.boottime_or_realtime_coarse ( )
ret = u til.writeToSysfs( " mem " , " /sys/power/state " )
ret = ffiU til.writeToSysfs( " mem " , " /sys/power/state " )
-- NOTE: At this point, we *should* be in suspend to RAM, as such,
-- execution should only resume on wakeup...
@ -1234,7 +1238,7 @@ function Kobo:suspend()
else
logger.warn ( " Kobo suspend: the kernel refused to enter suspend! " )
-- Reset state-extended back to 0 since we are giving up.
u til.writeToSysfs( " 0 " , " /sys/power/state-extended " )
ffiU til.writeToSysfs( " 0 " , " /sys/power/state-extended " )
if G_reader_settings : isTrue ( " pm_debug_entry_failure " ) then
self : toggleChargingLED ( true )
end
@ -1283,7 +1287,7 @@ function Kobo:resume()
-- kernel to suspend/resume various subsystems
-- cf. kernel/power/main.c @ L#207
-- Among other things, this sets up the wakeup pins (e.g., resume on input).
local ret = u til.writeToSysfs( " 0 " , " /sys/power/state-extended " )
local ret = ffiU til.writeToSysfs( " 0 " , " /sys/power/state-extended " )
if ret then
logger.dbg ( " Kobo resume: successfully asked the kernel to resume subsystems " )
else
@ -1299,7 +1303,7 @@ function Kobo:resume()
-- c.f., neo_ctl @ drivers/input/touchscreen/zforce_i2c.c,
-- basically, a is wakeup (for activate), d is sleep (for deactivate), and we don't care about s (set res),
-- and l (led signal level, actually a NOP on NTX kernels).
u til.writeToSysfs( " a " , self.hasIRGridSysfsKnob )
ffiU til.writeToSysfs( " a " , self.hasIRGridSysfsKnob )
end
-- A full suspend may have toggled the LED off.
@ -1373,7 +1377,7 @@ function Kobo:_NTXChargingLEDToggle(toggle)
end
function Kobo : _LinuxChargingLEDToggle ( toggle )
u til.writeToSysfs( toggle and " 1 " or " 0 " , self.charging_led_sysfs_knob )
ffiU til.writeToSysfs( toggle and " 1 " or " 0 " , self.charging_led_sysfs_knob )
end
function Kobo : toggleChargingLED ( toggle )
@ -1421,16 +1425,16 @@ function Kobo:enableCPUCores(amount)
up = " 1 "
end
u til.writeToSysfs( up , path )
ffiU til.writeToSysfs( up , path )
end
end
function Kobo : performanceCPUGovernor ( )
u til.writeToSysfs( " performance " , self.cpu_governor_knob )
ffiU til.writeToSysfs( " performance " , self.cpu_governor_knob )
end
function Kobo : defaultCPUGovernor ( )
u til.writeToSysfs( self.default_cpu_governor , self.cpu_governor_knob )
ffiU til.writeToSysfs( self.default_cpu_governor , self.cpu_governor_knob )
end
function Kobo : isStartupScriptUpToDate ( )