kernel: bump 5.10 to 5.10.180
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.10 / 950-0053-firmware-bcm2835-Support-ARCH_BCM270x.patch
1 From 410ae9727ad520a140b88c7151e0432d58516bc3 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Fri, 26 Jun 2015 14:25:01 +0200
4 Subject: [PATCH] firmware: bcm2835: Support ARCH_BCM270x
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Support booting without Device Tree.
10 Turn on USB power.
11 Load driver early because of lacking support for deferred probing
12 in many drivers.
13
14 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
15
16 firmware: bcm2835: Don't turn on USB power
17
18 The raspberrypi-power driver is now used to turn on USB power.
19
20 This partly reverts commit:
21 firmware: bcm2835: Support ARCH_BCM270x
22
23 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
24 ---
25 drivers/firmware/raspberrypi.c | 19 +++++++++++++++++--
26 1 file changed, 17 insertions(+), 2 deletions(-)
27
28 --- a/drivers/firmware/raspberrypi.c
29 +++ b/drivers/firmware/raspberrypi.c
30 @@ -32,6 +32,8 @@ struct rpi_firmware {
31 struct kref consumers;
32 };
33
34 +static struct platform_device *g_pdev;
35 +
36 static DEFINE_MUTEX(transaction_lock);
37
38 static void response_callback(struct mbox_client *cl, void *msg)
39 @@ -280,6 +282,7 @@ static int rpi_firmware_probe(struct pla
40 kref_init(&fw->consumers);
41
42 platform_set_drvdata(pdev, fw);
43 + g_pdev = pdev;
44
45 rpi_firmware_print_firmware_revision(fw);
46 rpi_register_hwmon_driver(dev, fw);
47 @@ -309,6 +312,8 @@ static int rpi_firmware_remove(struct pl
48
49 rpi_firmware_put(fw);
50
51 + g_pdev = NULL;
52 +
53 return 0;
54 }
55
56 @@ -322,7 +327,7 @@ static int rpi_firmware_remove(struct pl
57 */
58 struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
59 {
60 - struct platform_device *pdev = of_find_device_by_node(firmware_node);
61 + struct platform_device *pdev = g_pdev;
62 struct rpi_firmware *fw;
63
64 if (!pdev)
65 @@ -335,12 +340,9 @@ struct rpi_firmware *rpi_firmware_get(st
66 if (!kref_get_unless_zero(&fw->consumers))
67 goto err_put_device;
68
69 - put_device(&pdev->dev);
70 -
71 return fw;
72
73 err_put_device:
74 - put_device(&pdev->dev);
75 return NULL;
76 }
77 EXPORT_SYMBOL_GPL(rpi_firmware_get);
78 @@ -382,7 +384,18 @@ static struct platform_driver rpi_firmwa
79 .shutdown = rpi_firmware_shutdown,
80 .remove = rpi_firmware_remove,
81 };
82 -module_platform_driver(rpi_firmware_driver);
83 +
84 +static int __init rpi_firmware_init(void)
85 +{
86 + return platform_driver_register(&rpi_firmware_driver);
87 +}
88 +subsys_initcall(rpi_firmware_init);
89 +
90 +static void __init rpi_firmware_exit(void)
91 +{
92 + platform_driver_unregister(&rpi_firmware_driver);
93 +}
94 +module_exit(rpi_firmware_exit);
95
96 MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
97 MODULE_DESCRIPTION("Raspberry Pi firmware driver");