diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/msi-laptop.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index ff21d1acf3be..af1b62f76117 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c | |||
@@ -77,6 +77,8 @@ | |||
77 | #define MSI_STANDARD_EC_SCM_LOAD_ADDRESS 0x2d | 77 | #define MSI_STANDARD_EC_SCM_LOAD_ADDRESS 0x2d |
78 | #define MSI_STANDARD_EC_SCM_LOAD_MASK (1 << 0) | 78 | #define MSI_STANDARD_EC_SCM_LOAD_MASK (1 << 0) |
79 | 79 | ||
80 | static int msi_laptop_resume(struct platform_device *device); | ||
81 | |||
80 | static int force; | 82 | static int force; |
81 | module_param(force, bool, 0); | 83 | module_param(force, bool, 0); |
82 | MODULE_PARM_DESC(force, "Force driver load, ignore DMI data"); | 84 | MODULE_PARM_DESC(force, "Force driver load, ignore DMI data"); |
@@ -395,7 +397,8 @@ static struct platform_driver msipf_driver = { | |||
395 | .driver = { | 397 | .driver = { |
396 | .name = "msi-laptop-pf", | 398 | .name = "msi-laptop-pf", |
397 | .owner = THIS_MODULE, | 399 | .owner = THIS_MODULE, |
398 | } | 400 | }, |
401 | .resume = msi_laptop_resume, | ||
399 | }; | 402 | }; |
400 | 403 | ||
401 | static struct platform_device *msipf_device; | 404 | static struct platform_device *msipf_device; |
@@ -584,6 +587,27 @@ err_bluetooth: | |||
584 | return retval; | 587 | return retval; |
585 | } | 588 | } |
586 | 589 | ||
590 | static int msi_laptop_resume(struct platform_device *device) | ||
591 | { | ||
592 | u8 data; | ||
593 | int result; | ||
594 | |||
595 | if (!load_scm_model) | ||
596 | return 0; | ||
597 | |||
598 | /* set load SCM to disable hardware control by fn key */ | ||
599 | result = ec_read(MSI_STANDARD_EC_SCM_LOAD_ADDRESS, &data); | ||
600 | if (result < 0) | ||
601 | return result; | ||
602 | |||
603 | result = ec_write(MSI_STANDARD_EC_SCM_LOAD_ADDRESS, | ||
604 | data | MSI_STANDARD_EC_SCM_LOAD_MASK); | ||
605 | if (result < 0) | ||
606 | return result; | ||
607 | |||
608 | return 0; | ||
609 | } | ||
610 | |||
587 | static int load_scm_model_init(struct platform_device *sdev) | 611 | static int load_scm_model_init(struct platform_device *sdev) |
588 | { | 612 | { |
589 | u8 data; | 613 | u8 data; |