From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 06C00380FFB for ; Wed, 8 Jul 2026 14:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783522161; cv=none; b=pOpOAgGFJV/s1ztiAbgbWmsC/0fWjFng98Urb0xYGKw+arrvDctN7BN8/dZXZp1IzxSoVzQSiYdbY8Bba0Gqk07OphgcTe5SZ8/ee1jtXX89FBWjkqt6MBDLmbDKfOHOa3NkV/UExSqArsgoZVEWc4C67bxauCfLG7XtVuOD6Mc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783522161; c=relaxed/simple; bh=hKJ1wRNw/4+kZM2FA6xVtBeoupjoOkwvBGVT6gKhBAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hN4Da9udldKhDNZm4Qjnja1kBbX0PUWPbV2nscG+TMLQq4D7rC3740aACqzlMnNSpGKT30jl8rW5K8sEoaDRz49/HOjZ7E3/Gcm9pml5GHLBvAvrcVwWM2mSBifrIW7QbBLSzXP+TqPG29+4sEI7NR8TT8s7NImTtym+2ovGtJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=WJnM5xML; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="WJnM5xML" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493c19bad03so7509985e9.2 for ; Wed, 08 Jul 2026 07:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1783522155; x=1784126955; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9ab8Gq6xMWbh9FkKTB7pyP7zvswAoiXm+T3oZQ3TQDc=; b=WJnM5xMLQtvEhuVygsL4mCmUp036jCBhOB7ZWsFErEzmNJKe/M8iB4pbH9x9pjyAB+ jBj+K8Bf5pqqzBWev3cMaUPGGAqqGxFbylBSgXA+zpTXJelnkIJk/zR4O38OxTktutA6 ckCRW2VHdSzQMG1e77+E4QVZkWLALZnhdntBsmPyeQho0mqATg5EP82kcxB/+QY7/vGZ +7DfbZ9JmgzE98EayV9ik7rA3O3Pmlo2euGv8/m7yMQ5IfNs0FX95TsII9q7pl4KOtkF fxnfZVvqPTwnNHHw6cjvHKc7FM0S08B9Xb5bqOJwfvq7cjx8yBFBy9SlsGLj2CQ5JxdB uiXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783522155; x=1784126955; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9ab8Gq6xMWbh9FkKTB7pyP7zvswAoiXm+T3oZQ3TQDc=; b=h344JUyGfw4OGsJdVf5EA0g95xt/34pH+TidbcY3QcpLU5m2yYLFM5xVgFuzmx8zTh aIpGBbLcZ4oowZl1MOBW7xYAhonsiIZzNz7D+KIZ5D/w+Et7rWRedkDa1XPU7IB2TxCS GhZspLn3CMBm/Y60MQC4G/XSpA7wmZ0fS4vuVSGCZk3JrmyMKWzDJBpCiQggvNMJKKwZ wEMEj8eglRznOFD/Lr3ADrjoLdsAr6WQC2Khvyx4kdcRhk6wFp+3HPg94uoP7khHH/cN 2uHIfnD7Xz2Ha+iPW0XqfRbHcoXbleginTqpXPBH5jPG7E83C2YoDcWte9pRfH4v0E2O +1yg== X-Forwarded-Encrypted: i=1; AHgh+Rp4NKpfNeb0y2g69gMUmd465xsBM0SyUWBUaALq48Mz6vOt9TY44nlEqP8e5jl8rchavqfLirG+RMpj@vger.kernel.org X-Gm-Message-State: AOJu0YwuUqc4xjduv7vfMCeJq2g8mo21dlAifIIlbDkMb3EHkSrbUjSw poNcSsf+G1cxMvPNiumhWcsw2BlO33amatjDVGSWbq2o3+TO1U/eqZj/i/Xyv3dRG4c= X-Gm-Gg: AfdE7cmkhxhMMjsPduGZLsgmwKt9Y82Gj6uA4JSBs05qiqJFN6wU9ofTFi8phsdHWyG 5s+c7+x8jKkgsau0i7wrvKud/jVUvjHPtvVV2nRFHxHwTxFNFDaJEMh4DQWJwc61gTbp8T+hFAr vvFODz73Lga9tQPgCFkbs5L9XTAcCfD1WSTLY7LzrLmMgRgRTHMWpNnBu1QjBYnyWQmHOTSTBIh mNwBLizBW6H9+YP1o0Lun7sXJz4/CKM6mIyCKpOxAbK4j2pzPOcYpJ3mqK/jV9AHVTbbtLaJaTF I3Cssj+TthUposxRQPngj9+o3TnyLRYhQzmDLS/sL82QYLxD2XxWGna0ypDjm04E3wLLkeQX0pu 4wkc9wGSpYcPxSw6QU+8hTtby0TxTxn1u4K6pdnih4MpMSRFmRDsQ/fnV/mwRkXJN2Aw/X3gVog RUhmrSCpVUoKosdGUMblptkTBeUeYDFx4v2C6z2RtLkgbkqz3IWOcM0HgpUUBoatrVk/0gP1Lvc 2Q= X-Received: by 2002:a05:600c:3e07:b0:493:de89:61b with SMTP id 5b1f17b1804b1-493e6868766mr31462495e9.26.1783522154549; Wed, 08 Jul 2026 07:49:14 -0700 (PDT) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-493e0fbd355sm135363315e9.13.2026.07.08.07.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 07:49:14 -0700 (PDT) From: Dave Stevenson Date: Wed, 08 Jul 2026 15:48:42 +0100 Subject: [PATCH v3 06/20] media: imx355: Set register LINE_LENGTH_PCK programmatically Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260708-media-imx355-v3-6-9df386a623d7@raspberrypi.com> References: <20260708-media-imx355-v3-0-9df386a623d7@raspberrypi.com> In-Reply-To: <20260708-media-imx355-v3-0-9df386a623d7@raspberrypi.com> To: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Acayan Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, David Heidelberg , Jacopo Mondi , devicetree@vger.kernel.org, Dave Stevenson X-Mailer: b4 0.14.1 The driver already has the LLP value stored in the mode structure, but also had the same value set via register writes in the mode's register list. Remove this duplication. Signed-off-by: Dave Stevenson Reviewed-by: Jacopo Mondi --- drivers/media/i2c/imx355.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index 29bca1d98791..7aabd281cd3c 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -33,6 +33,9 @@ #define IMX355_REG_FLL 0x0340 #define IMX355_FLL_MAX 0xffff +#define IMX355_REG_LLP 0x0342 +#define IMX355_LLP_MAX 0xffff + #define IMX355_REG_X_ADD_START 0x0344 #define IMX355_REG_Y_ADD_START 0x0346 #define IMX355_REG_X_ADD_END 0x0348 @@ -260,8 +263,6 @@ static const struct imx355_reg_list imx355_global_setting = { }; static const struct imx355_reg mode_3268x2448_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -270,8 +271,6 @@ static const struct imx355_reg mode_3268x2448_regs[] = { }; static const struct imx355_reg mode_3264x2448_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -280,8 +279,6 @@ static const struct imx355_reg mode_3264x2448_regs[] = { }; static const struct imx355_reg mode_3280x2464_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -290,8 +287,6 @@ static const struct imx355_reg mode_3280x2464_regs[] = { }; static const struct imx355_reg mode_1940x1096_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -300,8 +295,6 @@ static const struct imx355_reg mode_1940x1096_regs[] = { }; static const struct imx355_reg mode_1936x1096_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -310,8 +303,6 @@ static const struct imx355_reg mode_1936x1096_regs[] = { }; static const struct imx355_reg mode_1924x1080_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -320,8 +311,6 @@ static const struct imx355_reg mode_1924x1080_regs[] = { }; static const struct imx355_reg mode_1920x1080_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -330,8 +319,6 @@ static const struct imx355_reg mode_1920x1080_regs[] = { }; static const struct imx355_reg mode_1640x1232_regs[] = { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -340,8 +327,6 @@ static const struct imx355_reg mode_1640x1232_regs[] = { }; static const struct imx355_reg mode_1640x922_regs[] = { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -350,8 +335,6 @@ static const struct imx355_reg mode_1640x922_regs[] = { }; static const struct imx355_reg mode_1300x736_regs[] = { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -360,8 +343,6 @@ static const struct imx355_reg mode_1300x736_regs[] = { }; static const struct imx355_reg mode_1296x736_regs[] = { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -370,8 +351,6 @@ static const struct imx355_reg mode_1296x736_regs[] = { }; static const struct imx355_reg mode_1284x720_regs[] = { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -380,8 +359,6 @@ static const struct imx355_reg mode_1284x720_regs[] = { }; static const struct imx355_reg mode_1280x720_regs[] = { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -390,8 +367,6 @@ static const struct imx355_reg mode_1280x720_regs[] = { }; static const struct imx355_reg mode_820x616_regs[] = { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x01 }, { 0x0901, 0x44 }, { 0x0902, 0x00 }, @@ -1059,6 +1034,12 @@ static int imx355_start_streaming(struct imx355 *imx355) if (ret) return ret; + /* set line length */ + ret = imx355_write_reg(imx355, IMX355_REG_LLP, 2, + imx355->hblank->val + imx355->cur_mode->width); + if (ret) + return ret; + /* Apply customized values from user */ ret = __v4l2_ctrl_handler_setup(imx355->sd.ctrl_handler); if (ret) -- 2.34.1