File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
drivers/platform/x86/amd/hfi Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,38 @@ static int amd_hfi_metadata_parser(struct platform_device *pdev,
385
385
return ret ;
386
386
}
387
387
388
+ static int amd_hfi_pm_resume (struct device * dev )
389
+ {
390
+ int ret , cpu ;
391
+
392
+ for_each_online_cpu (cpu ) {
393
+ ret = amd_hfi_set_state (cpu , true);
394
+ if (ret < 0 ) {
395
+ dev_err (dev , "failed to enable workload class config: %d\n" , ret );
396
+ return ret ;
397
+ }
398
+ }
399
+
400
+ return 0 ;
401
+ }
402
+
403
+ static int amd_hfi_pm_suspend (struct device * dev )
404
+ {
405
+ int ret , cpu ;
406
+
407
+ for_each_online_cpu (cpu ) {
408
+ ret = amd_hfi_set_state (cpu , false);
409
+ if (ret < 0 ) {
410
+ dev_err (dev , "failed to disable workload class config: %d\n" , ret );
411
+ return ret ;
412
+ }
413
+ }
414
+
415
+ return 0 ;
416
+ }
417
+
418
+ static DEFINE_SIMPLE_DEV_PM_OPS (amd_hfi_pm_ops , amd_hfi_pm_suspend , amd_hfi_pm_resume ) ;
419
+
388
420
static const struct acpi_device_id amd_hfi_platform_match [] = {
389
421
{"AMDI0104" , 0 },
390
422
{ }
@@ -434,6 +466,7 @@ static struct platform_driver amd_hfi_driver = {
434
466
.driver = {
435
467
.name = AMD_HFI_DRIVER ,
436
468
.owner = THIS_MODULE ,
469
+ .pm = & amd_hfi_pm_ops ,
437
470
.acpi_match_table = ACPI_PTR (amd_hfi_platform_match ),
438
471
},
439
472
.probe = amd_hfi_probe ,
You can’t perform that action at this time.
0 commit comments