hc
2024-02-20 e636c8d336489bf3eed5878299e6cc045bbad077
kernel/drivers/mfd/wm8994-core.c
....@@ -1,15 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * wm8994-core.c -- Device access for Wolfson WM8994
34 *
45 * Copyright 2009 Wolfson Microelectronics PLC.
56 *
67 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
138 */
149
1510 #include <linux/kernel.h>
....@@ -21,7 +16,6 @@
2116 #include <linux/mfd/core.h>
2217 #include <linux/of.h>
2318 #include <linux/of_device.h>
24
-#include <linux/of_gpio.h>
2519 #include <linux/pm_runtime.h>
2620 #include <linux/regmap.h>
2721 #include <linux/regulator/consumer.h>
....@@ -306,14 +300,6 @@
306300
307301 pdata->csnaddr_pd = of_property_read_bool(np, "wlf,csnaddr-pd");
308302
309
- pdata->ldo[0].enable = of_get_named_gpio(np, "wlf,ldo1ena", 0);
310
- if (pdata->ldo[0].enable < 0)
311
- pdata->ldo[0].enable = 0;
312
-
313
- pdata->ldo[1].enable = of_get_named_gpio(np, "wlf,ldo2ena", 0);
314
- if (pdata->ldo[1].enable < 0)
315
- pdata->ldo[1].enable = 0;
316
-
317303 return 0;
318304 }
319305 #else
....@@ -407,7 +393,9 @@
407393 ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
408394 wm8994->supplies);
409395 if (ret != 0) {
410
- dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);
396
+ if (ret != -EPROBE_DEFER)
397
+ dev_err(wm8994->dev, "Failed to get supplies: %d\n",
398
+ ret);
411399 goto err;
412400 }
413401
....@@ -598,6 +586,7 @@
598586 goto err_irq;
599587 }
600588
589
+ pm_runtime_set_active(wm8994->dev);
601590 pm_runtime_enable(wm8994->dev);
602591 pm_runtime_idle(wm8994->dev);
603592
....@@ -617,7 +606,9 @@
617606
618607 static void wm8994_device_exit(struct wm8994 *wm8994)
619608 {
609
+ pm_runtime_get_sync(wm8994->dev);
620610 pm_runtime_disable(wm8994->dev);
611
+ pm_runtime_put_noidle(wm8994->dev);
621612 wm8994_irq_exit(wm8994);
622613 regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies);
623614 regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);