lede/target/linux/bcm27xx/patches-6.12/950-0490-media-platform-Move-bcm2835-unicam-compatible-to-dow.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

60 lines
2.2 KiB
Diff

From c16518bcacebbb292956251a6a5f8291d99c384d Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 23 Jul 2024 11:27:16 +0100
Subject: [PATCH] media: platform: Move bcm2835-unicam compatible to downstream
driver
The upstream Unicam driver needs a set of userland changes to get
libcamera to run, and those aren't written or merged yet.
Move the "brcm,bcm2835-unicam" compatible from the upstream driver
to the old downstream version so that users can run libcamera
against 6.10.
Once the libcamera changes have been merged this can be reverted
to use the upstream driver.
If using the non-legacy compatible then assume we want to use
media-controller API for configuration.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/media/platform/bcm2835/bcm2835-unicam.c | 8 +++++++-
drivers/media/platform/broadcom/bcm2835-unicam.c | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
@@ -3381,6 +3381,11 @@ static int unicam_probe(struct platform_
* device tree requests it.
*/
unicam->mc_api = media_controller;
+
+ /* Compatible is for the non-legacy version of the driver - use compatible */
+ if (of_device_get_match_data(&unicam->pdev->dev))
+ unicam->mc_api = true;
+
if (of_property_read_bool(pdev->dev.of_node, "brcm,media-controller"))
unicam->mc_api = true;
@@ -3500,7 +3505,8 @@ static void unicam_remove(struct platfor
}
static const struct of_device_id unicam_of_match[] = {
- { .compatible = "brcm,bcm2835-unicam-legacy", },
+ { .compatible = "brcm,bcm2835-unicam", .data = (void *)1 },
+ { .compatible = "brcm,bcm2835-unicam-legacy", .data = 0 },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, unicam_of_match);
--- a/drivers/media/platform/broadcom/bcm2835-unicam.c
+++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
@@ -2711,7 +2711,7 @@ static void unicam_remove(struct platfor
}
static const struct of_device_id unicam_of_match[] = {
- { .compatible = "brcm,bcm2835-unicam", },
+ { .compatible = "brcm,bcm2835-unicam-upstream", },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, unicam_of_match);