From patchwork Thu Jul 20 10:30:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3054461vqt; Thu, 20 Jul 2023 04:41:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlGzpxIJA0RXA6z1jQFE5UaasoTUxnOLvPu0fYQigRhnYflWcC02jvToM0WuwP5zez0R1NO2 X-Received: by 2002:a05:6830:1e35:b0:6b2:e8dc:e468 with SMTP id t21-20020a0568301e3500b006b2e8dce468mr2493799otr.37.1689853277911; Thu, 20 Jul 2023 04:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689853277; cv=none; d=google.com; s=arc-20160816; b=aAcqmsnUrQDr3VSevjNlrd4iKJIwHjqCl1vVZl62ZIF9AW9oJPUG9OKVO8Syns+bMy 6Ok3+QDK2plLZFIaigNblMpq4SfvClfo1Re45e7C9MUh/V/dbbFhUoywG1fGwG0rQwZR 48Gw8g5UO0fcdxzCZVn5C+X8iHx/1dC77WNFO6m6FaQT4WVRzrEMEgOnrBeat5ar7ctA hI0C8nXP+CaY6VGKWlvMmaHeI+klzeeQoH7rZxC9gRTcB3pyU9vc5o7QJ8bPr0KFozLC +Y52y0fn5Wkw5/QqWVm+9Krl+QKb02aiothSbG9IXIo1NAGgPvnKWZzz95c+ualWcskX D8xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=JX50G/1PridOyGRZtoJBLaOyh7tHwkD4X0+6VYfvjms=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=l677nRHvrIgjv8vuuPelkvIyPn236mTKXRdN4g85h9aiYOyPkI92JVkstEGfVZS7/Y YU+bfEOqaKfgG6jg4knAaihu8EpYSufzHCsSLwLLiSFVDOQDZPdg2ldlkMZlLz7+b1ib ErY9nFML4U7MGagraIlkPaKqjiRuvZ+c7Rr7iBAZ5rQF2QWbYayLjce+lxiDuw/DwEe8 WYy499XHmazDMGN537VFVxYrJ5Xo0vWz2v2RmyD01j6GnKT2yf3h9AV5oo3uRm0ftRz1 2DDaG4xz5DTeXrZ3WBxHeWxONi3nMMpOYqOBLL4GiqXuWyW8Hs3YG5Ojg3UZKw7bL8Od EXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=WjRX1Z6G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a63d809000000b0055391572218si33677pgh.26.2023.07.20.04.41.04; Thu, 20 Jul 2023 04:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=WjRX1Z6G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231374AbjGTKbp (ORCPT + 99 others); Thu, 20 Jul 2023 06:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbjGTKbk (ORCPT ); Thu, 20 Jul 2023 06:31:40 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22A9C1701; Thu, 20 Jul 2023 03:31:39 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 20CB12F5E; Thu, 20 Jul 2023 12:30:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849042; bh=VvRAsOayGAFfVlRWY6mvSxhGtbu4PqRaUHHDSYQLW78=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WjRX1Z6Gq3fbuR3hGGjZTrHyf++yYhoPnlYADQm5Swa67xruVukl1QoxeR9Y1kbfQ ilt731iTJOBJtVYmRjD5+WY96PRBUhHQiv5ic7g+DnPa93XeaZhLYpiOHGCr438T5F tRpUP9zdgz5NsLvoQJwZi8+RCSWSRgkeg8rqwSJI= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:32 +0300 Subject: [PATCH v2 1/8] media: i2c: ds90ub960: Configure CSI-2 continuous clock MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-1-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1537; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=VvRAsOayGAFfVlRWY6mvSxhGtbu4PqRaUHHDSYQLW78=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0EHUKJmhQkd21aXtcFt+ry9DJ3f/tcBaYhG P9RW2UCFsGJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBAAKCRD6PaqMvJYe 9fVyD/9UmdT0BwBvEErjuszB92Cw0kEX7l60TrqwbVeyil4kJVOuz5lUUJYRfJvMTaYkXS+VzzS EBROVv72P0bHP6Ve9NOBdXHOh12m0mE0OIKxrFfuSOwEfAq5IYmVExM73WcXme2R+cZpP7hYoWF fR1JXnsUKzLx1zaGq1BBUvmCQm49V1T9YV/HTUwKKcbm0NiNOwGlRQKgU3MvjKrGIPjHK3FvgJF tdTyNFtu/padgoGqaNSlIbJzqMYvpDTxVxHpX2k6x67ydHB36RiFk47Xw97a6PpgTsIcwN6F2wL 2o9CWQRpTiRDltAf2Cpfy2C7IOpI2+HKbnpobC6O37NL+Px4oQQs0oW5AU4hSjP2NbkvbSvXI34 49/GcGekmr8PV930Eg40tbfgrX9qN0j1e3W+/OERIuuYpWwAchfzt45PgLKb84+xqTzkPbCUELZ bKKc+sy+jhWtrJVBaloplWLfyKXu8s5Cu3ZVZAWqkBSvL8ypP1vmWi+MRWFPPKFZ3x1EgfRszx/ Rl0O4Dqdc7OnFfDhgazXJLy+4pWi6wxXz5cUT9SMQQB0nxoRZwoT70LScXf4zwzL12C9JudqEpl E1+/O81u8uWPsPZnA6LWUulHjbq156MmAV4uB3PWFPzrpxnD8L6I8UrHeYQ0RHavwpVWM6leZSW ymLoWMHFRNVbIHw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771939590671332563 X-GMAIL-MSGID: 1771939590671332563 Use 'clock-noncontinuous' from DT to configure the continuous/non-continuous clock setting for the TX ports. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub960.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index b9a1ef63629b..a83091f47140 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -149,6 +149,7 @@ #define UB960_TR_CSI_CTL 0x33 #define UB960_TR_CSI_CTL_CSI_CAL_EN BIT(6) +#define UB960_TR_CSI_CTL_CSI_CONTS_CLOCK BIT(1) #define UB960_TR_CSI_CTL_CSI_ENABLE BIT(0) #define UB960_TR_CSI_CTL2 0x34 @@ -485,6 +486,7 @@ struct ub960_txport { u8 nport; /* TX port number, and index in priv->txport[] */ u32 num_data_lanes; + bool non_continous_clk; }; struct ub960_data { @@ -1133,6 +1135,9 @@ static int ub960_parse_dt_txport(struct ub960_data *priv, goto err_free_txport; } + txport->non_continous_clk = vep.bus.mipi_csi2.flags & + V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; + txport->num_data_lanes = vep.bus.mipi_csi2.num_data_lanes; if (vep.nr_of_link_frequencies != 1) { @@ -1744,6 +1749,9 @@ static void ub960_init_tx_port(struct ub960_data *priv, csi_ctl |= (4 - txport->num_data_lanes) << 4; + if (!txport->non_continous_clk) + csi_ctl |= UB960_TR_CSI_CTL_CSI_CONTS_CLOCK; + ub960_txport_write(priv, nport, UB960_TR_CSI_CTL, csi_ctl); } From patchwork Thu Jul 20 10:30:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123178 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3026416vqt; Thu, 20 Jul 2023 03:46:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlHaQWXi7k+pQksDQwnqNI0KXPEzonvNQECGnxH4ewRPntrg6H7Z/NLCGh3TDDnKUL6Gvn23 X-Received: by 2002:a50:fa97:0:b0:521:7ab6:b95d with SMTP id w23-20020a50fa97000000b005217ab6b95dmr4565614edr.29.1689849987065; Thu, 20 Jul 2023 03:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689849987; cv=none; d=google.com; s=arc-20160816; b=rbGKl9W3K8OnweIdkY1EKoFpsA1kuSgnPW8yvn57oOMHm7ML5eEATnQdg7ircuX3bq UzutRCkSxM/XuJp4DVqp+TqQWTCeI64uzuxI3opGG15szCP+z8K3UK1K9au8Zk5RAh+5 wnka6QrR+Vexq+80WiYrPrHglXx2lu8jGmiat6aNmGXItHmfO1kCOfUeMrXEA4AY1Phz IuqbwIZ+2fceOCRqHnlT337KMPOEuKyzq2G9xuVN6yHj/K5hPPb5ovUaQxI5MbOtI4dE ElRvqIroUVb2USQ448LROtiYvybsBhjgtJ/uFfyl9AGSyIJklsB0TlERSNxfr1vXJF5L Il2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=+LgvThjGisYViECYiqpP3UOHTux+fmOT35ROPVBv2e4=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=wuSKe/NYxdRe8wpblr6HrFqgJQiajQ6S6pI8fpLbSpXKoGIa4U0Gfl0NIq9C12VOma dvXpvWrjfr9mQfe0rD5O3qSn+dcgRrxLB+r7vHWxKbxqUDN+XT8W06TPaQFFyp8K+UDl Gzl5uMhMNxFBQYmqGUh6lR52mQh0uhNHiMDcL2s7rToEWX3biOffGa88sN/wKKPG2hLb lTIiwm0enjBLd0QspJI64gIq44vv/YQYyUwD2uS/XMcTCm+5lB4ZEXvlSA6He3jPEVrT wjpjC3m9Ksb6anpC6zGigjAi50Kr63lQ5WHPriQFS6vQz1AM4n5GyTbfZ5S82cRa7Jjy +zbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RBp2sQ4B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020a05640202d300b0051e0c612208si601496edx.546.2023.07.20.03.46.03; Thu, 20 Jul 2023 03:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RBp2sQ4B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231398AbjGTKbs (ORCPT + 99 others); Thu, 20 Jul 2023 06:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbjGTKbn (ORCPT ); Thu, 20 Jul 2023 06:31:43 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3D510F1; Thu, 20 Jul 2023 03:31:42 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 030083484; Thu, 20 Jul 2023 12:30:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849043; bh=P2mwt86IU+mUzZLLbuoF0ir+LSKXHqgzspTaSIT0SUo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RBp2sQ4BeAQlW9GbIPUqXXxiM7Vat1kuWEuSNUnM+KqZX8kESb7u1Y+tGAUSD009x zAk16Q0j56P9QBPsR71Dr1+hyBAaef36TajrQjv9uVHMSWxX+5Dna4GFAbfv7ClXrK FXCjwJbYFcCgw0yUqq+Sg7NLye976KV4GI+hByCM= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:33 +0300 Subject: [PATCH v2 2/8] media: i2c: ds90ub953: Use v4l2_fwnode_endpoint_parse() MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-2-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1970; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=P2mwt86IU+mUzZLLbuoF0ir+LSKXHqgzspTaSIT0SUo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0FA9GXOLwxUYO52+WLLQqADbI7QZUvTsO5o 6uQOD1QOEaJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBQAKCRD6PaqMvJYe 9dKJD/9HVYxsj3ditaU5OdgmrYzNNMcy2DR8i8FE+5Sc46z+HqD5hWREguYYRs9kd2a2nFDRSnP yHaS9nteGT+HuWXkaLBMh4XJLY9IMpXb5X6q2sAsLrPUTdRPEU8GQ2h1aNoLIJXnIL44lTymJPV hSgiubMe0VBk6auxPmneHQTt/es6RTAG9v/QfN4nxJbkqbsiQ/MiDb090yxDLMN+IREPrMzmq+6 iqWbYwUCruJWQvzQjDuC01OZzhMnV2MVw4Uw4GVEhyW0HeKBit7VBDXKnqP8TIOWgSavxK33eV5 ITi3YgjW3lTdklCOi7z4gMplpdxqvu84Xs7VpkkgtrLH0WisgTeGcfGIEC08srbv8W9XhDuoJNp SzzFPV0ndcxuFkNL9B0HEs2CwGo3XISUJRvofcg8B5zpB2VmLVAwi2D1vzKUdd3T73g9C2p9e33 9XJzCpbu33rvdVKiTpgNuUu/pzo0PVQ8bpzVbMH5ECvVv3O3vPZr6/JPfTP/9XGUf4uidKv/crN iWK/vEUrg48v4+789L0jV/+lzlSlMy+VWYXGGoNMijsINhli3R8EWt8JcYciAM5EFmtUZO6wVV6 2P4nQv13LqhPJdG8AvxnlL67dLWuDOruXet0jOTSyTb8A+OQeZmFCKJyBEUrWvoO5YWs6Kp069v oRzd6mu7Anf9alg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771936139956736070 X-GMAIL-MSGID: 1771936139956736070 Use v4l2_fwnode_endpoint_parse() to parse the sink endpoint parameters. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub953.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index 591b52bf71c2..ad964bd6c7eb 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #define UB953_PAD_SINK 0 @@ -1111,7 +1113,9 @@ static const struct regmap_config ub953_regmap_config = { static int ub953_parse_dt(struct ub953_data *priv) { struct device *dev = &priv->client->dev; + struct v4l2_fwnode_endpoint vep = {}; struct fwnode_handle *ep_fwnode; + unsigned char nlanes; int ret; ep_fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), @@ -1119,19 +1123,21 @@ static int ub953_parse_dt(struct ub953_data *priv) if (!ep_fwnode) return dev_err_probe(dev, -ENOENT, "no endpoint found\n"); - ret = fwnode_property_count_u32(ep_fwnode, "data-lanes"); + vep.bus_type = V4L2_MBUS_CSI2_DPHY; + ret = v4l2_fwnode_endpoint_parse(ep_fwnode, &vep); fwnode_handle_put(ep_fwnode); - if (ret < 0) + if (ret) return dev_err_probe(dev, ret, - "failed to parse property 'data-lanes'\n"); + "failed to parse sink endpoint data\n"); - if (ret != 1 && ret != 2 && ret != 4) + nlanes = vep.bus.mipi_csi2.num_data_lanes; + if (nlanes != 1 && nlanes != 2 && nlanes != 4) return dev_err_probe(dev, -EINVAL, - "bad number of data-lanes: %d\n", ret); + "bad number of data-lanes: %d\n", nlanes); - priv->num_data_lanes = ret; + priv->num_data_lanes = nlanes; return 0; } From patchwork Thu Jul 20 10:30:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3026872vqt; Thu, 20 Jul 2023 03:47:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlFrnDu0zfV+1WerDt8071uwBSj+b2jM9sDLNgfVXuga12C3B89RabKCxNQ7mPeswdbZYzI5 X-Received: by 2002:a17:907:6d20:b0:991:e815:a1ef with SMTP id sa32-20020a1709076d2000b00991e815a1efmr5067775ejc.31.1689850061689; Thu, 20 Jul 2023 03:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689850061; cv=none; d=google.com; s=arc-20160816; b=iFrsBD0jQDRWp7XIJkJMWjX3hPsF1t2PsMUPk2k0QTEWnp+aZv3lGanGR1I9Et8jhF hC35BWmBRyGbFLei98SUZia1W+j9sv1O4GXw7eHOlZSpjmSMM6LecnfjF7gEh8aIUjut gH5Xd1Hv6451fCh3IVuXcLYPY0nuE0WfUIWzSWQn37OW4wRLAzJ8bUfmURuBhkaE2zP+ suUsL8k4ymRHFGlzduIknC3t06vddVfs8iklTdzlw8tQWKqMCZECB12GSukvd8MOE1fG Df+xDUPquXkq+P06FCZCzjRx61BcaYsfVkgZTKsqnXVMhmJQqyDwhRHY/CkNZWABKbw2 TaeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=XmzvHkknUVe0AEjMbQmZ7ARGCoKnA1ziFPyeKNdgRjs=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=CA7OCnRv3d09uuTfwdx7s1VTze1afbex54H5UQNYNyxT9+DhbMV1mq6yGUUZp1IlGS C8aVy0cRDdWf3kTdJwtE1nhUQUfw2TkmLHsVkbbibqxw/b0qgyeEdQ0rGg9IaC2cioBd vMD8xSCieH44/xBG040XVJgIHmYLRJs779jBP8aVLKddHBCVVnqyZWfWZryVW3859YMg QOj9C1cDx9r97DXxpxFaet805tFiPT2F2A1+LbcsSvmq127AeKTDdx61NSth2Jyz0nti QMagYv4Flw87tHqLgYgGxZOyf5Etou6/xau5r0jaOrLpcf9CNeSebNtfVY11hS4rslYZ QSFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gLRZb6AF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt17-20020a170906f21100b00992f45c9343si473355ejb.1025.2023.07.20.03.47.17; Thu, 20 Jul 2023 03:47:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gLRZb6AF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbjGTKbw (ORCPT + 99 others); Thu, 20 Jul 2023 06:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbjGTKbn (ORCPT ); Thu, 20 Jul 2023 06:31:43 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D68910FC; Thu, 20 Jul 2023 03:31:42 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D93AE35CF; Thu, 20 Jul 2023 12:30:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849044; bh=uXXiOXqzAU663MXYPT+tmzzgKeAuEaHLvlQ0jliVr5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gLRZb6AFKQidi64B0rF14hKfBN9ZKMZrDhvCf5cW9qC8Hxg8SAsq3ZAK1Knsl2ogC pmwZ4YknB+hbQZW9j0MXHoEOr5z4glDIp39Hkw7boJ7v+J4doeb6zv2xq7NZU+FP9V mk3WQtEN39Uoz1D1MR12D4UnqWKJTdwwOCqVpvuI= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:34 +0300 Subject: [PATCH v2 3/8] media: i2c: ds90ub913: Use v4l2_fwnode_endpoint_parse() MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-3-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2600; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=uXXiOXqzAU663MXYPT+tmzzgKeAuEaHLvlQ0jliVr5o=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0FoUEkQ60fvyZWGZBo8/gv2L3cSLqBJFNNy jhrdDffSKuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBQAKCRD6PaqMvJYe 9erZD/45jCtpXK5XImZlG2TG8AXAWT6T3sCxNwrn78kiUW97Is5ICbG3T27HYJRRVzYtednngw4 qFXN0MLj5BgvtCTofolDCn0n3zCfKuwGZue0k6dM13rGCNcqyT/YGd1uQ5wcNNEptgsmJx3p50L ynBlE7loHtXLhgMjGFtzan8qcKIS0a9cEQXEFrkobBFLTMovW0dQ6dpbEcQq9gwzuVH4TPhDg/X dkcDVvQFa/JvGtRgg2ArE32WrF4xE+noOcwjZgDLGFlbvDzkL+87e4x4txgsf9mJIWo5Stc1xDo LTtOy7EeYuNnvIc8bKAuXseOmLASg3OkJSWf79LScUj+932M5Sd1nA1iiblkrRx5/QGwsptalnv CxZ9qz/JIXVLv0JexBEvytAFkCp+XWaEl1+fyMeXXdvbxfFefZw/SZNkKCQHBeufeV+Pl5VznLI olKrhec2yGBcqG4Rol4kzls13uD/+kIC5te016suagEIy+86qsqIoCrIhLiA7ZBTC4QaKiNiMKT 7XrpJ4a9j50Jn76fw8ro1/1S6a2rNViPMWOChFACc5XBAt4285O9OFxTIuwZ6r3+dwyMYPiMdNo BKBOgxgfeDtN8V5gJuSJztkxeMzzZ8PlOqL0EWwb7gasT1U5lxnitBP26sWH7ejXESpxjhF0fSB 0hDhFlDAO3fsp5Q== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771936218378261233 X-GMAIL-MSGID: 1771936218378261233 Use v4l2_fwnode_endpoint_parse() to parse the sink endpoint parameters. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub913.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c index 4dae5afa9fa9..cb53b0654a43 100644 --- a/drivers/media/i2c/ds90ub913.c +++ b/drivers/media/i2c/ds90ub913.c @@ -21,6 +21,8 @@ #include #include +#include +#include #include #define UB913_PAD_SINK 0 @@ -83,7 +85,7 @@ struct ub913_data { struct ds90ub9xx_platform_data *plat_data; - u32 pclk_polarity; + u32 pclk_polarity_rising; }; static inline struct ub913_data *sd_to_ub913(struct v4l2_subdev *sd) @@ -675,25 +677,31 @@ static int ub913_add_i2c_adapter(struct ub913_data *priv) static int ub913_parse_dt(struct ub913_data *priv) { struct device *dev = &priv->client->dev; + struct v4l2_fwnode_endpoint vep = {}; struct fwnode_handle *ep_fwnode; int ret; ep_fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), UB913_PAD_SINK, 0, 0); - if (!ep_fwnode) { - dev_err_probe(dev, -ENOENT, "No sink endpoint\n"); - return -ENOENT; - } + if (!ep_fwnode) + return dev_err_probe(dev, -ENOENT, "No sink endpoint\n"); - ret = fwnode_property_read_u32(ep_fwnode, "pclk-sample", - &priv->pclk_polarity); + vep.bus_type = V4L2_MBUS_PARALLEL; + ret = v4l2_fwnode_endpoint_parse(ep_fwnode, &vep); fwnode_handle_put(ep_fwnode); - if (ret) { - dev_err_probe(dev, ret, "failed to parse 'pclk-sample'\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, + "failed to parse sink endpoint data\n"); + + if (vep.bus.parallel.flags & V4L2_MBUS_PCLK_SAMPLE_RISING) + priv->pclk_polarity_rising = true; + else if (vep.bus.parallel.flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) + priv->pclk_polarity_rising = false; + else + return dev_err_probe(dev, -EINVAL, + "bad value for 'pclk-sample'\n"); return 0; } @@ -726,7 +734,7 @@ static int ub913_hw_init(struct ub913_data *priv) ub913_read(priv, UB913_REG_GENERAL_CFG, &v); v &= ~UB913_REG_GENERAL_CFG_PCLK_RISING; - v |= priv->pclk_polarity ? UB913_REG_GENERAL_CFG_PCLK_RISING : 0; + v |= priv->pclk_polarity_rising ? UB913_REG_GENERAL_CFG_PCLK_RISING : 0; ub913_write(priv, UB913_REG_GENERAL_CFG, v); return 0; From patchwork Thu Jul 20 10:30:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123188 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3042067vqt; Thu, 20 Jul 2023 04:16:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdhC3zfd2GAh06lApok6NPlBZ980lxXSvlqOo9YxD+9+IY23UXKkDQA+I6I90HUguFEAST X-Received: by 2002:a17:902:bb89:b0:1b8:1b79:a76d with SMTP id m9-20020a170902bb8900b001b81b79a76dmr16860539pls.44.1689851805146; Thu, 20 Jul 2023 04:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689851805; cv=none; d=google.com; s=arc-20160816; b=e6rnAvjp8Kt0Be0qxmtKUYPrv7fmVKKpCocG34AwCGMARw0gQJeKYcCatyqOVr5tqW L0VN3iSg2zJQc0zGiww2p8nDW9rZucCL+vn4en2usseUrOdb5ZE3jjMhPFYEA5tkyoY7 Qdyk7O3GRhkG21x14dm8woHYeXAruQT9bePDbJFRDWrbqN+e1wK/pVqax5Ygi8Cqs6YG qBeoyaDo4E13Vgcan7HhsoqE3zXNES2FKyT0FYd3+aTcCcg+F5A6pbOh3BwcfJSORNF4 XMKTfDKK1u4E1TVeyzFN4u5hPW3yEmBkrF7qzSvwAh5zl3o+PkrabnUbMgOIHZiys4j9 IB9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=oc4axegdAh7K62niS8I5wRO/sgWWa30gMoagLORzAwk=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=L4fv6tMg109Ztmhw3RPLb90mDaXyd7sqN4RnBIiynRzsOBSRdpv1MDFaIM4bKirAKM P94llBoDeMzEPj628djcebvxcq5cULelxCDgNXCYD3encBFFgj3bHjWHHP94ZnEZsLqR XquL7NWHkVCAWv89kfRSEiW6Tyc1uvPqMxNgLqCzxsDA+g6VGzygJMCleQzT3NecaA70 HIsU8oUzk8u7ykjYp4Pd3XHV+5KFpbuiSPTJcBcf+H3K/q68aIn5Pctpzf/9OiRgivgn cSEhljuyetwqbmIRS9vCFTeq5MP0mxdP9Swvt7JIera7XDMo7gGOLm8UOTnd2jdTrVR9 lHfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=kpfxg6FZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kz7-20020a170902f9c700b001b9ca3550c0si746872plb.52.2023.07.20.04.16.31; Thu, 20 Jul 2023 04:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=kpfxg6FZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231407AbjGTKb5 (ORCPT + 99 others); Thu, 20 Jul 2023 06:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbjGTKbp (ORCPT ); Thu, 20 Jul 2023 06:31:45 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5945310F1; Thu, 20 Jul 2023 03:31:44 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BA0483697; Thu, 20 Jul 2023 12:30:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849045; bh=3zg0TxkVcXHwj80fcueaquBqUvRn/uJahEbl2HWcRHo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kpfxg6FZprwwUtPx9ietn1V4s0lFbbWhlMEwizaf+z1blPmYtbwBJT3DnkbVK0Ss/ Qd0lTD3yCP6aGS3HJnRaQqytNZKDkZfWXd2Ynul8b69Y5XIb7lUxLYLSiWDow4//5N rPBWN77RwyJmCIVCxDTA+48fnZT/uayuNmKtwFfo= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:35 +0300 Subject: [PATCH v2 4/8] media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-4-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1301; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=3zg0TxkVcXHwj80fcueaquBqUvRn/uJahEbl2HWcRHo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0FWYffPp2nMhTi2liX/2xEN899/vyaYUJJX yU9efkuiHyJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBQAKCRD6PaqMvJYe 9RPAD/47epS1smq6O8YL2r+cKuMGUA+uCmzry2xhn4N/I7X51aKRcgpq22drWpksdA8nKP81kCH WASbwl9eJnahZX37OWbDsAvLFJsU9oryaAkDooOp4lizGw/c8AjXlLrjsIt+3mjK+6EFKvmAMjP b+lulfsxM08Dbx7vivjtMVR72qed3+YoD/CS11CPK+Miq7FYqMzwWRivgyoPjAcqD5VXqd0uG43 cSpfrpx0N85dnvpjBwZ4V6cIdyaW61FCjsIPWX2CQsvcVrR5Rkf3xdy1b+s8SHfeuChe818j0Zj 9yB/QBDVO4ne9sGJHQ3Ke6PFGbcqM/4BQMGrUMqxz+H11WCNGbdsEb/swjUqHriec/fWuzlcVOO PKqAIdKWJBgMxINgkMB82cGxLnOLXV9cu3ZkOePqGu6mUMO+k1VKiLHZygPQe30MrdAm3qJblux ru3TGTn9ahKlgm7JkqVA+F/ENu3ESZvN3TsTyxCMf/My8CkCk0PUkxkVYR2O00/DxNn1sAnKaPi jwJfWbgiEbdxhQ+rpyK2WPwuW9f1eQlHrgaOTMYoVuLtmfFhaaCjJaPnYXPkqbsd2Vrc4rbLlJN dJsY6l42GtQ8jF2qXSxWVGMLyM50ErM0xU2KVhhqIyOzajwmLa1RV2Wfw1+JfGU9T94xv1t3K7Z qTS8JbfVtaLKXSw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771938046185582643 X-GMAIL-MSGID: 1771938046185582643 Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK flag to configure the CSI-2 RX continuous/non-continuous clock register. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub953.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index ad964bd6c7eb..ad479923d2b4 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -138,6 +138,7 @@ struct ub953_data { struct regmap *regmap; u32 num_data_lanes; + bool non_cont_clk; struct gpio_chip gpio_chip; @@ -1139,6 +1140,9 @@ static int ub953_parse_dt(struct ub953_data *priv) priv->num_data_lanes = nlanes; + priv->non_cont_clk = vep.bus.mipi_csi2.flags & + V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; + return 0; } @@ -1201,7 +1205,7 @@ static int ub953_hw_init(struct ub953_data *priv) return dev_err_probe(dev, ret, "i2c init failed\n"); ub953_write(priv, UB953_REG_GENERAL_CFG, - UB953_REG_GENERAL_CFG_CONT_CLK | + (priv->non_cont_clk ? 0 : UB953_REG_GENERAL_CFG_CONT_CLK) | ((priv->num_data_lanes - 1) << UB953_REG_GENERAL_CFG_CSI_LANE_SEL_SHIFT) | UB953_REG_GENERAL_CFG_CRC_TX_GEN_ENABLE); From patchwork Thu Jul 20 10:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3051405vqt; Thu, 20 Jul 2023 04:34:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlECtZkVsagfL1yHOegXsJCRnxKqXPy1WhjRE6rBzerS44HlT/R+3HERXn2VdW0KIFHkL0SJ X-Received: by 2002:ac2:4c52:0:b0:4fb:8603:f6aa with SMTP id o18-20020ac24c52000000b004fb8603f6aamr2432375lfk.11.1689852891354; Thu, 20 Jul 2023 04:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689852891; cv=none; d=google.com; s=arc-20160816; b=ETLU2Nj29gT24QaUe1wGOo/Oz+ysu3HKRVLsQX+q3GnpllAcW7EgVKZHC4p22l2t1n S0wV6de2tn8ZVBs54QqWYbzdN0ylG8hM1h5ApZ5kzrxtwISsBTpCQ0o5qFdROXdhNzmb /7XXp9YPzhjUr5tYm/14UAtY77LA4lVinBLGSa9ylZ/EVRdcHQpWGF884MCV8XZmbv40 E7fT1AMUeH47gJ0DJ1MBgiuhBS6FixOD8O78keNz0a5LFRoIGbQuBV4d+Kth378958Ft otjMaX+qLRnJpoQpF4+kJnIJrldNS4Ta5yq+7jxLqaNf07Eeeyi3Z7FazMyBho3PUHD1 2Hjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=6T3+hcc9cNZZUU6ojvymcLdH1t9m4ytOprrW2R/igP4=; fh=jh+7v3szpfmpm7aeAZBeUyBAgjiSgOnhDPEhaInbk38=; b=CZhqGnxmmif9fV8LUACvN1xpili0KfOSQn3oE0aROuADbEouqFQB8scPAfc9mboCFR 0gmeqB7Gdh0zLhvVCe+0iIjBmRDHU2jLAV7HfeAjEuLUMMNRmpd2j/L9RnJDLqsIxLan xzjDwAVn6ajx0sIrcWfrdFEHW4J2Z28ynufB9g7WNH2CDzQ1d4sVWRpC6DX9tspFFstT lm2Y7nRdr+TVCWDM+8Ruxw71IQ7xXEDUCT5FSDmDY9FcnUdN366id4TjWtcLvY3ajbBm PF2p3VnGBqWnP5DcxzDFmnxiBYwgkWMqi1mGLiKnOOVAiIqTaFH339XaH7BX1D2/wYMu iX9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=wUd28V0p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020aa7dd12000000b0051e27e00a96si675667edv.126.2023.07.20.04.34.27; Thu, 20 Jul 2023 04:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=wUd28V0p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbjGTKcB (ORCPT + 99 others); Thu, 20 Jul 2023 06:32:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbjGTKbp (ORCPT ); Thu, 20 Jul 2023 06:31:45 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9015910FC; Thu, 20 Jul 2023 03:31:44 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F1DD373D; Thu, 20 Jul 2023 12:30:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849046; bh=bS5i5doTbSucq0ar42mZOd1EPRTamwE8j3ah3qy/e4s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=wUd28V0pe4O9hotnFlHCiz8pzFKU6I0ugnmryeXgX29mhIi+EDjjtTfbMv5YuCOTO rk3Yf9Fm7Y35rHcJZEGtbIzFl2glcuRF9A86x1mdrknhUsq3JJYfMEqJZa6YRtpn0d CoOVA2qIANLZ3XAGHzBqq/L2fRxNa1RuRV0fU+so= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:36 +0300 Subject: [PATCH v2 5/8] media: i2c: ds90ub960: Allow FPD-Link async mode MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-5-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen , Andy Shevchenko X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=907; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=bS5i5doTbSucq0ar42mZOd1EPRTamwE8j3ah3qy/e4s=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0GYZsPUbzsSK2JECdTPkcdIHBDIEvrJu359 Mm270T0WJOJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBgAKCRD6PaqMvJYe 9QnJD/4s8UeNqGmWQPr9OW3S/znmoLR5DpkmyTgwNiUNCqKqM3a/6v52+j0Muf+J67a80e6Dkhq ybnCQ8k6Uy+YWBGOYy0cAjRYBoKazSyzlfASNhduK6EWjDWsbLF7hhuKtloVGUjsLrTAGIL3Gso OMWS+vKPSo8DFiHAvi4Hxaljlt5bfDl3+M3X3/VvyVNdHeO5d6//NH3j6fcVIIg9Man94zq9uGa /oFJoeiDTXc1RAyC9PqD5lQ8kOD38E9H6WcvuXv/sbAvBr3CEMZesA1N01vsRGxej3b98hQSKDz dHNwyUPyhyCp8gtI6hCvTiDFnwLqQJXYAkS24Ui1aDEkV4meIL1qHWt2nec+Ay9use1A3PvFPy/ Bh0gMywGhqRp+8sgMF7K2/wC75nZRfOpt10GlXBhGcXpTmXwH9GA3Jhzu7z32SHPVfK0aMM02Gq qTMXKabRHskOnN3HUNGmyAfoN4a8J7a32oIzLihMLWE83w10lmjQbFDe2hPhaezsCQM0S52PlNH 6p4s03CJlxFNg6C6cdWuKpMEL9099sFca4TMHeZveldqIMT6reV7sgQF/HuV2WEOqjLAHBJKjVp WdGMfmFrRzk6nSUxXqB6BiDl/XTmgPWr9xOgSHO6kgcKpIrjazB0PRGOh4OdSlho0pmKHhoXR61 sTS0DtF6TenI4PQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771939185590961457 X-GMAIL-MSGID: 1771939185590961457 Allow using FPD-Link in async mode. The driver handles it correctly, but the mode was blocked at probe time as there wasn't HW to test this with. Now the mode has been tested, and it works. Signed-off-by: Tomi Valkeinen Reviewed-by: Andy Shevchenko Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub960.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index a83091f47140..ea819fb6e99b 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -3240,7 +3240,6 @@ ub960_parse_dt_rxport_link_properties(struct ub960_data *priv, switch (rx_mode) { case RXPORT_MODE_RAW12_HF: case RXPORT_MODE_RAW12_LF: - case RXPORT_MODE_CSI2_ASYNC: dev_err(dev, "rx%u: unsupported 'ti,rx-mode' %u\n", nport, rx_mode); return -EINVAL; From patchwork Thu Jul 20 10:30:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123187 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3041514vqt; Thu, 20 Jul 2023 04:15:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlG1vRtltzuBbj0uKS25PguCbJtL/zybKXfWR4jq1QJxtZYNIctUWYGINHYq62z8xo9ehDvP X-Received: by 2002:a05:6358:7e8f:b0:135:845f:431d with SMTP id o15-20020a0563587e8f00b00135845f431dmr19528156rwn.21.1689851740233; Thu, 20 Jul 2023 04:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689851740; cv=none; d=google.com; s=arc-20160816; b=a1g0I15qx9mr1W/IFtf4N8QYf4lvGOAuoDdAXRxAv0IMB/JEB/PX+nqHo7mRPU0D5A xqx6K/ptC0Jt8DN+2E1fRWhyBxkIHNYT4hX65FNmtJ/sscJPrD52JT+PBl/X3+4tnldk buvZ0/q0Oyqnc3a6IBTPmou5qpvcvNUwSt+gVueHA0neGdioN7VsSL/+o4jDtHLljowz b2Ipb4u9mYA/q46b6wioMcAW6SiggKH2EQm5rX5XkIlMVc2w6CgfZAYtqxTO3kSDOP30 Mnm39V2yxHpCda7Xvat2yHOEo/urPCSAaR2LqVtj4brQV0P4BFk1qISy/nKV8+Wy7Ger 0egw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hyv3nQP1zRS5rVTzTCFdiUlVfHqwfhmUWaGkXwS4yMc=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=tf3+oQEyGxL/XC9+Ny+TD2Bu8UsCi6xzCS0oGtt9GmKRbrAPwaid3kffWRTUn7z2kX uw7JXdqnuoICSQZdfY2w+1mtii6kXonvpNdSZR7N0TJ6U0CoKb+RbpwPl+qmJkTTYCYm uSHpwwKVgiElYfPATaUbhuncPtstYyEZ4LOd4170mim5kVG6OhfEb31nArJ0B1ENRPm3 RzIfBzE2kwtkFPRjLPXjQ4KpVVqEYYGUDml0bErO4l037P8VrZa7ZOBx2PMBgtRYftDg tNNrAYeQBW73GvZ0CAvDkhU4Jqt2zZGr9h6doIKrlc+WHtRu3FOBXuoYTC6Xeiw9lFTN G2Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qOJTeAAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a63db44000000b0055c51cc6265si588485pgi.551.2023.07.20.04.15.26; Thu, 20 Jul 2023 04:15:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qOJTeAAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbjGTKcH (ORCPT + 99 others); Thu, 20 Jul 2023 06:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231382AbjGTKbs (ORCPT ); Thu, 20 Jul 2023 06:31:48 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D3410F1; Thu, 20 Jul 2023 03:31:46 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8ED4737A2; Thu, 20 Jul 2023 12:30:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849047; bh=voR+HIz/XDavd4wzz+Vp//Iu4A0tNRNWdTZwN65n+JA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qOJTeAAF3tE6iRTT5jV6xxjKztvE1oDRJZ1hno6nioW0QURCwO/dPtFm2yyCbLJZk G9w1cVZ8i2avaoSyUBkKm9wV4dL/dixDhpq+EpeV1liYz12gkgWj8Ab/0evs6R+oJ/ zcLYvA2Hg9rvtMYRUpyjs7+KFCqUfMbaZXke5dUU= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:37 +0300 Subject: [PATCH v2 6/8] media: i2c: ds90ub953: Restructure clkout management MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-6-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6059; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=voR+HIz/XDavd4wzz+Vp//Iu4A0tNRNWdTZwN65n+JA=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0Gh4xXec7JBNHbwWLxEILbCSmxX/r09MWxF riAySfG8geJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBgAKCRD6PaqMvJYe 9XsZD/4oZvc1In4dU9ecUxJcex96ZAaNC6MyWiaVfKcTQ5tceKRvVcugDEJB3lMiN46aRY6qhtx 52PbvOESJrTS/V4LU8gIGPebkF7ji+tS4464TunFmeOgd0k9cixziwUOZZ/zDT50GXyu6+qjYkE i79F15ZNsHyOFk68iIsenAAgZvf6yBivCQeSjRltHx4ECnvucg9fnS+eWQnaeRWA0puzMCNU4xx bqrqoeUvFq/W3ZoxQ5zkuHmZs1EWxO6flcziZPYrGRZHabM1hpEfaRD1WT1jkTa55we4qUoUfzx ZHS3xJxpII62k8M8YRqwLKPOQNf/q75IGCiYpe5m4dsatxudLRyaCeO2G4ff2taQf89NT41RJnH Tct5ljQ41Ihy0N+69EYjQm5ChS1i2D5lof0Kw+wMecDRF8xR/kOIjEwrFiwD/1CYcft8BzTVbwl RIqU9kAK+IwsAfu9ApkujeP5T04dM67rZpHDwuSiitvRyGhZ48mFXA7YmEPT98kvL8NN5UH09cE Z1E3Si9lLCqClKjDmuFX98JrNUYfmyo8/0hZdAFOiC8kgYBYreqmmiAeLQIEFkZ4ZVkOjv+RUfv sXFqAezX5PFndxr+nY2m2Mr/Lku6YTzWa8b9nLmvqMCYpXxEOWK32uIr7UOU4gJ4TVZfLko+GoP v5OR2w2UXWCU4DA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771937978601147543 X-GMAIL-MSGID: 1771937978601147543 Separate clkout calculations and register writes into two functions: ub953_calc_clkout_params and ub953_write_clkout_regs, and add a struct ub953_clkout_data that is used to store the clkout parameters. This simplifies the clkout management. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub953.c | 135 ++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index ad479923d2b4..3a19c6dedd2f 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -131,6 +131,13 @@ struct ub953_hw_data { bool is_ub971; }; +struct ub953_clkout_data { + u32 hs_div; + u32 m; + u32 n; + unsigned long rate; +}; + struct ub953_data { const struct ub953_hw_data *hw_data; @@ -906,6 +913,58 @@ static unsigned long ub953_calc_clkout_ub971(struct ub953_data *priv, return res; } +static void ub953_calc_clkout_params(struct ub953_data *priv, + unsigned long target_rate, + struct ub953_clkout_data *clkout_data) +{ + struct device *dev = &priv->client->dev; + unsigned long clkout_rate; + u64 fc_rate; + + fc_rate = ub953_get_fc_rate(priv); + + if (priv->hw_data->is_ub971) { + u8 m, n; + + clkout_rate = ub953_calc_clkout_ub971(priv, target_rate, + fc_rate, &m, &n); + + clkout_data->m = m; + clkout_data->n = n; + + dev_dbg(dev, "%s %llu * %u / (8 * %u) = %lu (requested %lu)", + __func__, fc_rate, m, n, clkout_rate, target_rate); + } else { + u8 hs_div, m, n; + + clkout_rate = ub953_calc_clkout_ub953(priv, target_rate, + fc_rate, &hs_div, &m, &n); + + clkout_data->hs_div = hs_div; + clkout_data->m = m; + clkout_data->n = n; + + dev_dbg(dev, "%s %llu / %u * %u / %u = %lu (requested %lu)", + __func__, fc_rate, hs_div, m, n, clkout_rate, + target_rate); + } + + clkout_data->rate = clkout_rate; +} + +static void ub953_write_clkout_regs(struct ub953_data *priv, + struct ub953_clkout_data *clkout_data) +{ + if (priv->hw_data->is_ub971) { + ub953_write(priv, UB953_REG_CLKOUT_CTRL0, clkout_data->m); + ub953_write(priv, UB953_REG_CLKOUT_CTRL1, clkout_data->n); + } else { + ub953_write(priv, UB953_REG_CLKOUT_CTRL0, + (__ffs(clkout_data->hs_div) << 5) | clkout_data->m); + ub953_write(priv, UB953_REG_CLKOUT_CTRL1, clkout_data->n); + } +} + static unsigned long ub953_clkout_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { @@ -965,52 +1024,25 @@ static long ub953_clkout_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { struct ub953_data *priv = container_of(hw, struct ub953_data, clkout_clk_hw); - struct device *dev = &priv->client->dev; - unsigned long res; - u64 fc_rate; - u8 hs_div, m, n; - - fc_rate = ub953_get_fc_rate(priv); + struct ub953_clkout_data clkout_data; - if (priv->hw_data->is_ub971) { - res = ub953_calc_clkout_ub971(priv, rate, fc_rate, &m, &n); + ub953_calc_clkout_params(priv, rate, &clkout_data); - dev_dbg(dev, "%s %llu * %u / (8 * %u) = %lu (requested %lu)", - __func__, fc_rate, m, n, res, rate); - } else { - res = ub953_calc_clkout_ub953(priv, rate, fc_rate, &hs_div, &m, &n); - - dev_dbg(dev, "%s %llu / %u * %u / %u = %lu (requested %lu)", - __func__, fc_rate, hs_div, m, n, res, rate); - } - - return res; + return clkout_data.rate; } static int ub953_clkout_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct ub953_data *priv = container_of(hw, struct ub953_data, clkout_clk_hw); - u64 fc_rate; - u8 hs_div, m, n; - unsigned long res; + struct ub953_clkout_data clkout_data; - fc_rate = ub953_get_fc_rate(priv); - - if (priv->hw_data->is_ub971) { - res = ub953_calc_clkout_ub971(priv, rate, fc_rate, &m, &n); - - ub953_write(priv, UB953_REG_CLKOUT_CTRL0, m); - ub953_write(priv, UB953_REG_CLKOUT_CTRL1, n); - } else { - res = ub953_calc_clkout_ub953(priv, rate, fc_rate, &hs_div, &m, &n); + ub953_calc_clkout_params(priv, rate, &clkout_data); - ub953_write(priv, UB953_REG_CLKOUT_CTRL0, (__ffs(hs_div) << 5) | m); - ub953_write(priv, UB953_REG_CLKOUT_CTRL1, n); - } + dev_dbg(&priv->client->dev, "%s %lu (requested %lu)\n", __func__, + clkout_data.rate, rate); - dev_dbg(&priv->client->dev, "%s %lu (requested %lu)\n", __func__, res, - rate); + ub953_write_clkout_regs(priv, &clkout_data); return 0; } @@ -1021,32 +1053,6 @@ static const struct clk_ops ub953_clkout_ops = { .set_rate = ub953_clkout_set_rate, }; -static void ub953_init_clkout_ub953(struct ub953_data *priv) -{ - u64 fc_rate; - u8 hs_div, m, n; - - fc_rate = ub953_get_fc_rate(priv); - - ub953_calc_clkout_ub953(priv, 25000000, fc_rate, &hs_div, &m, &n); - - ub953_write(priv, UB953_REG_CLKOUT_CTRL0, (__ffs(hs_div) << 5) | m); - ub953_write(priv, UB953_REG_CLKOUT_CTRL1, n); -} - -static void ub953_init_clkout_ub971(struct ub953_data *priv) -{ - u64 fc_rate; - u8 m, n; - - fc_rate = ub953_get_fc_rate(priv); - - ub953_calc_clkout_ub971(priv, 25000000, fc_rate, &m, &n); - - ub953_write(priv, UB953_REG_CLKOUT_CTRL0, m); - ub953_write(priv, UB953_REG_CLKOUT_CTRL1, n); -} - static int ub953_register_clkout(struct ub953_data *priv) { struct device *dev = &priv->client->dev; @@ -1055,16 +1061,15 @@ static int ub953_register_clkout(struct ub953_data *priv) priv->hw_data->model, dev_name(dev)), .ops = &ub953_clkout_ops, }; + struct ub953_clkout_data clkout_data; int ret; if (!init.name) return -ENOMEM; /* Initialize clkout to 25MHz by default */ - if (priv->hw_data->is_ub971) - ub953_init_clkout_ub971(priv); - else - ub953_init_clkout_ub953(priv); + ub953_calc_clkout_params(priv, 25000000, &clkout_data); + ub953_write_clkout_regs(priv, &clkout_data); priv->clkout_clk_hw.init = &init; From patchwork Thu Jul 20 10:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3041496vqt; Thu, 20 Jul 2023 04:15:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlEmpaXJD1q35cLgOuPKwLYwa+xDSQaUkCX8RhJYZhu2f83o5gf78d6MLeBuNYmyW8Hefcgi X-Received: by 2002:a05:6358:990e:b0:135:85ec:a08d with SMTP id w14-20020a056358990e00b0013585eca08dmr6454295rwa.31.1689851738255; Thu, 20 Jul 2023 04:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689851738; cv=none; d=google.com; s=arc-20160816; b=nnqjqBYCHo6XWffeWa18iuWcBgNndRanq9wGZxhy+d7djeWe5+Ud2JOewhvuI2BClp y2H0kkMUUGaA0IeVZ5ArP5Uw2ML66pC0o9umvgEYEUmvfPIYC2P+AvGpI5liDlLoqQWj Cf8hR2PQMW1X4nmSw17QbiI1qkcAZHRnIJ8FRQgE6mYx0S+Y+L5zTG7Qvde/Y5L3t06H qUmYazyW9bAhwVjdeHUpMVItbSTuebcwKSNVGld9IhID3xN1QczGFKSG5RScdPClXFuh 903BXQ7C7aPNKlJtV0y02qmFSp0MV+PE7DwnS+1yrbgH9u8hifRJYQWiH575hggRl4do xyxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=eP6W3NNEZS2snGppWwC/z0SUNUrGK0BsOfgbzb4Ljak=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=dhd1c1Jp4+MTAQ/DJ4G1l8vCm+ZxaBZL2GjCIAgP1ta/aTQRL2wLs8pb7jKcsqo28z TpPtK6T8IgtCyF9P5y+92q4kN8roaUEJVqngioicg7gaKkc0qS3kohm3LONQRoR4vbdj DW2sum2r8jNNEP+VIK8zrvOhzE6cwesb290MkDQWXkG3PBs+IYIso5Inmij/Vp3YD7vN KFdhCO2LRqUjarqHAJrwl5uUOeFHXgeCOGkDIIP7aLlYQJTrjJ4t/DAAF2tZmwxEn85G XXbtGAb5rljJGWiH7vT1UCwJJ+gBpJGCvPKKdeBMozLgNABQkxkkUuvq93JJnzYjDfE5 COcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="kTWD2/BO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q35-20020a631f63000000b00557888b4eb9si590678pgm.622.2023.07.20.04.15.25; Thu, 20 Jul 2023 04:15:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="kTWD2/BO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231463AbjGTKcE (ORCPT + 99 others); Thu, 20 Jul 2023 06:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjGTKbs (ORCPT ); Thu, 20 Jul 2023 06:31:48 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D82261719; Thu, 20 Jul 2023 03:31:46 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 71C1537B1; Thu, 20 Jul 2023 12:30:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849048; bh=Rur1IK4TcPD70743h/tvl3kOfm8iOTDAhEwetSWaWDY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kTWD2/BOqU1mHDUETVmqL8Xqgc+KID6QJZTDOvsZViSS1WlREwDP2O7HQPiZhuBbE IqQj6taNn4vL14OwZZ0E8ZBBUjoHMCiGkJ7tunZqd+IkL6P41xgbNwnTFANABWs5eM y/syppZugjyabQMHPXi/e/yxxvfa/Fst76OxvvuE= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:38 +0300 Subject: [PATCH v2 7/8] media: i2c: ds90ub953: Support non-sync mode MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-7-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2508; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=Rur1IK4TcPD70743h/tvl3kOfm8iOTDAhEwetSWaWDY=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0GiP2nZraBbDa6yM3SKZJuVPbC4eCco1Cnr ATJOwBF2HGJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBgAKCRD6PaqMvJYe 9X7KD/9AUuDRNnHu+8MdFW0vpJ19RtR8/1MAfDzbJjDy/hW7fD/oBZvcnwVZ4M83XAzbi1uEjg6 znk7BsFaCw9LYOBd9WvU7mGfbcr6F6TH1ZWwRFMZhZE+ZE+aYTIEGppn0mmkgTXs8yeeJHHPEaw K3nvyntN1NyxfotbW2YrhzJ7nxDkvX/3fAE9ST/1jo59TKgkbDVeWyzD9f54zbUPGlqLcnoiiw9 Q/0+CvBpN9W33nLsoSHR6J5s2pvdObiXFzH7T8+QMUSoDkwaH5MU/qihWbPoAsMRx0TkdeBe9tx SyCGlrkCtNHKfFsNZvk8MV1ONk4AeZNflPEfcgrj2O5RANhvTFE5h5ybUdwxvkeW/NmvnAIdgjN uqDIj8F63hl1BclVZA1PzhL7gZvtOeUZ/bFs88ja/xF8F5U5ZngplyWmzTPy5PexY7A8Rckm5EQ bzUEIX/xhWqC7ESGr2clmY4deyy1UY2k4yx5rmriIflvt14PQdLA+99wPjbXABRRymNPqlygq6u lePxsFdB33QicHht0dwss9L0IDYeDOj6qT7k0s22ljX/ap9EJg3M57Xv8dFhpcHZvD76Qqpjx0U 7VMUgtY0AW3kEDtNhzwCvJ7gcgAxRxDUCyJJwPx3Q7Pq5yshOJJ4U9iSKmKCqzsTsr91tef0KY/ CFzBb21ty6PiVXQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771937976393527130 X-GMAIL-MSGID: 1771937976393527130 Add support for FPD-Link non-sync mode with external clock. The only thing that needs to be added is the calculation for the clkout. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub953.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index 3a19c6dedd2f..846542e6e20d 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -143,6 +143,7 @@ struct ub953_data { struct i2c_client *client; struct regmap *regmap; + struct clk *clkin; u32 num_data_lanes; bool non_cont_clk; @@ -842,15 +843,21 @@ static int ub953_i2c_master_init(struct ub953_data *priv) static u64 ub953_get_fc_rate(struct ub953_data *priv) { - if (priv->mode != UB953_MODE_SYNC) { + switch (priv->mode) { + case UB953_MODE_SYNC: + if (priv->hw_data->is_ub971) + return priv->plat_data->bc_rate * 160ull; + else + return priv->plat_data->bc_rate / 2 * 160ull; + + case UB953_MODE_NONSYNC_EXT: + /* CLKIN_DIV = 1 always */ + return clk_get_rate(priv->clkin) * 80ull; + + default: /* Not supported */ return 0; } - - if (priv->hw_data->is_ub971) - return priv->plat_data->bc_rate * 160ull; - else - return priv->plat_data->bc_rate / 2 * 160ull; } static unsigned long ub953_calc_clkout_ub953(struct ub953_data *priv, @@ -1188,9 +1195,15 @@ static int ub953_hw_init(struct ub953_data *priv) dev_dbg(dev, "mode from %s: %#x\n", mode_override ? "reg" : "strap", priv->mode); - if (priv->mode != UB953_MODE_SYNC) + if (priv->mode != UB953_MODE_SYNC && + priv->mode != UB953_MODE_NONSYNC_EXT) return dev_err_probe(dev, -ENODEV, - "Only synchronous mode supported\n"); + "Unsupported mode selected: %d\n", + priv->mode); + + if (priv->mode == UB953_MODE_NONSYNC_EXT && !priv->clkin) + return dev_err_probe(dev, -EINVAL, + "clkin required for non-sync ext mode\n"); ret = ub953_read(priv, UB953_REG_REV_MASK_ID, &v); if (ret) @@ -1318,6 +1331,11 @@ static int ub953_probe(struct i2c_client *client) goto err_mutex_destroy; } + priv->clkin = devm_clk_get_optional(dev, "clkin"); + if (IS_ERR(priv->clkin)) + return dev_err_probe(dev, PTR_ERR(priv->clkin), + "failed to parse 'clkin'\n"); + ret = ub953_parse_dt(priv); if (ret) goto err_mutex_destroy; From patchwork Thu Jul 20 10:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 123182 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3037514vqt; Thu, 20 Jul 2023 04:08:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgoclUA1YkKIWr+tsMqd+hG/RGhuxgWR+0bgqJQ5HSfGlGw9bWa0ydJFCGB5Gm8LUk3sV9 X-Received: by 2002:a05:6402:1299:b0:51d:961a:b27a with SMTP id w25-20020a056402129900b0051d961ab27amr4262591edv.7.1689851314041; Thu, 20 Jul 2023 04:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689851314; cv=none; d=google.com; s=arc-20160816; b=wxWVPmhbNGPagcR9Lsc8KxSHa3q26oTwSpcUXqToQWmaqofOJGQEYsAQI5fZEMuzsq NKBsjmO/UlTWyjbuFF6jQ0Zm3zKyiccQQuSDzbX2Uu9Sfu2BnjNLXCLZDELUscdFfIoH vLuPyRdbpAdWR/h2acSo2T8sFJ6m93nlVnku8Jop4PR6XFwuM/xiJmV9rnNa+CfSys5n hxJ2MS/BNfjpqA3xkzt+ai3pGrVffEjnwFWd/DvCvzpvxEW9aZkRLpkXDVXhaA7lUruM DkOBjQhPgqyf653bWpVWO5HYfOEatN5mtQKvTYPvSVhQRPLhNhCJkIG6SeIMHCQvvK94 g8yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=l9ansjchUxgARIgXIKUUnPjYcL0HXRLKksGZXQGFaw0=; fh=cL8V8cgQpxlbGU1a/BFb9J43s+fdNyaB+cfzJFyBZIE=; b=Okw/rSOGy7RoLY+nPANAqSE4g1wSMYOfR9Rxt8OpxKLQe0gaGePDFOB8R1Vqgf4vcW kAO6N4cPHM6lp18G6dfbD90CczVlkDBKzF/FInPwlpcGg0TqkLCMFg1Tex3ey3Ieejs+ w9MsxmguN9aiezfFsj55yfJ5CQFsbYj1AqtSly0JENNJdlyHhUPgVjBU9Wk7NzJgNAvY vWxkvd1FReOQQxLOBFoyk9iwuqS3CO2+HtriFmC6Xx+uLa7yp3kWEi+5HZXx0Q7fi/JQ te2F2pky+wqN1M8MA/vfc+DqBdREfHJ1gcMuQ7AyVI9YTq6dRmznEgdCMiqokBcwNMjh rOyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="ti9StKN/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020aa7dcca000000b005217421a386si638530edu.201.2023.07.20.04.08.09; Thu, 20 Jul 2023 04:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="ti9StKN/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbjGTKcM (ORCPT + 99 others); Thu, 20 Jul 2023 06:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbjGTKb4 (ORCPT ); Thu, 20 Jul 2023 06:31:56 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C7331726; Thu, 20 Jul 2023 03:31:49 -0700 (PDT) Received: from [127.0.1.1] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 530693809; Thu, 20 Jul 2023 12:30:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1689849049; bh=BnpBVZYY+/GA3ZmNzw9v9ygUo60Pbgode19CRNRPRs0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ti9StKN/4g2CywLOTcOwwZvLuq5X93caF52kjjVcu9f0wTJ3NUHaKSB4/mjUNT4oc mimXgvQJbbJuSjKdo9DzgKKiw6R4GCpPvEpq3TikPJbWNv8NPsldFZT1ahBlKAnRZC i7aq46ob6LjgGLMszVxoIv/fKyajHJ3ahP/s2+7U= From: Tomi Valkeinen Date: Thu, 20 Jul 2023 13:30:39 +0300 Subject: [PATCH v2 8/8] media: i2c: ds90ub960: Rename RXPORT_MODE_CSI2_ASYNC to RXPORT_MODE_CSI2_NONSYNC MIME-Version: 1.0 Message-Id: <20230720-fpdlink-additions-v2-8-b91b1eca2ad3@ideasonboard.com> References: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> In-Reply-To: <20230720-fpdlink-additions-v2-0-b91b1eca2ad3@ideasonboard.com> To: Mauro Carvalho Chehab , Luca Ceresoli , Andy Shevchenko , Laurent Pinchart , Sakari Ailus , Hans Verkuil , Satish Nagireddy , Matti Vaittinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3438; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=BnpBVZYY+/GA3ZmNzw9v9ygUo60Pbgode19CRNRPRs0=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBkuQ0HPIOE/bsugJhJge9C5M30jkHGJVYVewFg6 LClJf5MKiSJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZLkNBwAKCRD6PaqMvJYe 9XjWD/9Jlpj1Kf468RDQ4MDKE+dX5gJTkcj384jqFJlPxnjlyX2et0g+PHE3NjKG7/HIBk0i5JP N0+ndA0hX7SDjyKsCmVtqNFN4mILbXN75QLxWwSiGd1O7ITtNN0E/sbkSGUXe6a5rjtZGdSGB0o fJDI57eU4tTaiIWbgscEUd8YUA4p+hzPo5FLye8Qd3aDJyR3WGIzKwWaqhfeMsopV3aXKvuZLMR DZyy4IH50xGTrxrHDl4vGfYaWEABhbm8VS5rQotXoHhvWkD3xHui1l0nYWu4XvAP+mDGwXIxzyo eDd5vgX+bue9GVrozgMMFMvo4tAyiCPG5w7Y837qjImE50IN7XhHQIW5N30pTK4sT6rYS+CHzxx 3i7hvt5Y+dg8qVzqjGPROjsqNskC6ndLWhzxoIquUCMRvXmmDSc6sygviUlKWtywEbNvidPXr8U 6kKN5cHorkI9x21kAA8VVRXf3SVyO2TMNTBglXq11H4Y8BdBe27mSWfZCXL08gcLOvPe5Ku/am+ LnYga/IeDPQiXstGTeovpdMmHvrZkWnRxSTML0NUdLvRzUNfb3lID1OQGxFd0kIOzE2s7Hs+f0h DSHZW/DTwep6quF1r7jj98u0q8dq8fN3eMjvb26xaSEvbbxGU3u3LlKJAlzE326CkasdULWSGHH oiDrsBBVX19Ww1w== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771937531367958741 X-GMAIL-MSGID: 1771937531367958741 FPD-Link has an operating mode that used to be called "asynchronous" in the hardware documentation, but that has been changed to non-synchronous already quite a while back. The ub960 driver still had one instance of the old naming, so let's rename it. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ds90ub960.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index ea819fb6e99b..2ed4d4763a02 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -415,8 +415,8 @@ enum ub960_rxport_mode { RXPORT_MODE_RAW12_HF = 1, RXPORT_MODE_RAW12_LF = 2, RXPORT_MODE_CSI2_SYNC = 3, - RXPORT_MODE_CSI2_ASYNC = 4, - RXPORT_MODE_LAST = RXPORT_MODE_CSI2_ASYNC, + RXPORT_MODE_CSI2_NONSYNC = 4, + RXPORT_MODE_LAST = RXPORT_MODE_CSI2_NONSYNC, }; enum ub960_rxport_cdr { @@ -1609,7 +1609,7 @@ static unsigned long ub960_calc_bc_clk_rate_ub960(struct ub960_data *priv, div = 1; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: mult = 2; div = 5; break; @@ -1633,7 +1633,7 @@ static unsigned long ub960_calc_bc_clk_rate_ub9702(struct ub960_data *priv, case RXPORT_MODE_CSI2_SYNC: return 47187500; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: return 9437500; default: @@ -1840,7 +1840,7 @@ static void ub960_init_rx_port_ub960(struct ub960_data *priv, bc_freq_val = 0; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: bc_freq_val = 2; break; @@ -1878,7 +1878,7 @@ static void ub960_init_rx_port_ub960(struct ub960_data *priv, return; case RXPORT_MODE_CSI2_SYNC: - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: /* CSI-2 Mode (DS90UB953-Q1 compatible) */ ub960_rxport_update_bits(priv, nport, UB960_RR_PORT_CONFIG, 0x3, 0x0); @@ -1938,7 +1938,7 @@ static void ub960_init_rx_port_ub9702_fpd3(struct ub960_data *priv, fpd_func_mode = 2; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: bc_freq_val = 2; fpd_func_mode = 2; break; @@ -2032,7 +2032,7 @@ static void ub960_init_rx_port_ub9702_fpd4(struct ub960_data *priv, bc_freq_val = 6; break; - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: bc_freq_val = 2; break; @@ -2098,7 +2098,7 @@ static void ub960_init_rx_port_ub9702(struct ub960_data *priv, return; case RXPORT_MODE_CSI2_SYNC: - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: break; } @@ -2444,7 +2444,7 @@ static int ub960_configure_ports_for_streaming(struct ub960_data *priv, /* For the rest, we are only interested in parallel busses */ if (rxport->rx_mode == RXPORT_MODE_CSI2_SYNC || - rxport->rx_mode == RXPORT_MODE_CSI2_ASYNC) + rxport->rx_mode == RXPORT_MODE_CSI2_NONSYNC) continue; if (rx_data[nport].num_streams > 2) @@ -2508,7 +2508,7 @@ static int ub960_configure_ports_for_streaming(struct ub960_data *priv, break; case RXPORT_MODE_CSI2_SYNC: - case RXPORT_MODE_CSI2_ASYNC: + case RXPORT_MODE_CSI2_NONSYNC: if (!priv->hw_data->is_ub9702) { /* Map all VCs from this port to the same VC */ ub960_rxport_write(priv, nport, UB960_RR_CSI_VC_MAP,