Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp551089lqm; Wed, 1 May 2024 08:33:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtYV4BtUotZC/yhRGCWmWDSvU0EBFt7DZuEfRXq9j8KXXDVT9OoFNNVUaw1CMaVDyen5D5xaX3wrvmhtgE3FYT2JIQF6X6ULC8e9iy4g== X-Google-Smtp-Source: AGHT+IFK8XtmDkN80Sd+l6kM1/Fm3iCRzvrybKc+4mIhurWE2wqDzSzrk8FuLUqM0HMgPGFJ9tJz X-Received: by 2002:a05:620a:1907:b0:790:945e:6f0 with SMTP id bj7-20020a05620a190700b00790945e06f0mr3204703qkb.55.1714577624240; Wed, 01 May 2024 08:33:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714577624; cv=pass; d=google.com; s=arc-20160816; b=LqcRvu3vZ2SrB07o+0G09/VFvgviOC5gYnT75VPhDf6otcUd6hV2MVDpKkjZFum4Mi wmex9JlHU9bRDDpvDnLM7G4odKlpUR2ttia66GsXjNFvORaDB/nddoHcwbLCMXMayLYU hlOg5qEu+yq2X/gj4ITMgvXDR3RAAN/qMtW2IbKxx18JD1occFZg7Fpt8VI6MuX7Axln IwSJY8z08KVAPU6lTLcJmErCBubxa36Q9XSd5/wz2qBgypTv1mHWU0rI3P2Ow+X2fIko U5Zk0Ch5+weENm6QNWfugQ5aXZJxjEZPfeiq8yZeDYgkcpwx+704BOu6bWu467ImCQ6O GVvQ== 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=bZhiRPeL9jOMw1N4B5HoYuhr3z7xt+xH2s8wek/zi98=; fh=ng0FUFwPgHHqIHtWcUlLUSBs0e7fHIUGeuUhfcQSRgA=; b=Gro9y7M7jteNFj7RW1XUmxMLQ9qmI4OOyn+O0H0O+mR3dN+AHUPfbEZmJ1AbdZ6RML JzG1v5vYbrqL5fbiDfySllzlRYvf89b5PfFuhOZQ0wGT5gR4aJOsZtTsmCf1EPP5tZkp vyZbOO0tSjk4bG/e3Nlu7CUD+9pS8ykIpXSMZ2kT7hQoX+jmhxARTgKByd3AfrSH/EhS IFCOq3xgWgGKAcwh7u1McYqgsXYRlbUbB30a1SucXGpr0+O8C5YHWlI2vyuRJ5LClVYY QE1jXwFhJd6FJ9ybktja6IKifSBVTGvAegtL7x4z3edix0L7ZLy694bi1d0XwwBeWXjj K90Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=n9qOmSLU; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-165488-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165488-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r21-20020a05620a299500b0079158f66be8si4952591qkp.372.2024.05.01.08.33.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 08:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165488-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=n9qOmSLU; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-165488-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165488-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EFBB91C20AF2 for ; Wed, 1 May 2024 15:33:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5ADF131E25; Wed, 1 May 2024 15:31:19 +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="n9qOmSLU" Received: from mail-108-mta123.mxroute.com (mail-108-mta123.mxroute.com [136.175.108.123]) (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 75C58131750 for ; Wed, 1 May 2024 15:31:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714577478; cv=none; b=VE2G4GT4b4JriEVKY3Hw1lFsHvVIDF9BIPpd2LykGlO9i7c0IN7ufypWgNT1+1PVpvWz+wo0nwjo3C0RwDqMDr/ZsPAlYTuDDK07pkbrIGfobb+8qZhJtcjmbI2ektdiqC3Q2/4fATUnlGtnVZlA20HCmvgu2R9aQ9NrXbbmZpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714577478; c=relaxed/simple; bh=DW93lC9rSeEtaobf7itjE64XnEYnqZ7qSOk+RzOJB00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nVEX5yLrwgYfM3uRR8u+XunWqlOZdOioKzlWCeKA45Q7C6g1iB367VVy4IdEVjO7rW/Mhvzd16RnU5An+ZvHyhHRYGhXWMpe3UcYcDlJq3Yzndpi/KoI3zjhc3OeelOu5iq/+P6tfMU2lhYIuaa1zW2Arc9AT8D5NUtngSEz0nY= 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=n9qOmSLU; arc=none smtp.client-ip=136.175.108.123 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-mta123.mxroute.com (ZoneMTA) with ESMTPSA id 18f34c2903b0008ca2.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 01 May 2024 15:25:17 +0000 X-Zone-Loop: 290a68761a2febeb490b3ea34b2da5c94aafe75c0ef9 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=bZhiRPeL9jOMw1N4B5HoYuhr3z7xt+xH2s8wek/zi98=; b=n9qOmSLU2isncEzDzGlkGQitd/ BomYYLCpt3OiODoZPQQlCODBrj1c2QGm95XmKA9xSkUyJ2cQIMyLPPl5RZch0eoQJTx20Eg7xYOgA 6MKS2c6mHP8mh5ZLeIHvFWp77Ya2f8uSkjFQtq5ZOwehxkW226VxEMgSb4khxI8JTLpZ8LOw4N2DI 7htJYspuh33ocRmK1TnSjI4B3eVa0gbZxplWRWh1MtvYV/J8TeF4XV3Ln/k3K/xK4CRiH6XQ4pWOS uQbrNQWHVe3our0pc8ypnUpbFHQBiX/INbgLRMNecHsGDJP+do9mE69ts7dzXSejGSvj65v71qAw5 LFdz9YIQ==; 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 v5 12/25] media: i2c: imx258: Allow configuration of clock lane behaviour Date: Wed, 1 May 2024 09:24:29 -0600 Message-ID: <20240501152442.1072627-13-git@luigi311.com> In-Reply-To: <20240501152442.1072627-1-git@luigi311.com> References: <20240501152442.1072627-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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index 59a78a4cfe44..2429eb7b55c6 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,14 @@ 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)); + 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 +1449,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.44.0