Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: ezequiel@collabora.com, dafna.hirschfeld@collabora.com,
	helen.koike@collabora.com, Laurent.pinchart@ideasonboard.com
Cc: linux-rockchip@lists.infradead.org,
	christoph.muellner@theobroma-systems.com,
	linux-media@vger.kernel.org, mchehab@kernel.org, heiko@sntech.de,
	Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Subject: [PATCH RFC 07/11] media: rockchip: rkisp1: carry ip version information
Date: Fri,  8 Jan 2021 20:33:07 +0100
Message-ID: <20210108193311.3423236-8-heiko@sntech.de> (raw)
In-Reply-To: <20210108193311.3423236-1-heiko@sntech.de>

From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>

The IP block evolved from its rk3288/rk3399 base and the vendor
designates them with a numerical version. rk3399 for example
is designated V10 probably meaning V1.0.

There doesn't seem to be an actual version register we could read that
information from, so allow the match_data to carry that information
for future differentiation.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 5 +++++
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c    | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
index 44f333bf5d6a..7678eabc9ffc 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
@@ -59,6 +59,10 @@
 					 RKISP1_CIF_ISP_EXP_END |	\
 					 RKISP1_CIF_ISP_HIST_MEASURE_RDY)
 
+enum rkisp1_isp_ver {
+	RKISP1_V10 = 0,
+};
+
 /* enum for the resizer pads */
 enum rkisp1_rsz_pad {
 	RKISP1_RSZ_PAD_SINK,
@@ -355,6 +359,7 @@ struct rkisp1_device {
 	void __iomem *base_addr;
 	int irq;
 	struct device *dev;
+	enum rkisp1_isp_ver isp_ver;
 	unsigned int clk_size;
 	struct clk_bulk_data clks[RKISP1_MAX_BUS_CLK];
 	struct v4l2_device v4l2_dev;
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
index 96afc1d1a914..0a01ffbc2cae 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
@@ -104,6 +104,7 @@
 struct rkisp1_match_data {
 	const char * const *clks;
 	unsigned int size;
+	enum rkisp1_isp_ver isp_ver;
 };
 
 /* ----------------------------------------------------------------------------
@@ -408,15 +409,16 @@ static const char * const rk3399_isp_clks[] = {
 	"hclk",
 };
 
-static const struct rkisp1_match_data rk3399_isp_clk_data = {
+static const struct rkisp1_match_data rk3399_isp_match_data = {
 	.clks = rk3399_isp_clks,
 	.size = ARRAY_SIZE(rk3399_isp_clks),
+	.isp_ver = RKISP1_V10,
 };
 
 static const struct of_device_id rkisp1_of_match[] = {
 	{
 		.compatible = "rockchip,rk3399-cif-isp",
-		.data = &rk3399_isp_clk_data,
+		.data = &rk3399_isp_match_data,
 	},
 	{},
 };
@@ -532,6 +534,7 @@ static int rkisp1_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 	rkisp1->clk_size = clk_data->size;
+	rkisp1->isp_ver = clk_data->isp_ver;
 
 	pm_runtime_enable(&pdev->dev);
 
-- 
2.29.2


  parent reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 19:33 [RFC PATCH 00/11] rkisp1 support for px30 - including uapi questions for 5.11 Heiko Stuebner
2021-01-08 19:33 ` [PATCH RFC 01/11] arm64: dts: rockchip: add csi-dphy to px30 Heiko Stuebner
2021-01-08 19:33 ` [PATCH RFC 02/11] arm64: dts: rockchip: add isp node for px30 Heiko Stuebner
2021-01-08 19:33 ` [PATCH RFC 03/11] arm64: dts: rockchip: hook up camera on px30-evb Heiko Stuebner
2021-01-08 19:33 ` [PATCH RFC 04/11] phy/rockchip: add Innosilicon-based CSI dphy Heiko Stuebner
2021-01-18 18:05   ` Helen Koike
2021-01-08 19:33 ` [PATCH RFC 05/11] media: rockchip: rkisp1: extend uapi array sizes Heiko Stuebner
2021-01-09 20:12   ` Dafna Hirschfeld
2021-01-08 19:33 ` [PATCH RFC 06/11] media: rockchip: rkisp1: allow separate interrupts Heiko Stuebner
2021-01-18 18:05   ` Helen Koike
2021-02-05 13:23   ` Dafna Hirschfeld
2021-01-08 19:33 ` Heiko Stuebner [this message]
2021-01-08 19:33 ` [PATCH RFC 08/11] media: rockchip: rkisp1: make some isp-param functions variable Heiko Stuebner
2021-01-18 18:05   ` Helen Koike
2021-02-05 14:05   ` Dafna Hirschfeld
2021-01-08 19:33 ` [PATCH RFC 09/11] media: rockchip: rkisp1: make some isp-stats " Heiko Stuebner
2021-01-18 18:05   ` Helen Koike
2021-01-08 19:33 ` [PATCH RFC 10/11] media: rockchip: rkisp1: add support for v12 isp variants Heiko Stuebner
2021-01-18 18:06   ` Helen Koike
2021-02-05 19:23     ` Dafna Hirschfeld
2021-02-08 12:24       ` Helen Koike
2021-02-05 14:04   ` Dafna Hirschfeld
2021-02-05 14:32   ` Dafna Hirschfeld
2021-01-08 19:33 ` [PATCH RFC 11/11] media: rockchip: rkisp1: add support for px30 isp version Heiko Stuebner

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=20210108193311.3423236-8-heiko@sntech.de \
    --to=heiko@sntech.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=christoph.muellner@theobroma-systems.com \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=ezequiel@collabora.com \
    --cc=heiko.stuebner@theobroma-systems.com \
    --cc=helen.koike@collabora.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@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

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git