#define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
#define MIN_FREQUENCY_UP_THRESHOLD (11)
#define MAX_FREQUENCY_UP_THRESHOLD (100)
+#define MAX_FREQUENCY_DOWN_DIFFERENTIAL (30)
+#define MIN_FREQUENCY_DOWN_DIFFERENTIAL MICRO_FREQUENCY_DOWN_DIFFERENTIAL
/*
* The polling frequency of this governor depends on the capability of
show_one(sampling_down_factor, sampling_down_factor);
show_one(ignore_nice_load, ignore_nice);
show_one(powersave_bias, powersave_bias);
+show_one(down_differential, down_differential);
static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
return count;
}
+static ssize_t store_down_differential(struct kobject *a, struct attribute *b,
+ const char *buf, size_t count)
+{
+ unsigned int input;
+ int ret = sscanf(buf, "%u", &input);
+
+ if (ret != 1 || input < MIN_FREQUENCY_DOWN_DIFFERENTIAL ||
+ input > MAX_FREQUENCY_DOWN_DIFFERENTIAL ||
+ input >= dbs_tuners_ins.up_threshold) {
+ return -EINVAL;
+ }
+
+ mutex_lock(&dbs_mutex);
+ dbs_tuners_ins.down_differential = input;
+ mutex_unlock(&dbs_mutex);
+
+ return count;
+}
+
static ssize_t store_up_threshold(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
define_one_global_rw(sampling_down_factor);
define_one_global_rw(ignore_nice_load);
define_one_global_rw(powersave_bias);
+define_one_global_rw(down_differential);
static struct attribute *dbs_attributes[] = {
&sampling_rate_min.attr,
&sampling_rate.attr,
&up_threshold.attr,
&sampling_down_factor.attr,
+ &down_differential.attr,
&ignore_nice_load.attr,
&powersave_bias.attr,
&io_is_busy.attr,