From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00F41420476 for ; Tue, 11 Aug 2026 08:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786438645; cv=none; b=jGDzz41DoyWsURdEikhoGse4N8S4AaOl3sv7FAQy+JHBLy8blvrlWl2lBg4Wgch47uOG++JZKykD1WdVuS2whKiu1WM9wT8AE4WWhjlLubaEIzs3FT+CxfTK7MgnWLoWH8OcuVjE/0mtAJI78U7Gc4On0WU/n1Q9AzM7qFDR8y0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786438645; c=relaxed/simple; bh=ctVwGNs67Fa6z+hLCuJ8VLAaBJHX9wbgA9F0FRIaAuw=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=OkrsK52ffdFGgNgmEWla7lGNCOd4HqdU6B6OWsgEp0N0aCOpczv/XWPoNJUhQp6k16bMkj0wp5Tlehh7GxIkEumaQLSPt4yn3KaFU/dKUtjCjD4JtDhJF4uw28bDd79983pkZ7iyrgyfaOQYqBWjmbvRUlcxniBim0N63HbhTFQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=F0m5H1v3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=e0LgnNBD; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="F0m5H1v3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="e0LgnNBD" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67B7THqC2937767 for ; Tue, 11 Aug 2026 08:57:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= elooRN3b3UOMpv7wiJboOEuKd6vdGvMOOo10ZNjf5Bc=; b=F0m5H1v3uPL5OCJL lVKiVbn5NLq+9yv4FUiK30drplli0dk+njiMmv61n0OBBqiiWvSoWtRbhz0GRrnc yUxZFqT5mwngnm2RPsKeqrlls0wd6WZgCDgiRsNbmTjEJ3CvzDHF9Mqjfs4iEzVe TeLURWcKEk5tlFklXxvr2CfP/eZB7EPgOO671QZXktBj8nQqfK/kDZraVsgNQTAY XQbx1LouIpCVXWHTDFJ8GDh/o53yi7Irz+S4nfzUeF/dbjP9yf9wwg5qM2J3fOAg FEWSkedq1hw+NkvXzcCCDB64w5ptEFl7hdB0zdPiBJY4U+1XNhXIaieDe9ad1Rap vrsg4g== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fyjjv38er-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 08:57:22 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51c12e43b98so6727721cf.1 for ; Tue, 11 Aug 2026 01:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786438642; x=1787043442; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=elooRN3b3UOMpv7wiJboOEuKd6vdGvMOOo10ZNjf5Bc=; b=e0LgnNBDm01jNRH6KikcAxRvvOYrQI9koZxSeakCyupolXYGEW5AhoHCrXgwXxtZA6 KmskxOdjvJwwrvL6V7AoeT2nZ79MRZU8Qb9/wDpPZSzIDKckUiwi6eS/HxCiJQOnXOvD VJhlgz1vqy7aofhpofTuCQGmWbcMy5To5sC5ghbcXzLpF3eqiscPWoX3P0mOVmfmWTX4 YT0NKdtzQjYpy7pw27Xb7y1CAzA4vqDXjkgJospCCei1nLZ0oUlRPbrVyN1P2r2Jh3I7 FlKOBi2S1Hx0Tz60eIueasVt5xmWAeLAXV4JTm81kcEUwMWEsFF0MwTtYGYBqW0CYuRC Ds1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786438642; x=1787043442; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=elooRN3b3UOMpv7wiJboOEuKd6vdGvMOOo10ZNjf5Bc=; b=BSwhtPLE7Tdu1RLIVUI8eD7DJWL6HDSyZV4FcfpiG7LP85RxU/7BfR4hXXaFUIwsJE Ooq1f6vuxhM5RxAMNolljZlseHRzqGYw1N8FcYnI+McaUOruKUcR8QZhdeRoAmZGEJIV pvHsRAkgOZ8nB7AJ/YDYpJWrwcy+HW+jvbcD4FqPIx9U2llXmSF60c6nSAasSVgDwjDh BkLh9RrUUuge/TlYyrmzH+ophsGPGSURwlJTupuabo80le0r8FrqGMefEJ2Au/LTuDBV /O/LY47cnEPqRvkwS2KJkJtX9gxXe7roEwIzeraPfLpM4kKYBDFqQWCIs4apPASjTrQG ycLg== X-Forwarded-Encrypted: i=1; AHgh+Rr0Bs3Q7nsOFJFIbCABUVoTYF4dLjOXKp+sIner3XMd2PNwxfqcZ8gvhW/UfJRNDUHf4gbDTimb3SvOU4s=@vger.kernel.org X-Gm-Message-State: AOJu0YypyClqk5SZueD0T9YgCSrYZMctpL1Rx1G1L5u+seZiP5vRukQi 8b+JNFf2w1ohX6x9judw5NWbUTAD2KBobs+mjnjgNOPV59m7oXipE+bAmJtoTxM4sxOMro7JSUQ kqcHq880CZWdT5C1RQk6mE8Z3NsxRMDK2fbWAXYhimJrFtlrKoozAVaeL+9utxgf1mYc= X-Gm-Gg: AR+sD12zACQdGQMWpM5fvtSSFApcGqsWVczXYgk4IPqgmX6NkztDNbtiUJvC4YczMyh DOVYAGwIA6CxCc9Rna/hk0eyxkma9kZU1oXkNzuMad7JJHh1Fh6RPzA911A4Kwb+u9pOkszZd6S 5KDJ1jjPu/40aXPKqP9wIA+wE1y+YxrYriUZ9cq/cUWaB8F7W+vtEA+RRJ6s61Lqsilv88U/5Ar iUjuXz10QyWRgWwW0X1l84vfBlnTn0WUW8sQ+hdiiS0qIqX3xU57ZQSj2SbB8P4rDlU491AadwG HalcsyVmEVv4cEbvK6ktNxXcG83lEh1XHrwqxHlt3F7KGCst4DsUtz7CI4MbkWFhjIqAz8yFLVE LhffhS3R76PHnom5HGzHItZXKYiCZCkK+nircS9kw6yz0xawo1XqZlitu7IVJe9pzM4M4TVcKXF lauYs5ZmLBLd7gq2LLul/w+TXH+7j7PYj2NuPunpjp7QtE5wN+5oyRZNxuf+W/18Syk4A= X-Received: by 2002:a05:622a:1820:b0:51c:ba4:d837 with SMTP id d75a77b69052e-52d5856d370mr12243601cf.18.1786438641979; Tue, 11 Aug 2026 01:57:21 -0700 (PDT) X-Received: by 2002:a05:622a:1820:b0:51c:ba4:d837 with SMTP id d75a77b69052e-52d5856d370mr12243301cf.18.1786438641426; Tue, 11 Aug 2026 01:57:21 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a362e17756sm399788a12.1.2026.08.11.01.57.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2026 01:57:20 -0700 (PDT) Message-ID: Date: Tue, 11 Aug 2026 10:57:18 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: johannes.goede@oss.qualcomm.com Subject: Re: [PATCH v3] media: ov5640: select the MIPI lane mode from the endpoint lane count To: jason98166@gmail.com, Steve Longerbeam , Sakari Ailus , Mauro Carvalho Chehab Cc: Hans Verkuil , Jacopo Mondi , Kieran Bingham , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260811-ov5640-1lane-v1-v3-1-ae476eaf5024@gmail.com> Content-Language: en-US, nl In-Reply-To: <20260811-ov5640-1lane-v1-v3-1-ae476eaf5024@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDA3MyBTYWx0ZWRfX6qKXGksqujzT dmzcUhJg7qRZmOLbEi29dZ+U/i9Z2sX2KC3tGfuISpu8cqUURjfMQN5iJXnG/pYBfXJEyOirBMj P/TPT3D5M115N5ctymkvBw5ZUgCMLJePZicszqPplcwCQjPzV8CZ40QQBrtddh30LKe6lUfm2aL U1aCaftXWZYL6zu4nCV5QNCn51mN2P4ltIHc+N9qpDGSIpmjJ7PxC8mNOSb7vz9H0RjZXlonZtT ZAL+dQAKDajCaqQVRZKc2knreePSaJchRIubeGS3F4hgY6lYf0YnzEJ4dc/HOOTc/QlrMGKFSQC YcWzi7Gj+VjQepSag1dkF4PHQZWad8FcvqLM8Pw7xSPVjtLIq9SI4gWWtNVGanvZ2+HseUWfx/9 iK3PjFFP1wNjYs8UqMEln/wH26TwtPnMiXTAhX+6rmsoQqKHr1sHv4Pi1sgr6hyM0z4bJtmtcag KEMAbcyCjpn8RerN0iA== X-Proofpoint-ORIG-GUID: gg0gQSNy8_ksz7oX8AEl3ZieMpc0YvR1 X-Authority-Analysis: v=2.4 cv=KLtqylFo c=1 sm=1 tr=0 ts=6a7ae3f2 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=s5WTe2n68omTjJFxeYUA:9 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-GUID: gg0gQSNy8_ksz7oX8AEl3ZieMpc0YvR1 X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDA3MyBTYWx0ZWRfX6RyUM/c485K/ LDkDAEo6mX5koWUW5f60y5BEFNhIfo/Jpigz1J4m4hh8mJJeWWbaLB7YCcYkDOVVe9jAElvWiRU dw0oP8qKElygCJNDZi9pA8X2OR6GOPY= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-10_06,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110073 Hi, On 11-Aug-26 09:30, Jason Yang via B4 Relay wrote: > From: Jason Yang > > ov5640_set_stream_mipi() always programs IO_MIPI_CTRL00 with 0x45, > which selects the two data lane mode: the number of data lanes > described in the devicetree endpoint only feeds the sensor's clock > tree computations, so a module wired with one data lane starts > streaming in two lane mode and the receiver never assembles a > frame. > > Take the lane mode from the endpoint instead. The field encodes > the lane count directly - 001 for one lane, 010 for two - per the > current sensor manual (version 2.33). The 2.03 manual documented > 000/001 for one/two lanes; OmniVision corrected the table in > version 2.1, which is why the long-standing comment here found 001 > unusable for two lanes and validated 010 instead. > > The power-up path also programs a two data lane mode, but that > value is overwritten when streaming starts, so it is left alone. > > Tested with a single data lane module on an i.MX8MP board > (imx-mipi-csis receiver), where the unpatched value produces no > frames at all, and on an RK3588 board. > > Fixes: 19a81c1426c1 ("[media] add Omnivision OV5640 sensor driver") > Cc: stable@vger.kernel.org > Signed-off-by: Jason Yang > Assisted-by: Claude:claude-opus-5 > --- > Changes in v3: > - Inline the lane count in the write instead of going through a > local variable (Sakari Ailus). > - Link to v2: https://lore.kernel.org/r/20260811-ov5640-1lane-v1-v2-1-65205ae86feb@gmail.com > > Changes in v2: > - Compute the register value from the lane count in the single > write instead of branching on it (Sakari Ailus), with the count > in a local variable to stay within 80 columns; the programmed > values are unchanged, 0x25 for one lane and 0x45 for two. > - Request a normal stable backport rather than opting out of > AUTOSEL (Sakari Ailus). > - Drop the quotes around the function name in the reference from > ov5640_set_power_mipi() (Sakari Ailus). > - Link to v1: https://lore.kernel.org/r/20260811-ov5640-1lane-v1-v1-1-79699457ce13@gmail.com > --- > drivers/media/i2c/ov5640.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c > index 8deb5f5501fa..18c3bb5498f8 100644 > --- a/drivers/media/i2c/ov5640.c > +++ b/drivers/media/i2c/ov5640.c > @@ -1831,22 +1831,16 @@ static int ov5640_set_stream_mipi(struct ov5640_dev *sensor, bool on) > /* > * Enable/disable the MIPI interface > * > - * 0x300e = on ? 0x45 : 0x40 > - * > - * FIXME: the sensor manual (version 2.03) reports > - * [7:5] = 000 : 1 data lane mode > - * [7:5] = 001 : 2 data lanes mode > - * But this settings do not work, while the following ones > - * have been validated for 2 data lanes mode. > - * > - * [7:5] = 010 : 2 data lanes mode > + * [7:5] : data lane count, 001 for one lane and 010 for two, > + * per version 2.33 of the sensor manual > * [4] = 0 : Power up MIPI HS Tx > * [3] = 0 : Power up MIPI LS Rx > * [2] = 1/0 : MIPI interface enable/disable > * [1:0] = 01/00: FIXME: 'debug' > */ > ret = ov5640_write_reg(sensor, OV5640_REG_IO_MIPI_CTRL00, > - on ? 0x45 : 0x40); > + on ? 0x5 | sensor->ep.bus.mipi_csi2.num_data_lanes << 5 : > + 0x40); You're writing 0x40 aka 2 lines now when turning the sensor off in 1 line mode. I believe this should be: ret = ov5640_write_reg(sensor, OV5640_REG_IO_MIPI_CTRL00, sensor->ep.bus.mipi_csi2.num_data_lanes << 5 | (on ? 0x05 : 0x0)); Only changing the low nibble for on / off and always setting the correct lane count. Regards, Hans