Skip to content

Commit c3895f6

Browse files
notropopcornmix
authored andcommitted
firmware: bcm2835: Support ARCH_BCM270x
Support booting without Device Tree. Turn on USB power. Load driver early because of lacking support for deferred probing in many drivers. Signed-off-by: Noralf Trønnes <[email protected]> firmware: bcm2835: Don't turn on USB power The raspberrypi-power driver is now used to turn on USB power. This partly reverts commit: firmware: bcm2835: Support ARCH_BCM270x Signed-off-by: Noralf Trønnes <[email protected]>
1 parent a867b62 commit c3895f6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

drivers/firmware/raspberrypi.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ struct rpi_firmware {
2828
u32 enabled;
2929
};
3030

31+
static struct platform_device *g_pdev;
32+
3133
static DEFINE_MUTEX(transaction_lock);
3234

3335
static void response_callback(struct mbox_client *cl, void *msg)
@@ -207,6 +209,7 @@ static int rpi_firmware_probe(struct platform_device *pdev)
207209
init_completion(&fw->c);
208210

209211
platform_set_drvdata(pdev, fw);
212+
g_pdev = pdev;
210213

211214
rpi_firmware_print_firmware_revision(fw);
212215

@@ -218,6 +221,7 @@ static int rpi_firmware_remove(struct platform_device *pdev)
218221
struct rpi_firmware *fw = platform_get_drvdata(pdev);
219222

220223
mbox_free_channel(fw->chan);
224+
g_pdev = NULL;
221225

222226
return 0;
223227
}
@@ -230,7 +234,7 @@ static int rpi_firmware_remove(struct platform_device *pdev)
230234
*/
231235
struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
232236
{
233-
struct platform_device *pdev = of_find_device_by_node(firmware_node);
237+
struct platform_device *pdev = g_pdev;
234238

235239
if (!pdev)
236240
return NULL;
@@ -253,7 +257,18 @@ static struct platform_driver rpi_firmware_driver = {
253257
.probe = rpi_firmware_probe,
254258
.remove = rpi_firmware_remove,
255259
};
256-
module_platform_driver(rpi_firmware_driver);
260+
261+
static int __init rpi_firmware_init(void)
262+
{
263+
return platform_driver_register(&rpi_firmware_driver);
264+
}
265+
subsys_initcall(rpi_firmware_init);
266+
267+
static void __init rpi_firmware_exit(void)
268+
{
269+
platform_driver_unregister(&rpi_firmware_driver);
270+
}
271+
module_exit(rpi_firmware_exit);
257272

258273
MODULE_AUTHOR("Eric Anholt <[email protected]>");
259274
MODULE_DESCRIPTION("Raspberry Pi firmware driver");

0 commit comments

Comments
 (0)