#!/system/bin/sh
#
# Set the UnderVolt for the Cor Plenus v2.1 4 frequencies
#
# Author:
#	Michelasso @ androidiani.com
#	Miche1asso @ xda
#
# Version 1.02

log -p i -t setUV "Starting setUV"

# Define here the UV mode you want to choose
# Values are CUSTOM, STOCK, MEDIUM, LOW. NONE as default
UV_MODE=STOCK

case $UV_MODE in
# CUSTOM: Define your values in here changing the current ones.
# Uncomment the line removing the leading "#" before "echo"
"CUSTOM")
#	echo 1360 1320 1280 1240 > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
	log -p d -t setUV "CUSTOM Volting selected"
	;;
# STOCK: Stock voltages adapted to the new frequencies
"STOCK")
	echo 1360 1320 1280 1240 > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
	log -p d -t setUV "STOCK Volting selected"
	;;
# MEDIUM: as the label says
"MEDIUM")
	echo 1300 1280 1240 1200 > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
	log -p d -t setUV "MEDIUM Volting selected"
	;;
# LOW: tested with Italian USIM 3
"LOW")
	echo 1240 1200 1160 1120 > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
	log -p d -t setUV "LOW Volting selected"
	;;
"NONE"|*)
	log -p d -t setUV "No UnderVolting selected"
	;;
esac

log -p i -t setUV "Current Voltages are:"
log -p i -t setUV "$(cat /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table)"

log -p i -t setUV "setUV ended"

