From: Balakrishnan Sambath <balakrishnan.s@microchip.com>
To: <ehristev@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Balamanikandan Gunasundar
<balamanikandan.gunasundar@microchip.com>,
Balakrishnan Sambath <balakrishnan.s@microchip.com>
Subject: [PATCH 02/15] media: microchip-isc: set SAM9X7 maximum resolution per SoC
Date: Wed, 2 Dec 2026 12:46:08 +0530 [thread overview]
Message-ID: <20261202-isc-series-v1-v1-2-4e2f17c0271c@microchip.com> (raw)
In-Reply-To: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com>
SAM9X7 shares the XISC with SAMA7G5 but supports at most 2560x1920
(DS60001813C, section 50.2), where SAMA7G5 allows 3264x2464.
Take the limits from the matched compatible with
of_device_get_match_data() instead of of_machine_is_compatible(), which
only looks at the root node and is not how the device is identified.
Co-developed-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
.../platform/microchip/microchip-sama7g5-isc.c | 29 ++++++++++++++++++----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
index f5968e3b388d..6403d2d43864 100644
--- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
@@ -35,6 +35,7 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
@@ -53,8 +54,20 @@
#include "microchip-isc-regs.h"
#include "microchip-isc.h"
-#define ISC_SAMA7G5_MAX_SUPPORT_WIDTH 3264
-#define ISC_SAMA7G5_MAX_SUPPORT_HEIGHT 2464
+struct isc_xisc_data {
+ u32 max_width;
+ u32 max_height;
+};
+
+static const struct isc_xisc_data isc_sama7g5_data = {
+ .max_width = 3264,
+ .max_height = 2464,
+};
+
+static const struct isc_xisc_data isc_sam9x7_data = {
+ .max_width = 2560,
+ .max_height = 1920,
+};
#define ISC_SAMA7G5_PIPELINE \
(WB_ENABLE | CFA_ENABLE | CC_ENABLE | GAM_ENABLES | CSC_ENABLE | \
@@ -403,6 +416,7 @@ static int microchip_xisc_probe(struct platform_device *pdev)
struct isc_device *isc;
void __iomem *io_base;
struct isc_subdev_entity *subdev_entity;
+ const struct isc_xisc_data *data;
int irq;
int ret;
u32 ver;
@@ -450,8 +464,12 @@ static int microchip_xisc_probe(struct platform_device *pdev)
isc->gamma_table = isc_sama7g5_gamma_table;
isc->gamma_max = 0;
- isc->max_width = ISC_SAMA7G5_MAX_SUPPORT_WIDTH;
- isc->max_height = ISC_SAMA7G5_MAX_SUPPORT_HEIGHT;
+ data = of_device_get_match_data(dev);
+ if (!data)
+ return dev_err_probe(dev, -ENODEV, "no match data\n");
+
+ isc->max_width = data->max_width;
+ isc->max_height = data->max_height;
isc->config_dpc = isc_sama7g5_config_dpc;
isc->config_csc = isc_sama7g5_config_csc;
@@ -626,7 +644,8 @@ static const struct dev_pm_ops microchip_xisc_dev_pm_ops = {
#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id microchip_xisc_of_match[] = {
- { .compatible = "microchip,sama7g5-isc" },
+ { .compatible = "microchip,sama7g5-isc", .data = &isc_sama7g5_data },
+ { .compatible = "microchip,sam9x7-isc", .data = &isc_sam9x7_data },
{ }
};
MODULE_DEVICE_TABLE(of, microchip_xisc_of_match);
--
2.34.1
next prev parent reply other threads:[~2026-12-02 7:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 7:16 [PATCH 00/15] media: microchip-isc: fix SAMA7G5 image pipeline and AWB Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 01/15] dt-bindings: media: microchip,xisc: add SAM9X7 compatible Balakrishnan Sambath
2026-12-02 7:16 ` Balakrishnan Sambath [this message]
2026-12-02 7:16 ` [PATCH 03/15] media: microchip-isc: fix DPC black level scale Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 04/15] media: microchip-isc: enable black level correction on SAMA7G5 Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 05/15] media: microchip-isc: bypass SAMA7G5 pipeline for Bayer output Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 06/15] media: microchip-isc: add gamma 1.8 and 2.4 curves for SAMA7G5 Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 07/15] media: microchip-isc: fix CBHS register names Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 08/15] media: microchip-isc: add SAMA7G5 hue and saturation controls Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 09/15] media: microchip-isc: fix histogram bin index for AWB Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 10/15] media: microchip-isc: trim outliers in the AWB average Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 11/15] media: microchip-isc: skip AWB on near-empty channels Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 12/15] media: microchip-isc: do the AWB gain product in 64 bits Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 13/15] media: microchip-isc: smooth AWB gains with an EMA filter Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 14/15] media: microchip-isc: use an unsigned contrast range Balakrishnan Sambath
2026-12-02 7:16 ` [PATCH 15/15] media: microchip-isc: add driver documentation Balakrishnan Sambath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202-isc-series-v1-v1-2-4e2f17c0271c@microchip.com \
--to=balakrishnan.s@microchip.com \
--cc=balamanikandan.gunasundar@microchip.com \
--cc=ehristev@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®