public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Marc Gonzalez <mgonzalez@freebox.fr>
Cc: Conor Dooley <conor+dt@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	 Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	 Daniel Vetter <daniel@ffwll.ch>,
	Liam Girdwood <lgirdwood@gmail.com>,
	 Mark Brown <broonie@kernel.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	 linux-arm-msm@vger.kernel.org, Arnaud Vrac <avrac@freebox.fr>,
	 Pierre-Hugues Husson <phhusson@freebox.fr>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: Re: [PATCH v3 1/2] dt-bindings: display: bridge: add TI TDP158
Date: Tue, 30 Jul 2024 10:27:44 +0200	[thread overview]
Message-ID: <20240730-eminent-venomous-condor-8ef421@houat> (raw)
In-Reply-To: <c302bc47-6492-44af-86a1-3ff6a815e314@freebox.fr>

[-- Attachment #1: Type: text/plain, Size: 3347 bytes --]

On Wed, Jul 24, 2024 at 07:59:21PM GMT, Marc Gonzalez wrote:
> On 15/07/2024 16:40, Maxime Ripard wrote:
> > On Thu, Jul 04, 2024 at 07:04:41PM GMT, Marc Gonzalez wrote:
> >> On 01/07/2024 15:50, Maxime Ripard wrote:
> >>
> >>> The i2c register access (and the whole behaviour of the device) is
> >>> constrained on the I2C_EN pin status, and you can't read it from the
> >>> device, so it's also something we need to have in the DT.
> >>
> >> I think the purpose of the I2C_EN pin might have been misunderstood.
> >>
> >> I2C_EN is not meant to be toggled, ever, by anyone from this planet.
> > 
> > Toggled, probably not. Connected to a GPIO and the kernel has to assert
> > a level at boot, I've seen worse hardware design already.
> > 
> >> I2C_EN is a layout-time setting, decided by a board manufacturer:
> >>
> >> - If the TDP158 is fully configured once-and-for-all at layout-time,
> >> then no I2C bus is required, and I2C_EN is pulled down forever.
> >>
> >> - If the board manufacturer wants to keep open the possibility
> >> to adjust some parameters at run-time, then they must connect
> >> the device to an I2C bus, and I2C_EN is pulled up forever.
> > 
> > How do you express both cases in your current binding?
> 
> It's not that I'm ignoring your question.
> 
> It's that I don't understand what you're asking.

And that's fine, you just need to say so.

Generally speaking, you're focusing on the driver. The driver is not the
issue here. You can do whatever you want in the driver for all I care,
we can change that later on as we wish.

The binding however cannot change, so it *has* to ideally cover all 
possible situations the hardware can be used in, or at a minimum leave
the door open to support those without a compatibility breakage.

That's why I've been asking those questions, because so far the only
thing you've claimed is that "I can't test the driver for anything
else", but, again, whether there's a driver or not, or if it's
functional, is completely missing the point.

> SITUATION 1
> tdp158 is pin strapped.
> Device node is child of root node.
> Properties in proposed binding are valid (regulators and power-on pin)
> Can be supported via module_platform_driver.
> 
> SITUATION 2
> tdp158 is sitting on I2C bus.
> Device node is child of i2c bus node.
> (robh said missing reg prop would be flagged by the compiler)
> Properties in proposed binding are valid (regulators and power-on pin)
> Supported via module_i2c_driver.
> 
> If some settings-specific properties are added later, like skew,
> they would only be valid for the I2C programmable mode, obviously.

I think there's a couple more combinations:

  - The device is connected on an I2C bus, but I2C_EN is tied low
  - The device is connected on an I2C bus, but I2C_EN is connected to a
    GPIO and the kernel needs to assert its state at boot.

The GPIO case can be easily dealt with later on using an optional GPIO
in the binding, but the current binding infers the I2C_EN level from the
bus it's connected to, and I think we don't have a good way to deal with
cases that would break that assumption.

So I think we need an extra property to report the state of the i2c_en
pin (and would be mutually exclusive with the GPIO if we ever have to
support it).

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2024-07-30  8:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 11:13 [PATCH v3 0/2] Basic support for TI TDP158 Marc Gonzalez
2024-06-27 11:13 ` [PATCH v3 1/2] dt-bindings: display: bridge: add " Marc Gonzalez
2024-06-27 16:25   ` Conor Dooley
2024-06-27 16:45     ` Marc Gonzalez
2024-06-28  7:36       ` Krzysztof Kozlowski
2024-06-28  7:49         ` Dmitry Baryshkov
2024-07-01 14:31           ` Marc Gonzalez
2024-07-23 15:17     ` Marc Gonzalez
2024-07-23 19:57       ` Conor Dooley
2024-07-24 14:03         ` Maxime Ripard
2024-07-01 13:50   ` Maxime Ripard
2024-07-01 15:36     ` Marc Gonzalez
2024-07-08 14:59       ` Maxime Ripard
2024-07-08 20:29         ` Dmitry Baryshkov
2024-07-15 14:42           ` Maxime Ripard
2024-07-15 16:38             ` Dmitry Baryshkov
2024-07-16  9:24               ` Maxime Ripard
2024-07-16 10:59                 ` Dmitry Baryshkov
2024-07-24 17:25                 ` Marc Gonzalez
2024-07-24 17:34               ` Marc Gonzalez
2024-07-24 17:18             ` Marc Gonzalez
2024-07-24 17:25               ` Dmitry Baryshkov
2024-07-24 17:28                 ` Marc Gonzalez
2024-07-30  8:44                   ` Maxime Ripard
2024-07-04 17:04     ` Marc Gonzalez
2024-07-15 14:40       ` Maxime Ripard
2024-07-24 17:59         ` Marc Gonzalez
2024-07-30  8:27           ` Maxime Ripard [this message]
2024-07-30  8:46             ` Dmitry Baryshkov
2024-07-30  9:30               ` Maxime Ripard
2024-07-30  9:44                 ` Marc Gonzalez
2024-07-30 10:38                 ` Dmitry Baryshkov
2024-06-27 11:13 ` [PATCH v3 2/2] drm/bridge: add support for " Marc Gonzalez
2024-07-29 12:54 ` [PATCH v3 0/2] Basic " Marc Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240730-eminent-venomous-condor-8ef421@houat \
    --to=mripard@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=avrac@freebox.fr \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mgonzalez@freebox.fr \
    --cc=neil.armstrong@linaro.org \
    --cc=phhusson@freebox.fr \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox