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); }