Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 13 changed files with 547 additions and 21 deletions.
4 changes: 4 additions & 0 deletions arch/arm64/configs/exynos9810-crownlte_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4674,6 +4674,10 @@ CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG=y
# CONFIG_ARM_EXYNOS_BUS_DEVFREQ is not set
# CONFIG_PM_DEVFREQ_EVENT is not set
CONFIG_ARM_EXYNOS9810_BUS_DEVFREQ=y
CONFIG_DEVFREQ_BOOST=y
CONFIG_DEVFREQ_INPUT_BOOST_DURATION_MS=100
CONFIG_DEVFREQ_WAKE_BOOST_DURATION_MS=1000
CONFIG_DEVFREQ_EXYNOS_MIF_BOOST_FREQ=1014000
CONFIG_EXTCON=y

#
Expand Down
33 changes: 33 additions & 0 deletions drivers/devfreq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,37 @@ config ARM_EXYNOS8890_BUS_DEVFREQ
help
This adds the DEVFREQ driver for Exynos8890 memory and int.

config DEVFREQ_BOOST
bool "Devfreq Boost"
help
Boosts enumerated devfreq devices upon input, and allows for boosting
specific devfreq devices on other custom events. The boost frequencies
for this driver should be set so that frame drops are near-zero at the
boosted frequencies and power consumption is minimized at said
frequencies. The goal of this driver is to provide an interface to
achieve optimal device performance by requesting boosts on key events,
such as when a frame is ready to rendered to the display.

if DEVFREQ_BOOST

config DEVFREQ_INPUT_BOOST_DURATION_MS
int "Input boost duration"
default "100"
help
Input boost duration in milliseconds for all boostable devices.

config DEVFREQ_WAKE_BOOST_DURATION_MS
int "Wake boost duration"
default "1000"
help
Wake boost duration in milliseconds for all boostable devices.

config DEVFREQ_EXYNOS_MIF_BOOST_FREQ
int "Boost freq for Exynos MIF device"
default "0"
help
Boost frequency for the Exynos MIF (DDR) bus.

endif

endif # PM_DEVFREQ
3 changes: 3 additions & 0 deletions drivers/devfreq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra-devfreq.o
# DEVFREQ Event Drivers
obj-$(CONFIG_PM_DEVFREQ_EVENT) += event/
obj-$(CONFIG_ARM_EXYNOS_DEVFREQ) += exynos/

# DEVFREQ Boost
obj-$(CONFIG_DEVFREQ_BOOST) += devfreq_boost.o
16 changes: 12 additions & 4 deletions drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,15 @@ int update_devfreq(struct devfreq *devfreq)
if (!devfreq->governor)
return -EINVAL;

/* Reevaluate the proper frequency */
err = devfreq->governor->get_target_freq(devfreq, &freq);
if (err)
return err;
if (devfreq->max_boost) {
/* Use the max freq for max boosts */
freq = ULONG_MAX;
} else {
/* Reevaluate the proper frequency */
err = devfreq->governor->get_target_freq(devfreq, &freq);
if (err)
return err;
}

#if defined(CONFIG_EXYNOS_DVFS_MANAGER)
err = find_exynos_devfreq_dm_type(devfreq->dev.parent, &dm_type);
Expand Down Expand Up @@ -1181,6 +1186,9 @@ static ssize_t polling_interval_store(struct device *dev,

if (!df->governor)
return -EINVAL;
/* Minfreq is managed by devfreq_boost */
if (df->is_boost_device)
return count;

ret = sscanf(buf, "%u", &value);
if (ret != 1)
Expand Down
Loading

0 comments on commit bfbd348

Please sign in to comment.