From patchwork Fri Jun 16 13:59:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 109168 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1379275vqr; Fri, 16 Jun 2023 07:20:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70x50i4Xhe2ol5FfeELH0r5/55oFTSkeEOyz4LucR6tv3cyYoRw7BY544YJOk2pmSGlZXw X-Received: by 2002:a05:6a20:6a24:b0:103:d538:5ea6 with SMTP id p36-20020a056a206a2400b00103d5385ea6mr2625873pzk.48.1686925259343; Fri, 16 Jun 2023 07:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686925259; cv=none; d=google.com; s=arc-20160816; b=Tm+DNnvZolrKWOuVK5r7QA89L8ZRK8RrDeZ38ID4sIMSt3Pp0xDasdenZftJZzIQWd MDHBQYUnhS6w7ff0SB1IJ11UyWhupdOaERkzS/jUkDk5qC1RhEw0NEZ6h7RxjScJJarZ hay6hr9GVoWPi9saCxyF2fE/qtZbgYB+EufMa8T8zSTsB64cwmS+ilyEJTz+IP4U7m+l /nCsnvUjmLAMCuBabv5H22uXzNBxAK3aur8nSagLNro9pod4UpCRWxXLS2sthrasKugw U3Wm9bisqN1YyNgX8WgU/Es9sHKvwKaV8J0eV+ohmWzithaVf+y+9M6AT5vO3K1aWJqT URhA== 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=IAUsrGNaof6Ck5q/zmxRB6NgSmdqpjOdNP9ePxzHIiE=; b=Jwt7fP3DkNVlC6wagnbXyct95qmRb3E6gU0chXU3ZTOf4gkN92CBPD9Lqai5akJ4l2 G7G+PbTJyRSsnMSxrTycw9DjvSeja7wRuDhteFvp4jHALLvQYL1L2QdEK2m9sNmfJLN8 K0m2MCZQMyL7q6FV92LuvWV4ozHnQYOLgV1s0Q8sIbOqdTVy7iKBO9UTtHTH+xqi/p+k KrBIg9qGbyVZTpBl65kIVKIs537qkci8CsfoSKD8N+UnpBzY76fmea3S2LCt51SAP8UZ wBMl/4wS6D0TPYlg5pClEophWlkB7UFMkMs00w2K7AFFNzO0mvZruyL0+1ppQTbCqvcS WqNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=aB0KB4+j; 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 p8-20020aa79e88000000b006665f0400a7si5518616pfq.197.2023.06.16.07.20.44; Fri, 16 Jun 2023 07:20:59 -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=aB0KB4+j; 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 S1345444AbjFPOB2 (ORCPT + 99 others); Fri, 16 Jun 2023 10:01:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345406AbjFPOAr (ORCPT ); Fri, 16 Jun 2023 10:00:47 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1DA23ABE; Fri, 16 Jun 2023 07:00:38 -0700 (PDT) Received: from desky.lan (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4BB43209A; Fri, 16 Jun 2023 16:00:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1686924002; bh=nED/RJDHJyg29w/DBB3glM12/4xdeiqHHA4Jmrf1gCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aB0KB4+j1275iIuPK4NaBWo3JzF/LkoqbjTuJ2h8VDrcU63PrkOMnIxpKOjFEwDbG rhcq4+wUgWLLNdDXSF+M+RfgtHDXl6DBz1lz5X591gLLmtcJJxD6vuiU66iGgTld++ oenKicSavewUKIJko3lJ72EFDFxAdJ1HDdCqKh2U= From: Tomi Valkeinen To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Luca Ceresoli , Andy Shevchenko , Matti Vaittinen , Laurent Pinchart , Sakari Ailus Cc: Wolfram Sang , Rob Herring , Krzysztof Kozlowski , Mauro Carvalho Chehab , Peter Rosin , Liam Girdwood , Mark Brown , Michael Tretter , Hans Verkuil , Mike Pagano , =?utf-8?q?Krzysztof_Ha=C5=82asa?= , Marek Vasut , Satish Nagireddy , Tomi Valkeinen Subject: [PATCH v14 15/18] media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK Date: Fri, 16 Jun 2023 16:59:19 +0300 Message-Id: <20230616135922.442979-16-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616135922.442979-1-tomi.valkeinen@ideasonboard.com> References: <20230616135922.442979-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768869340710664340?= X-GMAIL-MSGID: =?utf-8?q?1768869340710664340?= Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK flag to configure the CSI-2 RX continuous/non-continuous clock register. Signed-off-by: Tomi Valkeinen --- 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 5b586855c77b..f2e950a00d64 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; @@ -1140,6 +1141,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; } @@ -1202,7 +1206,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);