public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Chen-Yu Tsai <wenst@chromium.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/9] dt-bindings: arm: mediatek: Add MT8186 Tentacruel / Tentacool Chromebooks
Date: Sat, 14 Oct 2023 14:40:26 +0100	[thread overview]
Message-ID: <20231014-proud-levers-eb03f30a0a9a@spud> (raw)
In-Reply-To: <CAGXv+5EmLDWi3Lnca1vPft=9z9Cp2L2ee08in_b_21hipf9ieQ@mail.gmail.com>

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

On Fri, Oct 13, 2023 at 11:19:16AM -0700, Chen-Yu Tsai wrote:
> On Fri, Oct 13, 2023 at 10:55 AM Conor Dooley <conor@kernel.org> wrote:
> >
> > On Fri, Oct 13, 2023 at 10:29:25AM -0700, Chen-Yu Tsai wrote:
> > > On Fri, Oct 13, 2023 at 8:11 AM Conor Dooley <conor@kernel.org> wrote:
> > > >
> > > > On Fri, Oct 13, 2023 at 07:02:28AM +0800, Chen-Yu Tsai wrote:
> > > > > Add entries for MT8186 based Tentacruel / Tentacool Chromebooks. The two
> > > > > are based on the same board design: the former is a convertible device
> > > > > with a touchscreen, stylus, and some extra buttons; the latter is a
> > > > > clamshell device and lacks these additional features.
> > > > >
> > > > > The two devices both have two variants. The difference is a second
> > > > > source touchpad controller that shares the same address as the original,
> > > > > but is incompatible.
> > > >
> > > > > The extra SKU IDs for the Tentacruel devices map to different sensor
> > > > > components attached to the Embedded Controller. These are not visible
> > > > > to the main processor.
> > > >
> > > > Wha? Given your ordering, is a "google,tentacruel-sku262144" a super-set
> > > > of "google,tentacruel-sku262145"? If not, this compatible ordering
> > > > doesn't make sense. I can't tell from your description, and the
> > > > absence of a
> > > > items:
> > > >           - const: google,tentacruel-sku262145
> > > >           - const: google,tentacruel-sku262146
> > > >           - const: google,tentacruel-sku262147
> > > >           - const: google,tentacruel
> > > >           - const: mediatek,mt8186
> > > > suggests that there is no google,tentacruel-sku262145
> > > > device?
> > >
> > > AFAIK all four SKUs exist. And as far as the main processor is concerned,
> > > they look completely identical, so they should share the same device tree.
> > > As mentioned in the commit message, the differences are only visible to
> > > the embedded controller, which fuses the sensor inputs.
> >
> > Then it makes very little sense to write a binding like this.
> > If this was just for the 252144 SKU, this would be fine.
> > For the other SKUs, there is no way to uniquely identify them, as
> > all four of google,tentacruel-sku262144, google,tentacruel-sku262145,
> > google,tentacruel-sku262146 and google,tentacruel-sku262147 must be
> > present.
> > Given that, why even bother including the SKUs in the first place,
> > since no information can be derived from them that cannot be derived
> > from google,tentacruel?
> > There's something that I am clearly missing here...
> 
> There are incompatible variants of google,tentacruel. This is why this
> patch has four google,tentacruel based entries. Of them, two are Tentacool,
> which are clamshell laptops, and two of them are Tentacruel, which are
> convertibles.
> 
> Within each group there are two variants: the second variant swaps out
> the I2C touchpad controller. These two controllers use the same I2C
> address but use different compatible strings, so it's not possible to
> have them coexist within the same device tree file like we do for many
> other second source components.
> 
> So the relationship looks like the following:
> 
> google,tentacruel --- Tentacruel --- google,tentacruel-sku26214[4567]
>                    |              |
>                    |              -- google,tentacruel-sku2621{48,49,50,51}
>                    |
>                    -- Tentacool ---- google,tentacruel-sku327681
>                                  |
>                                  --- google,tentacruel-sku327683
> 
> Also, the devices themselves only know their own SKU ID. The firmware
> will generate a list of compatible strings like:
> 
>   google,tentacruel-rev4-sku262144
>   google,tentacruel-rev4
>   google,tentacruel-sku262144
>   google,tentacruel
> 
> and try to find a match in the kernel FIT image. The method we currently
> use is to include all the applicable board compatible strings.

