[HTC One S] Zarboz:
if you dont understand sysfs and contents thereof the folders are pointless

there is a code inside the governor....

static int cpufreq_governor_smartass(struct cpufreq_policy *new_policy,
unsigned int event)
{
unsigned int cpu = new_policy->cpu;
int rc;
struct smartass_info_s *this_smartass = &per_cpu(smartass_info, cpu);

switch (event) {
case CPUFREQ_GOV_START:
if ((!cpu_online(cpu)) || (!new_policy->cur))
return -EINVAL;

/*
* Do not register the idle hook and create sysfs
* entries if we have already done so.
*/
if (atomic_inc_return(&active_count) <= 1) {
rc = sysfs_create_group(&new_policy->kobj, &smartass_attr_group);
if (rc)
return rc;
pm_idle_old = pm_idle;
pm_idle = cpufreq_idle;
}

this_smartass->smartass_power_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 5;
this_smartass->smartass_power_suspend.suspend = smartass_early_suspend;
this_smartass->smartass_power_suspend.resume = smartass_late_resume;
register_early_suspend(&this_smartass->smartass_power_suspend);

this_smartass->cur_policy = new_policy;
this_smartass->enable = 1;

break;

case CPUFREQ_GOV_STOP:
del_timer(&this_smartass->timer);
this_smartass->enable = 0;

if (atomic_dec_return(&active_count) > 1)
return 0;
sysfs_remove_group(&new_policy->kobj,
&smartass_attr_group);

unregister_early_suspend(&this_smartass->smartass_power_suspend);

pm_idle = pm_idle_old;
break;

case CPUFREQ_GOV_LIMITS:
if (new_policy->max < new_policy->cur)
__cpufreq_driver_target(new_policy,
new_policy->max, CPUFREQ_RELATION_H);
else if (new_policy->min > new_policy->cur)
__cpufreq_driver_target(new_policy,
new_policy->min, CPUFREQ_RELATION_L);
break;
}

return 0;
}

this will spawn the sys folder you are referring to and populate it with the "cahces" or storage files for predetermined definitions set initially when declaring it in the .c file before compilation

this lets you do neat things like.... use setcpu / systemtuner to alter governor behavior. Such as Up Ramp. Sampling Ticks. Powersave Bias etc... watever items have been declared into the sys folder by the actual module

and again for ondemand

/************************** sysfs interface ************************/

static ssize_t show_sampling_rate_min(struct kobject *kobj,
struct attribute *attr, char *buf)
{
return sprintf(buf, "%u\n", min_sampling_rate);
}

define_one_global_ro(sampling_rate_min);

/* cpufreq_ondemand Governor Tunables */
#define show_one(file_name, object)	\
static ssize_t show_##file_name	\
(struct kobject *kobj, struct attribute *attr, char *buf) \
{	\
return sprintf(buf, "%u\n", dbs_tuners_ins.object);	\
}
show_one(sampling_rate, sampling_rate);
show_one(io_is_busy, io_is_busy);
show_one(up_threshold, up_threshold);
show_one(down_differential, down_differential);
show_one(sampling_down_factor, sampling_down_factor);
show_one(ignore_nice_load, ignore_nice);
#ifdef CONFIG_CPU_FREQ_GOV_ONDEMAND_2_PHASE
show_one(two_phase_freq, two_phase_freq);
#endif

static ssize_t show_powersave_bias
(struct kobject *kobj, struct attribute *attr, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", dbs_tuners_ins.powersave_bias);
}

static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate);
return count;
}

#ifdef CONFIG_CPU_FREQ_GOV_ONDEMAND_2_PHASE
static ssize_t store_two_phase_freq(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;

dbs_tuners_ins.two_phase_freq = input;

return count;
}
#endif

static ssize_t store_io_is_busy(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;

ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
dbs_tuners_ins.io_is_busy = !!input;
return count;
}

static ssize_t store_up_threshold(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);

if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
input < MIN_FREQUENCY_UP_THRESHOLD) {
return -EINVAL;
}
dbs_tuners_ins.up_threshold = input;
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;
ret = sscanf(buf, "%u", &input);

if (ret != 1 || input >= dbs_tuners_ins.up_threshold ||
input < MIN_FREQUENCY_DOWN_DIFFERENTIAL) {
return -EINVAL;
}

dbs_tuners_ins.down_differential = input;

return count;
}

