code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include <dt-bindings/input/atmel-maxtouch.h>
#include <dt-bindings/input/gpio-keys.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/thermal/thermal.h>

#include "tegra20.dtsi"
#include "tegra20-cpu-opp.dtsi"
#include "tegra20-cpu-opp-microvolt.dtsi"

/ {
	model = "ASUS EeePad Transformer TF101";
	compatible = "asus,tf101", "nvidia,tegra20";
	chassis-type = "convertible";

	aliases {
		mmc0 = &sdmmc4; /* eMMC */
		mmc1 = &sdmmc3; /* MicroSD */
		mmc2 = &sdmmc1; /* WiFi */

		rtc0 = &pmic;
		rtc1 = "/rtc@7000e000";

		serial0 = &uartd;
		serial1 = &uartc; /* Bluetooth */
		serial2 = &uartb; /* GPS */
	};

	/*
	 * The decompressor and also some bootloaders rely on a
	 * pre-existing /chosen node to be available to insert the
	 * command line and merge other ATAGS info.
	 */
	chosen {};

	memory@0 {
		reg = <0x00000000 0x40000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		ramoops@2ffe0000 {
			compatible = "ramoops";
			reg = <0x2ffe0000 0x10000>;	/* 64kB */
			console-size = <0x8000>;	/* 32kB */
			record-size = <0x400>;		/*  1kB */
			ecc-size = <16>;
		};

		linux,cma@30000000 {
			compatible = "shared-dma-pool";
			alloc-ranges = <0x30000000 0x10000000>;
			size = <0x10000000>; /* 256MiB */
			linux,cma-default;
			reusable;
		};
	};

	host1x@50000000 {
		dc@54200000 {
			rgb {
				status = "okay";

				port@0 {
					lcd_output: endpoint {
						remote-endpoint = <&lvds_encoder_input>;
						bus-width = <18>;
					};
				};
			};
		};

		hdmi@54280000 {
			status = "okay";

			vdd-supply = <&hdmi_vdd_reg>;
			pll-supply = <&hdmi_pll_reg>;
			hdmi-supply = <&vdd_hdmi_en>;

			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
				GPIO_ACTIVE_HIGH>;
		};
	};

	gpio@6000d000 {
		charging-enable-hog {
			gpio-hog;
			gpios = <TEGRA_GPIO(R, 6) GPIO_ACTIVE_HIGH>;
			output-low;
		};
	};

	pinmux@70000014 {
		pinctrl-names = "default";
		pinctrl-0 = <&state_default>;

		state_default: pinmux {
			ata {
				nvidia,pins = "ata";
				nvidia,function = "ide";
			};

			atb {
				nvidia,pins = "atb", "gma", "gme";
				nvidia,function = "sdio4";
			};

			atc {
				nvidia,pins = "atc";
				nvidia,function = "nand";
			};

			atd {
				nvidia,pins = "atd", "ate", "gmb", "spia",
					"spib", "spic";
				nvidia,function = "gmi";
			};

			cdev1 {
				nvidia,pins = "cdev1";
				nvidia,function = "plla_out";
			};

			cdev2 {
				nvidia,pins = "cdev2";
				nvidia,function = "pllp_out4";
			};

			crtp {
				nvidia,pins = "crtp";
				nvidia,function = "crt";
			};

			lm1 {
				nvidia,pins = "lm1";
				nvidia,function = "rsvd3";
			};

			csus {
				nvidia,pins = "csus";
				nvidia,function = "vi_sensor_clk";
			};

			dap1 {
				nvidia,pins = "dap1";
				nvidia,function = "dap1";
			};

			dap2 {
				nvidia,pins = "dap2";
				nvidia,function = "dap2";
			};

			dap3 {
				nvidia,pins = "dap3";
				nvidia,function = "dap3";
			};

			dap4 {
				nvidia,pins = "dap4";
				nvidia,function = "dap4";
			};

			dta {
				nvidia,pins = "dta", "dtb", "dtc", "dtd", "dte";
				nvidia,function = "vi";
			};

			dtf {
				nvidia,pins = "dtf";
				nvidia,function = "i2c3";
			};

			gmc {
				nvidia,pins = "gmc";
				nvidia,function = "uartd";
			};

			gmd {
				nvidia,pins = "gmd";
				nvidia,function = "sflash";
			};

			gpu {
				nvidia,pins = "gpu";
				nvidia,function = "pwm";
			};

			gpu7 {
				nvidia,pins = "gpu7";
				nvidia,function = "rtck";
			};

			gpv {
				nvidia,pins = "gpv", "slxa";
				nvidia,function = "pcie";
			};

			hdint {
				nvidia,pins = "hdint";
				nvidia,function = "hdmi";
			};

			i2cp {
				nvidia,pins = "i2cp";
				nvidia,function = "i2cp";
			};

			irrx {
				nvidia,pins = "irrx", "irtx";
				nvidia,function = "uartb";
			};

			kbca {
				nvidia,pins = "kbca", "kbcb", "kbcc", "kbcd",
					"kbce", "kbcf";
				nvidia,function = "kbc";
			};

			lcsn {
				nvidia,pins = "lcsn", "ldc", "lm0", "lpw1",
					"lsdi", "lvp0";
				nvidia,function = "rsvd4";
			};

			ld0 {
				nvidia,pins = "ld0", "ld1", "ld2", "ld3", "ld4",
					"ld5", "ld6", "ld7", "ld8", "ld9",
					"ld10", "ld11", "ld12", "ld13", "ld14",
					"ld15", "ld16", "ld17", "ldi", "lhp0",
					"lhp1", "lhp2", "lhs", "lpp", "lpw0",
					"lpw2", "lsc0", "lsc1", "lsck", "lsda",
					"lspi", "lvp1", "lvs";
				nvidia,function = "displaya";
			};

			owc {
				nvidia,pins = "owc", "spdi", "spdo", "uac";
				nvidia,function = "rsvd2";
			};

			pmc {
				nvidia,pins = "pmc";
				nvidia,function = "pwr_on";
			};

			rm {
				nvidia,pins = "rm";
				nvidia,function = "i2c1";
			};

			sdb {
				nvidia,pins = "sdb", "sdc", "sdd", "slxc", "slxk";
				nvidia,function = "sdio3";
			};

			sdio1 {
				nvidia,pins = "sdio1";
				nvidia,function = "sdio1";
			};

			slxd {
				nvidia,pins = "slxd";
				nvidia,function = "spdif";
			};

			spid {
				nvidia,pins = "spid", "spie", "spif";
				nvidia,function = "spi1";
			};

			spig {
				nvidia,pins = "spig", "spih";
				nvidia,function = "spi2_alt";
			};

			uaa {
				nvidia,pins = "uaa", "uab", "uda";
				nvidia,function = "ulpi";
			};

			uad {
				nvidia,pins = "uad";
				nvidia,function = "irda";
			};

			uca {
				nvidia,pins = "uca", "ucb";
				nvidia,function = "uartc";
			};

			conf_ata {
				nvidia,pins = "ata", "atb", "atc", "atd",
					"cdev1", "cdev2", "dap1", "dap4",
					"dte", "ddc", "dtf", "gma", "gmc",
					"gme", "gpu", "gpu7", "gpv", "i2cp",
					"irrx", "irtx", "pta", "rm", "sdc",
					"sdd", "slxc", "slxd", "slxk", "spdi",
					"spdo", "uac", "uad",
					"uda", "csus";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			conf_ate {
				nvidia,pins = "ate", "dap2", "dap3", "gmb", "gmd",
					"owc", "spia", "spib", "spic",
					"spid", "spie", "spig", "slxa";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			conf_ck32 {
				nvidia,pins = "ck32", "ddrc", "pmca", "pmcb",
					"pmcc", "pmcd", "pmce", "xm2c", "xm2d";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
			};

			conf_crtp {
				nvidia,pins = "crtp", "spih";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			conf_dta {
				nvidia,pins = "dta", "dtb", "dtc", "dtd";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			conf_spif {
				nvidia,pins = "spif";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			conf_hdint {
				nvidia,pins = "hdint", "lcsn", "ldc", "lm1",
					"lpw1", "lsck", "lsda", "lsdi", "lvp0";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			conf_kbca {
				nvidia,pins = "kbca", "kbcb", "kbcc", "kbcd",
					"kbce", "kbcf", "sdio1", "uaa", "uab",
					"uca", "ucb";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			conf_lc {
				nvidia,pins = "lc", "ls";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
			};

			conf_ld0 {
				nvidia,pins = "ld0", "ld1", "ld2", "ld3", "ld4",
					"ld5", "ld6", "ld7", "ld8", "ld9",
					"ld10", "ld11", "ld12", "ld13", "ld14",
					"ld15", "ld16", "ld17", "ldi", "lhp0",
					"lhp1", "lhp2", "lhs", "lm0", "lpp",
					"lpw0", "lpw2", "lsc0", "lsc1", "lspi",
					"lvp1", "lvs", "pmc", "sdb";
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			conf_ld17_0 {
				nvidia,pins = "ld17_0", "ld19_18", "ld21_20",
					"ld23_22";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			};

			drive_sdio1 {
				nvidia,pins = "drive_sdio1", "drive_ddc", "drive_vi1";
				nvidia,high-speed-mode = <TEGRA_PIN_DISABLE>;
				nvidia,schmitt = <TEGRA_PIN_ENABLE>;
				nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
				nvidia,pull-down-strength = <31>;
				nvidia,pull-up-strength = <31>;
				nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_SLOWEST>;
				nvidia,slew-rate-falling = <TEGRA_PIN_SLEW_RATE_SLOWEST>;
			};

			drive_csus {
				nvidia,pins = "drive_csus";
				nvidia,high-speed-mode = <TEGRA_PIN_DISABLE>;
				nvidia,schmitt = <TEGRA_PIN_DISABLE>;
				nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
				nvidia,pull-down-strength = <31>;
				nvidia,pull-up-strength = <31>;
				nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_SLOWEST>;
				nvidia,slew-rate-falling = <TEGRA_PIN_SLEW_RATE_SLOWEST>;
			};
		};

		state_i2cmux_ddc: pinmux-i2cmux-ddc {
			ddc {
				nvidia,pins = "ddc";
				nvidia,function = "i2c2";
			};

			pta {
				nvidia,pins = "pta";
				nvidia,function = "rsvd4";
			};
		};

		state_i2cmux_pta: pinmux-i2cmux-pta {
			ddc {
				nvidia,pins = "ddc";
				nvidia,function = "rsvd4";
			};

			pta {
				nvidia,pins = "pta";
				nvidia,function = "i2c2";
			};
		};

		state_i2cmux_idle: pinmux-i2cmux-idle {
			ddc {
				nvidia,pins = "ddc";
				nvidia,function = "rsvd4";
			};

			pta {
				nvidia,pins = "pta";
				nvidia,function = "rsvd4";
			};
		};
	};

	spdif@70002400 {
		status = "okay";

		nvidia,fixed-parent-rate;
	};

	i2s@70002800 {
		status = "okay";

		nvidia,fixed-parent-rate;
	};

	serial@70006040 {
		compatible = "nvidia,tegra20-hsuart";
		/delete-property/ reg-shift;
		/* GPS BCM4751 */
	};

	serial@70006200 {
		compatible = "nvidia,tegra20-hsuart";
		/delete-property/ reg-shift;
		status = "okay";

		/* Azurewave AW-NH615 BCM4329B1 */
		bluetooth {
			compatible = "brcm,bcm4329-bt";

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(U, 6) IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "host-wakeup";

			/* PLLP 216MHz / 16 / 4 */
			max-speed = <3375000>;

			clocks = <&tegra_pmc TEGRA_PMC_CLK_BLINK>;
			clock-names = "txco";

			vbat-supply  = <&vdd_3v3_sys>;
			vddio-supply = <&vdd_1v8_sys>;

			device-wakeup-gpios = <&gpio TEGRA_GPIO(U, 1) GPIO_ACTIVE_HIGH>;
			shutdown-gpios = <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
		};
	};

	serial@70006300 {
		status = "okay";
	};

	pwm@7000a000 {
		status = "okay";
	};

	i2c@7000c000 {
		status = "okay";
		clock-frequency = <400000>;

		/* Aichi AMI306 digital compass */
		magnetometer@e {
			compatible = "asahi-kasei,ak8974";
			reg = <0xe>;

			avdd-supply = <&vdd_3v3_sys>;
			dvdd-supply = <&vdd_1v8_sys>;

			mount-matrix = "-1",  "0",  "0",
					"0",  "1",  "0",
					"0",  "0", "-1";
		};

		wm8903: audio-codec@1a {
			compatible = "wlf,wm8903";
			reg = <0x1a>;

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(X, 1) IRQ_TYPE_EDGE_BOTH>;

			gpio-controller;
			#gpio-cells = <2>;

			micdet-cfg = <0x83>;
			micdet-delay = <100>;

			gpio-cfg = <
				0xffffffff /* don't touch */
				0xffffffff /* don't touch */
				0x00000000 /* Speaker-enable GPIO, output, low */
				0x00000400 /* Mic bias current detect */
				0xffffffff /* don't touch */
			>;

			AVDD-supply  = <&vdd_1v8_sys>;
			CPVDD-supply = <&vdd_1v8_sys>;
			DBVDD-supply = <&vdd_1v8_sys>;
			DCVDD-supply = <&vdd_1v8_sys>;
		};

		/* Atmel MXT1386 Touchscreen */
		touchscreen@5b {
			compatible = "atmel,maxtouch";
			reg = <0x5b>;

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(V, 6) IRQ_TYPE_LEVEL_LOW>;

			reset-gpios = <&gpio TEGRA_GPIO(Q, 7) GPIO_ACTIVE_LOW>;

			vdda-supply = <&vdd_3v3_sys>;
			vdd-supply  = <&vdd_3v3_sys>;

			atmel,wakeup-method = <ATMEL_MXT_WAKEUP_I2C_SCL>;
		};

		gyroscope@68 {
			compatible = "invensense,mpu3050";
			reg = <0x68>;

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(Z, 4) IRQ_TYPE_EDGE_RISING>;

			vdd-supply    = <&vdd_3v3_sys>;
			vlogic-supply = <&vdd_1v8_sys>;

			mount-matrix =	 "0",  "1",  "0",
					"-1",  "0",  "0",
					 "0",  "0",  "1";

			i2c-gate {
				#address-cells = <1>;
				#size-cells = <0>;

				accelerometer@f {
					compatible = "kionix,kxtf9";
					reg = <0xf>;

					interrupt-parent = <&gpio>;
					interrupts = <TEGRA_GPIO(N, 4) IRQ_TYPE_EDGE_RISING>;

					vdd-supply = <&vdd_1v8_sys>;
					vddio-supply = <&vdd_1v8_sys>;

					mount-matrix =	 "1",  "0",  "0",
							 "0",  "1",  "0",
							 "0",  "0",  "1";
				};
			};
		};
	};

	i2c2: i2c@7000c400 {
		status = "okay";
		clock-frequency = <100000>;
	};

	i2c@7000c500 {
		status = "okay";
		clock-frequency = <400000>;
	};

	i2c@7000d000 {
		status = "okay";
		clock-frequency = <400000>;

		pmic: pmic@34 {
			compatible = "ti,tps6586x";
			reg = <0x34>;
			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;

			ti,system-power-controller;

			#gpio-cells = <2>;
			gpio-controller;

			sys-supply = <&vdd_5v0_sys>;
			vin-sm0-supply = <&sys_reg>;
			vin-sm1-supply = <&sys_reg>;
			vin-sm2-supply = <&sys_reg>;
			vinldo01-supply = <&sm2_reg>;
			vinldo23-supply = <&sm2_reg>;
			vinldo4-supply = <&sm2_reg>;
			vinldo678-supply = <&sm2_reg>;
			vinldo9-supply = <&sm2_reg>;

			regulators {
				sys_reg: sys {
					regulator-name = "vdd_sys";
					regulator-always-on;
				};

				vdd_core: sm0 {
					regulator-name = "vdd_sm0,vdd_core";
					regulator-min-microvolt = <950000>;
					regulator-max-microvolt = <1300000>;
					regulator-coupled-with = <&rtc_vdd &vdd_cpu>;
					regulator-coupled-max-spread = <170000 550000>;
					regulator-always-on;
					regulator-boot-on;

					nvidia,tegra-core-regulator;
				};

				vdd_cpu: sm1 {
					regulator-name = "vdd_sm1,vdd_cpu";
					regulator-min-microvolt = <750000>;
					regulator-max-microvolt = <1125000>;
					regulator-coupled-with = <&vdd_core &rtc_vdd>;
					regulator-coupled-max-spread = <550000 550000>;
					regulator-always-on;
					regulator-boot-on;

					nvidia,tegra-cpu-regulator;
				};

				sm2_reg: sm2 {
					regulator-name = "vdd_sm2,vin_ldo*";
					regulator-min-microvolt = <3700000>;
					regulator-max-microvolt = <3700000>;
					regulator-always-on;
				};

				/* LDO0 is not connected to anything */

				ldo1 {
					regulator-name = "vdd_ldo1,avdd_pll*";
					regulator-min-microvolt = <1100000>;
					regulator-max-microvolt = <1100000>;
					regulator-always-on;
				};

				rtc_vdd: ldo2 {
					regulator-name = "vdd_ldo2,vdd_rtc";
					regulator-min-microvolt = <950000>;
					regulator-max-microvolt = <1300000>;
					regulator-coupled-with = <&vdd_core &vdd_cpu>;
					regulator-coupled-max-spread = <170000 550000>;
					regulator-always-on;
					regulator-boot-on;

					nvidia,tegra-rtc-regulator;
				};

				ldo3 {
					regulator-name = "vdd_ldo3,avdd_usb*";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};

				ldo4 {
					regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
				};

				vcore_emmc: ldo5 {
					regulator-name = "vdd_ldo5,vcore_mmc";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo6 {
					regulator-name = "vdd_ldo6,avdd_vdac";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				hdmi_vdd_reg: ldo7 {
					regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
				};

				hdmi_pll_reg: ldo8 {
					regulator-name = "vdd_ldo8,avdd_hdmi_pll";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				ldo9 {
					regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo_rtc {
					regulator-name = "vdd_rtc_out,vdd_cell";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};
			};
		};

		nct1008: temperature-sensor@4c {
			compatible = "onnn,nct1008";
			reg = <0x4c>;
			vcc-supply = <&vdd_3v3_sys>;

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(N, 6) IRQ_TYPE_EDGE_FALLING>;

			#thermal-sensor-cells = <1>;
		};
	};

	pmc@7000e400 {
		nvidia,invert-interrupt;
		nvidia,suspend-mode = <1>;
		nvidia,cpu-pwr-good-time = <2000>;
		nvidia,cpu-pwr-off-time = <100>;
		nvidia,core-pwr-good-time = <3845 3845>;
		nvidia,core-pwr-off-time = <458>;
		nvidia,sys-clock-req-active-high;
		core-supply = <&vdd_core>;
	};

	memory-controller@7000f400 {
		nvidia,use-ram-code;

		emc-tables@3 {
			reg = <0x3>;

			#address-cells = <1>;
			#size-cells = <0>;

			lpddr2 {
				compatible = "elpida,B8132B2PB-6D-F", "jedec,lpddr2-s4";
				revision-id = <1 0>;
				density = <2048>;
				io-width = <16>;
			};

			emc-table@25000 {
				reg = <25000>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <25000>;
				nvidia,emc-registers = <0x00000002 0x00000006
					0x00000003 0x00000003 0x00000006 0x00000004
					0x00000002 0x00000009 0x00000003 0x00000003
					0x00000002 0x00000002 0x00000002 0x00000004
					0x00000003 0x00000008 0x0000000b 0x0000004d
					0x00000000 0x00000003 0x00000003 0x00000003
					0x00000008 0x00000001 0x0000000a 0x00000004
					0x00000003 0x00000008 0x00000004 0x00000006
					0x00000002 0x00000068 0x00000000 0x00000003
					0x00000000 0x00000000 0x00000282 0xa0ae04ae
					0x00070000 0x00000000 0x00000000 0x00000003
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};

			emc-table@50000 {
				reg = <50000>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <50000>;
				nvidia,emc-registers = <0x00000003 0x00000007
					0x00000003 0x00000003 0x00000006 0x00000004
					0x00000002 0x00000009 0x00000003 0x00000003
					0x00000002 0x00000002 0x00000002 0x00000005
					0x00000003 0x00000008 0x0000000b 0x0000009f
					0x00000000 0x00000003 0x00000003 0x00000003
					0x00000008 0x00000001 0x0000000a 0x00000007
					0x00000003 0x00000008 0x00000004 0x00000006
					0x00000002 0x000000d0 0x00000000 0x00000000
					0x00000000 0x00000000 0x00000282 0xa0ae04ae
					0x00070000 0x00000000 0x00000000 0x00000005
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};

			emc-table@75000 {
				reg = <75000>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <75000>;
				nvidia,emc-registers = <0x00000005 0x0000000a
					0x00000004 0x00000003 0x00000006 0x00000004
					0x00000002 0x00000009 0x00000003 0x00000003
					0x00000002 0x00000002 0x00000002 0x00000005
					0x00000003 0x00000008 0x0000000b 0x000000ff
					0x00000000 0x00000003 0x00000003 0x00000003
					0x00000008 0x00000001 0x0000000a 0x0000000b
					0x00000003 0x00000008 0x00000004 0x00000006
					0x00000002 0x00000138 0x00000000 0x00000000
					0x00000000 0x00000000 0x00000282 0xa0ae04ae
					0x00070000 0x00000000 0x00000000 0x00000007
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};

			emc-table@150000 {
				reg = <150000>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <150000>;
				nvidia,emc-registers = <0x00000009 0x00000014
					0x00000007 0x00000003 0x00000006 0x00000004
					0x00000002 0x00000009 0x00000003 0x00000003
					0x00000002 0x00000002 0x00000002 0x00000005
					0x00000003 0x00000008 0x0000000b 0x0000021f
					0x00000000 0x00000003 0x00000003 0x00000003
					0x00000008 0x00000001 0x0000000a 0x00000015
					0x00000003 0x00000008 0x00000004 0x00000006
					0x00000002 0x00000270 0x00000000 0x00000001
					0x00000000 0x00000000 0x00000282 0xa07c04ae
					0x007dc010 0x00000000 0x00000000 0x0000000e
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};

			emc-table@300000 {
				reg = <300000>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <300000>;
				nvidia,emc-registers = <0x00000012 0x00000027
					0x0000000d 0x00000006 0x00000007 0x00000005
					0x00000003 0x00000009 0x00000006 0x00000006
					0x00000003 0x00000003 0x00000002 0x00000006
					0x00000003 0x00000009 0x0000000c 0x0000045f
					0x00000000 0x00000004 0x00000004 0x00000006
					0x00000008 0x00000001 0x0000000e 0x0000002a
					0x00000003 0x0000000f 0x00000007 0x00000005
					0x00000002 0x000004e0 0x00000005 0x00000002
					0x00000000 0x00000000 0x00000282 0xe059048b
					0x007e0010 0x00000000 0x00000000 0x0000001b
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};
		};
	};

	/* Peripheral USB via ASUS connector */
	usb@c5000000 {
		compatible = "nvidia,tegra20-udc";
		status = "okay";
		dr_mode = "peripheral";
	};

	usb-phy@c5000000 {
		status = "okay";
		dr_mode = "peripheral";
		nvidia,xcvr-setup-use-fuses;
		nvidia,xcvr-lsfslew = <2>;
		nvidia,xcvr-lsrslew = <2>;
		vbus-supply = <&vdd_5v0_sys>;
	};

	/* Dock's USB port */
	usb@c5008000 {
		status = "okay";
	};

	usb-phy@c5008000 {
		status = "okay";
		nvidia,xcvr-setup-use-fuses;
		vbus-supply = <&vdd_5v0_sys>;
	};

	sdmmc1: mmc@c8000000 {
		status = "okay";

		#address-cells = <1>;
		#size-cells = <0>;

		assigned-clocks = <&tegra_car TEGRA20_CLK_SDMMC1>;
		assigned-clock-parents = <&tegra_car TEGRA20_CLK_PLL_C>;
		assigned-clock-rates = <40000000>;

		max-frequency = <40000000>;
		keep-power-in-suspend;
		bus-width = <4>;
		non-removable;

		mmc-pwrseq = <&brcm_wifi_pwrseq>;
		vmmc-supply = <&vdd_3v3_sys>;
		vqmmc-supply = <&vdd_3v3_sys>;

		/* Azurewave AW-NH615 BCM4329B1 */
		wifi@1 {
			compatible = "brcm,bcm4329-fmac";
			reg = <1>;

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(S, 0) IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "host-wake";
		};
	};

	sdmmc3: mmc@c8000400 {
		status = "okay";
		bus-width = <4>;
		cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
		wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
		power-gpios = <&gpio TEGRA_GPIO(I, 6) GPIO_ACTIVE_HIGH>;
		vmmc-supply = <&vdd_3v3_sys>;
		vqmmc-supply = <&vdd_3v3_sys>;
	};

	sdmmc4: mmc@c8000600 {
		status = "okay";
		bus-width = <8>;
		vmmc-supply = <&vcore_emmc>;
		vqmmc-supply = <&vdd_3v3_sys>;
		non-removable;
	};

	mains: ac-adapter-detect {
		compatible = "gpio-charger";
		charger-type = "mains";
		gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_LOW>;
	};

	backlight: backlight {
		compatible = "pwm-backlight";

		enable-gpios = <&gpio TEGRA_GPIO(D, 4) GPIO_ACTIVE_HIGH>;
		power-supply = <&vdd_3v3_sys>;
		pwms = <&pwm 2 4000000>;

		brightness-levels = <7 255>;
		num-interpolated-steps = <248>;
		default-brightness-level = <20>;
	};

	/* PMIC has a built-in 32KHz oscillator which is used by PMC */
	clk32k_in: clock-32k-in {
		compatible = "fixed-clock";
		clock-frequency = <32768>;
		#clock-cells = <0>;
	};

	cpus {
		cpu0: cpu@0 {
			cpu-supply = <&vdd_cpu>;
			operating-points-v2 = <&cpu0_opp_table>;
			#cooling-cells = <2>;
		};

		cpu1: cpu@1 {
			cpu-supply = <&vdd_cpu>;
			operating-points-v2 = <&cpu0_opp_table>;
			#cooling-cells = <2>;
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		switch-dock-hall-sensor {
			label = "Lid";
			gpios = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_LOW>;
			linux,input-type = <EV_SW>;
			linux,code = <SW_LID>;
			debounce-interval = <500>;
			wakeup-event-action = <EV_ACT_ASSERTED>;
			wakeup-source;
		};

		key-power {
			label = "Power";
			gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			debounce-interval = <10>;
			wakeup-event-action = <EV_ACT_ASSERTED>;
			wakeup-source;
		};

		key-volume-up {
			label = "Volume Up";
			gpios = <&gpio TEGRA_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
			debounce-interval = <10>;
			wakeup-event-action = <EV_ACT_ASSERTED>;
			wakeup-source;
		};

		key-volume-down {
			label = "Volume Down";
			gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEDOWN>;
			debounce-interval = <10>;
			wakeup-event-action = <EV_ACT_ASSERTED>;
			wakeup-source;
		};
	};

	display-panel {
		compatible = "auo,b101ew05", "panel-lvds";

		/* AUO B101EW05 using custom timings */

		backlight = <&backlight>;
		ddc-i2c-bus = <&lvds_ddc>;
		power-supply = <&vdd_pnl_reg>;

		width-mm = <218>;
		height-mm = <135>;

		data-mapping = "jeida-18";

		panel-timing {
			clock-frequency = <71200000>;
			hactive = <1280>;
			vactive = <800>;
			hfront-porch = <8>;
			hback-porch = <18>;
			hsync-len = <184>;
			vsync-len = <3>;
			vfront-porch = <4>;
			vback-porch = <8>;
		};

		port {
			panel_input: endpoint {
				remote-endpoint = <&lvds_encoder_output>;
			};
		};
	};

	i2cmux {
		compatible = "i2c-mux-pinctrl";
		#address-cells = <1>;
		#size-cells = <0>;

		i2c-parent = <&i2c2>;

		pinctrl-names = "ddc", "pta", "idle";
		pinctrl-0 = <&state_i2cmux_ddc>;
		pinctrl-1 = <&state_i2cmux_pta>;
		pinctrl-2 = <&state_i2cmux_idle>;

		hdmi_ddc: i2c@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		lvds_ddc: i2c@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;

			smart-battery@b {
				compatible = "ti,bq20z75", "sbs,sbs-battery";
				reg = <0xb>;
				sbs,i2c-retry-count = <2>;
				sbs,poll-retry-count = <10>;
				power-supplies = <&mains>;
			};
		};
	};

	lvds-encoder {
		compatible = "ti,sn75lvds83", "lvds-encoder";

		powerdown-gpios = <&gpio TEGRA_GPIO(B, 2) GPIO_ACTIVE_LOW>;
		power-supply = <&vdd_3v3_sys>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				lvds_encoder_input: endpoint {
					remote-endpoint = <&lcd_output>;
				};
			};

			port@1 {
				reg = <1>;

				lvds_encoder_output: endpoint {
					remote-endpoint = <&panel_input>;
				};
			};
		};
	};

	vdd_5v0_sys: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_5v0";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	vdd_3v3_sys: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_3v3_vs";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		vin-supply = <&vdd_5v0_sys>;
	};

	regulator-pcie {
		compatible = "regulator-fixed";
		regulator-name = "pcie_vdd";
		regulator-min-microvolt = <1500000>;
		regulator-max-microvolt = <1500000>;
		gpio = <&pmic 0 GPIO_ACTIVE_HIGH>;
		regulator-always-on;
	};

	vdd_pnl_reg: regulator-panel {
		compatible = "regulator-fixed";
		regulator-name = "vdd_pnl";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		gpio = <&gpio TEGRA_GPIO(C, 6) GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	vdd_1v8_sys: regulator-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_1v8_vs";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
		vin-supply = <&vdd_5v0_sys>;
	};

	vdd_hdmi_en: regulator-hdmi {
		compatible = "regulator-fixed";
		regulator-name = "vdd_5v0_hdmi_en";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		vin-supply = <&vdd_5v0_sys>;
		gpio = <&gpio TEGRA_GPIO(V, 5) GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	sound {
		compatible = "asus,tegra-audio-wm8903-tf101",
			     "nvidia,tegra-audio-wm8903";
		nvidia,model = "Asus EeePad Transformer WM8903";

		nvidia,audio-routing =
			"Headphone Jack", "HPOUTR",
			"Headphone Jack", "HPOUTL",
			"Int Spk", "ROP",
			"Int Spk", "RON",
			"Int Spk", "LOP",
			"Int Spk", "LON",
			"Mic Jack", "MICBIAS",
			"IN1L", "Mic Jack";

		nvidia,i2s-controller = <&tegra_i2s1>;
		nvidia,audio-codec = <&wm8903>;

		nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
		nvidia,headset;

		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
			 <&tegra_car TEGRA20_CLK_CDEV1>;
		clock-names = "pll_a", "pll_a_out0", "mclk";
	};

	thermal-zones {
		/*
		 * NCT1008 has two sensors:
		 *
		 *	0: internal that monitors ambient/skin temperature
		 *	1: external that is connected to the CPU's diode
		 *
		 * Ideally we should use userspace thermal governor,
		 * but it's a much more complex solution.  The "skin"
		 * zone is a simpler solution which prevents TF101 from
		 * getting too hot from a user's tactile perspective.
		 * The CPU zone is intended to protect silicon from damage.
		 */

		skin-thermal {
			polling-delay-passive = <1000>; /* milliseconds */
			polling-delay = <5000>; /* milliseconds */

			thermal-sensors = <&nct1008 0>;

			trips {
				trip0: skin-alert {
					/* start throttling at 60C */
					temperature = <60000>;
					hysteresis = <200>;
					type = "passive";
				};

				trip1: skin-crit {
					/* shut down at 70C */
					temperature = <70000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&trip0>;
					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};

		cpu-thermal {
			polling-delay-passive = <1000>; /* milliseconds */
			polling-delay = <5000>; /* milliseconds */

			thermal-sensors = <&nct1008 1>;

			trips {
				trip2: cpu-alert {
					/* throttle at 85C until temperature drops to 84.8C */
					temperature = <85000>;
					hysteresis = <200>;
					type = "passive";
				};

				trip3: cpu-crit {
					/* shut down at 90C */
					temperature = <90000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map1 {
					trip = <&trip2>;
					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};
	};

	brcm_wifi_pwrseq: wifi-pwrseq {
		compatible = "mmc-pwrseq-simple";

		clocks = <&tegra_pmc TEGRA_PMC_CLK_BLINK>;
		clock-names = "ext_clock";

		reset-gpios = <&gpio TEGRA_GPIO(K, 6) GPIO_ACTIVE_LOW>;
		post-power-on-delay-ms = <200>;
		power-off-delay-us = <200>;
	};
};

&emc_icc_dvfs_opp_table {
	/delete-node/ opp-666000000;
	/delete-node/ opp-760000000;
};


code:
// SPDX-License-Identifier: GPL-2.0 OR MIT
/dts-v1/;

#include <dt-bindings/input/input.h>
#include "tegra20-colibri.dtsi"

/ {
	model = "Toradex Colibri T20 on Colibri Evaluation Board";
	compatible = "toradex,colibri_t20-eval-v3", "toradex,colibri_t20",
		     "nvidia,tegra20";

	aliases {
		rtc0 = "/i2c@7000c000/rtc@68";
		rtc1 = "/i2c@7000d000/pmic@34";
		rtc2 = "/rtc@7000e000";
		serial0 = &uarta;
		serial1 = &uartd;
		serial2 = &uartb;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	host1x@50000000 {
		dc@54200000 {
			rgb {
				status = "okay";
				nvidia,panel = <&panel>;
			};
		};

		hdmi@54280000 {
			status = "okay";
			hdmi-supply = <&reg_5v0>;
		};
	};

	pinmux@70000014 {
		state_default: pinmux {
			bl-on {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			ddc {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			hotplug-detect {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			i2c {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			lcd {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			lm1 {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			mmc {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			mmccd {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			sdc {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			sdb_sdd {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			ssp {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			uart-a {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			uart-b {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			uart-c {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			usbh-pen {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
		};
	};

	/* Colibri UART-A */
	serial@70006000 {
		status = "okay";
	};

	/* Colibri UART-C */
	serial@70006040 {
		status = "okay";
	};

	/* Colibri UART-B */
	serial@70006300 {
		status = "okay";
	};

	pwm@7000a000 {
		status = "okay";
	};

	/*
	 * GEN1_I2C: I2C_SDA/SCL on SODIMM pin 194/196 (e.g. RTC on carrier
	 * board)
	 */
	i2c@7000c000 {
		status = "okay";
		clock-frequency = <400000>;

		/* M41T0M6 real time clock on carrier board */
		rtc@68 {
			compatible = "st,m41t0";
			reg = <0x68>;
		};
	};

	/* GEN2_I2C: unused */

	/* CAM_I2C (I2C3): unused */

	/* DDC_CLOCK/DATA on X3 pin 15/16 (e.g. display EDID) */
	i2c@7000c400 {
		status = "okay";
	};

	/* EHCI instance 0: USB1_DP/N -> USBC_P/N */
	usb@c5000000 {
		status = "okay";
		dr_mode = "otg";
	};

	usb-phy@c5000000 {
		status = "okay";
		vbus-supply = <&reg_usbc_vbus>;
	};

	/* EHCI instance 2: USB3_DP/N -> USBH_P/N */
	usb@c5008000 {
		status = "okay";
	};

	usb-phy@c5008000 {
		status = "okay";
		vbus-supply = <&reg_usbh_vbus>;
	};

	/* SPI4: Colibri SSP */
	spi@7000da00 {
		status = "okay";
		spi-max-frequency = <25000000>;

		can@0 {
			compatible = "microchip,mcp2515";
			reg = <0>;
			clocks = <&clk16m>;
			interrupt-parent = <&gpio>;
			/* CAN_INT */
			interrupts = <TEGRA_GPIO(A, 0) IRQ_TYPE_EDGE_FALLING>;
			spi-max-frequency = <10000000>;
			vdd-supply = <&reg_3v3>;
			xceiver-supply = <&reg_5v0>;
		};
	};

	/* SD/MMC */
	mmc@c8000600 {
		status = "okay";
		bus-width = <4>;
		cd-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>; /* MMCD */
		no-1-8-v;
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		brightness-levels = <255 128 64 32 16 8 4 0>;
		default-brightness-level = <6>;
		/* BL_ON */
		enable-gpios = <&gpio TEGRA_GPIO(T, 4) GPIO_ACTIVE_HIGH>;
		power-supply = <&reg_3v3>;
		pwms = <&pwm 0 5000000>; /* PWM<A> */
	};

	clk16m: osc3 {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <16000000>;
	};

	gpio-keys {
		compatible = "gpio-keys";

		key-wakeup {
			label = "SODIMM pin 45 wakeup";
			gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_WAKEUP>;
			debounce-interval = <10>;
			wakeup-source;
		};
	};

	panel: panel {
		/*
		 * edt,et057090dhu: EDT 5.7" LCD TFT
		 * edt,et070080dh6: EDT 7.0" LCD TFT
		 */
		compatible = "edt,et057090dhu";
		backlight = <&backlight>;
		power-supply = <&reg_3v3>;
	};

	reg_3v3: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "3.3V_SW";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	reg_5v0: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "5V_SW";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

	reg_usbc_vbus: regulator-usbc-vbus {
		compatible = "regulator-fixed";
		regulator-name = "VCC_USB5";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&reg_5v0>;
	};

	/* USBH_PEN resp. USB_P_EN */
	reg_usbh_vbus: regulator-usbh-vbus {
		compatible = "regulator-fixed";
		regulator-name = "VCC_USB[1-4]";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
		vin-supply = <&reg_5v0>;
	};
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include <dt-bindings/input/input.h>
#include "tegra20-colibri.dtsi"

/ {
	model = "Toradex Colibri T20 on Iris";
	compatible = "toradex,colibri_t20-iris", "toradex,colibri_t20",
		     "nvidia,tegra20";

	aliases {
		rtc0 = "/i2c@7000c000/rtc@68";
		rtc1 = "/i2c@7000d000/pmic@34";
		rtc2 = "/rtc@7000e000";
		serial0 = &uarta;
		serial1 = &uartd;
		serial2 = &uartb;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	host1x@50000000 {
		dc@54200000 {
			rgb {
				status = "okay";
				nvidia,panel = <&panel>;
			};
		};

		hdmi@54280000 {
			status = "okay";
			hdmi-supply = <&reg_5v0>;
		};
	};

	pinmux@70000014 {
		state_default: pinmux {
			bl-on {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			ddc {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			hotplug-detect {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			i2c {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			lcd {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			lm1 {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			mmc {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			mmccd {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			sdc {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			sdb_sdd {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			ssp {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			uart-a {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			uart-b {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			uart-c {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			usbh-pen {
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
		};
	};

	/* Colibri UART-A */
	serial@70006000 {
		status = "okay";
	};

	/* Colibri UART-C */
	serial@70006040 {
		status = "okay";
	};

	/* Colibri UART-B */
	serial@70006300 {
		status = "okay";
	};

	pwm@7000a000 {
		status = "okay";
	};

	/*
	 * GEN1_I2C: I2C_SDA/SCL on SODIMM pin 194/196 (e.g. RTC on carrier
	 * board)
	 */
	i2c@7000c000 {
		status = "okay";
		clock-frequency = <400000>;

		/* M41T0M6 real time clock on carrier board */
		rtc@68 {
			compatible = "st,m41t0";
			reg = <0x68>;
		};
	};

	/* GEN2_I2C: unused */

	/* CAM_I2C (I2C3): unused */

	/* DDC_CLOCK/DATA on X3 pin 15/16 (e.g. display EDID) */
	i2c@7000c400 {
		status = "okay";
	};

	/* EHCI instance 0: USB1_DP/N -> USBC_P/N */
	usb@c5000000 {
		status = "okay";
		dr_mode = "otg";
	};

	usb-phy@c5000000 {
		status = "okay";
		vbus-supply = <&reg_usbc_vbus>;
	};

	/* EHCI instance 2: USB3_DP/N -> USBH_P/N */
	usb@c5008000 {
		status = "okay";
	};

	usb-phy@c5008000 {
		status = "okay";
		vbus-supply = <&reg_usbh_vbus>;
	};

	/* SPI4: Colibri SSP */
	spi@7000da00 {
		status = "okay";
		spi-max-frequency = <25000000>;
	};

	/* SD/MMC */
	mmc@c8000600 {
		status = "okay";
		bus-width = <4>;
		cd-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>; /* MMCD */
		no-1-8-v;
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		brightness-levels = <255 128 64 32 16 8 4 0>;
		default-brightness-level = <6>;
		/* BL_ON */
		enable-gpios = <&gpio TEGRA_GPIO(T, 4) GPIO_ACTIVE_HIGH>;
		power-supply = <&reg_3v3>;
		pwms = <&pwm 0 5000000>; /* PWM<A> */
	};

	gpio-keys {
		compatible = "gpio-keys";

		key-wakeup {
			label = "SODIMM pin 45 wakeup";
			gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_WAKEUP>;
			debounce-interval = <10>;
			wakeup-source;
		};
	};

	panel: panel {
		/*
		 * edt,et057090dhu: EDT 5.7" LCD TFT
		 * edt,et070080dh6: EDT 7.0" LCD TFT
		 */
		compatible = "edt,et057090dhu";
		backlight = <&backlight>;
		power-supply = <&reg_3v3>;
	};

	reg_3v3: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "3.3V";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	reg_5v0: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

	reg_usbc_vbus: regulator-usbc-vbus {
		compatible = "regulator-fixed";
		regulator-name = "VCC_USB2";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&reg_5v0>;
	};

	/* USBH_PEN resp. USB_P_EN */
	reg_usbh_vbus: regulator-usbh-vbus {
		compatible = "regulator-fixed";
		regulator-name = "VCC_USB1";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
		vin-supply = <&reg_5v0>;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
#include "tegra20.dtsi"

/*
 * Toradex Colibri T20 Module Device Tree
 * Compatible for Revisions Colibri T20 256MB V1.1B, V1.2A;
 * Colibri T20 256MB IT V1.2A; Colibri T20 512MB V1.1C, V1.2A;
 * Colibri T20 512MB IT V1.2A
 */
/ {
	memory@0 {
		/*
		 * Set memory to 256 MB to be safe as this could be used on
		 * 256 or 512 MB module. It is expected from bootloader
		 * to fix this up for 512 MB version.
		 */
		reg = <0x00000000 0x10000000>;
	};

	host1x@50000000 {
		hdmi@54280000 {
			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
			nvidia,hpd-gpio =
				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
			pll-supply = <&reg_1v8_avdd_hdmi_pll>;
			vdd-supply = <&reg_3v3_avdd_hdmi>;
		};
	};

	pinmux@70000014 {
		pinctrl-names = "default";
		pinctrl-0 = <&state_default>;

		state_default: pinmux {
			/* Analogue Audio AC97 to WM9712 (On-module) */
			audio-refclk {
				nvidia,pins = "cdev1";
				nvidia,function = "plla_out";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			dap3 {
				nvidia,pins = "dap3";
				nvidia,function = "dap3";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/*
			 * AC97_RESET, ULPI_RESET, AC97_INT aka WM9712 GENIRQ
			 * (All on-module), SODIMM Pin 45 Wakeup
			 */
			gpio-uac {
				nvidia,pins = "uac";
				nvidia,function = "rsvd2";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/*
			 * Buffer Enables for nPWE and RDnWR (On-module,
			 * see GPIO hogging further down below)
			 */
			gpio-pta {
				nvidia,pins = "pta";
				nvidia,function = "rsvd4";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/*
			 * CLK_32K_OUT, CORE_PWR_REQ, CPU_PWR_REQ, PWR_INT_N,
			 * SYS_CLK_REQ (All on-module)
			 */
			pmc {
				nvidia,pins = "pmc";
				nvidia,function = "pwr_on";
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/*
			 * Colibri Address/Data Bus (GMI)
			 * Note: spid and spie optionally used for SPI1
			 */
			gmi {
				nvidia,pins = "atc", "atd", "ate", "dap1",
					      "dap2", "dap4", "gmd", "gpu",
					      "irrx", "irtx", "spia", "spib",
					      "spic", "spid", "spie", "uca",
					      "ucb";
				nvidia,function = "gmi";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			/* Further pins may be used as GPIOs */
			gmi-gpio1 {
				nvidia,pins = "lpw0", "lsc1", "lsck", "lsda";
				nvidia,function = "hdmi";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			gmi-gpio2 {
				nvidia,pins = "lcsn", "ldc", "lm0", "lsdi";
				nvidia,function = "rsvd4";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri BL_ON */
			bl-on {
				nvidia,pins = "dta";
				nvidia,function = "rsvd1";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri Backlight PWM<A>, PWM<B> */
			sdc {
				nvidia,pins = "sdc";
				nvidia,function = "pwm";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri DDC */
			ddc {
				nvidia,pins = "ddc";
				nvidia,function = "i2c2";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/*
			 * Colibri EXT_IO*
			 * Note: dtf optionally used for I2C3
			 */
			ext-io {
				nvidia,pins = "dtf", "spdi";
				nvidia,function = "rsvd2";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/*
			 * Colibri Ethernet (On-module)
			 * ULPI EHCI instance 1 USB2_DP/N -> AX88772B
			 */
			ulpi {
				nvidia,pins = "uaa", "uab", "uda";
				nvidia,function = "ulpi";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			ulpi-refclk {
				nvidia,pins = "cdev2";
				nvidia,function = "pllp_out4";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/* Colibri HOTPLUG_DETECT (HDMI) */
			hotplug-detect {
				nvidia,pins = "hdint";
				nvidia,function = "hdmi";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri I2C */
			i2c {
				nvidia,pins = "rm";
				nvidia,function = "i2c1";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/*
			 * Colibri L_BIAS, LCD_M1 is muxed with LCD_DE
			 * today's display need DE, disable LCD_M1
			 */
			lm1 {
				nvidia,pins = "lm1";
				nvidia,function = "rsvd3";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri LCD (L_* resp. LDD<*>) */
			lcd {
				nvidia,pins = "ld0", "ld1", "ld2", "ld3",
					      "ld4", "ld5", "ld6", "ld7",
					      "ld8", "ld9", "ld10", "ld11",
					      "ld12", "ld13", "ld14", "ld15",
					      "ld16", "ld17", "lhs", "lsc0",
					      "lspi", "lvs";
				nvidia,function = "displaya";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			/* Colibri LCD (Optional 24 BPP Support) */
			lcd-24 {
				nvidia,pins = "ldi", "lhp0", "lhp1", "lhp2",
					      "lpp", "lvp1";
				nvidia,function = "displaya";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri MMC */
			mmc {
				nvidia,pins = "atb", "gma";
				nvidia,function = "sdio4";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri MMCCD */
			mmccd {
				nvidia,pins = "gmb";
				nvidia,function = "gmi_int";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri MMC (Optional 8-bit) */
			mmc-8bit {
				nvidia,pins = "gme";
				nvidia,function = "sdio4";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/*
			 * Colibri Parallel Camera (Optional)
			 * pins multiplexed with others and therefore disabled
			 * Note: dta used for BL_ON by default
			 */
			cif-mclk {
				nvidia,pins = "csus";
				nvidia,function = "vi_sensor_clk";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			cif {
				nvidia,pins = "dtb", "dtc", "dtd";
				nvidia,function = "vi";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri PWM<C>, PWM<D> */
			sdb_sdd {
				nvidia,pins = "sdb", "sdd";
				nvidia,function = "pwm";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri SSP */
			ssp {
				nvidia,pins = "slxa", "slxc", "slxd", "slxk";
				nvidia,function = "spi4";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri UART-A */
			uart-a {
				nvidia,pins = "sdio1";
				nvidia,function = "uarta";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			uart-a-dsr {
				nvidia,pins = "lpw1";
				nvidia,function = "rsvd3";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			uart-a-dcd {
				nvidia,pins = "lpw2";
				nvidia,function = "hdmi";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri UART-B */
			uart-b {
				nvidia,pins = "gmc";
				nvidia,function = "uartd";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri UART-C */
			uart-c {
				nvidia,pins = "uad";
				nvidia,function = "irda";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri USB_CDET */
			usb-cdet {
				nvidia,pins = "spdo";
				nvidia,function = "rsvd2";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri USBH_OC */
			usbh-oc {
				nvidia,pins = "spih";
				nvidia,function = "spi2_alt";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri USBH_PEN */
			usbh-pen {
				nvidia,pins = "spig";
				nvidia,function = "spi2_alt";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Colibri VGA not supported */
			vga {
				nvidia,pins = "crtp";
				nvidia,function = "crt";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* I2C3 (Optional) */
			i2c3 {
				nvidia,pins = "dtf";
				nvidia,function = "i2c3";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* JTAG_RTCK */
			jtag-rtck {
				nvidia,pins = "gpu7";
				nvidia,function = "rtck";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/*
			 * LAN_RESET, LAN_EXT_WAKEUP and LAN_PME
			 * (All On-module)
			 */
			gpio-gpv {
				nvidia,pins = "gpv";
				nvidia,function = "rsvd2";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/*
			 * LAN_V_BUS, VDD_FAULT, BATT_FAULT, WM9712 PENDOWN
			 * (All On-module); Colibri CAN_INT
			 */
			gpio-dte {
				nvidia,pins = "dte";
				nvidia,function = "rsvd1";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/* NAND (On-module) */
			nand {
				nvidia,pins = "kbca", "kbcb", "kbcc", "kbcd",
					      "kbce", "kbcf";
				nvidia,function = "nand";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/* Onewire (Optional) */
			owr {
				nvidia,pins = "owc";
				nvidia,function = "owr";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/* Power I2C (On-module) */
			i2cp {
				nvidia,pins = "i2cp";
				nvidia,function = "i2cp";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/* RESET_OUT */
			reset-out {
				nvidia,pins = "ata";
				nvidia,function = "gmi";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};

			/*
			 * SPI1 (Optional)
			 * Note: spid and spie used for Colibri Address/Data
			 *       Bus (GMI)
			 */
			spi1 {
				nvidia,pins = "spid", "spie", "spif";
				nvidia,function = "spi1";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};

			/*
			 * THERMD_ALERT# (On-module), unlatched I2C address pin
			 * of LM95245 temperature sensor therefore requires
			 * disabling for now
			 */
			lvp0 {
				nvidia,pins = "lvp0";
				nvidia,function = "rsvd3";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
		};
	};

	tegra_ac97: ac97@70002000 {
		status = "okay";
		nvidia,codec-reset-gpio =
			<&gpio TEGRA_GPIO(V, 0) GPIO_ACTIVE_HIGH>;
		nvidia,codec-sync-gpio =
			<&gpio TEGRA_GPIO(P, 0) GPIO_ACTIVE_HIGH>;
	};

	serial@70006040 {
		compatible = "nvidia,tegra20-hsuart";
		/delete-property/ reg-shift;
	};

	serial@70006300 {
		compatible = "nvidia,tegra20-hsuart";
		/delete-property/ reg-shift;
	};

	nand-controller@70008000 {
		status = "okay";

		nand@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <1>;
			nand-bus-width = <8>;
			nand-on-flash-bbt;
			nand-ecc-algo = "bch";
			nand-is-boot-medium;
			nand-ecc-maximize;
			wp-gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_LOW>;
		};
	};

	/*
	 * GEN1_I2C: I2C_SDA/SCL on SODIMM pin 194/196 (e.g. RTC on carrier
	 * board)
	 */
	i2c@7000c000 {
		clock-frequency = <400000>;
	};

	/* DDC_SCL/SDA on X3 pin 15/16 (e.g. display EDID) */
	hdmi_ddc: i2c@7000c400 {
		clock-frequency = <10000>;
	};

	/* GEN2_I2C: unused */

	/* CAM/GEN3_I2C: used as EXT_IO1/2 GPIOs on SODIMM pin 133/127 */

	/* PWR_I2C: power I2C to PMIC and temperature sensor (On-module) */
	i2c@7000d000 {
		status = "okay";
		clock-frequency = <100000>;

		pmic@34 {
			compatible = "ti,tps6586x";
			reg = <0x34>;
			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
			ti,system-power-controller;
			#gpio-cells = <2>;
			gpio-controller;
			sys-supply = <&reg_module_3v3>;
			vin-sm0-supply = <&reg_3v3_vsys>;
			vin-sm1-supply = <&reg_3v3_vsys>;
			vin-sm2-supply = <&reg_3v3_vsys>;
			vinldo01-supply = <&reg_1v8_vdd_ddr2>;
			vinldo23-supply = <&reg_module_3v3>;
			vinldo4-supply = <&reg_module_3v3>;
			vinldo678-supply = <&reg_module_3v3>;
			vinldo9-supply = <&reg_module_3v3>;

			regulators {
				reg_3v3_vsys: sys {
					regulator-name = "VSYS_3.3V";
					regulator-always-on;
				};

				vdd_core: sm0 {
					regulator-name = "VDD_CORE_1.2V";
					regulator-min-microvolt = <1200000>;
					regulator-max-microvolt = <1200000>;
					regulator-always-on;
				};

				sm1 {
					regulator-name = "VDD_CPU_1.0V";
					regulator-min-microvolt = <1000000>;
					regulator-max-microvolt = <1000000>;
					regulator-always-on;
				};

				reg_1v8_vdd_ddr2: sm2 {
					regulator-name = "VDD_DDR2_1.8V";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
				};

				/* LDO0 is not connected to anything */

				/*
				 * +3.3V_ENABLE_N switching via FET:
				 * AVDD_AUDIO_S and +3.3V
				 * see also +3.3V fixed supply
				 */
				ldo1 {
					regulator-name = "AVDD_PLL_1.1V";
					regulator-min-microvolt = <1100000>;
					regulator-max-microvolt = <1100000>;
					regulator-always-on;
				};

				ldo2 {
					regulator-name = "VDD_RTC_1.2V";
					regulator-min-microvolt = <1200000>;
					regulator-max-microvolt = <1200000>;
				};

				/* LDO3 is not connected to anything */

				ldo4 {
					regulator-name = "VDDIO_SYS_1.8V";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
				};

				/* Switched via FET from regular +3.3V */
				ldo5 {
					regulator-name = "+3.3V_USB";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};

				ldo6 {
					regulator-name = "AVDD_VDAC_2.85V";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
				};

				reg_3v3_avdd_hdmi: ldo7 {
					regulator-name = "AVDD_HDMI_3.3V";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
				};

				reg_1v8_avdd_hdmi_pll: ldo8 {
					regulator-name = "AVDD_HDMI_PLL_1.8V";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				ldo9 {
					regulator-name = "VDDIO_RX_DDR_2.85V";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo_rtc {
					regulator-name = "VCC_BATT";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};
			};
		};

		/* LM95245 temperature sensor */
		temp-sensor@4c {
			compatible = "national,lm95245";
			reg = <0x4c>;
		};
	};

	pmc@7000e400 {
		nvidia,suspend-mode = <1>;
		nvidia,cpu-pwr-good-time = <5000>;
		nvidia,cpu-pwr-off-time = <5000>;
		nvidia,core-pwr-good-time = <3845 3845>;
		nvidia,core-pwr-off-time = <3875>;
		nvidia,sys-clock-req-active-high;
		core-supply = <&vdd_core>;

		/* Set SLEEP MODE bit in SUPPLYENE register of TPS658643 PMIC */
		i2c-thermtrip {
			nvidia,i2c-controller-id = <3>;
			nvidia,bus-addr = <0x34>;
			nvidia,reg-addr = <0x14>;
			nvidia,reg-data = <0x8>;
		};
	};

	memory-controller@7000f400 {
		emc-table@83250 {
			reg = <83250>;
			compatible = "nvidia,tegra20-emc-table";
			clock-frequency = <83250>;
			nvidia,emc-registers =   <0x00000005 0x00000011
				0x00000004 0x00000002 0x00000004 0x00000004
				0x00000001 0x0000000a 0x00000002 0x00000002
				0x00000001 0x00000001 0x00000003 0x00000004
				0x00000003 0x00000009 0x0000000c 0x0000025f
				0x00000000 0x00000003 0x00000003 0x00000002
				0x00000002 0x00000001 0x00000008 0x000000c8
				0x00000003 0x00000005 0x00000003 0x0000000c
				0x00000002 0x00000000 0x00000000 0x00000002
				0x00000000 0x00000000 0x00000083 0x00520006
				0x00000010 0x00000008 0x00000000 0x00000000
				0x00000000 0x00000000 0x00000000 0x00000000>;
		};
		emc-table@133200 {
			reg = <133200>;
			compatible = "nvidia,tegra20-emc-table";
			clock-frequency = <133200>;
			nvidia,emc-registers =   <0x00000008 0x00000019
				0x00000006 0x00000002 0x00000004 0x00000004
				0x00000001 0x0000000a 0x00000002 0x00000002
				0x00000002 0x00000001 0x00000003 0x00000004
				0x00000003 0x00000009 0x0000000c 0x0000039f
				0x00000000 0x00000003 0x00000003 0x00000002
				0x00000002 0x00000001 0x00000008 0x000000c8
				0x00000003 0x00000007 0x00000003 0x0000000c
				0x00000002 0x00000000 0x00000000 0x00000002
				0x00000000 0x00000000 0x00000083 0x00510006
				0x00000010 0x00000008 0x00000000 0x00000000
				0x00000000 0x00000000 0x00000000 0x00000000>;
		};
		emc-table@166500 {
			reg = <166500>;
			compatible = "nvidia,tegra20-emc-table";
			clock-frequency = <166500>;
			nvidia,emc-registers =   <0x0000000a 0x00000021
				0x00000008 0x00000003 0x00000004 0x00000004
				0x00000002 0x0000000a 0x00000003 0x00000003
				0x00000002 0x00000001 0x00000003 0x00000004
				0x00000003 0x00000009 0x0000000c 0x000004df
				0x00000000 0x00000003 0x00000003 0x00000003
				0x00000003 0x00000001 0x00000009 0x000000c8
				0x00000003 0x00000009 0x00000004 0x0000000c
				0x00000002 0x00000000 0x00000000 0x00000002
				0x00000000 0x00000000 0x00000083 0x004f0006
				0x00000010 0x00000008 0x00000000 0x00000000
				0x00000000 0x00000000 0x00000000 0x00000000>;
		};
		emc-table@333000 {
			reg = <333000>;
			compatible = "nvidia,tegra20-emc-table";
			clock-frequency = <333000>;
			nvidia,emc-registers =   <0x00000014 0x00000041
				0x0000000f 0x00000005 0x00000004 0x00000005
				0x00000003 0x0000000a 0x00000005 0x00000005
				0x00000004 0x00000001 0x00000003 0x00000004
				0x00000003 0x00000009 0x0000000c 0x000009ff
				0x00000000 0x00000003 0x00000003 0x00000005
				0x00000005 0x00000001 0x0000000e 0x000000c8
				0x00000003 0x00000011 0x00000006 0x0000000c
				0x00000002 0x00000000 0x00000000 0x00000002
				0x00000000 0x00000000 0x00000083 0x00380006
				0x00000010 0x00000008 0x00000000 0x00000000
				0x00000000 0x00000000 0x00000000 0x00000000>;
		};
	};

	/* EHCI instance 1: ULPI PHY -> AX88772B (On-module) */
	usb@c5004000 {
		status = "okay";
		#address-cells = <1>;
		#size-cells = <0>;

		ethernet@1 {
			compatible = "usbb95,772b";
			reg = <1>;
			local-mac-address = [00 00 00 00 00 00];
		};
	};

	usb-phy@c5004000 {
		status = "okay";
		nvidia,phy-reset-gpio =
			<&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_LOW>;
		vbus-supply = <&reg_lan_v_bus>;
	};

	clk32k_in: xtal3 {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
	};

	reg_lan_v_bus: regulator-lan-v-bus {
		compatible = "regulator-fixed";
		regulator-name = "LAN_V_BUS";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		enable-active-high;
		gpio = <&gpio TEGRA_GPIO(BB, 1) GPIO_ACTIVE_HIGH>;
	};

	reg_module_3v3: regulator-module-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "+V3.3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	sound {
		compatible = "nvidia,tegra-audio-wm9712-colibri_t20",
			     "nvidia,tegra-audio-wm9712";
		nvidia,model = "Toradex Colibri T20";
		nvidia,audio-routing =
			"Headphone", "HPOUTL",
			"Headphone", "HPOUTR",
			"LineIn", "LINEINL",
			"LineIn", "LINEINR",
			"Mic", "MIC1";
		nvidia,ac97-controller = <&tegra_ac97>;
		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
			 <&tegra_car TEGRA20_CLK_CDEV1>;
		clock-names = "pll_a", "pll_a_out0", "mclk";
	};
};

&emc_icc_dvfs_opp_table {
	/delete-node/ opp-760000000;
};

&gpio {
	lan-reset-n-hog {
		gpio-hog;
		gpios = <TEGRA_GPIO(V, 4) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "LAN_RESET#";
	};

	/* Tri-stating GMI_WR_N on SODIMM pin 99 nPWE */
	npwe-hog {
		gpio-hog;
		gpios = <TEGRA_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "Tri-state nPWE";
	};

	/* Not tri-stating GMI_WR_N on SODIMM pin 93 RDnWR */
	rdnwr-hog {
		gpio-hog;
		gpios = <TEGRA_GPIO(T, 6) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "Not tri-state RDnWR";
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include <dt-bindings/input/input.h>
#include "tegra20.dtsi"

/ {
	model = "NVIDIA Tegra20 Harmony evaluation board";
	compatible = "nvidia,harmony", "nvidia,tegra20";

	aliases {
		rtc0 = "/i2c@7000d000/tps6586x@34";
		rtc1 = "/rtc@7000e000";
		serial0 = &uartd;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@0 {
		reg = <0x00000000 0x40000000>;
	};

	host1x@50000000 {
		dc@54200000 {
			rgb {
				status = "okay";

				nvidia,panel = <&panel>;
			};
		};

		hdmi@54280000 {
			status = "okay";

			hdmi-supply = <&vdd_5v0_hdmi>;
			vdd-supply = <&hdmi_vdd_reg>;
			pll-supply = <&hdmi_pll_reg>;

			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
				GPIO_ACTIVE_HIGH>;
		};
	};

	pinmux@70000014 {
		pinctrl-names = "default";
		pinctrl-0 = <&state_default>;

		state_default: pinmux {
			ata {
				nvidia,pins = "ata";
				nvidia,function = "ide";
			};
			atb {
				nvidia,pins = "atb", "gma", "gme";
				nvidia,function = "sdio4";
			};
			atc {
				nvidia,pins = "atc";
				nvidia,function = "nand";
			};
			atd {
				nvidia,pins = "atd", "ate", "gmb", "gmd", "gpu",
					"spia", "spib", "spic";
				nvidia,function = "gmi";
			};
			cdev1 {
				nvidia,pins = "cdev1";
				nvidia,function = "plla_out";
			};
			cdev2 {
				nvidia,pins = "cdev2";
				nvidia,function = "pllp_out4";
			};
			crtp {
				nvidia,pins = "crtp";
				nvidia,function = "crt";
			};
			csus {
				nvidia,pins = "csus";
				nvidia,function = "vi_sensor_clk";
			};
			dap1 {
				nvidia,pins = "dap1";
				nvidia,function = "dap1";
			};
			dap2 {
				nvidia,pins = "dap2";
				nvidia,function = "dap2";
			};
			dap3 {
				nvidia,pins = "dap3";
				nvidia,function = "dap3";
			};
			dap4 {
				nvidia,pins = "dap4";
				nvidia,function = "dap4";
			};
			ddc {
				nvidia,pins = "ddc";
				nvidia,function = "i2c2";
			};
			dta {
				nvidia,pins = "dta", "dtd";
				nvidia,function = "sdio2";
			};
			dtb {
				nvidia,pins = "dtb", "dtc", "dte";
				nvidia,function = "rsvd1";
			};
			dtf {
				nvidia,pins = "dtf";
				nvidia,function = "i2c3";
			};
			gmc {
				nvidia,pins = "gmc";
				nvidia,function = "uartd";
			};
			gpu7 {
				nvidia,pins = "gpu7";
				nvidia,function = "rtck";
			};
			gpv {
				nvidia,pins = "gpv", "slxa", "slxk";
				nvidia,function = "pcie";
			};
			hdint {
				nvidia,pins = "hdint", "pta";
				nvidia,function = "hdmi";
			};
			i2cp {
				nvidia,pins = "i2cp";
				nvidia,function = "i2cp";
			};
			irrx {
				nvidia,pins = "irrx", "irtx";
				nvidia,function = "uarta";
			};
			kbca {
				nvidia,pins = "kbca", "kbcb", "kbcc", "kbcd",
					"kbce", "kbcf";
				nvidia,function = "kbc";
			};
			lcsn {
				nvidia,pins = "lcsn", "ld0", "ld1", "ld2",
					"ld3", "ld4", "ld5", "ld6", "ld7",
					"ld8", "ld9", "ld10", "ld11", "ld12",
					"ld13", "ld14", "ld15", "ld16", "ld17",
					"ldc", "ldi", "lhp0", "lhp1", "lhp2",
					"lhs", "lm0", "lm1", "lpp", "lpw0",
					"lpw1", "lpw2", "lsc0", "lsc1", "lsck",
					"lsda", "lsdi", "lspi", "lvp0", "lvp1",
					"lvs";
				nvidia,function = "displaya";
			};
			owc {
				nvidia,pins = "owc", "spdi", "spdo", "uac";
				nvidia,function = "rsvd2";
			};
			pmc {
				nvidia,pins = "pmc";
				nvidia,function = "pwr_on";
			};
			rm {
				nvidia,pins = "rm";
				nvidia,function = "i2c1";
			};
			sdb {
				nvidia,pins = "sdb", "sdc", "sdd";
				nvidia,function = "pwm";
			};
			sdio1 {
				nvidia,pins = "sdio1";
				nvidia,function = "sdio1";
			};
			slxc {
				nvidia,pins = "slxc", "slxd";
				nvidia,function = "spdif";
			};
			spid {
				nvidia,pins = "spid", "spie", "spif";
				nvidia,function = "spi1";
			};
			spig {
				nvidia,pins = "spig", "spih";
				nvidia,function = "spi2_alt";
			};
			uaa {
				nvidia,pins = "uaa", "uab", "uda";
				nvidia,function = "ulpi";
			};
			uad {
				nvidia,pins = "uad";
				nvidia,function = "irda";
			};
			uca {
				nvidia,pins = "uca", "ucb";
				nvidia,function = "uartc";
			};
			conf_ata {
				nvidia,pins = "ata", "atb", "atc", "atd", "ate",
					"cdev1", "cdev2", "dap1", "dtb", "gma",
					"gmb", "gmc", "gmd", "gme", "gpu7",
					"gpv", "i2cp", "pta", "rm", "slxa",
					"slxk", "spia", "spib", "uac";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			conf_ck32 {
				nvidia,pins = "ck32", "ddrc", "pmca", "pmcb",
					"pmcc", "pmcd", "pmce", "xm2c", "xm2d";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
			};
			conf_csus {
				nvidia,pins = "csus", "spid", "spif";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_crtp {
				nvidia,pins = "crtp", "dap2", "dap3", "dap4",
					"dtc", "dte", "dtf", "gpu", "sdio1",
					"slxc", "slxd", "spdi", "spdo", "spig",
					"uda";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_ddc {
				nvidia,pins = "ddc", "dta", "dtd", "kbca",
					"kbcb", "kbcc", "kbcd", "kbce", "kbcf",
					"sdc";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			conf_hdint {
				nvidia,pins = "hdint", "lcsn", "ldc", "lm1",
					"lpw1", "lsc1", "lsck", "lsda", "lsdi",
					"lvp0", "owc", "sdb";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_irrx {
				nvidia,pins = "irrx", "irtx", "sdd", "spic",
					"spie", "spih", "uaa", "uab", "uad",
					"uca", "ucb";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_lc {
				nvidia,pins = "lc", "ls";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
			};
			conf_ld0 {
				nvidia,pins = "ld0", "ld1", "ld2", "ld3", "ld4",
					"ld5", "ld6", "ld7", "ld8", "ld9",
					"ld10", "ld11", "ld12", "ld13", "ld14",
					"ld15", "ld16", "ld17", "ldi", "lhp0",
					"lhp1", "lhp2", "lhs", "lm0", "lpp",
					"lpw0", "lpw2", "lsc0", "lspi", "lvp1",
					"lvs", "pmc";
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			conf_ld17_0 {
				nvidia,pins = "ld17_0", "ld19_18", "ld21_20",
					"ld23_22";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			};
		};
	};

	i2s@70002800 {
		status = "okay";
	};

	serial@70006300 {
		status = "okay";
	};

	pwm: pwm@7000a000 {
		status = "okay";
	};

	i2c@7000c000 {
		status = "okay";
		clock-frequency = <400000>;

		wm8903: wm8903@1a {
			compatible = "wlf,wm8903";
			reg = <0x1a>;
			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(X, 3) IRQ_TYPE_LEVEL_HIGH>;

			gpio-controller;
			#gpio-cells = <2>;

			micdet-cfg = <0>;
			micdet-delay = <100>;
			gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
		};
	};

	hdmi_ddc: i2c@7000c400 {
		status = "okay";
		clock-frequency = <100000>;
	};

	i2c@7000c500 {
		status = "okay";
		clock-frequency = <400000>;
	};

	i2c@7000d000 {
		status = "okay";
		clock-frequency = <400000>;

		pmic: tps6586x@34 {
			compatible = "ti,tps6586x";
			reg = <0x34>;
			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;

			ti,system-power-controller;

			#gpio-cells = <2>;
			gpio-controller;

			sys-supply = <&vdd_5v0_reg>;
			vin-sm0-supply = <&sys_reg>;
			vin-sm1-supply = <&sys_reg>;
			vin-sm2-supply = <&sys_reg>;
			vinldo01-supply = <&sm2_reg>;
			vinldo23-supply = <&sm2_reg>;
			vinldo4-supply = <&sm2_reg>;
			vinldo678-supply = <&sm2_reg>;
			vinldo9-supply = <&sm2_reg>;

			regulators {
				sys_reg: sys {
					regulator-name = "vdd_sys";
					regulator-always-on;
				};

				vdd_core: sm0 {
					regulator-name = "vdd_sm0,vdd_core";
					regulator-min-microvolt = <1200000>;
					regulator-max-microvolt = <1200000>;
					regulator-always-on;
				};

				sm1 {
					regulator-name = "vdd_sm1,vdd_cpu";
					regulator-min-microvolt = <1000000>;
					regulator-max-microvolt = <1000000>;
					regulator-always-on;
				};

				sm2_reg: sm2 {
					regulator-name = "vdd_sm2,vin_ldo*";
					regulator-min-microvolt = <3700000>;
					regulator-max-microvolt = <3700000>;
					regulator-always-on;
				};

				pci_clk_reg: ldo0 {
					regulator-name = "vdd_ldo0,vddio_pex_clk";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
				};

				ldo1 {
					regulator-name = "vdd_ldo1,avdd_pll*";
					regulator-min-microvolt = <1100000>;
					regulator-max-microvolt = <1100000>;
					regulator-always-on;
				};

				ldo2 {
					regulator-name = "vdd_ldo2,vdd_rtc";
					regulator-min-microvolt = <1200000>;
					regulator-max-microvolt = <1200000>;
				};

				ldo3 {
					regulator-name = "vdd_ldo3,avdd_usb*";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};

				ldo4 {
					regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
				};

				ldo5 {
					regulator-name = "vdd_ldo5,vcore_mmc";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo6 {
					regulator-name = "vdd_ldo6,avdd_vdac";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				hdmi_vdd_reg: ldo7 {
					regulator-name = "vdd_ldo7,avdd_hdmi";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
				};

				hdmi_pll_reg: ldo8 {
					regulator-name = "vdd_ldo8,avdd_hdmi_pll";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				ldo9 {
					regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo_rtc {
					regulator-name = "vdd_rtc_out,vdd_cell";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};
			};
		};

		temperature-sensor@4c {
			compatible = "adi,adt7461";
			reg = <0x4c>;
		};
	};

	kbc@7000e200 {
		status = "okay";
		nvidia,debounce-delay-ms = <2>;
		nvidia,repeat-delay-ms = <160>;
		nvidia,kbc-row-pins = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
		nvidia,kbc-col-pins = <16 17 18 19 20 21 22 23>;
		linux,keymap = <MATRIX_KEY(0x00, 0x02, KEY_W)
				MATRIX_KEY(0x00, 0x03, KEY_S)
				MATRIX_KEY(0x00, 0x04, KEY_A)
				MATRIX_KEY(0x00, 0x05, KEY_Z)
				MATRIX_KEY(0x00, 0x07, KEY_FN)
				MATRIX_KEY(0x01, 0x07, KEY_MENU)
				MATRIX_KEY(0x02, 0x06, KEY_LEFTALT)
				MATRIX_KEY(0x02, 0x07, KEY_RIGHTALT)
				MATRIX_KEY(0x03, 0x00, KEY_5)
				MATRIX_KEY(0x03, 0x01, KEY_4)
				MATRIX_KEY(0x03, 0x02, KEY_R)
				MATRIX_KEY(0x03, 0x03, KEY_E)
				MATRIX_KEY(0x03, 0x04, KEY_F)
				MATRIX_KEY(0x03, 0x05, KEY_D)
				MATRIX_KEY(0x03, 0x06, KEY_X)
				MATRIX_KEY(0x04, 0x00, KEY_7)
				MATRIX_KEY(0x04, 0x01, KEY_6)
				MATRIX_KEY(0x04, 0x02, KEY_T)
				MATRIX_KEY(0x04, 0x03, KEY_H)
				MATRIX_KEY(0x04, 0x04, KEY_G)
				MATRIX_KEY(0x04, 0x05, KEY_V)
				MATRIX_KEY(0x04, 0x06, KEY_C)
				MATRIX_KEY(0x04, 0x07, KEY_SPACE)
				MATRIX_KEY(0x05, 0x00, KEY_9)
				MATRIX_KEY(0x05, 0x01, KEY_8)
				MATRIX_KEY(0x05, 0x02, KEY_U)
				MATRIX_KEY(0x05, 0x03, KEY_Y)
				MATRIX_KEY(0x05, 0x04, KEY_J)
				MATRIX_KEY(0x05, 0x05, KEY_N)
				MATRIX_KEY(0x05, 0x06, KEY_B)
				MATRIX_KEY(0x05, 0x07, KEY_BACKSLASH)
				MATRIX_KEY(0x06, 0x00, KEY_MINUS)
				MATRIX_KEY(0x06, 0x01, KEY_0)
				MATRIX_KEY(0x06, 0x02, KEY_O)
				MATRIX_KEY(0x06, 0x03, KEY_I)
				MATRIX_KEY(0x06, 0x04, KEY_L)
				MATRIX_KEY(0x06, 0x05, KEY_K)
				MATRIX_KEY(0x06, 0x06, KEY_COMMA)
				MATRIX_KEY(0x06, 0x07, KEY_M)
				MATRIX_KEY(0x07, 0x01, KEY_EQUAL)
				MATRIX_KEY(0x07, 0x02, KEY_RIGHTBRACE)
				MATRIX_KEY(0x07, 0x03, KEY_ENTER)
				MATRIX_KEY(0x07, 0x07, KEY_MENU)
				MATRIX_KEY(0x08, 0x04, KEY_LEFTSHIFT)
				MATRIX_KEY(0x08, 0x05, KEY_RIGHTSHIFT)
				MATRIX_KEY(0x09, 0x05, KEY_LEFTCTRL)
				MATRIX_KEY(0x09, 0x07, KEY_RIGHTCTRL)
				MATRIX_KEY(0x0B, 0x00, KEY_LEFTBRACE)
				MATRIX_KEY(0x0B, 0x01, KEY_P)
				MATRIX_KEY(0x0B, 0x02, KEY_APOSTROPHE)
				MATRIX_KEY(0x0B, 0x03, KEY_SEMICOLON)
				MATRIX_KEY(0x0B, 0x04, KEY_SLASH)
				MATRIX_KEY(0x0B, 0x05, KEY_DOT)
				MATRIX_KEY(0x0C, 0x00, KEY_F10)
				MATRIX_KEY(0x0C, 0x01, KEY_F9)
				MATRIX_KEY(0x0C, 0x02, KEY_BACKSPACE)
				MATRIX_KEY(0x0C, 0x03, KEY_3)
				MATRIX_KEY(0x0C, 0x04, KEY_2)
				MATRIX_KEY(0x0C, 0x05, KEY_UP)
				MATRIX_KEY(0x0C, 0x06, KEY_PRINT)
				MATRIX_KEY(0x0C, 0x07, KEY_PAUSE)
				MATRIX_KEY(0x0D, 0x00, KEY_INSERT)
				MATRIX_KEY(0x0D, 0x01, KEY_DELETE)
				MATRIX_KEY(0x0D, 0x03, KEY_PAGEUP )
				MATRIX_KEY(0x0D, 0x04, KEY_PAGEDOWN)
				MATRIX_KEY(0x0D, 0x05, KEY_RIGHT)
				MATRIX_KEY(0x0D, 0x06, KEY_DOWN)
				MATRIX_KEY(0x0D, 0x07, KEY_LEFT)
				MATRIX_KEY(0x0E, 0x00, KEY_F11)
				MATRIX_KEY(0x0E, 0x01, KEY_F12)
				MATRIX_KEY(0x0E, 0x02, KEY_F8)
				MATRIX_KEY(0x0E, 0x03, KEY_Q)
				MATRIX_KEY(0x0E, 0x04, KEY_F4)
				MATRIX_KEY(0x0E, 0x05, KEY_F3)
				MATRIX_KEY(0x0E, 0x06, KEY_1)
				MATRIX_KEY(0x0E, 0x07, KEY_F7)
				MATRIX_KEY(0x0F, 0x00, KEY_ESC)
				MATRIX_KEY(0x0F, 0x01, KEY_GRAVE)
				MATRIX_KEY(0x0F, 0x02, KEY_F5)
				MATRIX_KEY(0x0F, 0x03, KEY_TAB)
				MATRIX_KEY(0x0F, 0x04, KEY_F1)
				MATRIX_KEY(0x0F, 0x05, KEY_F2)
				MATRIX_KEY(0x0F, 0x06, KEY_CAPSLOCK)
				MATRIX_KEY(0x0F, 0x07, KEY_F6)
				MATRIX_KEY(0x14, 0x00, KEY_KP7)
				MATRIX_KEY(0x15, 0x00, KEY_KP9)
				MATRIX_KEY(0x15, 0x01, KEY_KP8)
				MATRIX_KEY(0x15, 0x02, KEY_KP4)
				MATRIX_KEY(0x15, 0x04, KEY_KP1)
				MATRIX_KEY(0x16, 0x01, KEY_KPSLASH)
				MATRIX_KEY(0x16, 0x02, KEY_KP6)
				MATRIX_KEY(0x16, 0x03, KEY_KP5)
				MATRIX_KEY(0x16, 0x04, KEY_KP3)
				MATRIX_KEY(0x16, 0x05, KEY_KP2)
				MATRIX_KEY(0x16, 0x07, KEY_KP0)
				MATRIX_KEY(0x1B, 0x01, KEY_KPASTERISK)
				MATRIX_KEY(0x1B, 0x03, KEY_KPMINUS)
				MATRIX_KEY(0x1B, 0x04, KEY_KPPLUS)
				MATRIX_KEY(0x1B, 0x05, KEY_KPDOT)
				MATRIX_KEY(0x1C, 0x05, KEY_VOLUMEUP)
				MATRIX_KEY(0x1D, 0x03, KEY_HOME)
				MATRIX_KEY(0x1D, 0x04, KEY_END)
				MATRIX_KEY(0x1D, 0x05, KEY_BRIGHTNESSUP)
				MATRIX_KEY(0x1D, 0x06, KEY_VOLUMEDOWN)
				MATRIX_KEY(0x1D, 0x07, KEY_BRIGHTNESSDOWN)
				MATRIX_KEY(0x1E, 0x00, KEY_NUMLOCK)
				MATRIX_KEY(0x1E, 0x01, KEY_SCROLLLOCK)
				MATRIX_KEY(0x1E, 0x02, KEY_MUTE)
				MATRIX_KEY(0x1F, 0x04, KEY_QUESTION)>;
	};

	pmc@7000e400 {
		nvidia,invert-interrupt;
		nvidia,suspend-mode = <1>;
		nvidia,cpu-pwr-good-time = <5000>;
		nvidia,cpu-pwr-off-time = <5000>;
		nvidia,core-pwr-good-time = <3845 3845>;
		nvidia,core-pwr-off-time = <3875>;
		nvidia,sys-clock-req-active-high;
		core-supply = <&vdd_core>;
	};

	pcie@80003000 {
		status = "okay";

		avdd-pex-supply = <&pci_vdd_reg>;
		vdd-pex-supply = <&pci_vdd_reg>;
		avdd-pex-pll-supply = <&pci_vdd_reg>;
		avdd-plle-supply = <&pci_vdd_reg>;
		vddio-pex-clk-supply = <&pci_clk_reg>;

		pci@1,0 {
			status = "okay";
		};

		pci@2,0 {
			status = "okay";
		};
	};

	usb@c5000000 {
		status = "okay";
	};

	usb-phy@c5000000 {
		status = "okay";
	};

	usb@c5004000 {
		status = "okay";
	};

	usb-phy@c5004000 {
		status = "okay";
		nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1)
			GPIO_ACTIVE_LOW>;
	};

	usb@c5008000 {
		status = "okay";
	};

	usb-phy@c5008000 {
		status = "okay";
	};

	mmc@c8000200 {
		status = "okay";
		cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
		wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
		power-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>;
		bus-width = <4>;
	};

	mmc@c8000600 {
		status = "okay";
		cd-gpios = <&gpio TEGRA_GPIO(H, 2) GPIO_ACTIVE_LOW>;
		wp-gpios = <&gpio TEGRA_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
		power-gpios = <&gpio TEGRA_GPIO(I, 6) GPIO_ACTIVE_HIGH>;
		bus-width = <8>;
	};

	backlight: backlight {
		compatible = "pwm-backlight";

		enable-gpios = <&gpio TEGRA_GPIO(B, 5) GPIO_ACTIVE_HIGH>;
		power-supply = <&vdd_bl_reg>;
		pwms = <&pwm 0 5000000>;

		brightness-levels = <0 4 8 16 32 64 128 255>;
		default-brightness-level = <6>;
	};

	clk32k_in: clock-32k {
		compatible = "fixed-clock";
		clock-frequency = <32768>;
		#clock-cells = <0>;
	};

	gpio-keys {
		compatible = "gpio-keys";

		key-power {
			label = "Power";
			gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			wakeup-source;
		};
	};

	panel: panel {
		compatible = "auo,b101aw03";

		power-supply = <&vdd_pnl_reg>;
		enable-gpios = <&gpio TEGRA_GPIO(B, 2) GPIO_ACTIVE_HIGH>;

		backlight = <&backlight>;
	};

	vdd_5v0_reg: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_5v0";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	regulator-1v5 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_1v5";
		regulator-min-microvolt = <1500000>;
		regulator-max-microvolt = <1500000>;
		gpio = <&pmic 0 GPIO_ACTIVE_HIGH>;
	};

	regulator-1v2 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_1v2";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		gpio = <&pmic 1 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	pci_vdd_reg: regulator-1v05 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_1v05";
		regulator-min-microvolt = <1050000>;
		regulator-max-microvolt = <1050000>;
		gpio = <&pmic 2 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	vdd_pnl_reg: regulator-pn1 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_pnl";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		gpio = <&gpio TEGRA_GPIO(C, 6) GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	vdd_bl_reg: regulator-bl {
		compatible = "regulator-fixed";
		regulator-name = "vdd_bl";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		gpio = <&gpio TEGRA_GPIO(W, 0) GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	vdd_5v0_hdmi: regulator-hdmi {
		compatible = "regulator-fixed";
		regulator-name = "VDDIO_HDMI";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio TEGRA_GPIO(T, 2) GPIO_ACTIVE_HIGH>;
		enable-active-high;
		vin-supply = <&vdd_5v0_reg>;
	};

	sound {
		compatible = "nvidia,tegra-audio-wm8903-harmony",
			     "nvidia,tegra-audio-wm8903";
		nvidia,model = "NVIDIA Tegra Harmony";

		nvidia,audio-routing =
			"Headphone Jack", "HPOUTR",
			"Headphone Jack", "HPOUTL",
			"Int Spk", "ROP",
			"Int Spk", "RON",
			"Int Spk", "LOP",
			"Int Spk", "LON",
			"Mic Jack", "MICBIAS",
			"IN1L", "Mic Jack";

		nvidia,i2s-controller = <&tegra_i2s1>;
		nvidia,audio-codec = <&wm8903>;

		nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2)
			GPIO_ACTIVE_LOW>;
		nvidia,int-mic-en-gpios = <&gpio TEGRA_GPIO(X, 0)
			GPIO_ACTIVE_HIGH>;
		nvidia,ext-mic-en-gpios = <&gpio TEGRA_GPIO(X, 1)
			GPIO_ACTIVE_HIGH>;

		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
			 <&tegra_car TEGRA20_CLK_CDEV1>;
		clock-names = "pll_a", "pll_a_out0", "mclk";
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "tegra20-tamonten.dtsi"

/ {
	model = "Avionic Design Medcom-Wide board";
	compatible = "ad,medcom-wide", "ad,tamonten", "nvidia,tegra20";

	aliases {
		serial0 = &uartd;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	pwm@7000a000 {
		status = "okay";
	};

	host1x@50000000 {
		dc@54200000 {
			rgb {
				status = "okay";
				nvidia,panel = <&panel>;
			};
		};
	};

	i2c@7000c000 {
		wm8903: wm8903@1a {
			compatible = "wlf,wm8903";
			reg = <0x1a>;
			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(X, 3) IRQ_TYPE_LEVEL_HIGH>;

			gpio-controller;
			#gpio-cells = <2>;

			micdet-cfg = <0>;
			micdet-delay = <100>;
			gpio-cfg = <0xffffffff
				    0xffffffff
				    0
				    0xffffffff
				    0xffffffff>;
		};
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		pwms = <&pwm 0 5000000>;

		brightness-levels = <0 4 8 16 32 64 128 255>;
		default-brightness-level = <6>;

		/* close enough */
		power-supply = <&vdd_3v3_reg>;
	};

	panel: panel {
		compatible = "innolux,n156bge-l21";

		power-supply =  <&vdd_1v8_reg>; // <&vdd_3v3_reg>;
		enable-gpios = <&gpio TEGRA_GPIO(B, 2) GPIO_ACTIVE_HIGH>;

		backlight = <&backlight>;
	};

	sound {
		compatible = "ad,tegra-audio-wm8903-medcom-wide",
			     "nvidia,tegra-audio-wm8903";
		nvidia,model = "Avionic Design Medcom-Wide";

		nvidia,audio-routing =
			"Headphone Jack", "HPOUTR",
			"Headphone Jack", "HPOUTL",
			"Int Spk", "ROP",
			"Int Spk", "RON",
			"Int Spk", "LOP",
			"Int Spk", "LON",
			"Mic Jack", "MICBIAS",
			"IN1L", "Mic Jack";

		nvidia,i2s-controller = <&tegra_i2s1>;
		nvidia,audio-codec = <&wm8903>;

		nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;

		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
			 <&tegra_car TEGRA20_CLK_CDEV1>;
		clock-names = "pll_a", "pll_a_out0", "mclk";
	};

	vcc_24v_reg: regulator-24v0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc_24v";
		regulator-min-microvolt = <24000000>;
		regulator-max-microvolt = <24000000>;
		regulator-always-on;
	};

	vdd_5v0_reg: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_5v0";
		vin-supply = <&vcc_24v_reg>;
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	vdd_3v3_reg: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_3v3";
		vin-supply = <&vcc_24v_reg>;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	vdd_1v8_reg: regulator-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_1v8";
		vin-supply = <&vdd_3v3_reg>;
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/thermal/thermal.h>

#include "tegra20.dtsi"
#include "tegra20-cpu-opp.dtsi"
#include "tegra20-cpu-opp-microvolt.dtsi"

/ {
	model = "Toshiba AC100 / Dynabook AZ";
	compatible = "compal,paz00", "nvidia,tegra20";

	aliases {
		mmc0 = &sdmmc4; /* eMMC */
		mmc1 = &sdmmc1; /* MicroSD */
		rtc0 = "/i2c@7000d000/tps6586x@34";
		rtc1 = "/rtc@7000e000";
		serial0 = &uarta;
		serial1 = &uartc;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory@0 {
		reg = <0x00000000 0x20000000>;
	};

	host1x@50000000 {
		dc@54200000 {
			rgb {
				status = "okay";

				nvidia,panel = <&panel>;
			};
		};

		hdmi@54280000 {
			status = "okay";

			vdd-supply = <&hdmi_vdd_reg>;
			pll-supply = <&hdmi_pll_reg>;

			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
				GPIO_ACTIVE_HIGH>;
		};
	};

	pinmux@70000014 {
		pinctrl-names = "default";
		pinctrl-0 = <&state_default>;

		state_default: pinmux {
			ata {
				nvidia,pins = "ata", "atc", "atd", "ate",
					"dap2", "gmb", "gmc", "gmd", "spia",
					"spib", "spic", "spid", "spie";
				nvidia,function = "gmi";
			};
			atb {
				nvidia,pins = "atb", "gma", "gme";
				nvidia,function = "sdio4";
			};
			cdev1 {
				nvidia,pins = "cdev1";
				nvidia,function = "plla_out";
			};
			cdev2 {
				nvidia,pins = "cdev2";
				nvidia,function = "pllp_out4";
			};
			crtp {
				nvidia,pins = "crtp";
				nvidia,function = "crt";
			};
			csus {
				nvidia,pins = "csus";
				nvidia,function = "pllc_out1";
			};
			dap1 {
				nvidia,pins = "dap1";
				nvidia,function = "dap1";
			};
			dap3 {
				nvidia,pins = "dap3";
				nvidia,function = "dap3";
			};
			dap4 {
				nvidia,pins = "dap4";
				nvidia,function = "dap4";
			};
			ddc {
				nvidia,pins = "ddc";
				nvidia,function = "i2c2";
			};
			dta {
				nvidia,pins = "dta", "dtb", "dtc", "dtd", "dte";
				nvidia,function = "rsvd1";
			};
			dtf {
				nvidia,pins = "dtf";
				nvidia,function = "i2c3";
			};
			gpu {
				nvidia,pins = "gpu", "sdb", "sdd";
				nvidia,function = "pwm";
			};
			gpu7 {
				nvidia,pins = "gpu7";
				nvidia,function = "rtck";
			};
			gpv {
				nvidia,pins = "gpv", "slxa", "slxk";
				nvidia,function = "pcie";
			};
			hdint {
				nvidia,pins = "hdint", "pta";
				nvidia,function = "hdmi";
			};
			i2cp {
				nvidia,pins = "i2cp";
				nvidia,function = "i2cp";
			};
			irrx {
				nvidia,pins = "irrx", "irtx";
				nvidia,function = "uarta";
			};
			kbca {
				nvidia,pins = "kbca", "kbcc", "kbce", "kbcf";
				nvidia,function = "kbc";
			};
			kbcb {
				nvidia,pins = "kbcb", "kbcd";
				nvidia,function = "sdio2";
			};
			lcsn {
				nvidia,pins = "lcsn", "ld0", "ld1", "ld2",
					"ld3", "ld4", "ld5", "ld6", "ld7",
					"ld8", "ld9", "ld10", "ld11", "ld12",
					"ld13", "ld14", "ld15", "ld16", "ld17",
					"ldc", "ldi", "lhp0", "lhp1", "lhp2",
					"lhs", "lm0", "lm1", "lpp", "lpw0",
					"lpw1", "lpw2", "lsc0", "lsc1", "lsck",
					"lsda", "lsdi", "lspi", "lvp0", "lvp1",
					"lvs";
				nvidia,function = "displaya";
			};
			owc {
				nvidia,pins = "owc";
				nvidia,function = "owr";
			};
			pmc {
				nvidia,pins = "pmc";
				nvidia,function = "pwr_on";
			};
			rm {
				nvidia,pins = "rm";
				nvidia,function = "i2c1";
			};
			sdc {
				nvidia,pins = "sdc";
				nvidia,function = "twc";
			};
			sdio1 {
				nvidia,pins = "sdio1";
				nvidia,function = "sdio1";
			};
			slxc {
				nvidia,pins = "slxc", "slxd";
				nvidia,function = "spi4";
			};
			spdi {
				nvidia,pins = "spdi", "spdo";
				nvidia,function = "rsvd2";
			};
			spif {
				nvidia,pins = "spif", "uac";
				nvidia,function = "rsvd4";
			};
			spig {
				nvidia,pins = "spig", "spih";
				nvidia,function = "spi2_alt";
			};
			uaa {
				nvidia,pins = "uaa", "uab", "uda";
				nvidia,function = "ulpi";
			};
			uad {
				nvidia,pins = "uad";
				nvidia,function = "spdif";
			};
			uca {
				nvidia,pins = "uca", "ucb";
				nvidia,function = "uartc";
			};
			conf_ata {
				nvidia,pins = "ata", "atb", "atc", "atd", "ate",
					"cdev1", "cdev2", "dap1", "dap2", "dtf",
					"gma", "gmb", "gmc", "gmd", "gme",
					"gpu", "gpu7", "gpv", "i2cp", "pta",
					"rm", "sdio1", "slxk", "spdo", "uac",
					"uda";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			conf_ck32 {
				nvidia,pins = "ck32", "ddrc", "pmca", "pmcb",
					"pmcc", "pmcd", "pmce", "xm2c", "xm2d";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
			};
			conf_crtp {
				nvidia,pins = "crtp", "dap3", "dap4", "dtb",
					"dtc", "dte", "slxa", "slxc", "slxd",
					"spdi";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_csus {
				nvidia,pins = "csus", "spia", "spib", "spid",
					"spif";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_ddc {
				nvidia,pins = "ddc", "irrx", "irtx", "kbca",
					"kbcb", "kbcc", "kbcd", "kbce", "kbcf",
					"spic", "spig", "uaa", "uab";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			conf_dta {
				nvidia,pins = "dta", "dtd", "owc", "sdc", "sdd",
					"spie", "spih", "uad", "uca", "ucb";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_hdint {
				nvidia,pins = "hdint", "ld0", "ld1", "ld2",
					"ld3", "ld4", "ld5", "ld6", "ld7",
					"ld8", "ld9", "ld10", "ld11", "ld12",
					"ld13", "ld14", "ld15", "ld16", "ld17",
					"ldc", "ldi", "lhs", "lsc0", "lspi",
					"lvs", "pmc";
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
			};
			conf_lc {
				nvidia,pins = "lc", "ls";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
			};
			conf_lcsn {
				nvidia,pins = "lcsn", "lhp0", "lhp1", "lhp2",
					"lm0", "lm1", "lpp", "lpw0", "lpw1",
					"lpw2", "lsc1", "lsck", "lsda", "lsdi",
					"lvp0", "lvp1", "sdb";
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
			};
			conf_ld17_0 {
				nvidia,pins = "ld17_0", "ld19_18", "ld21_20",
					"ld23_22";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
			};
		};
	};

	spdif@70002400 {
		status = "okay";

		nvidia,fixed-parent-rate;
	};

	i2s@70002800 {
		status = "okay";

		nvidia,fixed-parent-rate;
	};

	serial@70006000 {
		status = "okay";
	};

	serial@70006200 {
		status = "okay";
	};

	pwm: pwm@7000a000 {
		status = "okay";
	};

	lvds_ddc: i2c@7000c000 {
		status = "okay";
		clock-frequency = <400000>;

		alc5632: alc5632@1e {
			compatible = "realtek,alc5632";
			reg = <0x1e>;
			gpio-controller;
			#gpio-cells = <2>;
		};
	};

	hdmi_ddc: i2c@7000c400 {
		status = "okay";
		clock-frequency = <100000>;
	};

	nvec@7000c500 {
		compatible = "nvidia,nvec";
		reg = <0x7000c500 0x100>;
		interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
		#address-cells = <1>;
		#size-cells = <0>;
		clock-frequency = <80000>;
		request-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
		slave-addr = <138>;
		clocks = <&tegra_car TEGRA20_CLK_I2C3>,
			 <&tegra_car TEGRA20_CLK_PLL_P_OUT3>;
		clock-names = "div-clk", "fast-clk";
		resets = <&tegra_car 67>;
		reset-names = "i2c";
	};

	memory-controller@7000f400 {
		nvidia,use-ram-code;

		emc-tables@0 {
			nvidia,ram-code = <0x0>;
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;

			emc-table@166500 {
				reg = <166500>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <166500>;
				nvidia,emc-registers = <0x0000000a 0x00000016
					0x00000008 0x00000003 0x00000004 0x00000004
					0x00000002 0x0000000c 0x00000003 0x00000003
					0x00000002 0x00000001 0x00000004 0x00000005
					0x00000004 0x00000009 0x0000000d 0x000004df
					0x00000000 0x00000003 0x00000003 0x00000003
					0x00000003 0x00000001 0x0000000a 0x000000c8
					0x00000003 0x00000006 0x00000004 0x00000008
					0x00000002 0x00000000 0x00000000 0x00000002
					0x00000000 0x00000000 0x00000083 0xe03b0323
					0x007fe010 0x00001414 0x00000000 0x00000000
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};

			emc-table@333000 {
				reg = <333000>;
				compatible = "nvidia,tegra20-emc-table";
				clock-frequency = <333000>;
				nvidia,emc-registers = <0x00000018 0x00000033
					0x00000012 0x00000004 0x00000004 0x00000005
					0x00000003 0x0000000c 0x00000006 0x00000006
					0x00000003 0x00000001 0x00000004 0x00000005
					0x00000004 0x00000009 0x0000000d 0x00000bff
					0x00000000 0x00000003 0x00000003 0x00000006
					0x00000006 0x00000001 0x00000011 0x000000c8
					0x00000003 0x0000000e 0x00000007 0x00000008
					0x00000002 0x00000000 0x00000000 0x00000002
					0x00000000 0x00000000 0x00000083 0xf0440303
					0x007fe010 0x00001414 0x00000000 0x00000000
					0x00000000 0x00000000 0x00000000 0x00000000>;
			};
		};
	};

	i2c@7000d000 {
		status = "okay";
		clock-frequency = <400000>;

		pmic: tps6586x@34 {
			compatible = "ti,tps6586x";
			reg = <0x34>;
			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;

			#gpio-cells = <2>;
			gpio-controller;

			sys-supply = <&p5valw_reg>;
			vin-sm0-supply = <&sys_reg>;
			vin-sm1-supply = <&sys_reg>;
			vin-sm2-supply = <&sys_reg>;
			vinldo01-supply = <&sm2_reg>;
			vinldo23-supply = <&sm2_reg>;
			vinldo4-supply = <&sm2_reg>;
			vinldo678-supply = <&sm2_reg>;
			vinldo9-supply = <&sm2_reg>;

			regulators {
				sys_reg: sys {
					regulator-name = "vdd_sys";
					regulator-always-on;
				};

				core_vdd_reg: sm0 {
					regulator-name = "+1.2vs_sm0,vdd_core";
					regulator-min-microvolt = <950000>;
					regulator-max-microvolt = <1300000>;
					regulator-coupled-with = <&rtc_vdd_reg &cpu_vdd_reg>;
					regulator-coupled-max-spread = <170000 550000>;
					regulator-always-on;

					nvidia,tegra-core-regulator;
				};

				cpu_vdd_reg: sm1 {
					regulator-name = "+1.0vs_sm1,vdd_cpu";
					regulator-min-microvolt = <750000>;
					regulator-max-microvolt = <1100000>;
					regulator-coupled-with = <&core_vdd_reg &rtc_vdd_reg>;
					regulator-coupled-max-spread = <550000 550000>;
					regulator-always-on;

					nvidia,tegra-cpu-regulator;
				};

				sm2_reg: sm2 {
					regulator-name = "+3.7vs_sm2,vin_ldo*";
					regulator-min-microvolt = <3700000>;
					regulator-max-microvolt = <3700000>;
					regulator-always-on;
				};

				/* LDO0 is not connected to anything */

				ldo1 {
					regulator-name = "+1.1vs_ldo1,avdd_pll*";
					regulator-min-microvolt = <1100000>;
					regulator-max-microvolt = <1100000>;
					regulator-always-on;
				};

				rtc_vdd_reg: ldo2 {
					regulator-name = "+1.2vs_ldo2,vdd_rtc";
					regulator-min-microvolt = <950000>;
					regulator-max-microvolt = <1300000>;
					regulator-coupled-with = <&core_vdd_reg &cpu_vdd_reg>;
					regulator-coupled-max-spread = <170000 550000>;
					regulator-always-on;

					nvidia,tegra-rtc-regulator;
				};

				ldo3 {
					regulator-name = "+3.3vs_ldo3,avdd_usb*";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};

				ldo4 {
					regulator-name = "+1.8vs_ldo4,avdd_osc,vddio_sys";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
				};

				ldo5 {
					regulator-name = "+2.85vs_ldo5,vcore_mmc";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo6 {
					/*
					 * Research indicates this should be
					 * 1.8v; other boards that use this
					 * rail for the same purpose need it
					 * set to 1.8v. The schematic signal
					 * name is incorrect; perhaps copied
					 * from an incorrect NVIDIA reference.
					 */
					regulator-name = "+2.85vs_ldo6,avdd_vdac";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				hdmi_vdd_reg: ldo7 {
					regulator-name = "+3.3vs_ldo7,avdd_hdmi";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
				};

				hdmi_pll_reg: ldo8 {
					regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
				};

				ldo9 {
					regulator-name = "+2.85vs_ldo9,vdd_ddr_rx";
					regulator-min-microvolt = <2850000>;
					regulator-max-microvolt = <2850000>;
					regulator-always-on;
				};

				ldo_rtc {
					regulator-name = "+3.3vs_rtc";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
				};
			};
		};

		adt7461: temperature-sensor@4c {
			compatible = "adi,adt7461";
			reg = <0x4c>;

			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(N, 6) IRQ_TYPE_EDGE_FALLING>;

			#thermal-sensor-cells = <1>;
		};
	};

	pmc@7000e400 {
		nvidia,invert-interrupt;
		nvidia,suspend-mode = <1>;
		nvidia,cpu-pwr-good-time = <2000>;
		nvidia,cpu-pwr-off-time = <0>;
		nvidia,core-pwr-good-time = <3845 3845>;
		nvidia,core-pwr-off-time = <0>;
		nvidia,sys-clock-req-active-high;
		core-supply = <&core_vdd_reg>;
	};

	usb@c5000000 {
		compatible = "nvidia,tegra20-udc";
		status = "okay";
		dr_mode = "peripheral";
	};

	usb-phy@c5000000 {
		status = "okay";
	};

	usb@c5004000 {
		status = "okay";
	};

	usb-phy@c5004000 {
		status = "okay";
		nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 0)
			GPIO_ACTIVE_LOW>;
	};

	usb@c5008000 {
		status = "okay";
	};

	usb-phy@c5008000 {
		status = "okay";
	};

	sdmmc1: mmc@c8000000 {
		status = "okay";
		cd-gpios = <&gpio TEGRA_GPIO(V, 5) GPIO_ACTIVE_LOW>;
		wp-gpios = <&gpio TEGRA_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
		power-gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_HIGH>;
		bus-width = <4>;
	};

	sdmmc4: mmc@c8000600 {
		status = "okay";
		bus-width = <8>;
		non-removable;
	};

	backlight: backlight {
		compatible = "pwm-backlight";

		enable-gpios = <&gpio TEGRA_GPIO(U, 4) GPIO_ACTIVE_HIGH>;
		pwms = <&pwm 0 5000000>;

		brightness-levels = <0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 255>;
		default-brightness-level = <10>;

		/* close enough */
		power-supply = <&vdd_pnl_reg>;
	};

	clk32k_in: clock-32k {
		compatible = "fixed-clock";
		clock-frequency = <32768>;
		#clock-cells = <0>;
	};

	gpio-keys {
		compatible = "gpio-keys";

		key-wakeup {
			label = "Wakeup";
			gpios = <&gpio TEGRA_GPIO(J, 7) GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WAKEUP>;
			wakeup-source;
		};
	};

	gpio-leds {
		compatible = "gpio-leds";

		led-0 {
			label = "wifi-led";
			gpios = <&gpio TEGRA_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "rfkill0";
		};
	};

	panel: panel {
		compatible = "samsung,ltn101nt05";

		ddc-i2c-bus = <&lvds_ddc>;
		power-supply = <&vdd_pnl_reg>;
		enable-gpios = <&gpio TEGRA_GPIO(M, 6) GPIO_ACTIVE_HIGH>;

		backlight = <&backlight>;
	};

	p5valw_reg: regulator-5v0alw {
		compatible = "regulator-fixed";
		regulator-name = "+5valw";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	vdd_pnl_reg: regulator-3v0 {
		compatible = "regulator-fixed";
		regulator-name = "+3VS,vdd_pnl";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-boot-on;
		gpio = <&gpio TEGRA_GPIO(A, 4) GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	sound {
		compatible = "nvidia,tegra-audio-alc5632-paz00",
			"nvidia,tegra-audio-alc5632";

		nvidia,model = "Compal PAZ00";

		nvidia,audio-routing =
			"Int Spk", "SPKOUT",
			"Int Spk", "SPKOUTN",
			"Headset Mic", "MICBIAS1",
			"MIC1", "Headset Mic",
			"Headset Stereophone", "HPR",
			"Headset Stereophone", "HPL",
			"DMICDAT", "Digital Mic";

		nvidia,audio-codec = <&alc5632>;
		nvidia,i2s-controller = <&tegra_i2s1>;
		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2)
			GPIO_ACTIVE_HIGH>;

		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
			 <&tegra_car TEGRA20_CLK_CDEV1>;
		clock-names = "pll_a", "pll_a_out0", "mclk";
	};

	cpus {
		cpu0: cpu@0 {
			cpu-supply = <&cpu_vdd_reg>;
			operating-points-v2 = <&cpu0_opp_table>;
			#cooling-cells = <2>;
		};

		cpu1: cpu@1 {
			cpu-supply = <&cpu_vdd_reg>;
			operating-points-v2 = <&cpu0_opp_table>;
			#cooling-cells = <2>;
		};
	};

	thermal-zones {
		cpu-thermal {
			polling-delay-passive = <500>; /* milliseconds */
			polling-delay = <1500>; /* milliseconds */

			thermal-sensors = <&adt7461 1>;

			trips {
				trip0: cpu-alert0 {
					/* start throttling at 80C */
					temperature = <80000>;
					hysteresis = <200>;
					type = "passive";
				};

				trip1: cpu-crit {
					/* shut down at 85C */
					temperature = <85000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&trip0>;
					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};
	};
};

&emc_icc_dvfs_opp_table {
	/delete-node/ opp-760000000;
};


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "tegra20-tamonten.dtsi"

/ {
	model = "Avionic Design Plutux board";
	compatible = "ad,plutux", "ad,tamonten", "nvidia,tegra20";

	host1x@50000000 {
		hdmi@54280000 {
			status = "okay";
		};
	};

	i2c@7000c000 {
		wm8903: wm8903@1a {
			compatible = "wlf,wm8903";
			reg = <0x1a>;
			interrupt-parent = <&gpio>;
			interrupts = <TEGRA_GPIO(X, 3) IRQ_TYPE_LEVEL_HIGH>;

			gpio-controller;
			#gpio-cells = <2>;

			micdet-cfg = <0>;
			micdet-delay = <100>;
			gpio-cfg = <0xffffffff
				    0xffffffff
				    0
				    0xffffffff
				    0xffffffff>;
		};
	};

	sound {
		compatible = "ad,tegra-audio-plutux",
			     "nvidia,tegra-audio-wm8903";
		nvidia,model = "Avionic Design Plutux";

		nvidia,audio-routing =
			"Headphone Jack", "HPOUTR",
			"Headphone Jack", "HPOUTL",
			"Int Spk", "ROP",
			"Int Spk", "RON",
			"Int Spk", "LOP",
			"Int Spk", "LON",
			"Mic Jack", "MICBIAS",
			"IN1L", "Mic Jack";

		nvidia,i2s-controller = <&tegra_i2s1>;
		nvidia,audio-codec = <&wm8903>;

		nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>;
		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;

		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
			 <&tegra_car TEGRA20_CLK_CDEV1>;
		clock-names = "pll_a", "pll_a_out0", "mclk";
	};

	vcc_24v_reg: regulator-24v0 {
		compatible = "regulator-fixed";
		regulator-name = "vcc_24v";
		regulator-min-microvolt = <24000000>;
		regulator-max-microvolt = <24000000>;
		regulator-always-on;
	};

	vdd_5v0_reg: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_5v0";
		vin-supply = <&vcc_24v_reg>;
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	vdd_3v3_reg: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_3v3";
		vin-supply = <&vcc_24v_reg>;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	vdd_1v8_reg: regulator-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "vdd_1v8";
		vin-supply = <&vdd_3v3_reg>;
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
	};
};