mbox series

[v4,0/9] arm64: dts: mediatek: Add MT8186 Corsola Chromebooks

Message ID 20231213150435.4134390-1-wenst@chromium.org
Headers show
Series arm64: dts: mediatek: Add MT8186 Corsola Chromebooks | expand

Message

Chen-Yu Tsai Dec. 13, 2023, 3:04 p.m. UTC
Hi everyone,

This is v4 of the MT8186 Chromebook device tree series. Sending now in
case you still want to apply more patches.

Changes since v3:
- Collected reviewed-by from Angelo
- Reorder some properties to conform better to the newly proposed DT
  style guidelines
- Drop unused labels
- Rename bt-sco node name to bt-sco-codec
- Drop i2s*-share properties from afe node
- Drop aud_gpio_tdm_{on,off} pinctrl nodes
- Replace interrupts with interrupts-extended in tpm node
- Enable adsp device

Changes since v2:
- Picked up Conor's ack
- Renamed remaining "touchpad" nodes to "trackpad"
- Dropped pinctrl from tentacruel/tentacool second source trackpad

Changes since v1:
- Reorder SKU numbers in descending order.
- Fixed pinconfig node names
- Moved pinctrl-* properties after interrupts-*
- Switched to interrupts-extended for external components
- Marked ADSP as explicitly disabled, with a comment explaining that it
  stalls the system
- Renamed "touchpad" to "trackpad"
- Dropped bogus "no-laneswap" property from it6505 node
- Moved "realtek,jd-src" property to after all the regulator supplies
- Switched to macros for MT6366 regulator "regulator-allowed-modes"
- Renamed "vgpu" regulator name to allow coupling, with a comment
  containing the name used in the design
- Renamed "cr50" node name to "tpm"
- Moved trackpad_pins reference up to i2c2; workaround for second source
  component resource sharing.
- Fix copyright year
- Fixed touchscreen supply name
- Mark missing components as disabled instead of deleting the node
- Dropped reset-gpios from touchscreen nodes
- Drop status = "okay", which is the default


This series adds device trees for the various MT8186 Chromebooks that
were initially released. These are the Tentacruel / Tentacool devices
released by ASUS, and the Steelix / Rusty / Magneton devices released
by Lenovo. The device trees are taken from the downstream ChromeOS v5.15
kernel, ported to mainline and cleaned up.

Corsola is the Google codename given to the MT8186 platform. This
platform has two reference designs, Krabby and Kingler. Kingler was not
used in any actual product, and is therefor not included. Steelix is
an alternative design put forward and is effectively a mix-and-match of
the two reference designs.

Most of the core design is shared between the variants. The differences
are on which external components, such as the display bridges, are used.

Patch 1 cleans up the current list of MediaTek boards. The entries are
reordered by SoC model first, then by board name.

Patch 2 through 5 add DT binding entries for the Tentacruel/Tentacool,
Steelix, Rusty, and Magneton Chromebooks.

Patch 6 through 9 add board device tree files for these devices. Patch 6
also adds the corsola dtsi file for the commonalities between the designs,
as well as a dtsi file for the krabby reference design.

Currently external display support is missing. Audio is not working, as
enabling the audio DSP causes my test systems to hang.

Please have a look and test if possible.


Regards
ChenYu

Chen-Yu Tsai (9):
  dt-bindings: arm: mediatek: Sort entries by SoC then board compatibles
  dt-bindings: arm: mediatek: Add MT8186 Tentacruel / Tentacool
    Chromebooks
  dt-bindings: arm: mediatek: Add MT8186 Steelix Chromebook
  dt-bindings: arm: mediatek: Add MT8186 Rusty Chromebook
  dt-bindings: arm: mediatek: Add MT8186 Magneton Chromebooks
  arm64: dts: mediatek: Add MT8186 Krabby platform based Tentacruel /
    Tentacool
  arm64: dts: mediatek: Introduce MT8186 Steelix
  arm64: dts: mediatek: Add MT8186 Steelix platform based Rusty
  arm64: dts: mediatek: Add MT8186 Magneton Chromebooks

 .../devicetree/bindings/arm/mediatek.yaml     |  180 +-
 arch/arm64/boot/dts/mediatek/Makefile         |   10 +
 .../dts/mediatek/mt8186-corsola-krabby.dtsi   |  129 ++
 .../mt8186-corsola-magneton-sku393216.dts     |   39 +
 .../mt8186-corsola-magneton-sku393217.dts     |   39 +
 .../mt8186-corsola-magneton-sku393218.dts     |   26 +
 .../mt8186-corsola-rusty-sku196608.dts        |   26 +
 .../mt8186-corsola-steelix-sku131072.dts      |   18 +
 .../mt8186-corsola-steelix-sku131073.dts      |   18 +
 .../dts/mediatek/mt8186-corsola-steelix.dtsi  |  195 ++
 .../mt8186-corsola-tentacool-sku327681.dts    |   57 +
 .../mt8186-corsola-tentacool-sku327683.dts    |   24 +
 .../mt8186-corsola-tentacruel-sku262144.dts   |   44 +
 .../mt8186-corsola-tentacruel-sku262148.dts   |   26 +
 .../boot/dts/mediatek/mt8186-corsola.dtsi     | 1707 +++++++++++++++++
 15 files changed, 2477 insertions(+), 61 deletions(-)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-krabby.dtsi
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-magneton-sku393216.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-magneton-sku393217.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-magneton-sku393218.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-rusty-sku196608.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327681.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327683.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262144.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi

Comments

AngeloGioacchino Del Regno Dec. 14, 2023, 10:31 a.m. UTC | #1
Il 13/12/23 16:04, Chen-Yu Tsai ha scritto:
> Tentacruel and Tentacool are MT8186 based Chromebooks based on the
> Krabby design.
> 
> Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
> convertible device with touchscreen and stylus.
> 
> Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
> device. It does not have a touchscreen or stylus.
> 
> 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.
> 
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Changes since v3:
> - Reorder some properties to conform better to the newly proposed DT
>    style guidelines
> - Drop unused labels
> - Rename bt-sco node name to bt-sco-codec
> - Drop i2s*-share properties from afe node
> - Drop aud_gpio_tdm_{on,off} pinctrl nodes
> - Replace interrupts with interrupts-extended in tpm node
> - Enable adsp device
> 
> Changes since v2:
> - Picked up Conor's ack
> - Rename touchpad to trackpad
> - Drop pinctrl properties from trackpad in tentacruel/tentacool second
>    source trackpad
> 
> Changes since v1:
> - Reorder SKU numbers in descending order.
> - Fixed pinconfig node names
> - Moved pinctrl-* properties after interrupts-*
> - Switched to interrupts-extended for external components
> - Marked ADSP as explicitly disabled, with a comment explaining that it
>    stalls the system
> - Renamed "touchpad" to "trackpad"
> - Dropped bogus "no-laneswap" property from it6505 node
> - Moved "realtek,jd-src" property to after all the regulator supplies
> - Switched to macros for MT6366 regulator "regulator-allowed-modes"
> - Renamed "vgpu" regulator name to allow coupling, with a comment
>    containing the name used in the design
> - Renamed "cr50" node name to "tpm"
> - Moved trackpad_pins reference up to i2c2; workaround for second source
>    component resource sharing.
> - Fix copyright year
> - Fixed touchscreen supply name
> ---
>   arch/arm64/boot/dts/mediatek/Makefile         |    4 +
>   .../dts/mediatek/mt8186-corsola-krabby.dtsi   |  129 ++
>   .../mt8186-corsola-tentacool-sku327681.dts    |   57 +
>   .../mt8186-corsola-tentacool-sku327683.dts    |   24 +
>   .../mt8186-corsola-tentacruel-sku262144.dts   |   44 +
>   .../mt8186-corsola-tentacruel-sku262148.dts   |   26 +
>   .../boot/dts/mediatek/mt8186-corsola.dtsi     | 1707 +++++++++++++++++
>   7 files changed, 1991 insertions(+)
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-krabby.dtsi
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327681.dts
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327683.dts
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262144.dts
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> 
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> index e6e7592a3645..442af61b1305 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -43,6 +43,10 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327681.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327683.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262144.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262148.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-evb.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r1.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r5-sku2.dtb

..snip..

> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> new file mode 100644
> index 000000000000..447b57b12b41
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> @@ -0,0 +1,26 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright 2023 Google LLC
> + */
> +
> +#include "mt8186-corsola-tentacruel-sku262144.dts"
> +
> +/ {
> +	compatible = "google,tentacruel-sku262151", "google,tentacruel-sku262150",
> +		     "google,tentacruel-sku262149", "google,tentacruel-sku262148",
> +		     "google,tentacruel", "mediatek,mt8186";
> +};
> +
> +/* This variant replaces only the trackpad controller. */
> +&i2c2 {
> +	/delete-node/ trackpad@15;
> +
> +	trackpad@15 {
> +		compatible = "hid-over-i2c";
> +		reg = <0x15>;
> +		interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> +		hid-descr-addr = <0x0001>;
> +		vdd-supply = <&pp3300_s3>;
> +		wakeup-source;
> +	};
> +};
> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> new file mode 100644
> index 000000000000..adbeb0c765d3
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> @@ -0,0 +1,1707 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2022 MediaTek Inc.
> + */
> +/dts-v1/;
> +#include "mt8186.dtsi"
> +#include <dt-bindings/pinctrl/mt8186-pinfunc.h>
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/input/gpio-keys.h>
> +#include <dt-bindings/regulator/mediatek,mt6397-regulator.h>
> +

