From patchwork Sun Jan 23 16:08:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12720986 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8809C433F5 for ; Sun, 23 Jan 2022 16:09:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238443AbiAWQJY (ORCPT ); Sun, 23 Jan 2022 11:09:24 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:42248 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234211AbiAWQJX (ORCPT ); Sun, 23 Jan 2022 11:09:23 -0500 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2AABF1253; Sun, 23 Jan 2022 17:09:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1642954160; bh=3geSuoEz6g+fTciggs4nXwS8/gLrJ4EqA6eox6uSlLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YjqVuEhBKqsOdZkebLJrEzUIU6CK1n68nea6o7rGW2rG3A60q8k1oqKa4v/nK4/Y4 lKo4eaCKrt9Lhq6cWRG7xP0ZOH8gK0BCa92nheoEGwqtwmDspOhhDWU9enNJjVBWb2 BfegWCOyN7a6lIxObQht4vjjnEHmjQe9n7FJ33l4= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Sakari Ailus , Kieran Bingham , =?utf-8?q?Niklas_S=C3=B6d?= =?utf-8?q?erlund?= , Jacopo Mondi , Maxime Ripard , Dafna Hirschfeld , Pratyush Yadav Subject: [PATCH 3/6] media: rcar-isp: Use mipi-csi2.h Date: Sun, 23 Jan 2022 18:08:54 +0200 Message-Id: <20220123160857.24161-4-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220123160857.24161-1-laurent.pinchart+renesas@ideasonboard.com> References: <20220123160857.24161-1-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Replace the hardcoded MIPI CSI-2 data types with macros from mipi-csi2.h. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- drivers/media/platform/rcar-isp.c | 32 +++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/rcar-isp.c b/drivers/media/platform/rcar-isp.c index 2ffab30bc011..10b3474f93a4 100644 --- a/drivers/media/platform/rcar-isp.c +++ b/drivers/media/platform/rcar-isp.c @@ -17,6 +17,7 @@ #include #include +#include #include #define ISPINPUTSEL0_REG 0x0008 @@ -51,12 +52,31 @@ struct rcar_isp_format { }; static const struct rcar_isp_format rcar_isp_formats[] = { - { .code = MEDIA_BUS_FMT_RGB888_1X24, .datatype = 0x24, .procmode = 0x15 }, - { .code = MEDIA_BUS_FMT_Y10_1X10, .datatype = 0x2b, .procmode = 0x10 }, - { .code = MEDIA_BUS_FMT_UYVY8_1X16, .datatype = 0x1e, .procmode = 0x0c }, - { .code = MEDIA_BUS_FMT_YUYV8_1X16, .datatype = 0x1e, .procmode = 0x0c }, - { .code = MEDIA_BUS_FMT_UYVY8_2X8, .datatype = 0x1e, .procmode = 0x0c }, - { .code = MEDIA_BUS_FMT_YUYV10_2X10, .datatype = 0x1e, .procmode = 0x0c }, + { + .code = MEDIA_BUS_FMT_RGB888_1X24, + .datatype = MIPI_CSI2_DT_RGB888, + .procmode = 0x15 + }, { + .code = MEDIA_BUS_FMT_Y10_1X10, + .datatype = MIPI_CSI2_DT_RAW10, + .procmode = 0x10, + }, { + .code = MEDIA_BUS_FMT_UYVY8_1X16, + .datatype = MIPI_CSI2_DT_YUV422_8B, + .procmode = 0x0c, + }, { + .code = MEDIA_BUS_FMT_YUYV8_1X16, + .datatype = MIPI_CSI2_DT_YUV422_8B, + .procmode = 0x0c, + }, { + .code = MEDIA_BUS_FMT_UYVY8_2X8, + .datatype = MIPI_CSI2_DT_YUV422_8B, + .procmode = 0x0c, + }, { + .code = MEDIA_BUS_FMT_YUYV10_2X10, + .datatype = MIPI_CSI2_DT_YUV422_8B, + .procmode = 0x0c, + }, }; static const struct rcar_isp_format *risp_code_to_fmt(unsigned int code)