Then it seems like what you need is something like
oneOf:
  - items:
      - const: google,tentacruel-sku262144
      - const: google,tentacruel
      - const: mediatek,mt8186
  - items:
      - enum:
          - google,tentacruel-sku262145
          - google,tentacruel-sku262146
          - google,tentacruel-sku262147
      - const: google,tentacruel-sku262144
      - const: google,tentacruel
      - const: mediatek,mt8186

What you have at the moment just seems like a hack because you want to
stuff all of these compatible strings into a single dts.

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

  reply	other threads:[~2023-10-14 13:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 23:02 [PATCH 0/9] arm64: dts: mediatek: Add MT8186 Corsola Chromebooks Chen-Yu Tsai
2023-10-12 23:02 ` [PATCH 1/9] dt-bindings: arm: mediatek: Sort entries by SoC then board compatibles Chen-Yu Tsai
2023-10-13 15:04   ` Conor Dooley
2023-10-12 23:02 ` [PATCH 2/9] dt-bindings: arm: mediatek: Add MT8186 Tentacruel / Tentacool Chromebooks Chen-Yu Tsai
2023-10-13 15:11   ` Conor Dooley
2023-10-13 17:29     ` Chen-Yu Tsai
2023-10-13 17:55       ` Conor Dooley
2023-10-13 18:19         ` Chen-Yu Tsai
2023-10-14 13:40           ` Conor Dooley [this message]
2023-10-16  6:15             ` Chen-Yu Tsai
2023-10-18 15:07               ` Conor Dooley
2023-10-20  9:12                 ` Krzysztof Kozlowski
2023-10-20 10:06                 ` Chen-Yu Tsai
2023-11-24 14:08   ` Conor Dooley
2023-11-27  2:23     ` Chen-Yu Tsai
2023-10-12 23:02 ` [PATCH 3/9] dt-bindings: arm: mediatek: Add MT8186 Steelix Chromebook Chen-Yu Tsai
2023-10-13 15:12   ` Conor Dooley
2023-10-12 23:02 ` [PATCH 4/9] dt-bindings: arm: mediatek: Add MT8186 Rusty Chromebook Chen-Yu Tsai
2023-10-12 23:02 ` [PATCH 5/9] dt-bindings: arm: mediatek: Add MT8186 Magneton Chromebooks Chen-Yu Tsai
2023-10-12 23:02 ` [PATCH 6/9] arm64: dts: mediatek: Add MT8186 Krabby platform based Tentacruel / Tentacool Chen-Yu Tsai
2023-10-16  9:19   ` AngeloGioacchino Del Regno
2023-10-16 22:09     ` Chen-Yu Tsai
2023-10-16  9:21   ` Eugen Hristev
2023-10-16 17:12     ` Chen-Yu Tsai
2023-10-23  9:05   ` Eugen Hristev
2023-11-27  4:00     ` Chen-Yu Tsai
2023-11-27 13:05       ` AngeloGioacchino Del Regno
2023-12-01 15:32         ` Eugen Hristev
2023-10-12 23:02 ` [PATCH 7/9] arm64: dts: mediatek: Introduce MT8186 Steelix Chen-Yu Tsai
2023-10-16  8:36   ` Eugen Hristev
2023-11-27  3:56     ` Chen-Yu Tsai
2023-10-12 23:02 ` [PATCH 8/9] arm64: dts: mediatek: Add MT8186 Steelix platform based Rusty Chen-Yu Tsai
2023-10-12 23:02 ` [PATCH 9/9] arm64: dts: mediatek: Add MT8186 Magneton Chromebooks Chen-Yu Tsai

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=20231014-proud-levers-eb03f30a0a9a@spud \
    --to=conor@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=wenst@chromium.org \
    /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