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 D91D34C6EE3 for ; Wed, 6 May 2026 18:24:00 +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=1778091842; cv=none; b=CdBieRWOrIpoWv/sJPbRN0mrN7RzFREEOz9myHaHqwzKlNWIiExPlZdpi9yJDZKLqYupW7iF9gLUu+ba4ABf+E/U2nZOb7nnJMnlXVlEQ0dp5XlW0F/VybFpVjZqgrzzGc9GTkKjqnd1pmv9sSlHJNR8VjtW3CIFGMWKxW/tR6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778091842; c=relaxed/simple; bh=f6gIPNFF3ZGz6Dzi7iDBzYYDWPkgTeyPnawayseqnaE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gUTSommB/bKuk6OkkUQ3byf9F4DjkbgFJ2bRX2SjaM9FR9Z1qJ1PcjzEHi0VJzMbjvbuM/k4LGxipLwLu5WkuKhZjxKnavShLZouxV9Ggb/zn4EFAWYyG1iCiCOXTACoL7DBq6IfHyAsF2YqTfnQUb2miYktabuttKkLtaDocYo= 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=JO04K5dN; 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="JO04K5dN" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-488a8ca4aadso71488585e9.3 for ; Wed, 06 May 2026 11:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1778091839; x=1778696639; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=epOeXOJbCmT1H5jV/iuLaOOTzE2n5vMU5EsH3hJ6nfk=; b=JO04K5dNXASssIQ6yMJz/D7kQQA5sFoguuS5KdFcAVxu5gdqGY2d3CXZBsdDnruf0s tXDZGh6O4npIfvz6wTc2iRvnOdZfSdrQV7meET7EVJYokaMr8W1N4YDLek2PQFgfsiVp C/pnAaZJ7CA9uTEFvBfGVvmDWz5Iiik1faflPd+u4gG5nWvgYGUZz5o5Eyb0eo6ZLhRv 4QVf3EPoV4MbfluL356wttVXDPhHTJsnXYomsvHCSl9QUI7aLf/JXNkrdSR3a8UrLGoS gx+hNUvqxfZ1yPY6oc8yFsOXGs+0jNp0rfNu9XejVJ1YQYR04jpGZY6x4wroKLfogTxi SvLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778091839; x=1778696639; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=epOeXOJbCmT1H5jV/iuLaOOTzE2n5vMU5EsH3hJ6nfk=; b=WT2gzU2yJv6ulADrKW8hPSwjKrEI1DVcNugGmQM/9t7nygD60q4LJ38ZAMwa5TlNp+ FX+PB5jgwxTBTAtfavjemo5lyDttFqWiHWSuFudtzN39uyE/NEhyp3vZBAQEjghBgBst vXZQBeT10n28UtXMadkHPOgESjn1Fj3Vq3Mp+3SwoWTjFYKFKhRFOsy0EqL0BfARmjM5 4rdHf28U5qpztQbPzzmtT0baJCWX0INY+NBfFkchXNoNGdERJjFEhYB/xQCyT7FVTi4J ogpOd0bQSPtfguucvikulGapbPvR63dk/NFfWptVUD5WB6wrC9OscaaRLyfhdsIkJcuR Wp1A== X-Forwarded-Encrypted: i=1; AFNElJ866m/vsxUBsNKP9zLayxxxvE+cs3/TOiDQtgxvEgCX6pz5tXInRolp3a5oE3OB16tHYAZz96lwfboUL0I=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5HF+Esl/LhOJ6D4LXwTmNoALYNEi3bwFPiF91fj1Z5c/zN/5G Qd+UBZhz2TwprOgZrvNzqeyIaE5FrPK4mLryU5r3CKa9TyG7ByDrRJy6yUe7BEVaGSY= X-Gm-Gg: AeBDiessaHfwwn0mYccF5zIqWL3IbGZIeQ4eLjB3/2zz/6+qUG/T5Noo4Pr3ZLE5ALD yAu3mYm54I6unJjYHyUCqkkrvkFuwIjBtGp/3DBVmP1YfeuNOPgULvLRSaW4tPvpy9VDXXm0tP5 /g/FRpHzOwdshJ/E4fI726NuQw/+74dqEpt8Zc1wmXNZAIBnCnwEkDrkz19coHagYKjNwDioR77 q2/fuDlp/NsBJ2CoeK15qiRVJ22MVwC3nmaaPIAPHJ9lWaJn/v8BricYUfZqguCznR97rvzd11v Z1PTFn7aVmVquEfpOM4lb4Nv0ZQx+Di8f3BFt/ogZAlYGMfNWdBARpvdwyUsFLLBlI+dKkq/lcw xiSLcgunC4+tir6YytKFTQhDD42HFR9bvSUQ0/uv39NL/yx3PMU1ENcNzncw12KoomP/0edjGAZ x3Z7lNEzk9sOuY7+D2xngWRdw7 X-Received: by 2002:a05:600c:12d4:b0:488:9439:881a with SMTP id 5b1f17b1804b1-48e51e0bba9mr50399125e9.2.1778091839295; Wed, 06 May 2026 11:23:59 -0700 (PDT) Received: from [127.0.1.1] ([2a00:1098:3142:e::8]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48e5313b023sm36165675e9.5.2026.05.06.11.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 11:23:58 -0700 (PDT) From: Dave Stevenson Date: Wed, 06 May 2026 19:23:43 +0100 Subject: [PATCH 05/13] 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: <20260506-media-imx355-v1-5-660685030455@raspberrypi.com> References: <20260506-media-imx355-v1-0-660685030455@raspberrypi.com> In-Reply-To: <20260506-media-imx355-v1-0-660685030455@raspberrypi.com> To: Tianshu Qiu , Sakari Ailus , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, David Heidelberg , 20260414-imx355-24mhz-v1-1-9ae77bc6e7ec@ixit.cz, 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. This can't be implemented via a s_ctrl handler for V4L2_CID_HBLANK as __v4l2_ctrl_handler_setup doesn't call s_ctrl for read only controls. Signed-off-by: Dave Stevenson --- --- drivers/media/i2c/imx355.c | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index 589bad6c58e4..56a82f37709e 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -34,6 +34,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 @@ -266,8 +269,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 }, @@ -276,8 +277,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 }, @@ -286,8 +285,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 }, @@ -296,8 +293,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 }, @@ -306,8 +301,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 }, @@ -316,8 +309,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 }, @@ -326,8 +317,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 }, @@ -336,8 +325,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 }, @@ -346,8 +333,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 }, @@ -356,8 +341,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 }, @@ -366,8 +349,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 }, @@ -376,8 +357,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 }, @@ -386,8 +365,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 }, @@ -396,8 +373,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 }, @@ -1041,6 +1016,13 @@ static int imx355_start_streaming(struct imx355 *imx355) if (ret) return ret; + /* set line length */ + ret = imx355_write_reg(imx355, IMX355_REG_LLP, + imx355->hblank->val + imx355->cur_mode->width, + 2); + if (ret) + return ret; + /* Apply customized values from user */ ret = __v4l2_ctrl_handler_setup(imx355->sd.ctrl_handler); if (ret) -- 2.34.1