..snip..

> +
> +&i2c2 {
> +	pinctrl-names = "default";
> +	/*
> +	 * Trackpad pin put here to work around second source components
> +	 * sharing the pinmux in steelix designs.
> +	 */
> +	pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
> +	clock-frequency = <400000>;
> +	i2c-scl-internal-delay-ns = <10000>;
> +	status = "okay";
> +
> +	trackpad@15 {
> +		compatible = "elan,ekth3000";

You forgot to change this one.

Remove compatible from this node and stop using /delete-node/ in device specific
devicetrees.

> +		reg = <0x15>;
> +		interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> +		vcc-supply = <&pp3300_s3>;
> +		wakeup-source;
> +	};
> +};


corsola.dtsi (here):

&i2c2 {
	pinctrl-names = "default";
	/*
	 * Trackpad pin put here to work around second source components
	 * sharing the pinmux in steelix designs.
	 */
	pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
	clock-frequency = <400000>;
	i2c-scl-internal-delay-ns = <10000>;
	status = "okay";

	trackpad_i2c2_15: trackpad@15 {
		/*
		 * Those are common properties for i2c2 trackpad on Corsola boards.
		 * The compatible string is declared in device specific devicetrees
		 */
		reg = <0x15>;
		interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
		vcc-supply = <&pp3300_s3>;
		wakeup-source;
		status = "disabled";
	};
};

corsola-some-device.dts:

&trackpad_i2c2_15 {
	compatible = "hid-over-i2c";
	hid-descr-addr = <0x0001>;
	status = "okay";
};

corsola-some-other-device.dts:

&trackpad_i2c2_15 {
	compatible = "elan,ekth3000";
	status = "okay";
};

....everything else looks good.