static ssize_t store_sampling_down_factor(struct kobject *a,
struct attribute *b, const char *buf, size_t count)
{
unsigned int input, j;
int ret;
ret = sscanf(buf, "%u", &input);

if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1)
return -EINVAL;
dbs_tuners_ins.sampling_down_factor = input;

/* Reset down sampling multiplier in case it was active */
for_each_online_cpu(j) {
struct cpu_dbs_info_s *dbs_info;
dbs_info = &per_cpu(od_cpu_dbs_info, j);
dbs_info->rate_mult = 1;
}
return count;
}

static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;

unsigned int j;

ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;

if (input > 1)
input = 1;

if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */
return count;
}
dbs_tuners_ins.ignore_nice = input;

/* we need to re-evaluate prev_cpu_idle */
for_each_online_cpu(j) {
struct cpu_dbs_info_s *dbs_info;
dbs_info = &per_cpu(od_cpu_dbs_info, j);
dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
&dbs_info->prev_cpu_wall);
if (dbs_tuners_ins.ignore_nice)
dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice;

}
return count;
}

static ssize_t store_powersave_bias(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
int input = 0;
int bypass = 0;
int ret, cpu, reenable_timer;
struct cpu_dbs_info_s *dbs_info;

ret = sscanf(buf, "%d", &input);

if (ret != 1)
return -EINVAL;

if (input >= POWERSAVE_BIAS_MAXLEVEL) {
input = POWERSAVE_BIAS_MAXLEVEL;
bypass = 1;
} else if (input <= POWERSAVE_BIAS_MINLEVEL) {
input = POWERSAVE_BIAS_MINLEVEL;
bypass = 1;
}

if (input == dbs_tuners_ins.powersave_bias) {
/* no change */
return count;
}

reenable_timer = ((dbs_tuners_ins.powersave_bias ==
POWERSAVE_BIAS_MAXLEVEL) ||
(dbs_tuners_ins.powersave_bias ==
POWERSAVE_BIAS_MINLEVEL));

dbs_tuners_ins.powersave_bias = input;
if (!bypass) {
if (reenable_timer) {
/* reinstate dbs timer */
for_each_online_cpu(cpu) {
if (lock_policy_rwsem_write(cpu) < 0)
continue;

dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
if (dbs_info->cur_policy) {
/* restart dbs timer */
dbs_timer_init(dbs_info);
}
unlock_policy_rwsem_write(cpu);
}
}
ondemand_powersave_bias_init();
} else {
/* running at maximum or minimum frequencies; cancel
dbs timer as periodic load sampling is not necessary */
for_each_online_cpu(cpu) {
if (lock_policy_rwsem_write(cpu) < 0)
continue;

dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
if (dbs_info->cur_policy) {
/* cpu using ondemand, cancel dbs timer */
mutex_lock(&dbs_info->timer_mutex);
dbs_timer_exit(dbs_info);

ondemand_powersave_bias_setspeed(
dbs_info->cur_policy,
NULL,
input);

mutex_unlock(&dbs_info->timer_mutex);
}
unlock_policy_rwsem_write(cpu);
}
}

return count;
}

define_one_global_rw(sampling_rate);
define_one_global_rw(io_is_busy);
define_one_global_rw(up_threshold);
define_one_global_rw(down_differential);
define_one_global_rw(sampling_down_factor);
define_one_global_rw(ignore_nice_load);
define_one_global_rw(powersave_bias);
#ifdef CONFIG_CPU_FREQ_GOV_ONDEMAND_2_PHASE
define_one_global_rw(two_phase_freq);
#endif

static struct attribute *dbs_attributes[] = {
&sampling_rate_min.attr,
&sampling_rate.attr,
&up_threshold.attr,
&down_differential.attr,
&sampling_down_factor.attr,
&ignore_nice_load.attr,
&powersave_bias.attr,
&io_is_busy.attr,
#ifdef CONFIG_CPU_FREQ_GOV_ONDEMAND_2_PHASE
&two_phase_freq.attr,
#endif
NULL
};

static struct attribute_group dbs_attr_group = {
.attrs = dbs_attributes,
.name = "ondemand",
};

/************************** sysfs end ************************/

you will also notice when sweep2wake comes into play for our device it has a sys fs as well in android_touchscreen

it will be sweep2wake

when the file contains an 0 sweep2wake is off.. when file contains 1 sweep2wake is on with backlights when file contains 2 sweep2wake is on without backlight

its a way of registering a system stored flag that is only altered by the kernel for use by the kernel in reference to kernel releated functions and tuning