mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
HID: amd_sfh: Add support for shutdown operation
[ Upstream commit1353ecaf18] As soon as the system is booted after shutdown, the sensors may remain in a weird state and fail to initialize. Therefore, all sensors should be turned off during shutdown. Fixes:4f567b9f81("SFH: PCIe driver to add support of AMD sensor fusion hub") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b711dd0ba9
commit
db6f1b2bba
@@ -351,6 +351,14 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
|
||||
}
|
||||
|
||||
static void amd_sfh_shutdown(struct pci_dev *pdev)
|
||||
{
|
||||
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
|
||||
|
||||
if (mp2 && mp2->mp2_ops)
|
||||
mp2->mp2_ops->stop_all(mp2);
|
||||
}
|
||||
|
||||
static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
@@ -420,6 +428,7 @@ static struct pci_driver amd_mp2_pci_driver = {
|
||||
.id_table = amd_mp2_pci_tbl,
|
||||
.probe = amd_mp2_pci_probe,
|
||||
.driver.pm = &amd_mp2_pm_ops,
|
||||
.shutdown = amd_sfh_shutdown,
|
||||
};
|
||||
module_pci_driver(amd_mp2_pci_driver);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user