bmips: switch to linux 5.15
[openwrt/staging/dedeckeh.git] / target / linux / bmips / patches-5.10 / 022-v5.12-spi-bcm63xx-hsspi-fix-pm_runtime.patch
1 From 216e8e80057a9f0b6366327881acf88eaf9f1fd4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
3 Date: Tue, 23 Feb 2021 16:18:51 +0100
4 Subject: [PATCH 2/2] spi: bcm63xx-hsspi: fix pm_runtime
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 The driver sets auto_runtime_pm to true, but it doesn't call
10 pm_runtime_enable(), which results in "Failed to power device" when PM support
11 is enabled.
12
13 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
14 Link: https://lore.kernel.org/r/20210223151851.4110-3-noltari@gmail.com
15 Signed-off-by: Mark Brown <broonie@kernel.org>
16 ---
17 drivers/spi/spi-bcm63xx-hsspi.c | 7 ++++++-
18 1 file changed, 6 insertions(+), 1 deletion(-)
19
20 --- a/drivers/spi/spi-bcm63xx-hsspi.c
21 +++ b/drivers/spi/spi-bcm63xx-hsspi.c
22 @@ -21,6 +21,7 @@
23 #include <linux/mutex.h>
24 #include <linux/of.h>
25 #include <linux/reset.h>
26 +#include <linux/pm_runtime.h>
27
28 #define HSSPI_GLOBAL_CTRL_REG 0x0
29 #define GLOBAL_CTRL_CS_POLARITY_SHIFT 0
30 @@ -439,13 +440,17 @@ static int bcm63xx_hsspi_probe(struct pl
31 if (ret)
32 goto out_put_master;
33
34 + pm_runtime_enable(&pdev->dev);
35 +
36 /* register and we are done */
37 ret = devm_spi_register_master(dev, master);
38 if (ret)
39 - goto out_put_master;
40 + goto out_pm_disable;
41
42 return 0;
43
44 +out_pm_disable:
45 + pm_runtime_disable(&pdev->dev);
46 out_put_master:
47 spi_master_put(master);
48 out_disable_pll_clk: