Message ID | 20220205185429.2278860-35-paul.kocialkowski@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E863C433F5 for <linux-arm-kernel@archiver.kernel.org>; Sat, 5 Feb 2022 19:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P1863+n18pq/6bG6wldqgVzHjO3MGnw/kGfnIavda/U=; b=EsFEVN++OZrPOd J7EjSOXFo/I5sgnnzlaTifVVxEzO+4C2vLcDG2AbER9DtYyXtmy2TZMOV4MmwKk5kNnv3rKX/oQpQ 4eul/rx+1qxSQPrXoZmp9XgbGOQsUjts5cXIVg3FNK56QmIryn1yEv5YL8cy2jGFwCYapOjg1JhuJ S5TCG0XoGKwnb4usQbLufGhzQF5tbiKWER8FObMojVW7yy4pcjRpKtW7yjjCXrIxt9OiXv/+Uik5m p2C3I/TuAyYYl/znXOKH5NhhEG/9eOBwPov0dYOXbuk581ecCzC3+QyPSr3YtuVsEACtpKSSgZ5zp /xOEHudHf6j9IfVXX9Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nGQbV-007Akk-QH; Sat, 05 Feb 2022 19:20:14 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nGQDm-006zrc-C6; Sat, 05 Feb 2022 18:55:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=//Qc7XjLYxE3yQkQCiZCEdHx9uQtYT28JsyXBc9nHFY=; b=arQ3rOtwYIImcP1isWu6OUorNl QXm61lv901WdIU3oL6eaM+QSOGN5oVj3zxiGfZmClCrqUlqTmmrhboRxeIUD5DAbo3Ex6WAVwujE/ 8IYrB7xlwr27cXqoF1KuBdUhJ5g1ALWqyS2nGZuw2OKTZ36syBhyyj6gY6HMWG1axCYvTCgiY2gtE EJAx0hb2hQ6WYMONXYrDytJfEdMjTycDFdXP5tlynq7q/B0WGYorRfCPp9nSmFrxAuYcc4zmk2eZG r9gK2lsph68fT6S64sNaOF7r01pjeHgMnIJVazF8KBcoL9bbvk0TwABXa8AptzJEdBgDE7F4BgCxC gz87eCUg==; Received: from relay10.mail.gandi.net ([2001:4b98:dc4:8::230]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nGQDj-007CFJ-A0; Sat, 05 Feb 2022 18:55:41 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C64F524000F; Sat, 5 Feb 2022 18:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1644087338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=//Qc7XjLYxE3yQkQCiZCEdHx9uQtYT28JsyXBc9nHFY=; b=K7yx2LuUd3NG3rFwQWkeBbBjXRbtMwnQhMK4T+S49OsmWavbuyf6JYPe7BBFn0N4635MLr mD2mOYhaPMTaejD86sdHqZhJz0r6dO3asmE5Rhq11Ilv9S2mGIJLklrOMxvSVfg3nBl1+W I0iNQQKq/FOLz/5R06OpLG13WjqW7+ew5H3xqgmoGwIVzzYeOoMLr0OtMlqEVeyRC0JHaZ D4b0mC2uMBc5XyUNHayd/n+cXlQ3Mjjwfojwsb44h3oWSUEINqoobijoRrV/f/It7GBL82 6vWoQs2D9TENYPX+n+B44XOfYuzHL35licCcLwTOas0X+njp3WMK0ULxQP/o/g== From: Paul Kocialkowski <paul.kocialkowski@bootlin.com> To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, linux-staging@lists.linux.dev Cc: Yong Deng <yong.deng@magewell.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Rob Herring <robh+dt@kernel.org>, Maxime Ripard <mripard@kernel.org>, Sakari Ailus <sakari.ailus@linux.intel.com>, Hans Verkuil <hans.verkuil@cisco.com>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Helen Koike <helen.koike@collabora.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v2 34/66] media: sun6i-csi: Add dimensions and format helpers to capture Date: Sat, 5 Feb 2022 19:53:57 +0100 Message-Id: <20220205185429.2278860-35-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220205185429.2278860-1-paul.kocialkowski@bootlin.com> References: <20220205185429.2278860-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220205_185539_516925_DF04BC8B X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Allwinner A31/A83T MIPI CSI-2 Support and A31 ISP Support
|
expand
|
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c index bcbb4ffbb517..7b8556a25c61 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c @@ -25,6 +25,25 @@ /* Helpers */ +void sun6i_csi_capture_dimensions(struct sun6i_csi_device *csi_dev, + unsigned int *width, unsigned int *height) +{ + if (width) + *width = csi_dev->capture.format.fmt.pix.width; + if (height) + *height = csi_dev->capture.format.fmt.pix.height; +} + +void sun6i_csi_capture_format(struct sun6i_csi_device *csi_dev, + u32 *pixelformat, u32 *field) +{ + if (pixelformat) + *pixelformat = csi_dev->capture.format.fmt.pix.pixelformat; + + if (field) + *field = csi_dev->capture.format.fmt.pix.field; +} + static struct v4l2_subdev * sun6i_csi_capture_remote_subdev(struct sun6i_csi_capture *capture, u32 *pad) { diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.h b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.h index 7fa66a2af5ec..935f35b7049a 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.h +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.h @@ -37,6 +37,11 @@ struct sun6i_csi_capture { u32 mbus_code; }; +void sun6i_csi_capture_dimensions(struct sun6i_csi_device *csi_dev, + unsigned int *width, unsigned int *height); +void sun6i_csi_capture_format(struct sun6i_csi_device *csi_dev, + u32 *pixelformat, u32 *field); + void sun6i_csi_capture_sync(struct sun6i_csi_device *csi_dev); void sun6i_csi_capture_frame_done(struct sun6i_csi_device *csi_dev);
Define and export useful helpers to access dimensions and pixel format. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> --- .../sunxi/sun6i-csi/sun6i_csi_capture.c | 19 +++++++++++++++++++ .../sunxi/sun6i-csi/sun6i_csi_capture.h | 5 +++++ 2 files changed, 24 insertions(+)