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
a283781b
Commit
a283781b
authored
Sep 27, 2022
by
Hans de Goede
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'platform-drivers-x86-amd-pmf' into review-hans
parents
9732f9c7
22ee98cb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
16 deletions
+24
-16
drivers/platform/x86/amd/pmf/acpi.c
drivers/platform/x86/amd/pmf/acpi.c
+22
-16
drivers/platform/x86/amd/pmf/core.c
drivers/platform/x86/amd/pmf/core.c
+1
-0
drivers/platform/x86/amd/pmf/pmf.h
drivers/platform/x86/amd/pmf/pmf.h
+1
-0
No files found.
drivers/platform/x86/amd/pmf/acpi.c
View file @
a283781b
...
@@ -243,6 +243,28 @@ int apmf_get_dyn_slider_def_dc(struct amd_pmf_dev *pdev, struct apmf_dyn_slider_
...
@@ -243,6 +243,28 @@ int apmf_get_dyn_slider_def_dc(struct amd_pmf_dev *pdev, struct apmf_dyn_slider_
return
apmf_if_call_store_buffer
(
pdev
,
APMF_FUNC_DYN_SLIDER_DC
,
data
,
sizeof
(
*
data
));
return
apmf_if_call_store_buffer
(
pdev
,
APMF_FUNC_DYN_SLIDER_DC
,
data
,
sizeof
(
*
data
));
}
}
int
apmf_install_handler
(
struct
amd_pmf_dev
*
pmf_dev
)
{
acpi_handle
ahandle
=
ACPI_HANDLE
(
pmf_dev
->
dev
);
acpi_status
status
;
/* Install the APMF Notify handler */
if
(
is_apmf_func_supported
(
pmf_dev
,
APMF_FUNC_AUTO_MODE
)
&&
is_apmf_func_supported
(
pmf_dev
,
APMF_FUNC_SBIOS_REQUESTS
))
{
status
=
acpi_install_notify_handler
(
ahandle
,
ACPI_ALL_NOTIFY
,
apmf_event_handler
,
pmf_dev
);
if
(
ACPI_FAILURE
(
status
))
{
dev_err
(
pmf_dev
->
dev
,
"failed to install notify handler
\n
"
);
return
-
ENODEV
;
}
/* Call the handler once manually to catch up with possibly missed notifies. */
apmf_event_handler
(
ahandle
,
0
,
pmf_dev
);
}
return
0
;
}
void
apmf_acpi_deinit
(
struct
amd_pmf_dev
*
pmf_dev
)
void
apmf_acpi_deinit
(
struct
amd_pmf_dev
*
pmf_dev
)
{
{
acpi_handle
ahandle
=
ACPI_HANDLE
(
pmf_dev
->
dev
);
acpi_handle
ahandle
=
ACPI_HANDLE
(
pmf_dev
->
dev
);
...
@@ -257,8 +279,6 @@ void apmf_acpi_deinit(struct amd_pmf_dev *pmf_dev)
...
@@ -257,8 +279,6 @@ void apmf_acpi_deinit(struct amd_pmf_dev *pmf_dev)
int
apmf_acpi_init
(
struct
amd_pmf_dev
*
pmf_dev
)
int
apmf_acpi_init
(
struct
amd_pmf_dev
*
pmf_dev
)
{
{
acpi_handle
ahandle
=
ACPI_HANDLE
(
pmf_dev
->
dev
);
acpi_status
status
;
int
ret
;
int
ret
;
ret
=
apmf_if_verify_interface
(
pmf_dev
);
ret
=
apmf_if_verify_interface
(
pmf_dev
);
...
@@ -279,20 +299,6 @@ int apmf_acpi_init(struct amd_pmf_dev *pmf_dev)
...
@@ -279,20 +299,6 @@ int apmf_acpi_init(struct amd_pmf_dev *pmf_dev)
schedule_delayed_work
(
&
pmf_dev
->
heart_beat
,
0
);
schedule_delayed_work
(
&
pmf_dev
->
heart_beat
,
0
);
}
}
/* Install the APMF Notify handler */
if
(
is_apmf_func_supported
(
pmf_dev
,
APMF_FUNC_AUTO_MODE
)
&&
is_apmf_func_supported
(
pmf_dev
,
APMF_FUNC_SBIOS_REQUESTS
))
{
status
=
acpi_install_notify_handler
(
ahandle
,
ACPI_ALL_NOTIFY
,
apmf_event_handler
,
pmf_dev
);
if
(
ACPI_FAILURE
(
status
))
{
dev_err
(
pmf_dev
->
dev
,
"failed to install notify handler
\n
"
);
return
-
ENODEV
;
}
/* Call the handler once manually to catch up with possibly missed notifies. */
apmf_event_handler
(
ahandle
,
0
,
pmf_dev
);
}
out:
out:
return
ret
;
return
ret
;
}
}
drivers/platform/x86/amd/pmf/core.c
View file @
a283781b
...
@@ -369,6 +369,7 @@ static int amd_pmf_probe(struct platform_device *pdev)
...
@@ -369,6 +369,7 @@ static int amd_pmf_probe(struct platform_device *pdev)
apmf_acpi_init
(
dev
);
apmf_acpi_init
(
dev
);
platform_set_drvdata
(
pdev
,
dev
);
platform_set_drvdata
(
pdev
,
dev
);
amd_pmf_init_features
(
dev
);
amd_pmf_init_features
(
dev
);
apmf_install_handler
(
dev
);
amd_pmf_dbgfs_register
(
dev
);
amd_pmf_dbgfs_register
(
dev
);
mutex_init
(
&
dev
->
lock
);
mutex_init
(
&
dev
->
lock
);
...
...
drivers/platform/x86/amd/pmf/pmf.h
View file @
a283781b
...
@@ -381,6 +381,7 @@ int is_apmf_func_supported(struct amd_pmf_dev *pdev, unsigned long index);
...
@@ -381,6 +381,7 @@ int is_apmf_func_supported(struct amd_pmf_dev *pdev, unsigned long index);
int
amd_pmf_send_cmd
(
struct
amd_pmf_dev
*
dev
,
u8
message
,
bool
get
,
u32
arg
,
u32
*
data
);
int
amd_pmf_send_cmd
(
struct
amd_pmf_dev
*
dev
,
u8
message
,
bool
get
,
u32
arg
,
u32
*
data
);
int
amd_pmf_init_metrics_table
(
struct
amd_pmf_dev
*
dev
);
int
amd_pmf_init_metrics_table
(
struct
amd_pmf_dev
*
dev
);
int
amd_pmf_get_power_source
(
void
);
int
amd_pmf_get_power_source
(
void
);
int
apmf_install_handler
(
struct
amd_pmf_dev
*
pmf_dev
);
/* SPS Layer */
/* SPS Layer */
int
amd_pmf_get_pprof_modes
(
struct
amd_pmf_dev
*
pmf
);
int
amd_pmf_get_pprof_modes
(
struct
amd_pmf_dev
*
pmf
);
...
...
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