Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2775949lqz; Wed, 3 Apr 2024 08:17:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGRho52lEUyxQ1jBEuE9dBz8D3djTtxhioEDOzqDuyVJ5spLA4EAOp+o5Ft9Jx9FFae7B1Z+PxFO7q6NYE9g0O77TQvd57MWP77uCbRA== X-Google-Smtp-Source: AGHT+IFVv49/J2dvJCLq3LZKR0I6LG/hiSAc/WsNPhybEoF5MODdv0i0v1wlf5IxmqByjPRNVuoL X-Received: by 2002:a50:cd5a:0:b0:569:6ef0:8382 with SMTP id d26-20020a50cd5a000000b005696ef08382mr2219323edj.27.1712157473376; Wed, 03 Apr 2024 08:17:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712157473; cv=pass; d=google.com; s=arc-20160816; b=nlcGA2DsV8xMb7llbKyh/wqGf4IDFBb8WMShIOyXJIQCam22u9q0WDzK9gDQZFyo/c GDDnLzm5+nGiryv3a2JLouV4KzrJRF5Pd+S5Fk3aJVfhLV9EFIlGpAnfGxW1zVvE6UMg DY+UIewR7U3gSjGWqNd0thcjaleIz1hgnn3Bkzva0ZuojcBh8Aik3Yo+peb7EENf86lW +MsU2K4xjViSx9pF3fjaOdDUtNe6KKZTSJkIYTMkZbCzxQhJs7+Gu5AAxG+ryuuBQMXs 7v4CEfVQNokfPsYFYVfnjhOYd1yXzjqLMzfXteue8slpMXEsuN3WiXmoURLi+IJRXNSe fiEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=pC8KcMEQ+O1uzY5if8H7MdwgFAggRiFzSTYlToHsqnw=; fh=ng0FUFwPgHHqIHtWcUlLUSBs0e7fHIUGeuUhfcQSRgA=; b=bk6+fCLYaA5U2kELUzFg3P+HRpZdKtONidCJmIfbFGHdgrSvRIyiWlKTPeplxY0zh5 FlY2cIUtnqOIIyxwy8XwgHFCnuXuKoFn9eIqwuptGIfzRbYGWKD1BGhwUSP+dWRo32B/ uIsp/BPuAEGF0RT+/v88EedFdv3A3hECIneEuVFaiY+AwdmQHSNbReOSJrVw2oc5VwTL 7e/eXqe9qm+dqA9xdq9YRi7CNKlCCwUeorB/slIZDkYOb+e+TIFt+pydr/1DGESHa5/2 8x0NtxtCmBe10SRrHBIKH+B4qM9af5dOZpemK5YQISXvJHZLGRV3efWnWRlGzDQZZ7/J bPVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b="shB8bQi/"; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-130067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130067-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s11-20020a50d48b000000b0056baa28de6csi6918090edi.38.2024.04.03.08.17.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:17:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b="shB8bQi/"; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-130067-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130067-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AC4321F23CFC for ; Wed, 3 Apr 2024 15:16:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0274B14F9C2; Wed, 3 Apr 2024 15:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b="shB8bQi/" Received: from mail-108-mta246.mxroute.com (mail-108-mta246.mxroute.com [136.175.108.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACD1B149DFB for ; Wed, 3 Apr 2024 15:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.246 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712157218; cv=none; b=Bnn64GIXzxg8YQTbk0X1fkiPFH5ZYZc0IND2CxkxoT4BNN7etFE0RIoVssssL/9LVpu+YPcH2mDXBZdSSAR5G8Or00c1nPm83TsbI0qfiJtDmGSGivhzuv8HnF2lEqH3EZksiWpv8kic1KPJURsKyYHfCS/5F0dJuchi7C973To= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712157218; c=relaxed/simple; bh=wrzkbVNaXYA07Wg3kgUuW7YQeJx9QRp29yiGRDIbHo0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eRQ02sSCcTdVObqVaPi28CwvkDPCmpGMEPcSXtxyh28ViTBfe0qSVpbJ9E2zctDEoVxuexei6k4fxgstaMxcVZU7Nh7n8r/f9FF1r5exdrtmhlPBsSGsxMhE28mNa9FMrfxy6LYeMYnGIy3JzKHMP54/ALrngeQ1Bp26/clLA10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com; spf=pass smtp.mailfrom=luigi311.com; dkim=pass (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b=shB8bQi/; arc=none smtp.client-ip=136.175.108.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=luigi311.com Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta246.mxroute.com (ZoneMTA) with ESMTPSA id 18ea48064e10003bea.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 03 Apr 2024 15:07:41 +0000 X-Zone-Loop: d613af321d03ceccbeddb1c0e4fb51722b95f5accfc8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=luigi311.com; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pC8KcMEQ+O1uzY5if8H7MdwgFAggRiFzSTYlToHsqnw=; b=shB8bQi/7DQsYVkCRg9q98H1sY xy/Z0vQZlChDBgmnHmf388CjFgUuXFo3ytiZCxuWaY1w2/84Moqf07VpQrIstr0QiNTv/Y9LTHFym /+yspnPUbegvXojQ4XPeJj85yWrcEOWRjiDNanvu7xgkLY1hUu3F3rHFxp6AnJBrZPnZZL9AKCGEr ifZmAhffPC1xbM28rzAbiYP9yaSvx81ENZDYRsJAg+Ln7ftHB4aWh8Pp9DrMNo7uFPvFzseE6Ib0l HN9g1pSkqthtewvULPp2iIqcC9AYO/u76G/3i29unvJry8ZAllD+w1KioY+CNyxcf9MMEpLiBsdrx rl2HvIRg==; From: git@luigi311.com To: linux-media@vger.kernel.org Cc: dave.stevenson@raspberrypi.com, jacopo.mondi@ideasonboard.com, mchehab@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, sakari.ailus@linux.intel.com, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, phone-devel@vger.kernel.org, Luis Garcia Subject: [PATCH v3 12/25] media: i2c: imx258: Allow configuration of clock lane behaviour Date: Wed, 3 Apr 2024 09:03:41 -0600 Message-ID: <20240403150355.189229-13-git@luigi311.com> In-Reply-To: <20240403150355.189229-1-git@luigi311.com> References: <20240403150355.189229-1-git@luigi311.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: personal@luigi311.com From: Dave Stevenson The sensor supports the clock lane either remaining in HS mode during frame blanking, or dropping to LP11. Add configuration of the mode via V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK. Signed-off-by: Dave Stevenson Reviewed-by: Jacopo Mondi Signed-off-by: Luis Garcia --- drivers/media/i2c/imx258.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index 805308b4a4c6..692a5aeb7941 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -72,6 +72,8 @@ /* Test Pattern Control */ #define IMX258_REG_TEST_PATTERN 0x0600 +#define IMX258_CLK_BLANK_STOP 0x4040 + /* Orientation */ #define REG_MIRROR_FLIP_CONTROL 0x0101 #define REG_CONFIG_MIRROR_FLIP 0x03 @@ -632,6 +634,7 @@ struct imx258 { const struct imx258_link_freq_config *link_freq_configs; const s64 *link_freq_menu_items; unsigned int nlanes; + unsigned int csi2_flags; /* * Mutex for serialized access: @@ -1066,6 +1069,15 @@ static int imx258_start_streaming(struct imx258 *imx258) return ret; } + ret = imx258_write_reg(imx258, IMX258_CLK_BLANK_STOP, + IMX258_REG_VALUE_08BIT, + imx258->csi2_flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK ? + 1 : 0); + if (ret) { + dev_err(&client->dev, "%s failed to set clock lane mode\n", __func__); + return ret; + } + /* Apply default values of current mode */ reg_list = &imx258->cur_mode->reg_list; ret = imx258_write_regs(imx258, reg_list->regs, reg_list->num_of_regs); @@ -1438,6 +1450,8 @@ static int imx258_probe(struct i2c_client *client) goto error_endpoint_free; } + imx258->csi2_flags = ep.bus.mipi_csi2.flags; + /* Initialize subdev */ v4l2_i2c_subdev_init(&imx258->sd, client, &imx258_subdev_ops); -- 2.42.0