linux
linux copied to clipboard
cpuidle support
Came across this while searching through vendor kernel for audio info and noticed it wasn't upstream.
Should be fairly easy to add, implementation for 3.0 present at https://github.com/xc-racer99/android_kernel_samsung_aries/blob/cm-10.1/arch/arm/mach-s5pv210/cpuidle.c
Would need to adjust it for current cpuidle interface as well as moving it to drivers/soc/samsung. Should probably use the pmu_syscon phandle and an offset to obtain the S5P_IDLE_CFG and S5P_PWR_CFG registers.
Note the above driver doesn't have anything beyond the basic idle state (ie no deep idle/stop/deep stop), although more states could be added in the future if desired (deep idle is the only one useful in my opinion and that would only be for music playback).
Work done on for-upstream/cpuidle Tested by checking /sys/devices/system/cpu/cpu0/cpuidle/state0/usage and it looks like it's working. Not sure if it should be in dts (we need pmu_syscon access) - other drivers are probed from board files.
It looks like upstream won't accept new cpuidle driver (which handles only WFI state). Tried to go with cpuidle-arm but it's mostly used for arm64. We should extend current exynos cpuidle driver.