Cheers,
Angelo
AngeloGioacchino Del Regno Dec. 14, 2023, 10:34 a.m. UTC | #2
Il 13/12/23 16:04, Chen-Yu Tsai ha scritto:
> The MT8186 Steelix, also known as the Lenovo 300e Yoga Chromebook Gen 4,
> is a convertible device based on a common design of the same name. The
> device comes in different variants. Of them, whether a world facing
> camera is integrated is the only differentiating factor between the
> two device trees added. The different SKU IDs describe this alone.
> 
> The other device difference is the touchpad component used. This is
> simply handled by having both possible components described in the
> device tree, and letting the implementation figure out which one is
> actually available. The system bootloader / firmware does not
> differentiate this in that they share the same SKU IDs.
> 
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Changes since v2:
> - Picked up Conor's ack
> 
> Changes since v1:
> - Removed trackpad_pins reference (moved to i2c2 in corsola dtsi)
> - Fixed copyright year
> - Renamed touchpad to trackpad
> ---
>   arch/arm64/boot/dts/mediatek/Makefile         |   2 +
>   .../mt8186-corsola-steelix-sku131072.dts      |  18 ++
>   .../mt8186-corsola-steelix-sku131073.dts      |  18 ++
>   .../dts/mediatek/mt8186-corsola-steelix.dtsi  | 195 ++++++++++++++++++
>   4 files changed, 233 insertions(+)
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
> 
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> index 442af61b1305..7bd9471b89f9 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -43,6 +43,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-steelix-sku131072.dtb
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-steelix-sku131073.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327681.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327683.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262144.dtb
> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
> new file mode 100644
> index 000000000000..eae17bca8585
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
> @@ -0,0 +1,18 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright 2022 Google LLC
> + */
> +
> +/dts-v1/;
> +#include "mt8186-corsola-steelix.dtsi"
> +
> +/ {
> +	model = "Google Steelix board";
> +	compatible = "google,steelix-sku131072", "google,steelix",
> +		     "mediatek,mt8186";
> +	chassis-type = "convertible";
> +};
> +
> +&mt6366codec {
> +	mediatek,dmic-mode = <0>; /* two-wire */
> +};
> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
> new file mode 100644
> index 000000000000..a55375b95d0d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
> @@ -0,0 +1,18 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright 2022 Google LLC
> + */
> +
> +/dts-v1/;
> +#include "mt8186-corsola-steelix.dtsi"
> +
> +/ {
> +	model = "Google Steelix board";
> +	compatible = "google,steelix-sku131073", "google,steelix",
> +		     "mediatek,mt8186";
> +	chassis-type = "convertible";
> +};
> +
> +&mt6366codec {
> +	mediatek,dmic-mode = <1>; /* one-wire */
> +};
> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
> new file mode 100644
> index 000000000000..47262bc499ad
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
> @@ -0,0 +1,195 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright 2022 Google LLC
> + */
> +
> +/dts-v1/;
> +#include "mt8186-corsola.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +/{
> +	pp1000_edpbrdg: regulator-pp1000-edpbrdg {
> +		compatible = "regulator-fixed";
> +		regulator-name = "pp1000_edpbrdg";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&en_pp1000_edpbrdg>;
> +		enable-active-high;
> +		regulator-boot-on;
> +		gpio = <&pio 29 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&pp3300_z2>;
> +	};
> +
> +	pp1800_edpbrdg_dx: regulator-pp1800-edpbrdg-dx {
> +		compatible = "regulator-fixed";
> +		regulator-name = "pp1800_edpbrdg_dx";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&en_pp1800_edpbrdg>;
> +		enable-active-high;
> +		regulator-boot-on;
> +		gpio = <&pio 30 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&mt6366_vio18_reg>;
> +	};
> +
> +	pp3300_edp_dx: regulator-pp3300-edp-dx {
> +		compatible = "regulator-fixed";
> +		regulator-name = "pp3300_edp_dx";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&en_pp3300_edpbrdg>;
> +		enable-active-high;
> +		regulator-boot-on;
> +		gpio = <&pio 31 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&pp3300_z2>;
> +	};
> +};
> +
> +&dsi_out {
> +	remote-endpoint = <&anx7625_in>;
> +};
> +
> +&i2c0 {
> +	clock-frequency = <400000>;
> +
> +	anx_bridge: anx7625@58 {
> +		compatible = "analogix,anx7625";
> +		reg = <0x58>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&anx7625_pins>;
> +		enable-gpios = <&pio 96 GPIO_ACTIVE_HIGH>;
> +		reset-gpios = <&pio 98 GPIO_ACTIVE_HIGH>;
> +		vdd10-supply = <&pp1000_edpbrdg>;
> +		vdd18-supply = <&pp1800_edpbrdg_dx>;
> +		vdd33-supply = <&pp3300_edp_dx>;
> +		analogix,lane0-swing = /bits/ 8 <0x70 0x30>;
> +		analogix,lane1-swing = /bits/ 8 <0x70 0x30>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				anx7625_in: endpoint {
> +					remote-endpoint = <&dsi_out>;
> +					data-lanes = <0 1 2 3>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				anx7625_out: endpoint {
> +					remote-endpoint = <&panel_in>;
> +				};
> +			};
> +		};
> +
> +		aux-bus {
> +			panel: panel {
> +				compatible = "edp-panel";
> +				power-supply = <&pp3300_disp_x>;
> +				backlight = <&backlight_lcd0>;
> +
> +				port {
> +					panel_in: endpoint {
> +						remote-endpoint = <&anx7625_out>;
> +					};
> +				};
> +			};
> +		};
> +	};
> +};
> +
> +&i2c1 {
> +	touchscreen: touchscreen@5d {
> +		compatible = "goodix,gt7375p";
> +		reg = <0x5d>;
> +		interrupts-extended = <&pio 12 IRQ_TYPE_EDGE_FALLING>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&touchscreen_pins>;
> +		reset-gpios = <&pio 60 GPIO_ACTIVE_LOW>;
> +		vdd-supply = <&pp3300_s3>;
> +		goodix,no-reset-during-suspend;
> +	};
> +};
> +
> +&i2c2 {
> +	i2c-scl-internal-delay-ns = <22000>;
> +
> +	/* second source component */
> +	trackpad@2c {
> +		compatible = "hid-over-i2c";
> +		reg = <0x2c>;
> +		hid-descr-addr = <0x20>;
> +		interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> +		vdd-supply = <&pp3300_s3>;
> +		wakeup-source;
> +	};
> +};
> +
> +&keyboard_controller {
> +	function-row-physmap = <
> +		MATRIX_KEY(0x00, 0x02, 0)	/* T1 */
> +		MATRIX_KEY(0x03, 0x02, 0)	/* T2 */
> +		MATRIX_KEY(0x02, 0x02, 0)	/* T3 */
> +		MATRIX_KEY(0x01, 0x02, 0)	/* T4 */
> +		MATRIX_KEY(0x03, 0x04, 0)	/* T5 */
> +		MATRIX_KEY(0x02, 0x04, 0)	/* T6 */
> +		MATRIX_KEY(0x01, 0x04, 0)	/* T7 */
> +		MATRIX_KEY(0x02, 0x09, 0)	/* T8 */
> +		MATRIX_KEY(0x01, 0x09, 0)	/* T9 */
> +		MATRIX_KEY(0x00, 0x04, 0)	/* T10 */
> +	>;
> +
> +	linux,keymap = <
> +		MATRIX_KEY(0x00, 0x02, KEY_BACK)
> +		MATRIX_KEY(0x03, 0x02, KEY_REFRESH)
> +		MATRIX_KEY(0x02, 0x02, KEY_ZOOM)
> +		MATRIX_KEY(0x01, 0x02, KEY_SCALE)
> +		MATRIX_KEY(0x03, 0x04, KEY_BRIGHTNESSDOWN)
> +		MATRIX_KEY(0x02, 0x04, KEY_BRIGHTNESSUP)
> +		MATRIX_KEY(0x01, 0x04, KEY_MICMUTE)
> +		MATRIX_KEY(0x02, 0x09, KEY_MUTE)
> +		MATRIX_KEY(0x01, 0x09, KEY_VOLUMEDOWN)
> +		MATRIX_KEY(0x00, 0x04, KEY_VOLUMEUP)
> +		CROS_STD_MAIN_KEYMAP
> +	>;
> +};
> +
> +&pio {
> +	anx7625_pins: anx7625-pins {
> +		pins1 {

pins-en-rst

> +			pinmux = <PINMUX_GPIO96__FUNC_GPIO96>,
> +				 <PINMUX_GPIO98__FUNC_GPIO98>;
> +			output-low;
> +		};
> +
> +		pins2 {

pins-is-this-an-interrupt? :-)

> +			pinmux = <PINMUX_GPIO9__FUNC_GPIO9>;
> +			input-enable;
> +			bias-disable;
> +		};
> +	};
> +
> +	en_pp1000_edpbrdg: pp1000-edpbrdg-en-pins {
> +		pins {

pins-vreg-en like in corsola.dtsi

> +			pinmux = <PINMUX_GPIO29__FUNC_GPIO29>;
> +			output-low;
> +		};
> +	};
> +
> +	en_pp1800_edpbrdg: pp1800-edpbrdg-en-pins {
> +		pins {

same

> +			pinmux = <PINMUX_GPIO30__FUNC_GPIO30>;
> +			output-low;
> +		};
> +	};
> +
> +	en_pp3300_edpbrdg: pp3300-edpbrdg-en-pins {
> +		pins {

ditto

Cheers,
Angelo
Fei Shao Dec. 14, 2023, 10:39 a.m. UTC | #3
On Wed, Dec 13, 2023 at 11:05 PM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> Tentacruel and Tentacool are MT8186 based Chromebooks based on the
> Krabby design.
>
> Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
> convertible device with touchscreen and stylus.
>
> Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
> device. It does not have a touchscreen or stylus.
>
> The two devices both have two variants. The difference is a second
> source touchpad controller that shares the same address as the original,
One nit since you need to resend this anyway...
s/touchpad/trackpad/g

Regards,
Fei

> 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.
>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
Chen-Yu Tsai Dec. 14, 2023, 2:37 p.m. UTC | #4
On Thu, Dec 14, 2023 at 7:31 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 13/12/23 16:04, Chen-Yu Tsai ha scritto:
> > Tentacruel and Tentacool are MT8186 based Chromebooks based on the
> > Krabby design.
> >
> > Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
> > convertible device with touchscreen and stylus.
> >
> > Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
> > device. It does not have a touchscreen or stylus.
> >
> > 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.
> >
> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > ---
> > Changes since v3:
> > - Reorder some properties to conform better to the newly proposed DT
> >    style guidelines
> > - Drop unused labels
> > - Rename bt-sco node name to bt-sco-codec
> > - Drop i2s*-share properties from afe node
> > - Drop aud_gpio_tdm_{on,off} pinctrl nodes
> > - Replace interrupts with interrupts-extended in tpm node
> > - Enable adsp device
> >
> > Changes since v2:
> > - Picked up Conor's ack
> > - Rename touchpad to trackpad
> > - Drop pinctrl properties from trackpad in tentacruel/tentacool second
> >    source trackpad
> >
> > Changes since v1:
> > - Reorder SKU numbers in descending order.
> > - Fixed pinconfig node names
> > - Moved pinctrl-* properties after interrupts-*
> > - Switched to interrupts-extended for external components
> > - Marked ADSP as explicitly disabled, with a comment explaining that it
> >    stalls the system
> > - Renamed "touchpad" to "trackpad"
> > - Dropped bogus "no-laneswap" property from it6505 node
> > - Moved "realtek,jd-src" property to after all the regulator supplies
> > - Switched to macros for MT6366 regulator "regulator-allowed-modes"
> > - Renamed "vgpu" regulator name to allow coupling, with a comment
> >    containing the name used in the design
> > - Renamed "cr50" node name to "tpm"
> > - Moved trackpad_pins reference up to i2c2; workaround for second source
> >    component resource sharing.
> > - Fix copyright year
> > - Fixed touchscreen supply name
> > ---
> >   arch/arm64/boot/dts/mediatek/Makefile         |    4 +
> >   .../dts/mediatek/mt8186-corsola-krabby.dtsi   |  129 ++
> >   .../mt8186-corsola-tentacool-sku327681.dts    |   57 +
> >   .../mt8186-corsola-tentacool-sku327683.dts    |   24 +
> >   .../mt8186-corsola-tentacruel-sku262144.dts   |   44 +
> >   .../mt8186-corsola-tentacruel-sku262148.dts   |   26 +
> >   .../boot/dts/mediatek/mt8186-corsola.dtsi     | 1707 +++++++++++++++++
> >   7 files changed, 1991 insertions(+)
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-krabby.dtsi
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327681.dts
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327683.dts
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262144.dts
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> > index e6e7592a3645..442af61b1305 100644
> > --- a/arch/arm64/boot/dts/mediatek/Makefile
> > +++ b/arch/arm64/boot/dts/mediatek/Makefile
> > @@ -43,6 +43,10 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327681.dtb
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327683.dtb
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262144.dtb
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262148.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-evb.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r1.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r5-sku2.dtb
>
> ..snip..
>
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> > new file mode 100644
> > index 000000000000..447b57b12b41
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> > @@ -0,0 +1,26 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright 2023 Google LLC
> > + */
> > +
> > +#include "mt8186-corsola-tentacruel-sku262144.dts"
> > +
> > +/ {
> > +     compatible = "google,tentacruel-sku262151", "google,tentacruel-sku262150",
> > +                  "google,tentacruel-sku262149", "google,tentacruel-sku262148",
> > +                  "google,tentacruel", "mediatek,mt8186";
> > +};
> > +
> > +/* This variant replaces only the trackpad controller. */
> > +&i2c2 {
> > +     /delete-node/ trackpad@15;
> > +
> > +     trackpad@15 {
> > +             compatible = "hid-over-i2c";
> > +             reg = <0x15>;
> > +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> > +             hid-descr-addr = <0x0001>;
> > +             vdd-supply = <&pp3300_s3>;
> > +             wakeup-source;
> > +     };
> > +};
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> > new file mode 100644
> > index 000000000000..adbeb0c765d3
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> > @@ -0,0 +1,1707 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright (C) 2022 MediaTek Inc.
> > + */
> > +/dts-v1/;
> > +#include "mt8186.dtsi"
> > +#include <dt-bindings/pinctrl/mt8186-pinfunc.h>
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/input/input.h>
> > +#include <dt-bindings/input/gpio-keys.h>
> > +#include <dt-bindings/regulator/mediatek,mt6397-regulator.h>
> > +
>
> ..snip..
>
> > +
> > +&i2c2 {
> > +     pinctrl-names = "default";
> > +     /*
> > +      * Trackpad pin put here to work around second source components
> > +      * sharing the pinmux in steelix designs.
> > +      */
> > +     pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
> > +     clock-frequency = <400000>;
> > +     i2c-scl-internal-delay-ns = <10000>;
> > +     status = "okay";
> > +
> > +     trackpad@15 {
> > +             compatible = "elan,ekth3000";
>
> You forgot to change this one.
>
> Remove compatible from this node and stop using /delete-node/ in device specific
> devicetrees.

I believe I already replied to the previous version why we can't and shouldn't
do that.

"elan,ekth3000" and "hid-over-i2c" have incompatible bindings, specifically
the former uses "vcc-supply" while the latter uses "vdd-supply".

One has to track down if a property is a "sharable" property or not,
then put it in the correct place, otherwise getting DT binding validation
errors.

To me it seems cleaner to just delete the node wholesale to not have any
remnants of the original node, i.e. start from a clean slate. Trying to
"share" common properties is asking for a headache.

This feels more like a preference thing. I also asked if deleting the node
through the label would be cleaner, but you didn't reply.

Also, "elan,ekth3000" is the one that was designed and tested on the Corsola
reference design, so I think it rightfully belongs there. The Tentacruel
SKU replaced it with another part, so the original part should be disabled,
or in this case, deleted, because otherwise there would be a conflict.


Regards
ChenYu



> > +             reg = <0x15>;
> > +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> > +             vcc-supply = <&pp3300_s3>;
> > +             wakeup-source;
> > +     };
> > +};
>
>
> corsola.dtsi (here):
>
> &i2c2 {
>         pinctrl-names = "default";
>         /*
>          * Trackpad pin put here to work around second source components
>          * sharing the pinmux in steelix designs.
>          */
>         pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
>         clock-frequency = <400000>;
>         i2c-scl-internal-delay-ns = <10000>;
>         status = "okay";
>
>         trackpad_i2c2_15: trackpad@15 {
>                 /*
>                  * Those are common properties for i2c2 trackpad on Corsola boards.
>                  * The compatible string is declared in device specific devicetrees
>                  */
>                 reg = <0x15>;
>                 interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
>                 vcc-supply = <&pp3300_s3>;
>                 wakeup-source;
>                 status = "disabled";
>         };
> };
>
> corsola-some-device.dts:
>
> &trackpad_i2c2_15 {
>         compatible = "hid-over-i2c";
>         hid-descr-addr = <0x0001>;
>         status = "okay";
> };
>
> corsola-some-other-device.dts:
>
> &trackpad_i2c2_15 {
>         compatible = "elan,ekth3000";
>         status = "okay";
> };
>
> ....everything else looks good.
>
> Cheers,
> Angelo
Chen-Yu Tsai Dec. 14, 2023, 2:53 p.m. UTC | #5
On Thu, Dec 14, 2023 at 7:34 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 13/12/23 16:04, Chen-Yu Tsai ha scritto:
> > The MT8186 Steelix, also known as the Lenovo 300e Yoga Chromebook Gen 4,
> > is a convertible device based on a common design of the same name. The
> > device comes in different variants. Of them, whether a world facing
> > camera is integrated is the only differentiating factor between the
> > two device trees added. The different SKU IDs describe this alone.
> >
> > The other device difference is the touchpad component used. This is
> > simply handled by having both possible components described in the
> > device tree, and letting the implementation figure out which one is
> > actually available. The system bootloader / firmware does not
> > differentiate this in that they share the same SKU IDs.
> >
> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > ---
> > Changes since v2:
> > - Picked up Conor's ack
> >
> > Changes since v1:
> > - Removed trackpad_pins reference (moved to i2c2 in corsola dtsi)
> > - Fixed copyright year
> > - Renamed touchpad to trackpad
> > ---
> >   arch/arm64/boot/dts/mediatek/Makefile         |   2 +
> >   .../mt8186-corsola-steelix-sku131072.dts      |  18 ++
> >   .../mt8186-corsola-steelix-sku131073.dts      |  18 ++
> >   .../dts/mediatek/mt8186-corsola-steelix.dtsi  | 195 ++++++++++++++++++
> >   4 files changed, 233 insertions(+)
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
> >   create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> > index 442af61b1305..7bd9471b89f9 100644
> > --- a/arch/arm64/boot/dts/mediatek/Makefile
> > +++ b/arch/arm64/boot/dts/mediatek/Makefile
> > @@ -43,6 +43,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-steelix-sku131072.dtb
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-steelix-sku131073.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327681.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327683.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262144.dtb
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
> > new file mode 100644
> > index 000000000000..eae17bca8585
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131072.dts
> > @@ -0,0 +1,18 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright 2022 Google LLC
> > + */
> > +
> > +/dts-v1/;
> > +#include "mt8186-corsola-steelix.dtsi"
> > +
> > +/ {
> > +     model = "Google Steelix board";
> > +     compatible = "google,steelix-sku131072", "google,steelix",
> > +                  "mediatek,mt8186";
> > +     chassis-type = "convertible";
> > +};
> > +
> > +&mt6366codec {
> > +     mediatek,dmic-mode = <0>; /* two-wire */
> > +};
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
> > new file mode 100644
> > index 000000000000..a55375b95d0d
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix-sku131073.dts
> > @@ -0,0 +1,18 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright 2022 Google LLC
> > + */
> > +
> > +/dts-v1/;
> > +#include "mt8186-corsola-steelix.dtsi"
> > +
> > +/ {
> > +     model = "Google Steelix board";
> > +     compatible = "google,steelix-sku131073", "google,steelix",
> > +                  "mediatek,mt8186";
> > +     chassis-type = "convertible";
> > +};
> > +
> > +&mt6366codec {
> > +     mediatek,dmic-mode = <1>; /* one-wire */
> > +};
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
> > new file mode 100644
> > index 000000000000..47262bc499ad
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-steelix.dtsi
> > @@ -0,0 +1,195 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright 2022 Google LLC
> > + */
> > +
> > +/dts-v1/;
> > +#include "mt8186-corsola.dtsi"
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/input/input.h>
> > +
> > +/{
> > +     pp1000_edpbrdg: regulator-pp1000-edpbrdg {
> > +             compatible = "regulator-fixed";
> > +             regulator-name = "pp1000_edpbrdg";
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&en_pp1000_edpbrdg>;
> > +             enable-active-high;
> > +             regulator-boot-on;
> > +             gpio = <&pio 29 GPIO_ACTIVE_HIGH>;
> > +             vin-supply = <&pp3300_z2>;
> > +     };
> > +
> > +     pp1800_edpbrdg_dx: regulator-pp1800-edpbrdg-dx {
> > +             compatible = "regulator-fixed";
> > +             regulator-name = "pp1800_edpbrdg_dx";
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&en_pp1800_edpbrdg>;
> > +             enable-active-high;
> > +             regulator-boot-on;
> > +             gpio = <&pio 30 GPIO_ACTIVE_HIGH>;
> > +             vin-supply = <&mt6366_vio18_reg>;
> > +     };
> > +
> > +     pp3300_edp_dx: regulator-pp3300-edp-dx {
> > +             compatible = "regulator-fixed";
> > +             regulator-name = "pp3300_edp_dx";
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&en_pp3300_edpbrdg>;
> > +             enable-active-high;
> > +             regulator-boot-on;
> > +             gpio = <&pio 31 GPIO_ACTIVE_HIGH>;
> > +             vin-supply = <&pp3300_z2>;
> > +     };
> > +};
> > +
> > +&dsi_out {
> > +     remote-endpoint = <&anx7625_in>;
> > +};
> > +
> > +&i2c0 {
> > +     clock-frequency = <400000>;
> > +
> > +     anx_bridge: anx7625@58 {
> > +             compatible = "analogix,anx7625";
> > +             reg = <0x58>;
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&anx7625_pins>;
> > +             enable-gpios = <&pio 96 GPIO_ACTIVE_HIGH>;
> > +             reset-gpios = <&pio 98 GPIO_ACTIVE_HIGH>;

BTW, do you think there is anything we can do about this backwards
active level setting?

> > +             vdd10-supply = <&pp1000_edpbrdg>;
> > +             vdd18-supply = <&pp1800_edpbrdg_dx>;
> > +             vdd33-supply = <&pp3300_edp_dx>;
> > +             analogix,lane0-swing = /bits/ 8 <0x70 0x30>;
> > +             analogix,lane1-swing = /bits/ 8 <0x70 0x30>;
> > +
> > +             ports {
> > +                     #address-cells = <1>;
> > +                     #size-cells = <0>;
> > +
> > +                     port@0 {
> > +                             reg = <0>;
> > +
> > +                             anx7625_in: endpoint {
> > +                                     remote-endpoint = <&dsi_out>;
> > +                                     data-lanes = <0 1 2 3>;
> > +                             };
> > +                     };
> > +
> > +                     port@1 {
> > +                             reg = <1>;
> > +
> > +                             anx7625_out: endpoint {
> > +                                     remote-endpoint = <&panel_in>;
> > +                             };
> > +                     };
> > +             };
> > +
> > +             aux-bus {
> > +                     panel: panel {
> > +                             compatible = "edp-panel";
> > +                             power-supply = <&pp3300_disp_x>;
> > +                             backlight = <&backlight_lcd0>;
> > +
> > +                             port {
> > +                                     panel_in: endpoint {
> > +                                             remote-endpoint = <&anx7625_out>;
> > +                                     };
> > +                             };
> > +                     };
> > +             };
> > +     };
> > +};
> > +
> > +&i2c1 {
> > +     touchscreen: touchscreen@5d {
> > +             compatible = "goodix,gt7375p";
> > +             reg = <0x5d>;
> > +             interrupts-extended = <&pio 12 IRQ_TYPE_EDGE_FALLING>;
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&touchscreen_pins>;
> > +             reset-gpios = <&pio 60 GPIO_ACTIVE_LOW>;
> > +             vdd-supply = <&pp3300_s3>;
> > +             goodix,no-reset-during-suspend;
> > +     };
> > +};
> > +
> > +&i2c2 {
> > +     i2c-scl-internal-delay-ns = <22000>;
> > +
> > +     /* second source component */
> > +     trackpad@2c {
> > +             compatible = "hid-over-i2c";
> > +             reg = <0x2c>;
> > +             hid-descr-addr = <0x20>;
> > +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> > +             vdd-supply = <&pp3300_s3>;
> > +             wakeup-source;
> > +     };
> > +};
> > +
> > +&keyboard_controller {
> > +     function-row-physmap = <
> > +             MATRIX_KEY(0x00, 0x02, 0)       /* T1 */
> > +             MATRIX_KEY(0x03, 0x02, 0)       /* T2 */
> > +             MATRIX_KEY(0x02, 0x02, 0)       /* T3 */
> > +             MATRIX_KEY(0x01, 0x02, 0)       /* T4 */
> > +             MATRIX_KEY(0x03, 0x04, 0)       /* T5 */
> > +             MATRIX_KEY(0x02, 0x04, 0)       /* T6 */
> > +             MATRIX_KEY(0x01, 0x04, 0)       /* T7 */
> > +             MATRIX_KEY(0x02, 0x09, 0)       /* T8 */
> > +             MATRIX_KEY(0x01, 0x09, 0)       /* T9 */
> > +             MATRIX_KEY(0x00, 0x04, 0)       /* T10 */
> > +     >;
> > +
> > +     linux,keymap = <
> > +             MATRIX_KEY(0x00, 0x02, KEY_BACK)
> > +             MATRIX_KEY(0x03, 0x02, KEY_REFRESH)
> > +             MATRIX_KEY(0x02, 0x02, KEY_ZOOM)
> > +             MATRIX_KEY(0x01, 0x02, KEY_SCALE)
> > +             MATRIX_KEY(0x03, 0x04, KEY_BRIGHTNESSDOWN)
> > +             MATRIX_KEY(0x02, 0x04, KEY_BRIGHTNESSUP)
> > +             MATRIX_KEY(0x01, 0x04, KEY_MICMUTE)
> > +             MATRIX_KEY(0x02, 0x09, KEY_MUTE)
> > +             MATRIX_KEY(0x01, 0x09, KEY_VOLUMEDOWN)
> > +             MATRIX_KEY(0x00, 0x04, KEY_VOLUMEUP)
> > +             CROS_STD_MAIN_KEYMAP
> > +     >;
> > +};
> > +
> > +&pio {
> > +     anx7625_pins: anx7625-pins {
> > +             pins1 {
>
> pins-en-rst

Ack. Also I think we can split them so they each get proper names.

> > +                     pinmux = <PINMUX_GPIO96__FUNC_GPIO96>,
> > +                              <PINMUX_GPIO98__FUNC_GPIO98>;
> > +                     output-low;
> > +             };
> > +
> > +             pins2 {
>
> pins-is-this-an-interrupt? :-)

Yes. Will use pins-int.

> > +                     pinmux = <PINMUX_GPIO9__FUNC_GPIO9>;
> > +                     input-enable;
> > +                     bias-disable;
> > +             };
> > +     };
> > +
> > +     en_pp1000_edpbrdg: pp1000-edpbrdg-en-pins {
> > +             pins {
>
> pins-vreg-en like in corsola.dtsi

Ack.

> > +                     pinmux = <PINMUX_GPIO29__FUNC_GPIO29>;
> > +                     output-low;
> > +             };
> > +     };
> > +
> > +     en_pp1800_edpbrdg: pp1800-edpbrdg-en-pins {
> > +             pins {
>
> same

Ack.

> > +                     pinmux = <PINMUX_GPIO30__FUNC_GPIO30>;
> > +                     output-low;
> > +             };
> > +     };
> > +
> > +     en_pp3300_edpbrdg: pp3300-edpbrdg-en-pins {
> > +             pins {

Ack.

ChenYu
Eugen Hristev Jan. 1, 2024, 2:09 p.m. UTC | #6
Hello Chen-Yu,

There is still some nonconformity with the bindings, please see below:

On 12/13/23 17:04, Chen-Yu Tsai wrote:
> Tentacruel and Tentacool are MT8186 based Chromebooks based on the
> Krabby design.
> 
> Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
> convertible device with touchscreen and stylus.
> 
> Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
> device. It does not have a touchscreen or stylus.
> 
> 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.
> 
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Changes since v3:
> - Reorder some properties to conform better to the newly proposed DT
>   style guidelines
> - Drop unused labels
> - Rename bt-sco node name to bt-sco-codec
> - Drop i2s*-share properties from afe node
> - Drop aud_gpio_tdm_{on,off} pinctrl nodes
> - Replace interrupts with interrupts-extended in tpm node
> - Enable adsp device
> 
> Changes since v2:
> - Picked up Conor's ack
> - Rename touchpad to trackpad
> - Drop pinctrl properties from trackpad in tentacruel/tentacool second
>   source trackpad
> 
> Changes since v1:
> - Reorder SKU numbers in descending order.
> - Fixed pinconfig node names
> - Moved pinctrl-* properties after interrupts-*
> - Switched to interrupts-extended for external components
> - Marked ADSP as explicitly disabled, with a comment explaining that it
>   stalls the system
> - Renamed "touchpad" to "trackpad"
> - Dropped bogus "no-laneswap" property from it6505 node
> - Moved "realtek,jd-src" property to after all the regulator supplies
> - Switched to macros for MT6366 regulator "regulator-allowed-modes"
> - Renamed "vgpu" regulator name to allow coupling, with a comment
>   containing the name used in the design
> - Renamed "cr50" node name to "tpm"
> - Moved trackpad_pins reference up to i2c2; workaround for second source
>   component resource sharing.
> - Fix copyright year
> - Fixed touchscreen supply name
> ---

[snip]

> +
> +&i2c3 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c3_pins>;
> +	clock-frequency = <100000>;
> +	status = "okay";
> +
> +	it6505dptx: dp-bridge@5c {
> +		compatible = "ite,it6505";

dp-bridge@5c: '#address-cells', '#size-cells', '#sound-dai-cells' do not match any
of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/display/bridge/ite,it6505.yaml#

> +		reg = <0x5c>;
> +		interrupts-extended = <&pio 8 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&it6505_pins>;
> +		#address-cells = <1>;
> +		#size-cells = <0>;

/soc/i2c@1100f000/dp-bridge@5c: unnecessary #address-cells/#size-cells without
"ranges" or child "reg" property

> +		#sound-dai-cells = <0>;
> +		ovdd-supply = <&mt6366_vsim2_reg>;
> +		pwr18-supply = <&pp1800_dpbrdg_dx>;
> +		reset-gpios = <&pio 177 GPIO_ACTIVE_HIGH>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				it6505_in: endpoint {
> +					link-frequencies = /bits/ 64 <150000000>;
> +					remote-endpoint = <&dpi_out>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +			};
> +		};
> +	};
> +};
> +

[snip]

> +&spi1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&spi1_pins>;
> +	mediatek,pad-select = <0>;
> +	status = "okay";
> +
> +	cros_ec: ec@0 {
> +		compatible = "google,cros-ec-spi";
> +		reg = <0>;
> +		interrupts-extended = <&pio 13 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&ec_ap_int>;
> +		spi-max-frequency = <1000000>;
> +
> +		i2c_tunnel: i2c-tunnel {
> +			compatible = "google,cros-ec-i2c-tunnel";
> +			google,remote-bus = <1>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +		};
> +
> +		typec {
> +			compatible = "google,cros-ec-typec";
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			usb_c0: connector@0 {
> +				compatible = "usb-c-connector";
> +				reg = <0>;
> +				label = "left";
> +				power-role = "dual";
> +				data-role = "host";
> +				try-power-role = "source";
> +
> +				ports {
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +
typec:connector@0:ports: 'port@0' is a required property
> +					port@1 {
> +						reg = <1>;
> +
> +						typec_port0: endpoint { };
> +					};
> +				};
> +			};
> +
> +			usb_c1: connector@1 {
> +				compatible = "usb-c-connector";
> +				reg = <1>;
> +				label = "right";
> +				power-role = "dual";
> +				data-role = "host";
> +				try-power-role = "source";
> +
> +				ports {
connector@1: Unevaluated properties are not allowed ('ports' was unexpected)
	from schema $id: http://devicetree.org/schemas/connector/usb-connector.yaml#
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +
> +					port@1 {
connector@0: ports: 'port@0' is a required property
> +						reg = <1>;
> +
> +						typec_port1: endpoint { };
> +					};
> +				};
> +			};
> +		};
> +	};
> +};
> +

[snip]

> +
> +&usb_host1 {
> +	#address-cells = <2>;
> +	#size-cells = <2>;

 usb@11281000: usb@11280000:#address-cells:0:0: 1 was expected
	from schema $id: http://devicetree.org/schemas/usb/mediatek,mtu3.yaml#
usb@11281000: usb@11280000:#size-cells:0:0: 0 was expected

> +	vbus-supply = <&usb_p1_vbus>;
> +	status = "okay";
> +};
> +
> +&watchdog {
> +	mediatek,reset-by-toprgu;
> +};
> +
> +#include <arm/cros-ec-keyboard.dtsi>
> +#include <arm/cros-ec-sbs.dtsi>


Eugen
Chen-Yu Tsai Jan. 2, 2024, 10:25 a.m. UTC | #7
Hi,

On Mon, Jan 1, 2024 at 10:09 PM Eugen Hristev
<eugen.hristev@collabora.com> wrote:
>
> Hello Chen-Yu,
>
> There is still some nonconformity with the bindings, please see below:
>
> On 12/13/23 17:04, Chen-Yu Tsai wrote:
> > Tentacruel and Tentacool are MT8186 based Chromebooks based on the
> > Krabby design.
> >
> > Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
> > convertible device with touchscreen and stylus.
> >
> > Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
> > device. It does not have a touchscreen or stylus.
> >
> > 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.
> >
> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > ---
> > Changes since v3:
> > - Reorder some properties to conform better to the newly proposed DT
> >   style guidelines
> > - Drop unused labels
> > - Rename bt-sco node name to bt-sco-codec
> > - Drop i2s*-share properties from afe node
> > - Drop aud_gpio_tdm_{on,off} pinctrl nodes
> > - Replace interrupts with interrupts-extended in tpm node
> > - Enable adsp device
> >
> > Changes since v2:
> > - Picked up Conor's ack
> > - Rename touchpad to trackpad
> > - Drop pinctrl properties from trackpad in tentacruel/tentacool second
> >   source trackpad
> >
> > Changes since v1:
> > - Reorder SKU numbers in descending order.
> > - Fixed pinconfig node names
> > - Moved pinctrl-* properties after interrupts-*
> > - Switched to interrupts-extended for external components
> > - Marked ADSP as explicitly disabled, with a comment explaining that it
> >   stalls the system
> > - Renamed "touchpad" to "trackpad"
> > - Dropped bogus "no-laneswap" property from it6505 node
> > - Moved "realtek,jd-src" property to after all the regulator supplies
> > - Switched to macros for MT6366 regulator "regulator-allowed-modes"
> > - Renamed "vgpu" regulator name to allow coupling, with a comment
> >   containing the name used in the design
> > - Renamed "cr50" node name to "tpm"
> > - Moved trackpad_pins reference up to i2c2; workaround for second source
> >   component resource sharing.
> > - Fix copyright year
> > - Fixed touchscreen supply name
> > ---
>
> [snip]
>
> > +
> > +&i2c3 {
> > +     pinctrl-names = "default";
> > +     pinctrl-0 = <&i2c3_pins>;
> > +     clock-frequency = <100000>;
> > +     status = "okay";
> > +
> > +     it6505dptx: dp-bridge@5c {
> > +             compatible = "ite,it6505";
>
> dp-bridge@5c: '#address-cells', '#size-cells', '#sound-dai-cells' do not match any
> of the regexes: 'pinctrl-[0-9]+'
>         from schema $id: http://devicetree.org/schemas/display/bridge/ite,it6505.yaml#

Will add a patch to update the bindings.

> > +             reg = <0x5c>;
> > +             interrupts-extended = <&pio 8 IRQ_TYPE_LEVEL_LOW>;
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&it6505_pins>;
> > +             #address-cells = <1>;
> > +             #size-cells = <0>;
>
> /soc/i2c@1100f000/dp-bridge@5c: unnecessary #address-cells/#size-cells without
> "ranges" or child "reg" property

Dropped.

> > +             #sound-dai-cells = <0>;
> > +             ovdd-supply = <&mt6366_vsim2_reg>;
> > +             pwr18-supply = <&pp1800_dpbrdg_dx>;
> > +             reset-gpios = <&pio 177 GPIO_ACTIVE_HIGH>;
> > +
> > +             ports {
> > +                     #address-cells = <1>;
> > +                     #size-cells = <0>;
> > +
> > +                     port@0 {
> > +                             reg = <0>;
> > +
> > +                             it6505_in: endpoint {
> > +                                     link-frequencies = /bits/ 64 <150000000>;
> > +                                     remote-endpoint = <&dpi_out>;
> > +                             };
> > +                     };
> > +
> > +                     port@1 {
> > +                             reg = <1>;
> > +                     };
> > +             };
> > +     };
> > +};
> > +
>
> [snip]
>
> > +&spi1 {
> > +     pinctrl-names = "default";
> > +     pinctrl-0 = <&spi1_pins>;
> > +     mediatek,pad-select = <0>;
> > +     status = "okay";
> > +
> > +     cros_ec: ec@0 {
> > +             compatible = "google,cros-ec-spi";
> > +             reg = <0>;
> > +             interrupts-extended = <&pio 13 IRQ_TYPE_LEVEL_LOW>;
> > +             pinctrl-names = "default";
> > +             pinctrl-0 = <&ec_ap_int>;
> > +             spi-max-frequency = <1000000>;
> > +
> > +             i2c_tunnel: i2c-tunnel {
> > +                     compatible = "google,cros-ec-i2c-tunnel";
> > +                     google,remote-bus = <1>;
> > +                     #address-cells = <1>;
> > +                     #size-cells = <0>;
> > +             };
> > +
> > +             typec {
> > +                     compatible = "google,cros-ec-typec";
> > +                     #address-cells = <1>;
> > +                     #size-cells = <0>;
> > +
> > +                     usb_c0: connector@0 {
> > +                             compatible = "usb-c-connector";
> > +                             reg = <0>;
> > +                             label = "left";
> > +                             power-role = "dual";
> > +                             data-role = "host";
> > +                             try-power-role = "source";
> > +
> > +                             ports {
> > +                                     #address-cells = <1>;
> > +                                     #size-cells = <0>;
> > +
> typec:connector@0:ports: 'port@0' is a required property
> > +                                     port@1 {
> > +                                             reg = <1>;
> > +
> > +                                             typec_port0: endpoint { };
> > +                                     };
> > +                             };
> > +                     };
> > +
> > +                     usb_c1: connector@1 {
> > +                             compatible = "usb-c-connector";
> > +                             reg = <1>;
> > +                             label = "right";
> > +                             power-role = "dual";
> > +                             data-role = "host";
> > +                             try-power-role = "source";
> > +
> > +                             ports {
> connector@1: Unevaluated properties are not allowed ('ports' was unexpected)
>         from schema $id: http://devicetree.org/schemas/connector/usb-connector.yaml#

Not sure why this is happening. Maybe because the sub-schema validation
failed?

In any case, I will drop the whole ports section. This can be re-added once
all the type-C mux stuff has been sorted out.

> > +                                     #address-cells = <1>;
> > +                                     #size-cells = <0>;
> > +
> > +                                     port@1 {
> connector@0: ports: 'port@0' is a required property
> > +                                             reg = <1>;
> > +
> > +                                             typec_port1: endpoint { };
> > +                                     };
> > +                             };
> > +                     };
> > +             };
> > +     };
> > +};
> > +
>
> [snip]
>
> > +
> > +&usb_host1 {
> > +     #address-cells = <2>;
> > +     #size-cells = <2>;
>
>  usb@11281000: usb@11280000:#address-cells:0:0: 1 was expected
>         from schema $id: http://devicetree.org/schemas/usb/mediatek,mtu3.yaml#
> usb@11281000: usb@11280000:#size-cells:0:0: 0 was expected

Dropped.

> > +     vbus-supply = <&usb_p1_vbus>;
> > +     status = "okay";
> > +};
> > +
> > +&watchdog {
> > +     mediatek,reset-by-toprgu;
> > +};
> > +
> > +#include <arm/cros-ec-keyboard.dtsi>
> > +#include <arm/cros-ec-sbs.dtsi>
>
>
> Eugen

Thanks for the review. Since the merge window is just around the corner,
I will send a new version later this month.

ChenYu
AngeloGioacchino Del Regno Jan. 19, 2024, 1:19 p.m. UTC | #8
Il 14/12/23 15:37, Chen-Yu Tsai ha scritto:
> On Thu, Dec 14, 2023 at 7:31 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Il 13/12/23 16:04, Chen-Yu Tsai ha scritto:
>>> Tentacruel and Tentacool are MT8186 based Chromebooks based on the
>>> Krabby design.
>>>
>>> Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
>>> convertible device with touchscreen and stylus.
>>>
>>> Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
>>> device. It does not have a touchscreen or stylus.
>>>
>>> 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.
>>>
>>> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
>>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>>> ---
>>> Changes since v3:
>>> - Reorder some properties to conform better to the newly proposed DT
>>>     style guidelines
>>> - Drop unused labels
>>> - Rename bt-sco node name to bt-sco-codec
>>> - Drop i2s*-share properties from afe node
>>> - Drop aud_gpio_tdm_{on,off} pinctrl nodes
>>> - Replace interrupts with interrupts-extended in tpm node
>>> - Enable adsp device
>>>
>>> Changes since v2:
>>> - Picked up Conor's ack
>>> - Rename touchpad to trackpad
>>> - Drop pinctrl properties from trackpad in tentacruel/tentacool second
>>>     source trackpad
>>>
>>> Changes since v1:
>>> - Reorder SKU numbers in descending order.
>>> - Fixed pinconfig node names
>>> - Moved pinctrl-* properties after interrupts-*
>>> - Switched to interrupts-extended for external components
>>> - Marked ADSP as explicitly disabled, with a comment explaining that it
>>>     stalls the system
>>> - Renamed "touchpad" to "trackpad"
>>> - Dropped bogus "no-laneswap" property from it6505 node
>>> - Moved "realtek,jd-src" property to after all the regulator supplies
>>> - Switched to macros for MT6366 regulator "regulator-allowed-modes"
>>> - Renamed "vgpu" regulator name to allow coupling, with a comment
>>>     containing the name used in the design
>>> - Renamed "cr50" node name to "tpm"
>>> - Moved trackpad_pins reference up to i2c2; workaround for second source
>>>     component resource sharing.
>>> - Fix copyright year
>>> - Fixed touchscreen supply name
>>> ---
>>>    arch/arm64/boot/dts/mediatek/Makefile         |    4 +
>>>    .../dts/mediatek/mt8186-corsola-krabby.dtsi   |  129 ++
>>>    .../mt8186-corsola-tentacool-sku327681.dts    |   57 +
>>>    .../mt8186-corsola-tentacool-sku327683.dts    |   24 +
>>>    .../mt8186-corsola-tentacruel-sku262144.dts   |   44 +
>>>    .../mt8186-corsola-tentacruel-sku262148.dts   |   26 +
>>>    .../boot/dts/mediatek/mt8186-corsola.dtsi     | 1707 +++++++++++++++++
>>>    7 files changed, 1991 insertions(+)
>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-krabby.dtsi
>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327681.dts
>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327683.dts
>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262144.dts
>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
>>>
>>> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
>>> index e6e7592a3645..442af61b1305 100644
>>> --- a/arch/arm64/boot/dts/mediatek/Makefile
>>> +++ b/arch/arm64/boot/dts/mediatek/Makefile
>>> @@ -43,6 +43,10 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
>>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
>>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
>>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
>>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327681.dtb
>>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327683.dtb
>>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262144.dtb
>>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262148.dtb
>>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-evb.dtb
>>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r1.dtb
>>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r5-sku2.dtb
>>
>> ..snip..
>>
>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
>>> new file mode 100644
>>> index 000000000000..447b57b12b41
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
>>> @@ -0,0 +1,26 @@
>>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>>> +/*
>>> + * Copyright 2023 Google LLC
>>> + */
>>> +
>>> +#include "mt8186-corsola-tentacruel-sku262144.dts"
>>> +
>>> +/ {
>>> +     compatible = "google,tentacruel-sku262151", "google,tentacruel-sku262150",
>>> +                  "google,tentacruel-sku262149", "google,tentacruel-sku262148",
>>> +                  "google,tentacruel", "mediatek,mt8186";
>>> +};
>>> +
>>> +/* This variant replaces only the trackpad controller. */
>>> +&i2c2 {
>>> +     /delete-node/ trackpad@15;
>>> +
>>> +     trackpad@15 {
>>> +             compatible = "hid-over-i2c";
>>> +             reg = <0x15>;
>>> +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
>>> +             hid-descr-addr = <0x0001>;
>>> +             vdd-supply = <&pp3300_s3>;
>>> +             wakeup-source;
>>> +     };
>>> +};
>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
>>> new file mode 100644
>>> index 000000000000..adbeb0c765d3
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
>>> @@ -0,0 +1,1707 @@
>>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>>> +/*
>>> + * Copyright (C) 2022 MediaTek Inc.
>>> + */
>>> +/dts-v1/;
>>> +#include "mt8186.dtsi"
>>> +#include <dt-bindings/pinctrl/mt8186-pinfunc.h>
>>> +#include <dt-bindings/gpio/gpio.h>
>>> +#include <dt-bindings/input/input.h>
>>> +#include <dt-bindings/input/gpio-keys.h>
>>> +#include <dt-bindings/regulator/mediatek,mt6397-regulator.h>
>>> +
>>
>> ..snip..
>>
>>> +
>>> +&i2c2 {
>>> +     pinctrl-names = "default";
>>> +     /*
>>> +      * Trackpad pin put here to work around second source components
>>> +      * sharing the pinmux in steelix designs.
>>> +      */
>>> +     pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
>>> +     clock-frequency = <400000>;
>>> +     i2c-scl-internal-delay-ns = <10000>;
>>> +     status = "okay";
>>> +
>>> +     trackpad@15 {
>>> +             compatible = "elan,ekth3000";
>>
>> You forgot to change this one.
>>
>> Remove compatible from this node and stop using /delete-node/ in device specific
>> devicetrees.
> 
> I believe I already replied to the previous version why we can't and shouldn't
> do that.
> 
> "elan,ekth3000" and "hid-over-i2c" have incompatible bindings, specifically
> the former uses "vcc-supply" while the latter uses "vdd-supply".
> 
> One has to track down if a property is a "sharable" property or not,
> then put it in the correct place, otherwise getting DT binding validation
> errors.
> 
> To me it seems cleaner to just delete the node wholesale to not have any
> remnants of the original node, i.e. start from a clean slate. Trying to
> "share" common properties is asking for a headache.
> 
> This feels more like a preference thing. I also asked if deleting the node
> through the label would be cleaner, but you didn't reply.
> 

I am truly sorry for not replying to that - and for replying to this one very late.

Ok, in that case, I still don't really like seeing /delete-node/ statements... and
unless there is a truly valid reason to have those, can we please just get each
node to each *.dts?

Just to clarify, a valid scenario to have a /delete-node/ statement there would be
the following:
  - Same platform, like Corsola in this case
  - Four devices
    - Three have one trackpad (better if expected more with the same TP)
    - One has the other trackpad

Even though I am flexible with that, I just don't see the value in deleting the
trackpad because we've got a 50-50 situation here!

At this point IMO it's worth defining the trackpad twice + twice instead... but
if you expect to have more devices, conforming to the valid scenario that I have
described above, then okay - keep going with /delete-node/.

> Also, "elan,ekth3000" is the one that was designed and tested on the Corsola
> reference design, so I think it rightfully belongs there. The Tentacruel
> SKU replaced it with another part, so the original part should be disabled,
> or in this case, deleted, because otherwise there would be a conflict.

If you really want to document the fact that the Corsola Reference Design
suggests to use a Elan eKTH3000 part, you can always leave a comment in the
dtsi, though, that's interesting mostly only to OEMs... but anyway I'm not
against having a comment, at all.

Cheers,
Angelo

> 
> 
> Regards
> ChenYu
> 
> 
> 
>>> +             reg = <0x15>;
>>> +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
>>> +             vcc-supply = <&pp3300_s3>;
>>> +             wakeup-source;
>>> +     };
>>> +};
>>
>>
>> corsola.dtsi (here):
>>
>> &i2c2 {
>>          pinctrl-names = "default";
>>          /*
>>           * Trackpad pin put here to work around second source components
>>           * sharing the pinmux in steelix designs.
>>           */
>>          pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
>>          clock-frequency = <400000>;
>>          i2c-scl-internal-delay-ns = <10000>;
>>          status = "okay";
>>
>>          trackpad_i2c2_15: trackpad@15 {
>>                  /*
>>                   * Those are common properties for i2c2 trackpad on Corsola boards.
>>                   * The compatible string is declared in device specific devicetrees
>>                   */
>>                  reg = <0x15>;
>>                  interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
>>                  vcc-supply = <&pp3300_s3>;
>>                  wakeup-source;
>>                  status = "disabled";
>>          };
>> };
>>
>> corsola-some-device.dts:
>>
>> &trackpad_i2c2_15 {
>>          compatible = "hid-over-i2c";
>>          hid-descr-addr = <0x0001>;
>>          status = "okay";
>> };
>>
>> corsola-some-other-device.dts:
>>
>> &trackpad_i2c2_15 {
>>          compatible = "elan,ekth3000";
>>          status = "okay";
>> };
>>
>> ....everything else looks good.
>>
>> Cheers,
>> Angelo
Chen-Yu Tsai Jan. 22, 2024, 3:14 a.m. UTC | #9
On Fri, Jan 19, 2024 at 9:19 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 14/12/23 15:37, Chen-Yu Tsai ha scritto:
> > On Thu, Dec 14, 2023 at 7:31 PM AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com> wrote:
> >>
> >> Il 13/12/23 16:04, Chen-Yu Tsai ha scritto:
> >>> Tentacruel and Tentacool are MT8186 based Chromebooks based on the
> >>> Krabby design.
> >>>
> >>> Tentacruel, also known as the ASUS Chromebook CM14 Flip CM1402F, is a
> >>> convertible device with touchscreen and stylus.
> >>>
> >>> Tentacool, also known as the ASUS Chromebook CM14 CM1402C, is a laptop
> >>> device. It does not have a touchscreen or stylus.
> >>>
> >>> 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.
> >>>
> >>> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> >>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> >>> ---
> >>> Changes since v3:
> >>> - Reorder some properties to conform better to the newly proposed DT
> >>>     style guidelines
> >>> - Drop unused labels
> >>> - Rename bt-sco node name to bt-sco-codec
> >>> - Drop i2s*-share properties from afe node
> >>> - Drop aud_gpio_tdm_{on,off} pinctrl nodes
> >>> - Replace interrupts with interrupts-extended in tpm node
> >>> - Enable adsp device
> >>>
> >>> Changes since v2:
> >>> - Picked up Conor's ack
> >>> - Rename touchpad to trackpad
> >>> - Drop pinctrl properties from trackpad in tentacruel/tentacool second
> >>>     source trackpad
> >>>
> >>> Changes since v1:
> >>> - Reorder SKU numbers in descending order.
> >>> - Fixed pinconfig node names
> >>> - Moved pinctrl-* properties after interrupts-*
> >>> - Switched to interrupts-extended for external components
> >>> - Marked ADSP as explicitly disabled, with a comment explaining that it
> >>>     stalls the system
> >>> - Renamed "touchpad" to "trackpad"
> >>> - Dropped bogus "no-laneswap" property from it6505 node
> >>> - Moved "realtek,jd-src" property to after all the regulator supplies
> >>> - Switched to macros for MT6366 regulator "regulator-allowed-modes"
> >>> - Renamed "vgpu" regulator name to allow coupling, with a comment
> >>>     containing the name used in the design
> >>> - Renamed "cr50" node name to "tpm"
> >>> - Moved trackpad_pins reference up to i2c2; workaround for second source
> >>>     component resource sharing.
> >>> - Fix copyright year
> >>> - Fixed touchscreen supply name
> >>> ---
> >>>    arch/arm64/boot/dts/mediatek/Makefile         |    4 +
> >>>    .../dts/mediatek/mt8186-corsola-krabby.dtsi   |  129 ++
> >>>    .../mt8186-corsola-tentacool-sku327681.dts    |   57 +
> >>>    .../mt8186-corsola-tentacool-sku327683.dts    |   24 +
> >>>    .../mt8186-corsola-tentacruel-sku262144.dts   |   44 +
> >>>    .../mt8186-corsola-tentacruel-sku262148.dts   |   26 +
> >>>    .../boot/dts/mediatek/mt8186-corsola.dtsi     | 1707 +++++++++++++++++
> >>>    7 files changed, 1991 insertions(+)
> >>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-krabby.dtsi
> >>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327681.dts
> >>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacool-sku327683.dts
> >>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262144.dts
> >>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> >>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> >>>
> >>> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> >>> index e6e7592a3645..442af61b1305 100644
> >>> --- a/arch/arm64/boot/dts/mediatek/Makefile
> >>> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> >>> @@ -43,6 +43,10 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
> >>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
> >>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
> >>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
> >>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327681.dtb
> >>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacool-sku327683.dtb
> >>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262144.dtb
> >>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-corsola-tentacruel-sku262148.dtb
> >>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-evb.dtb
> >>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r1.dtb
> >>>    dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r5-sku2.dtb
> >>
> >> ..snip..
> >>
> >>> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> >>> new file mode 100644
> >>> index 000000000000..447b57b12b41
> >>> --- /dev/null
> >>> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-tentacruel-sku262148.dts
> >>> @@ -0,0 +1,26 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> >>> +/*
> >>> + * Copyright 2023 Google LLC
> >>> + */
> >>> +
> >>> +#include "mt8186-corsola-tentacruel-sku262144.dts"
> >>> +
> >>> +/ {
> >>> +     compatible = "google,tentacruel-sku262151", "google,tentacruel-sku262150",
> >>> +                  "google,tentacruel-sku262149", "google,tentacruel-sku262148",
> >>> +                  "google,tentacruel", "mediatek,mt8186";
> >>> +};
> >>> +
> >>> +/* This variant replaces only the trackpad controller. */
> >>> +&i2c2 {
> >>> +     /delete-node/ trackpad@15;
> >>> +
> >>> +     trackpad@15 {
> >>> +             compatible = "hid-over-i2c";
> >>> +             reg = <0x15>;
> >>> +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> >>> +             hid-descr-addr = <0x0001>;
> >>> +             vdd-supply = <&pp3300_s3>;
> >>> +             wakeup-source;
> >>> +     };
> >>> +};
> >>> diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> >>> new file mode 100644
> >>> index 000000000000..adbeb0c765d3
> >>> --- /dev/null
> >>> +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi
> >>> @@ -0,0 +1,1707 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> >>> +/*
> >>> + * Copyright (C) 2022 MediaTek Inc.
> >>> + */
> >>> +/dts-v1/;
> >>> +#include "mt8186.dtsi"
> >>> +#include <dt-bindings/pinctrl/mt8186-pinfunc.h>
> >>> +#include <dt-bindings/gpio/gpio.h>
> >>> +#include <dt-bindings/input/input.h>
> >>> +#include <dt-bindings/input/gpio-keys.h>
> >>> +#include <dt-bindings/regulator/mediatek,mt6397-regulator.h>
> >>> +
> >>
> >> ..snip..
> >>
> >>> +
> >>> +&i2c2 {
> >>> +     pinctrl-names = "default";
> >>> +     /*
> >>> +      * Trackpad pin put here to work around second source components
> >>> +      * sharing the pinmux in steelix designs.
> >>> +      */
> >>> +     pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
> >>> +     clock-frequency = <400000>;
> >>> +     i2c-scl-internal-delay-ns = <10000>;
> >>> +     status = "okay";
> >>> +
> >>> +     trackpad@15 {
> >>> +             compatible = "elan,ekth3000";
> >>
> >> You forgot to change this one.
> >>
> >> Remove compatible from this node and stop using /delete-node/ in device specific
> >> devicetrees.
> >
> > I believe I already replied to the previous version why we can't and shouldn't
> > do that.
> >
> > "elan,ekth3000" and "hid-over-i2c" have incompatible bindings, specifically
> > the former uses "vcc-supply" while the latter uses "vdd-supply".
> >
> > One has to track down if a property is a "sharable" property or not,
> > then put it in the correct place, otherwise getting DT binding validation
> > errors.
> >
> > To me it seems cleaner to just delete the node wholesale to not have any
> > remnants of the original node, i.e. start from a clean slate. Trying to
> > "share" common properties is asking for a headache.
> >
> > This feels more like a preference thing. I also asked if deleting the node
> > through the label would be cleaner, but you didn't reply.
> >
>
> I am truly sorry for not replying to that - and for replying to this one very late.
>
> Ok, in that case, I still don't really like seeing /delete-node/ statements... and
> unless there is a truly valid reason to have those, can we please just get each
> node to each *.dts?
>
> Just to clarify, a valid scenario to have a /delete-node/ statement there would be
> the following:
>   - Same platform, like Corsola in this case
>   - Four devices
>     - Three have one trackpad (better if expected more with the same TP)
>     - One has the other trackpad
>
> Even though I am flexible with that, I just don't see the value in deleting the
> trackpad because we've got a 50-50 situation here!
>
> At this point IMO it's worth defining the trackpad twice + twice instead... but
> if you expect to have more devices, conforming to the valid scenario that I have
> described above, then okay - keep going with /delete-node/.

It's not 50-50, because all the other MT8186 devices inherit the original
trackpad in mt8186-corsola.dtsi. So for those devices it either means
pushing it down to the next level in mt8186-corsola-steelix.dtsi, or
down to the individual .dts files, of which we already have six within
this series, and another two for the Voltorb devices. So that's 10 vs 2.

I think that makes a very valid case for using /delete-node/ and not
duplicating the device node everywhere?

Maybe we'll be able to clean this mess up a bit with overlays and FIT
images, but the FIT image stuff is still under discussion.


ChenYu

> > Also, "elan,ekth3000" is the one that was designed and tested on the Corsola
> > reference design, so I think it rightfully belongs there. The Tentacruel
> > SKU replaced it with another part, so the original part should be disabled,
> > or in this case, deleted, because otherwise there would be a conflict.
>
> If you really want to document the fact that the Corsola Reference Design
> suggests to use a Elan eKTH3000 part, you can always leave a comment in the
> dtsi, though, that's interesting mostly only to OEMs... but anyway I'm not
> against having a comment, at all.
>
> Cheers,
> Angelo
>
> >
> >
> > Regards
> > ChenYu
> >
> >
> >
> >>> +             reg = <0x15>;
> >>> +             interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> >>> +             vcc-supply = <&pp3300_s3>;
> >>> +             wakeup-source;
> >>> +     };
> >>> +};
> >>
> >>
> >> corsola.dtsi (here):
> >>
> >> &i2c2 {
> >>          pinctrl-names = "default";
> >>          /*
> >>           * Trackpad pin put here to work around second source components
> >>           * sharing the pinmux in steelix designs.
> >>           */
> >>          pinctrl-0 = <&i2c2_pins>, <&trackpad_pin>;
> >>          clock-frequency = <400000>;
> >>          i2c-scl-internal-delay-ns = <10000>;
> >>          status = "okay";
> >>
> >>          trackpad_i2c2_15: trackpad@15 {
> >>                  /*
> >>                   * Those are common properties for i2c2 trackpad on Corsola boards.
> >>                   * The compatible string is declared in device specific devicetrees
> >>                   */
> >>                  reg = <0x15>;
> >>                  interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_LOW>;
> >>                  vcc-supply = <&pp3300_s3>;
> >>                  wakeup-source;
> >>                  status = "disabled";
> >>          };
> >> };
> >>
> >> corsola-some-device.dts:
> >>
> >> &trackpad_i2c2_15 {
> >>          compatible = "hid-over-i2c";
> >>          hid-descr-addr = <0x0001>;
> >>          status = "okay";
> >> };
> >>
> >> corsola-some-other-device.dts:
> >>
> >> &trackpad_i2c2_15 {
> >>          compatible = "elan,ekth3000";
> >>          status = "okay";
> >> };
> >>
> >> ....everything else looks good.
> >>
> >> Cheers,
> >> Angelo
>
>
>