From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3E927219A79; Tue, 30 Dec 2025 15:41:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767109285; cv=none; b=DA5qYJd3SwM8JQLPQ+ciA5H+DsVX7wzpAzi9rotznRJsHy4R80h5JV+shlG+XZWrqdsgHxzUu1wPHRN7r//OilBNalJfgUyw1G0Un0+iOuLPEXkwI7TGf+SQ5z7ORJmsKItHEXG5Zytz98Cf3KsZlkqhKfCP9WxjRtiNzqB+idc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767109285; c=relaxed/simple; bh=jd48LsNLSI+s7QCuEipniUUwm/mwWsBt6Wi2ZRPEBCM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OsYe2xoDxNT2azSYj6jUeeyhAziKsa8TTUPK2YP6fS+AT2vvPz2jvcFxOwhf+ZKA15vkOmLjjOzr3MHdnzxh1iVmlR6aBKpSiRHR8DtZAo7MXrnSmvKs6KSdDEgO8SlK4zXMcdw7TeNi93YfESxNHCpY0v6bqcfy80xpNZLMGa4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oQt0uCW3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oQt0uCW3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D6ACC19421; Tue, 30 Dec 2025 15:41:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767109284; bh=jd48LsNLSI+s7QCuEipniUUwm/mwWsBt6Wi2ZRPEBCM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oQt0uCW3f7CuNgtAQvjNGqC73R6NVqGh74DNZ/KRjXN8yOSN5wwZQ3xGzu/PUKqRh v3kDEFQnBWPnb84ByCqKGSGHPrd5XRLj5k2ZtAIEQPUQwYcA9aPN3I7bLFt1FKcv0b lBH74TfUq5puyjoHEChOUXC0kkR5iLwJ6cImkoxZeV4E7+XRjetEQWdUvWCvA/rpCM VR4hZSIZ3qFqPIx1yfgYq1PdSJ/ardnlv+vZ45U7QnMQTC4CE8qmQ61hX8noA8SfBb FoyJQosL76r7bvsKBygzBlBdrnNum8XSFfMCV0J8kmEcASGXInm4k/PvxZQt/KpHcQ gDhV8WNAhiyZA== Message-ID: <5c53a758-9499-4043-ad89-1cc6f1b12233@kernel.org> Date: Tue, 30 Dec 2025 16:41:20 +0100 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/4] media: i2c: ov9282: Fix reset-gpio logical state To: Loic Poulain Cc: Sakari Ailus , krzk+dt@kernel.org, andersson@kernel.org, konradybcio@kernel.org, dave.stevenson@raspberrypi.com, robh@kernel.org, conor+dt@kernel.org, mchehab@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com References: <20251114133822.434171-1-loic.poulain@oss.qualcomm.com> <20251114133822.434171-2-loic.poulain@oss.qualcomm.com> <41447e2e-52af-4fe0-8204-7ee7f43841c6@kernel.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZo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jzBmdq2esyE6zIqftdo4MOJho8uctOiWbwNNq2U9pPWmu 4vXVFBYIGmpyNPYzRm0QPwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmgXUF8FCRaWWyoACgkQG5NDfTtBYptO0w//dlXJs5/42hAXKsk+PDg3wyEFb4NpyA1v qmx7SfAzk9Hf6lWwU1O6AbqNMbh6PjEwadKUk1m04S7EjdQLsj/MBSgoQtCT3MDmWUUtHZd5 RYIPnPq3WVB47GtuO6/u375tsxhtf7vt95QSYJwCB+ZUgo4T+FV4hquZ4AsRkbgavtIzQisg Dgv76tnEv3YHV8Jn9mi/Bu0FURF+5kpdMfgo1sq6RXNQ//TVf8yFgRtTUdXxW/qHjlYURrm2 H4kutobVEIxiyu6m05q3e9eZB/TaMMNVORx+1kM3j7f0rwtEYUFzY1ygQfpcMDPl7pRYoJjB dSsm0ZuzDaCwaxg2t8hqQJBzJCezTOIkjHUsWAK+tEbU4Z4SnNpCyM3fBqsgYdJxjyC/tWVT AQ18NRLtPw7tK1rdcwCl0GFQHwSwk5pDpz1NH40e6lU+NcXSeiqkDDRkHlftKPV/dV+lQXiu jWt87ecuHlpL3uuQ0ZZNWqHgZoQLXoqC2ZV5KrtKWb/jyiFX/sxSrodALf0zf+tfHv0FZWT2 zHjUqd0t4njD/UOsuIMOQn4Ig0SdivYPfZukb5cdasKJukG1NOpbW7yRNivaCnfZz6dTawXw XRIV/KDsHQiyVxKvN73bThKhONkcX2LWuD928tAR6XMM2G5ovxLe09vuOzzfTWQDsm++9UKF a/A= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 30/12/2025 16:03, Loic Poulain wrote: > Hi Krzysztof, > > On Tue, Dec 30, 2025 at 2:54 PM Krzysztof Kozlowski wrote: >> >> On 15/12/2025 11:19, Loic Poulain wrote: >>> On Mon, Dec 15, 2025 at 10:40 AM Sakari Ailus >>> wrote: >>>> >>>> Hi Loic, >>>> >>>> On Mon, Dec 15, 2025 at 10:35:15AM +0100, Loic Poulain wrote: >>>>> Hi Sakari, >>>>> >>>>> On Mon, Nov 17, 2025 at 6:30 PM Sakari Ailus >>>>> wrote: >>>>>> >>>>>> Hi Loic, >>>>>> >>>>>> On Fri, Nov 14, 2025 at 02:38:19PM +0100, Loic Poulain wrote: >>>>>>> Ensure reset state is low in the power-on state and high in the >>>>>>> power-off state (assert reset). Note that the polarity is abstracted >>>>>>> by the GPIO subsystem, so the logic level reflects the intended reset >>>>>>> behavior. >>>>>> >>>>>> That's an interesting approach to fix DTS gone systematically wrong. >>>>>> >>>>>> I was thinking of the drivers that have this issue, too, but I would have >>>>>> introduced a new GPIO under a different name (many sensors use "enable", >>>>>> too). Any thoughts? >>>>> >>>>> Apologies for missing your point earlier. We can’t really name it >>>>> enable, as it performs the opposite function and that would be >>>>> confusing in the device tree description. A property like reset2 would >>>>> be more accurate, but I suspect such a binding wouldn’t be acceptable >>>>> from a device tree/bindings perspective. >>>> >>>> Many sensor datasheets document a pin called "xshutdown" or alike. That's >>>> not exactly "reset" or "enable" but it can be mapped to either and this can >>>> be seen in the existing bindings. The polarity is effectively the opposite, >>>> yes, but does that matter? >>> >>> I assume naming a pin 'xshutdown' or 'xreset' indicates that its >>> polarity is inverted at the driver level, the driver interprets the >>> shutdown or reset function as being active when the logical level is 0 >>> (low), as they actually incorrectly do for the 'reset' gpio. >>> >>> From the driver’s perspective, this naming convention is acceptable; >>> however, it causes the devicetree description to slightly diverge from >>> the datasheet and leaves the reset property effectively inverted (and >>> therefore incorrect). >>> >>> Honestly, in this specific case, the simplest solution would be to fix >>> the driver, since there is currently no upstream devicetree using this >>> sensor. That would technically break backward compatibility for any >>> out-of-tree DTS (if they exist), but those would have been incorrect >>> in the first place. >>> >>> But yes, this seems like a good opportunity to discuss and define a >>> more general approach that can be applied to other drivers with >>> similar polarity or naming issues. >>> >>> Krzysztof, any thoughts? >> >> You need to first CC me. You sent it to the special bulk email >> address... Anyway, please be specific about the question. > > Ultimately, I’d like to reach a consensus before moving forward with > V4, as several approaches have been discussed so far: > > 1. Keep the current (incorrect) driver logic: This was the approach I > used in V1 of this series, explicitly noting in the DTS that the > polarity was incorrect. However, this workaround was fairly rejected > as not being an acceptable solution. > > 2. Fix the driver logic: This was the approach in V2. It ensures > correct behavior going forward, especially since there is currently no > upstream DTB using this binding yet. The downside is that it would > consistently break any out-of-tree DTBs that *incorrectly* describe > the GPIO polarity. No... It will break EVERY out of tree DTBs, which was previously working. It won't break only the ones which were NEVER working... Breaking a working out of tree DTBs for a driver used for almost 5 years is a no-go. ...unless you get acks from all platform maintainers (so ~40 SoC maintainers?). Quite unlikely. This should stay as is just like I did not fix none of other sensor drivers. Best regards, Krzysztof