forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/misc/mei/pci-txe.c
....@@ -1,30 +1,17 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
2
- *
3
+ * Copyright (c) 2013-2020, Intel Corporation. All rights reserved.
34 * Intel Management Engine Interface (Intel MEI) Linux driver
4
- * Copyright (c) 2013-2014, Intel Corporation.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms and conditions of the GNU General Public License,
8
- * version 2, as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
14
- *
155 */
166
177 #include <linux/module.h>
188 #include <linux/kernel.h>
199 #include <linux/device.h>
20
-#include <linux/fs.h>
2110 #include <linux/errno.h>
2211 #include <linux/types.h>
2312 #include <linux/pci.h>
2413 #include <linux/init.h>
2514 #include <linux/sched.h>
26
-#include <linux/uuid.h>
27
-#include <linux/jiffies.h>
2815 #include <linux/interrupt.h>
2916 #include <linux/workqueue.h>
3017 #include <linux/pm_domain.h>
....@@ -141,7 +128,7 @@
141128 * MEI requires to resume from runtime suspend mode
142129 * in order to perform link reset flow upon system suspend.
143130 */
144
- dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NEVER_SKIP);
131
+ dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NO_DIRECT_COMPLETE);
145132
146133 /*
147134 * TXE maps runtime suspend/resume to own power gating states,
....@@ -286,12 +273,11 @@
286273 #ifdef CONFIG_PM
287274 static int mei_txe_pm_runtime_idle(struct device *device)
288275 {
289
- struct pci_dev *pdev = to_pci_dev(device);
290276 struct mei_device *dev;
291277
292
- dev_dbg(&pdev->dev, "rpm: txe: runtime_idle\n");
278
+ dev_dbg(device, "rpm: txe: runtime_idle\n");
293279
294
- dev = pci_get_drvdata(pdev);
280
+ dev = dev_get_drvdata(device);
295281 if (!dev)
296282 return -ENODEV;
297283 if (mei_write_is_idle(dev))
....@@ -301,13 +287,12 @@
301287 }
302288 static int mei_txe_pm_runtime_suspend(struct device *device)
303289 {
304
- struct pci_dev *pdev = to_pci_dev(device);
305290 struct mei_device *dev;
306291 int ret;
307292
308
- dev_dbg(&pdev->dev, "rpm: txe: runtime suspend\n");
293
+ dev_dbg(device, "rpm: txe: runtime suspend\n");
309294
310
- dev = pci_get_drvdata(pdev);
295
+ dev = dev_get_drvdata(device);
311296 if (!dev)
312297 return -ENODEV;
313298
....@@ -320,7 +305,7 @@
320305
321306 /* keep irq on we are staying in D0 */
322307
323
- dev_dbg(&pdev->dev, "rpm: txe: runtime suspend ret=%d\n", ret);
308
+ dev_dbg(device, "rpm: txe: runtime suspend ret=%d\n", ret);
324309
325310 mutex_unlock(&dev->device_lock);
326311
....@@ -332,13 +317,12 @@
332317
333318 static int mei_txe_pm_runtime_resume(struct device *device)
334319 {
335
- struct pci_dev *pdev = to_pci_dev(device);
336320 struct mei_device *dev;
337321 int ret;
338322
339
- dev_dbg(&pdev->dev, "rpm: txe: runtime resume\n");
323
+ dev_dbg(device, "rpm: txe: runtime resume\n");
340324
341
- dev = pci_get_drvdata(pdev);
325
+ dev = dev_get_drvdata(device);
342326 if (!dev)
343327 return -ENODEV;
344328
....@@ -350,7 +334,7 @@
350334
351335 mutex_unlock(&dev->device_lock);
352336
353
- dev_dbg(&pdev->dev, "rpm: txe: runtime resume ret = %d\n", ret);
337
+ dev_dbg(device, "rpm: txe: runtime resume ret = %d\n", ret);
354338
355339 if (ret)
356340 schedule_work(&dev->reset_work);