From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 E9AB14508F8 for ; Wed, 15 Jul 2026 11:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784115861; cv=none; b=K0ItQzQLZu6ADCL+2imYkWcpv2iE/rB2Joofo8H9MU1LXcTXhTOL/5S6K0VCbH8352ROE6YOx9hPKDu+PXJd2EuwwzK+0xlGne8Qj4hUCpuv4oOLURGLftIYKMhh70umN1S965Zl2snK5/zV5oZRGtuc0X8QHMX3wiBuxyrWraQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784115861; c=relaxed/simple; bh=gyqujfHJHkzn9T9XsAEbi0n2Q1X+fbSwsvnueuC+UJg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OG6E0rqb+HbpSEl2j0fQegp3GkhNxfhRSXP7+kBTp7MkZp0edMKbaKA+QWoFBOxdok51B/ltOC5zmzDPahVk2MnWhut2MqDDpnxuRuUKoWyJVaSVwTzZg+O+hhA1kmqiQ8k2F7qCnErowOV0QIW9+tXRqPPFqw8qcLxqL4nWn2c= 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=klVItU1a; arc=none smtp.client-ip=209.85.221.51 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="klVItU1a" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-47c2b362ee2so4668043f8f.1 for ; Wed, 15 Jul 2026 04:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1784115856; x=1784720656; 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=CQLciStRyxHcQjyBCc3cnu+LNwHPfM7OOKyYTNEVNSs=; b=klVItU1aGyjcGc5fX8ARnYxBEiOXuc374EEyzOURSdJeYObPU3qajJxItKEeAgaU2T TkadsQe/fo1+13cYZqnTIPdyYUX5PXq+ZR/j0Yf0xDzC+wp9AgjiuqHS+h5ONJjEFrza Az+z+0OmvT5a7efa3Dtf1G5PSqn3YWdP8MxWAb11CjJ8LYZEIIjxC/o1diW41Gq5TLlI 36PpNBWB2iOLRydCU3T0e1cm/shWqT50q7wAgVDzgro7aTvmjMJFB3u7hLLo516CcUoA FbLWOPMv0zrLIyfM0esdbGWtVMxsps9pID/fopHesdhMBuTWHGU/mCvY05QyZUndmHmQ WbtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784115856; x=1784720656; 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=CQLciStRyxHcQjyBCc3cnu+LNwHPfM7OOKyYTNEVNSs=; b=IQEvDFfEA8z1/lWS9CvAiTnH+kqwt4GNtKwbQ4ApTFf1cEGpeMarlLS63WCPzVRmW6 W1r4NYRf6KuooyWJGM6iW8dB3X5CpKa/dIm2IVGzOiqGJZVVi/lNFLlCZK0zATz/+maZ isYQNFsFgR1f3472IoEM9c08uSCfqcTfNUPrSBuokZ68lXSVuMVLa4Sw9QrAVR8I+zsA LXXeOgxU9GNElYLz8Dtf+oDMeYlphqAefhi5lXV+v6fw7U0WGiZkXvAnqBIYkspMC59B Ka1ijJ/xZ67f5aXyAVnp5WZBHGo+ntEi3O7RoqxzYQ8dikOIAm0NEF9Z+18VQUEu4FPq Szug== X-Forwarded-Encrypted: i=1; AHgh+RpCjqpFWeoGmrMLJ2XwXWqgqBu4iHibUe4KNv0AwYaLXJkwSM3m7NGZ870+QAFp/e8UZC0Xntoo9rijIhs=@vger.kernel.org X-Gm-Message-State: AOJu0YyNT+tKXiV4XvsASwy7p0EH20/hoZLsyP32QO/IvMG6/ux5roAn HpbSW2L8iXaPZVO0JmhYG13vc/3qP0Qcm0vuqBNQWN2cYDxWp0SDmtGU+i2I/x4U5pM= X-Gm-Gg: AfdE7ckn76vr47iibN4WcOseKzw3FO2YoWZBY7En90S2reCaEWckCmGUS++8hgdmDkK IEH4XYJgXQ/0hF1mW1vcmPlElz9jvxoiMDdHe19yI6thud41waug3Y6OHHIDUenGXY+9nKMvmig dCgcQcs7ty/xnDXCIDqqZ9/8MY49HAij4FMuu11BrhPaalRsOYfUVsWqb366/n0rA1AAl5fmLel 1yOt89nsmXzMJG0l9PMoPNUyIkqErzYbyDOTD8dGaX0c0OjZmNKLINTLr5uG5a21FIakm7Q7Ww/ 8rFd2pG1b44zgZEYKXsl567/cH75VgGTm7H220oOuvVci1eAuAvd4+VGf/fwo4DRpTvMJDVA5vU 3JYUDZUhTulvGfgXXumsTfeHfR9AkoIFrrzKFcEWH8vOQbBOQ9/xdTSodOcwgKoTqPIv6S9RWC+ H0P5JZlqlsihFz6aAd94p2aZ+T1rw9IO69NumhK3+Y0AfxZwzw9gliLMCxk2f+YKAT X-Received: by 2002:a05:6000:2407:b0:475:f0c2:75ac with SMTP id ffacd0b85a97d-47f4fd3a065mr2962749f8f.61.1784115856194; Wed, 15 Jul 2026 04:44:16 -0700 (PDT) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-47f4829896asm14005425f8f.23.2026.07.15.04.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 04:44:15 -0700 (PDT) From: Dave Stevenson Date: Wed, 15 Jul 2026 12:43:20 +0100 Subject: [PATCH v4 07/21] 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: 7bit Message-Id: <20260715-media-imx355-v4-7-f7f966fb9ffd@raspberrypi.com> References: <20260715-media-imx355-v4-0-f7f966fb9ffd@raspberrypi.com> In-Reply-To: <20260715-media-imx355-v4-0-f7f966fb9ffd@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 123ceed26d05..e9f4bea67d3a 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