From nobody Wed Aug 26 07:48:07 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 0B606449EB8 for ; Wed, 8 Jul 2026 14:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783522161; cv=none; b=bpcSozIJy/BjBbAwM3BPSn9O5xA5JZGKrV2SuRIfNVBz1+DU06rYshMQ6RDa+gnBMS1GDJDXqs2ySFXnmIXtM8j0YO1jYXxAuY0xI7un7O1YBeHyUnWhm4a4ryLcDVj+Aiu+ZiDiSDMVVowue3gR1qMPXGO2SuMdoleU9klhgMM= 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.43 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-f43.google.com with SMTP id 5b1f17b1804b1-493c19bad03so7509965e9.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=NjLSmkVJUJ28zc7I9YAS6nCMBQMpLFwjvKEU6my7MFZDLzfKbqSt84OjhWdBDagcN4 qZVJZzsjFuLWC+IxEWERWbhVl6og0yymD5CUZQuaMFwYWAloYI6ZuFPWbEjtDgASa2Ny r3NYcW0l5uKUQ2QeqbW/3zZ1MQttTWyxj7grAEc8hBiS+qalvGGFFjdT/L1h5Rxr94uB 9Q64tAGUgXkzs/QU07iEF6bnvXxgV79wf37eyPJeQtz15LJGdhXueml7SuvNrFZGqKpb qoow2wYXp8iPJZJJQ3OXG/qGsgF3h7OYQ2W3c92T/6rFyxf8P1qjIjhYX0GiJjclfhK3 hugg== X-Forwarded-Encrypted: i=1; AHgh+RoAyJygiZemS9oqj8Ezznrq2F4B7EeGOyrkErUht/vrMtvebLldnzpqtEsQfllOcBOmvRZC+QKR7txViOo=@vger.kernel.org X-Gm-Message-State: AOJu0YxaFh6qons4Uxwo33ISfATHlzMVgHNARCaeDRiOb6MM4PWVxRfq P4zyk7kUlYSOzYw90gTF6nrQApKX8SxIt7efXl9VkWKOrk9apg+BxCspxh91AHYs2gQ= X-Gm-Gg: AfdE7cl+V7o281XDmGmJ27SQcreKhjMHHLbHkgTE1bDDT1tSxLj4jiFbkc43J91fhZU i0xSwWzJr1oOk9BUI9WvzVUBoT52kmYEAysZ2EvL4XvtKKXNOTpEA7WQv1uEZRdkr25yZKhxmAv n+OgLk7EU+yPEAiUuSJxyuRGb2hwzt0LKVB7ql1YuHPLOjgaZTkWfVAuL5z9BCF2xExlJYf4hXn DRa6Nr5eyVeyk+5gzKoBrV4TEMDCUnbJXA30SAkLAQcnb8fa7Edd/c6c72Ni8ROncSpCzggcJPf sCD3FJjCDkB1Kf+ieXNNSA/Df12X5F/o/A4dbtkZxsw6Yv7DkStmVNXKe9XnoLIP8s43s2ugbvP ljqX/mV5xnLwtky1Z/aJdbtzm7HLKMqUiLmyNWELXltflz47KR+Q1xqcp0Cmcl1Ebeqr30Ui8y1 fk2s8LMoqO0A8BX9BPrant7MZkO2LFa34WvnYZcP9vZu8raqMRmTYy3W2Dj0eqe0qpvw0vSmcwV 5Q= 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 =20 +#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_setti= ng =3D { }; =20 static const struct imx355_reg mode_3268x2448_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -270,8 +271,6 @@ static const struct imx355_reg mode_3268x2448_regs[] = =3D { }; =20 static const struct imx355_reg mode_3264x2448_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -280,8 +279,6 @@ static const struct imx355_reg mode_3264x2448_regs[] = =3D { }; =20 static const struct imx355_reg mode_3280x2464_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -290,8 +287,6 @@ static const struct imx355_reg mode_3280x2464_regs[] = =3D { }; =20 static const struct imx355_reg mode_1940x1096_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -300,8 +295,6 @@ static const struct imx355_reg mode_1940x1096_regs[] = =3D { }; =20 static const struct imx355_reg mode_1936x1096_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -310,8 +303,6 @@ static const struct imx355_reg mode_1936x1096_regs[] = =3D { }; =20 static const struct imx355_reg mode_1924x1080_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -320,8 +311,6 @@ static const struct imx355_reg mode_1924x1080_regs[] = =3D { }; =20 static const struct imx355_reg mode_1920x1080_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x00 }, { 0x0901, 0x11 }, { 0x0902, 0x00 }, @@ -330,8 +319,6 @@ static const struct imx355_reg mode_1920x1080_regs[] = =3D { }; =20 static const struct imx355_reg mode_1640x1232_regs[] =3D { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -340,8 +327,6 @@ static const struct imx355_reg mode_1640x1232_regs[] = =3D { }; =20 static const struct imx355_reg mode_1640x922_regs[] =3D { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -350,8 +335,6 @@ static const struct imx355_reg mode_1640x922_regs[] =3D= { }; =20 static const struct imx355_reg mode_1300x736_regs[] =3D { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -360,8 +343,6 @@ static const struct imx355_reg mode_1300x736_regs[] =3D= { }; =20 static const struct imx355_reg mode_1296x736_regs[] =3D { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -370,8 +351,6 @@ static const struct imx355_reg mode_1296x736_regs[] =3D= { }; =20 static const struct imx355_reg mode_1284x720_regs[] =3D { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -380,8 +359,6 @@ static const struct imx355_reg mode_1284x720_regs[] =3D= { }; =20 static const struct imx355_reg mode_1280x720_regs[] =3D { - { 0x0342, 0x07 }, - { 0x0343, 0x2c }, { 0x0900, 0x01 }, { 0x0901, 0x22 }, { 0x0902, 0x00 }, @@ -390,8 +367,6 @@ static const struct imx355_reg mode_1280x720_regs[] =3D= { }; =20 static const struct imx355_reg mode_820x616_regs[] =3D { - { 0x0342, 0x0e }, - { 0x0343, 0x58 }, { 0x0900, 0x01 }, { 0x0901, 0x44 }, { 0x0902, 0x00 }, @@ -1059,6 +1034,12 @@ static int imx355_start_streaming(struct imx355 *imx= 355) if (ret) return ret; =20 + /* set line length */ + ret =3D 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 =3D __v4l2_ctrl_handler_setup(imx355->sd.ctrl_handler); if (ret) --=20 2.34.1