Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2021900rdh; Sat, 25 Nov 2023 10:24:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IExtAoIiSEtNWJAPzTlvGNX5ILwCwW2S/65+sQ4ITdJtJ70YWHPRWLDXwTPCmiSP91sFtIy X-Received: by 2002:a05:6a21:2d87:b0:187:71f7:bb26 with SMTP id ty7-20020a056a212d8700b0018771f7bb26mr7795586pzb.54.1700936676168; Sat, 25 Nov 2023 10:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700936676; cv=none; d=google.com; s=arc-20160816; b=OMrz4apln3cl76coGSorZuhoUJq/RmmxrPVFX1vo3lKzVYu7aR2MQVTfqt83RY88Rv TlmrpX3Sd3UdSRZIpjMiagLHvdzCxb1yHFucrLamkWoOXduWDO+z9Nz+wL38L/k7KdYD XTikr/UqJNyDlipnNBk67zxWIZyHqqmQ+y42O2PiJBBYekJ5NaXQW+f+ReQRfwM1V+3b A9gTDHedVSpNTXilb9S9oAp4gftlXF5Xn1skSESZyObAVNhBOxrtUF4+xBEIVVHmateh GN1XEiL3MFVI58SUpjudxG+0/6eu1NnNVLPSOl78XpEbRP+6vTnGctYWAcrl8P3XQcly /DrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2W7wCmX+NW6hmQI+fefcnZEdAolQngt0ItXz/a69y6s=; fh=aATIuJQBPIMUXucEnWXDVLrPAQTYMg8TXITJvQquOpU=; b=vq/2IRzM7xdh9xkqZvaGlllkQERT/DGv+Hg7afXrnSBqK0o22Pg0bHEHcpledhFhbk kquRjpAZZKFj/zotcAx2q+HaQ8ArG3dZEOqbGqIHw72WjEG58nPwk/SytZeACa0+J9Sd sgXIgZgVSznNUV0yRWRReIHhEW15msZKN/Z7VDZ7ztGd9TrR4YYfp/OaYSH3g9HcgYnK cYM7yxJe9sNdJq68HEoQh5iJlPMEA3C7m/u5RSulvt+HjHmSODqOZZU008cemo8/K4jL FzfXDA5AyLjXX9Wd2glqSNt4iPAGWrE+Sgnln9dibZRmqBL23+LtiCV8K1HFOxc/oaZI LQ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=YVc8fFc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v10-20020a056a00148a00b006cc040f386esi2070221pfu.60.2023.11.25.10.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 10:24:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=YVc8fFc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 12AF28062917; Sat, 25 Nov 2023 10:24:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbjKYSYZ (ORCPT + 99 others); Sat, 25 Nov 2023 13:24:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232305AbjKYSYY (ORCPT ); Sat, 25 Nov 2023 13:24:24 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 655AFDB; Sat, 25 Nov 2023 10:24:30 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3AP1NcLf017784; Sat, 25 Nov 2023 19:24:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= selector1; bh=2W7wCmX+NW6hmQI+fefcnZEdAolQngt0ItXz/a69y6s=; b=YV c8fFc+3++JkPvpRgNz0MlPsd2w76b3oGtor4ZTLK3rT50VrM1Z83p0F6Rm4W2/rO kc4JGd6jXgyHJQpb4ZvEmNOBn4nJH+ehbaU4qtApxd/VZhsKMnXoJFiin/fBn4gj vKt1iWhHPKDXhl4gaORTowhb9p6rby/fHbQf4rzN8bVAtek31HjaXT8KSSdFXj6w +3Z+ozl7P9ruuOXrLIL8O9Awj7/rRQvWhcFWbHlVlhzVZZ/Enktk6za42h78HvNF SYoFgIhfnbzr8JiYLAHA3XOGe72ZpeUYvgOA6oDZIhT+lVtsvYdA2CS/nF1W0qSq jAQrBmJiKMvOUZTWFChw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3uk77kj4t8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 25 Nov 2023 19:24:22 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C40BF10002A; Sat, 25 Nov 2023 19:24:07 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BABCD23C6AF; Sat, 25 Nov 2023 19:24:07 +0100 (CET) Received: from localhost (10.129.178.213) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 25 Nov 2023 19:24:08 +0100 From: Alain Volmat To: Mauro Carvalho Chehab , Benjamin Mugnier , Sylvain Petinot CC: Sakari Ailus , Alain Volmat , , Subject: [PATCH 5/7] media: i2c: st-mipid02: use mipi-csi macro for data-type Date: Sat, 25 Nov 2023 19:20:53 +0100 Message-ID: <20231125182057.1379357-6-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231125182057.1379357-1-alain.volmat@foss.st.com> References: <20231125182057.1379357-1-alain.volmat@foss.st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.129.178.213] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-25_18,2023-11-22_01,2023-05-22_02 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 25 Nov 2023 10:24:35 -0800 (PST) Use MIPI data-type macros. Signed-off-by: Alain Volmat --- drivers/media/i2c/st-mipid02.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 7af209905d7b..783c2848c584 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -158,17 +159,17 @@ static u8 data_type_from_code(__u32 code) case MEDIA_BUS_FMT_SGBRG8_1X8: case MEDIA_BUS_FMT_SGRBG8_1X8: case MEDIA_BUS_FMT_SRGGB8_1X8: - return 0x2a; + return MIPI_CSI2_DT_RAW8; case MEDIA_BUS_FMT_SBGGR10_1X10: case MEDIA_BUS_FMT_SGBRG10_1X10: case MEDIA_BUS_FMT_SGRBG10_1X10: case MEDIA_BUS_FMT_SRGGB10_1X10: - return 0x2b; + return MIPI_CSI2_DT_RAW10; case MEDIA_BUS_FMT_SBGGR12_1X12: case MEDIA_BUS_FMT_SGBRG12_1X12: case MEDIA_BUS_FMT_SGRBG12_1X12: case MEDIA_BUS_FMT_SRGGB12_1X12: - return 0x2c; + return MIPI_CSI2_DT_RAW12; case MEDIA_BUS_FMT_YUYV8_1X16: case MEDIA_BUS_FMT_YVYU8_1X16: case MEDIA_BUS_FMT_UYVY8_1X16: @@ -177,13 +178,13 @@ static u8 data_type_from_code(__u32 code) case MEDIA_BUS_FMT_YVYU8_2X8: case MEDIA_BUS_FMT_UYVY8_2X8: case MEDIA_BUS_FMT_VYUY8_2X8: - return 0x1e; + return MIPI_CSI2_DT_YUV422_8B; case MEDIA_BUS_FMT_BGR888_1X24: - return 0x24; + return MIPI_CSI2_DT_RGB888; case MEDIA_BUS_FMT_RGB565_1X16: case MEDIA_BUS_FMT_RGB565_2X8_LE: case MEDIA_BUS_FMT_RGB565_2X8_BE: - return 0x22; + return MIPI_CSI2_DT_RGB565; default: return 0; } -- 2.25.1