Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Bricked
ville
Commits
e3afe24c
Commit
e3afe24c
authored
11 years ago
by
Dennis Rassmann
Browse files
Options
Download
Email Patches
Plain Diff
msm_mpdecision: add sysfs interface for input event boost
Signed-off-by:
Dennis Rassmann
<
showp1984@gmail.com
>
parent
f5d18422
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
3 deletions
+77
-3
arch/arm/mach-msm/msm_mpdecision.c
arch/arm/mach-msm/msm_mpdecision.c
+77
-3
No files found.
arch/arm/mach-msm/msm_mpdecision.c
View file @
e3afe24c
...
...
@@ -115,7 +115,7 @@ static struct msm_mpdec_tuners {
unsigned
int
max_cpus
;
unsigned
int
min_cpus
;
#ifdef CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN
bool
boost_
cpumin_on_input_event
;
bool
boost_
enabled
;
unsigned
int
boost_time
;
unsigned
long
int
boost_freq
[
4
];
#endif
...
...
@@ -128,7 +128,7 @@ static struct msm_mpdec_tuners {
.
max_cpus
=
CONFIG_NR_CPUS
,
.
min_cpus
=
1
,
#ifdef CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN
.
boost_
cpumin_on_input_event
=
true
,
.
boost_
enabled
=
true
,
.
boost_time
=
MSM_MPDEC_BOOSTTIME
,
.
boost_freq
=
{
MSM_MPDEC_BOOSTFREQ_CPU0
,
...
...
@@ -460,7 +460,7 @@ static void mpdec_input_event(struct input_handle *handle, unsigned int type,
unsigned
int
code
,
int
value
)
{
int
i
=
0
;
if
(
!
msm_mpdec_tuners_ins
.
boost_
cpumin_on_input_event
)
if
(
!
msm_mpdec_tuners_ins
.
boost_
enabled
)
return
;
if
(
!
is_screen_on
)
...
...
@@ -612,6 +612,10 @@ show_one(pause, pause);
show_one
(
scroff_single_core
,
scroff_single_core
);
show_one
(
min_cpus
,
min_cpus
);
show_one
(
max_cpus
,
max_cpus
);
#ifdef CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN
show_one
(
boost_enabled
,
boost_enabled
);
show_one
(
boost_time
,
boost_time
);
#endif
#define show_one_twts(file_name, arraypos) \
static ssize_t show_##file_name \
...
...
@@ -871,6 +875,67 @@ static ssize_t store_enabled(struct kobject *a, struct attribute *b,
return
count
;
}
#ifdef CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN
static
ssize_t
store_boost_enabled
(
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
;
msm_mpdec_tuners_ins
.
boost_enabled
=
input
;
return
count
;
}
static
ssize_t
store_boost_time
(
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
;
msm_mpdec_tuners_ins
.
boost_time
=
input
;
return
count
;
}
static
ssize_t
show_boost_freqs
(
struct
kobject
*
a
,
struct
attribute
*
b
,
char
*
buf
)
{
ssize_t
len
=
0
;
int
cpu
=
0
;
for_each_present_cpu
(
cpu
)
{
len
+=
sprintf
(
buf
+
len
,
"%lu
\n
"
,
per_cpu
(
msm_mpdec_cpudata
,
cpu
).
boost_freq
);
}
return
len
;
}
static
ssize_t
store_boost_freqs
(
struct
kobject
*
a
,
struct
attribute
*
b
,
const
char
*
buf
,
size_t
count
)
{
int
i
=
0
;
unsigned
int
cpu
=
0
;
long
unsigned
int
hz
=
0
;
const
char
*
chz
=
NULL
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
buf
[
i
]
==
' '
)
{
sscanf
(
&
buf
[(
i
-
1
)],
"%u"
,
&
cpu
);
chz
=
&
buf
[(
i
+
1
)];
}
}
sscanf
(
chz
,
"%lu"
,
&
hz
);
per_cpu
(
msm_mpdec_cpudata
,
cpu
).
boost_freq
=
hz
;
return
count
;
}
define_one_global_rw
(
boost_freqs
);
#endif
define_one_global_rw
(
startdelay
);
define_one_global_rw
(
delay
);
define_one_global_rw
(
pause
);
...
...
@@ -879,6 +944,10 @@ define_one_global_rw(idle_freq);
define_one_global_rw
(
min_cpus
);
define_one_global_rw
(
max_cpus
);
define_one_global_rw
(
enabled
);
#ifdef CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN
define_one_global_rw
(
boost_enabled
);
define_one_global_rw
(
boost_time
);
#endif
static
struct
attribute
*
msm_mpdec_attributes
[]
=
{
&
startdelay
.
attr
,
...
...
@@ -905,6 +974,11 @@ static struct attribute *msm_mpdec_attributes[] = {
&
nwns_threshold_5
.
attr
,
&
nwns_threshold_6
.
attr
,
&
nwns_threshold_7
.
attr
,
#ifdef CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN
&
boost_freqs
.
attr
,
&
boost_enabled
.
attr
,
&
boost_time
.
attr
,
#endif
NULL
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment