From patchwork Mon Jun 17 13:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugues FRUCHET X-Patchwork-Id: 10999291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9E1B14C0 for ; Mon, 17 Jun 2019 13:44:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A87E326E40 for ; Mon, 17 Jun 2019 13:44:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B3EF285A3; Mon, 17 Jun 2019 13:44:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4346E26E40 for ; Mon, 17 Jun 2019 13:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727678AbfFQNoR (ORCPT ); Mon, 17 Jun 2019 09:44:17 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:38501 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfFQNoR (ORCPT ); Mon, 17 Jun 2019 09:44:17 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDfQkO016948; Mon, 17 Jun 2019 15:44:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=Yp0bFSnxg47LGWXkCBcDsGAcLvPwKkpEg+xTLQR3KdE=; b=vi1yD4sbQFogkqjr12uHPbgtkf+zvAbJEIX6Sqqpc88EdSS6bkg9J3oT9JeGMDEnjcUA 3DTnSpa7wIup+VF8dOn0lFy2TWWZMdbzO42PH9Iy44e5KNA+iHImsqcJ+VvgzK83X0Ld oiN1sPa1QI3mfT4G/eYN+ZEtw0z9q062yKY0lyQDj9Qcf5ZBk6OFScGVjMgEjiLO1RIi EwvHUYVeD1fRbwmRWBgs1Fi0dtA4c0CYOqd4CdbTt22kCRnNkTGEOirOPqRt1tKt5OMT xYvBHUQDzy79UYyqEBtq8jNQpboZ2CF3NhvfhtsiHfPNyTYzux/tSzzULQb+IIbR4qtF cw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t4peu2rmf-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 17 Jun 2019 15:44:11 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CB64431; Mon, 17 Jun 2019 13:44:10 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B4B0A29A6; Mon, 17 Jun 2019 13:44:10 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 15:44:10 +0200 Received: from localhost (10.201.23.19) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 15:44:10 +0200 From: Hugues Fruchet To: Mauro Carvalho Chehab , Sakari Ailus , Mickael Guene CC: , , "Hugues Fruchet" , Benjamin Gaignard Subject: [PATCH v2 1/3] media: st-mipid02: add support of RGB565 Date: Mon, 17 Jun 2019 15:43:56 +0200 Message-ID: <1560779038-26012-2-git-send-email-hugues.fruchet@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560779038-26012-1-git-send-email-hugues.fruchet@st.com> References: <1560779038-26012-1-git-send-email-hugues.fruchet@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.19] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-17_06:,, signatures=0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support of RGB565 pixel format. Signed-off-by: Hugues Fruchet --- drivers/media/i2c/st-mipid02.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 9369f38..76a9f52 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -61,7 +61,8 @@ static const u32 mipid02_supported_fmt_codes[] = { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10, MEDIA_BUS_FMT_SBGGR12_1X12, MEDIA_BUS_FMT_SGBRG12_1X12, MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SRGGB12_1X12, - MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_BGR888_1X24 + MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_BGR888_1X24, + MEDIA_BUS_FMT_RGB565_2X8_LE, MEDIA_BUS_FMT_RGB565_2X8_BE, }; /* regulator supplies */ @@ -128,6 +129,8 @@ static int bpp_from_code(__u32 code) case MEDIA_BUS_FMT_SRGGB12_1X12: return 12; case MEDIA_BUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_RGB565_2X8_LE: + case MEDIA_BUS_FMT_RGB565_2X8_BE: return 16; case MEDIA_BUS_FMT_BGR888_1X24: return 24; @@ -158,6 +161,9 @@ static u8 data_type_from_code(__u32 code) return 0x1e; case MEDIA_BUS_FMT_BGR888_1X24: return 0x24; + case MEDIA_BUS_FMT_RGB565_2X8_LE: + case MEDIA_BUS_FMT_RGB565_2X8_BE: + return 0x22; default: return 0; } From patchwork Mon Jun 17 13:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugues FRUCHET X-Patchwork-Id: 10999293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 611A676 for ; Mon, 17 Jun 2019 13:44:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51A3728585 for ; Mon, 17 Jun 2019 13:44:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45E022894D; Mon, 17 Jun 2019 13:44:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA70028585 for ; Mon, 17 Jun 2019 13:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727822AbfFQNoV (ORCPT ); Mon, 17 Jun 2019 09:44:21 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:49718 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726215AbfFQNoT (ORCPT ); Mon, 17 Jun 2019 09:44:19 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDeuob002079; Mon, 17 Jun 2019 15:44:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=6yBZz4ABYpxtClu7j1ho6thn8SuVUwy/sipntIef450=; b=fnwzH5rlPwBPBzB5hgQRo+7VRjIrqw4zRq8SdBgmWMd4Z293hmmV6LvpL5sDhQmVT2MY WBSp/O0aTNs2+cxFctPQx7x5dVutDl70MdH7K3LYUxl5hKxt1oDGk25HSpMUpPnnU2d9 xXnqIcBWFBS+f/79X7X+6bDfOkHN2B26MsL2+aTh/7u0y3bSs+uzwA9CSFVD53/O8oDF PzWh6V44DwhZLmCVsOY4MV1le0F46UYa5EBRd/fsrPrCU3MRei/PhXG0SvNDw/x17rix UKUCLKAQUU/3iH+WoIjcfMqAutp63iiPcOC36exkpZovCOxR9H2Zrl/U0nGj+igHRawU WA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2t4qjhtrvb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 17 Jun 2019 15:44:13 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 236DC31; Mon, 17 Jun 2019 13:44:12 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 044F529C2; Mon, 17 Jun 2019 13:44:11 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 15:44:11 +0200 Received: from localhost (10.201.23.19) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 15:44:11 +0200 From: Hugues Fruchet To: Mauro Carvalho Chehab , Sakari Ailus , Mickael Guene CC: , , "Hugues Fruchet" , Benjamin Gaignard Subject: [PATCH v2 2/3] media: st-mipid02: add support of YUYV8 and UYVY8 Date: Mon, 17 Jun 2019 15:43:57 +0200 Message-ID: <1560779038-26012-3-git-send-email-hugues.fruchet@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560779038-26012-1-git-send-email-hugues.fruchet@st.com> References: <1560779038-26012-1-git-send-email-hugues.fruchet@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.19] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-17_06:,, signatures=0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support of YUYV8 and UYVY8 pixel formats. Signed-off-by: Hugues Fruchet --- drivers/media/i2c/st-mipid02.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 76a9f52..35946ad 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -63,6 +63,7 @@ static const u32 mipid02_supported_fmt_codes[] = { MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SRGGB12_1X12, MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_BGR888_1X24, MEDIA_BUS_FMT_RGB565_2X8_LE, MEDIA_BUS_FMT_RGB565_2X8_BE, + MEDIA_BUS_FMT_YUYV8_2X8, MEDIA_BUS_FMT_UYVY8_2X8, }; /* regulator supplies */ @@ -129,6 +130,8 @@ static int bpp_from_code(__u32 code) case MEDIA_BUS_FMT_SRGGB12_1X12: return 12; case MEDIA_BUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: case MEDIA_BUS_FMT_RGB565_2X8_LE: case MEDIA_BUS_FMT_RGB565_2X8_BE: return 16; @@ -158,6 +161,8 @@ static u8 data_type_from_code(__u32 code) case MEDIA_BUS_FMT_SRGGB12_1X12: return 0x2c; case MEDIA_BUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: return 0x1e; case MEDIA_BUS_FMT_BGR888_1X24: return 0x24; From patchwork Mon Jun 17 13:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugues FRUCHET X-Patchwork-Id: 10999297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C77D14C0 for ; Mon, 17 Jun 2019 13:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 299C02860A for ; Mon, 17 Jun 2019 13:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AB1D28825; Mon, 17 Jun 2019 13:45:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFC422860A for ; Mon, 17 Jun 2019 13:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726716AbfFQNpW (ORCPT ); Mon, 17 Jun 2019 09:45:22 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:13828 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725884AbfFQNpW (ORCPT ); Mon, 17 Jun 2019 09:45:22 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5HDfLpV026019; Mon, 17 Jun 2019 15:44:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=TukET5a1B87T8jAy8Pcez1BbOi6ltkalZ8o/aJvv4Ow=; b=DfyeHbBodyNC7xlupkSuyuz6HEZY+FH5jtORUN+y9B1TKxuO2geqtoBs17rQpOTY6AGW 6rXrn6AUZXu3Wmyybdol0t2C+TyZ/yf3IqE27CzZG4C4ngTjf/3ps7U2h/UDZGvGPhN7 v0Iet8Gd643ilcQLocoYPG3MWyLKWismAQmejWLhNgLEmKu+zHKAMbmviCyriSRPtroZ LqspCfwS8YJx0V88PVDqCsQJ1dcvfM5/nbVA+tG3Xc9sp+F9GsGYbd90hXWdZeOF7ddo dAxbWXccgSywZ5RWkt+NKeOHj6PD4Fj0UJbBElvDiLLSGvf0OjzbH9D4ox57lOTz3drB KQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2t4nt834nu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 17 Jun 2019 15:44:15 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 78C743A; Mon, 17 Jun 2019 13:44:14 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2CCB12AFF; Mon, 17 Jun 2019 13:44:14 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 15:44:14 +0200 Received: from localhost (10.201.23.19) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 15:44:13 +0200 From: Hugues Fruchet To: Mauro Carvalho Chehab , Sakari Ailus , Mickael Guene CC: , , "Hugues Fruchet" , Benjamin Gaignard Subject: [PATCH v2 3/3] media: st-mipid02: add support of JPEG Date: Mon, 17 Jun 2019 15:43:58 +0200 Message-ID: <1560779038-26012-4-git-send-email-hugues.fruchet@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560779038-26012-1-git-send-email-hugues.fruchet@st.com> References: <1560779038-26012-1-git-send-email-hugues.fruchet@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.19] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-17_06:,, signatures=0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support of JPEG pixel format. This requires auto detection of data type from CSI-2 stream. Signed-off-by: Hugues Fruchet --- drivers/media/i2c/st-mipid02.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 35946ad..ff8a4d8 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -64,6 +64,7 @@ static const u32 mipid02_supported_fmt_codes[] = { MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_BGR888_1X24, MEDIA_BUS_FMT_RGB565_2X8_LE, MEDIA_BUS_FMT_RGB565_2X8_BE, MEDIA_BUS_FMT_YUYV8_2X8, MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_JPEG_1X8 }; /* regulator supplies */ @@ -101,6 +102,7 @@ struct mipid02_dev { u8 data_lane1_reg1; u8 mode_reg1; u8 mode_reg2; + u8 data_selection_ctrl; u8 data_id_rreg; u8 pix_width_ctrl; u8 pix_width_ctrl_emb; @@ -463,6 +465,7 @@ static int mipid02_configure_from_tx(struct mipid02_dev *bridge) { struct v4l2_fwnode_endpoint *ep = &bridge->tx; + bridge->r.data_selection_ctrl = SELECTION_MANUAL_WIDTH; bridge->r.pix_width_ctrl = ep->bus.parallel.bus_width; bridge->r.pix_width_ctrl_emb = ep->bus.parallel.bus_width; if (ep->bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) @@ -478,10 +481,15 @@ static int mipid02_configure_from_code(struct mipid02_dev *bridge) u8 data_type; bridge->r.data_id_rreg = 0; - data_type = data_type_from_code(bridge->fmt.code); - if (!data_type) - return -EINVAL; - bridge->r.data_id_rreg = data_type; + + if (bridge->fmt.code != MEDIA_BUS_FMT_JPEG_1X8) { + bridge->r.data_selection_ctrl |= SELECTION_MANUAL_DATA; + + data_type = data_type_from_code(bridge->fmt.code); + if (!data_type) + return -EINVAL; + bridge->r.data_id_rreg = data_type; + } return 0; } @@ -565,7 +573,7 @@ static int mipid02_stream_enable(struct mipid02_dev *bridge) if (ret) goto error; ret = mipid02_write_reg(bridge, MIPID02_DATA_SELECTION_CTRL, - SELECTION_MANUAL_DATA | SELECTION_MANUAL_WIDTH); + bridge->r.data_selection_ctrl); if (ret) goto error; ret = mipid02_write_reg(bridge, MIPID02_PIX_WIDTH_CTRL,