Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3f9ce024
Commit
3f9ce024
authored
Jul 31, 2023
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge back new thermal control material for v6.6.
parents
ac4436a5
e49c8ed8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+22
-22
No files found.
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
View file @
3f9ce024
...
...
@@ -15,6 +15,7 @@
#define INT3400_THERMAL_TABLE_CHANGED 0x83
#define INT3400_ODVP_CHANGED 0x88
#define INT3400_KEEP_ALIVE 0xA0
#define INT3400_FAKE_TEMP (20 * 1000)
/* faked temp sensor with 20C */
enum
int3400_thermal_uuid
{
INT3400_THERMAL_ACTIVE
=
0
,
...
...
@@ -453,6 +454,7 @@ static void int3400_notify(acpi_handle handle,
void
*
data
)
{
struct
int3400_thermal_priv
*
priv
=
data
;
struct
device
*
dev
;
char
*
thermal_prop
[
5
];
int
therm_event
;
...
...
@@ -475,12 +477,14 @@ static void int3400_notify(acpi_handle handle,
return
;
}
thermal_prop
[
0
]
=
kasprintf
(
GFP_KERNEL
,
"NAME=%s"
,
priv
->
thermal
->
type
);
thermal_prop
[
1
]
=
kasprintf
(
GFP_KERNEL
,
"TEMP=%d"
,
priv
->
thermal
->
temperature
);
dev
=
thermal_zone_device
(
priv
->
thermal
);
thermal_prop
[
0
]
=
kasprintf
(
GFP_KERNEL
,
"NAME=%s"
,
thermal_zone_device_type
(
priv
->
thermal
));
thermal_prop
[
1
]
=
kasprintf
(
GFP_KERNEL
,
"TEMP=%d"
,
INT3400_FAKE_TEMP
);
thermal_prop
[
2
]
=
kasprintf
(
GFP_KERNEL
,
"TRIP="
);
thermal_prop
[
3
]
=
kasprintf
(
GFP_KERNEL
,
"EVENT=%d"
,
therm_event
);
thermal_prop
[
4
]
=
NULL
;
kobject_uevent_env
(
&
priv
->
thermal
->
device
.
kobj
,
KOBJ_CHANGE
,
thermal_prop
);
kobject_uevent_env
(
&
dev
->
kobj
,
KOBJ_CHANGE
,
thermal_prop
);
kfree
(
thermal_prop
[
0
]);
kfree
(
thermal_prop
[
1
]);
kfree
(
thermal_prop
[
2
]);
...
...
@@ -490,7 +494,7 @@ static void int3400_notify(acpi_handle handle,
static
int
int3400_thermal_get_temp
(
struct
thermal_zone_device
*
thermal
,
int
*
temp
)
{
*
temp
=
20
*
1000
;
/* faked temp sensor with 20C */
*
temp
=
INT3400_FAKE_TEMP
;
return
0
;
}
...
...
@@ -499,32 +503,28 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
{
struct
int3400_thermal_priv
*
priv
=
thermal_zone_device_priv
(
thermal
);
int
result
=
0
;
int
enabled
;
if
(
!
priv
)
return
-
EINVAL
;
if
(
mode
!=
thermal
->
mode
)
{
int
enabled
;
enabled
=
mode
==
THERMAL_DEVICE_ENABLED
;
enabled
=
mode
==
THERMAL_DEVICE_ENABLED
;
if
(
priv
->
os_uuid_mask
)
{
if
(
!
enabled
)
{
priv
->
os_uuid_mask
=
0
;
result
=
set_os_uuid_mask
(
priv
,
priv
->
os_uuid_mask
);
}
goto
eval_odvp
;
if
(
priv
->
os_uuid_mask
)
{
if
(
!
enabled
)
{
priv
->
os_uuid_mask
=
0
;
result
=
set_os_uuid_mask
(
priv
,
priv
->
os_uuid_mask
);
}
if
(
priv
->
current_uuid_index
<
0
||
priv
->
current_uuid_index
>=
INT3400_THERMAL_MAXIMUM_UUID
)
return
-
EINVAL
;
result
=
int3400_thermal_run_osc
(
priv
->
adev
->
handle
,
int3400_thermal_uuids
[
priv
->
current_uuid_index
],
&
enabled
);
goto
eval_odvp
;
}
if
(
priv
->
current_uuid_index
<
0
||
priv
->
current_uuid_index
>=
INT3400_THERMAL_MAXIMUM_UUID
)
return
-
EINVAL
;
result
=
int3400_thermal_run_osc
(
priv
->
adev
->
handle
,
int3400_thermal_uuids
[
priv
->
current_uuid_index
],
&
enabled
);
eval_odvp:
evaluate_odvp
(
priv
);
...
...
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