1248da168SKshitiz Godara// SPDX-License-Identifier: BSD-3-Clause
2248da168SKshitiz Godara/*
3248da168SKshitiz Godara * sc7280 EC/H1 over SPI (common between IDP2 and CRD)
4248da168SKshitiz Godara *
5248da168SKshitiz Godara * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
6248da168SKshitiz Godara */
7248da168SKshitiz Godara
8248da168SKshitiz Godaraap_ec_spi: &spi10 {
9248da168SKshitiz Godara	status = "okay";
10248da168SKshitiz Godara
11248da168SKshitiz Godara	pinctrl-0 = <&qup_spi10_data_clk>, <&qup_spi10_cs_gpio_init_high>, <&qup_spi10_cs_gpio>;
12248da168SKshitiz Godara	cs-gpios = <&tlmm 43 GPIO_ACTIVE_LOW>;
13248da168SKshitiz Godara
14248da168SKshitiz Godara	cros_ec: ec@0 {
15248da168SKshitiz Godara		compatible = "google,cros-ec-spi";
16248da168SKshitiz Godara		reg = <0>;
17248da168SKshitiz Godara		interrupt-parent = <&tlmm>;
18248da168SKshitiz Godara		interrupts = <18 IRQ_TYPE_LEVEL_LOW>;
19248da168SKshitiz Godara		pinctrl-names = "default";
20248da168SKshitiz Godara		pinctrl-0 = <&ap_ec_int_l>;
21248da168SKshitiz Godara		spi-max-frequency = <3000000>;
22248da168SKshitiz Godara
231e49defbSKrzysztof Kozlowski		cros_ec_pwm: pwm {
24248da168SKshitiz Godara			compatible = "google,cros-ec-pwm";
25248da168SKshitiz Godara			#pwm-cells = <1>;
26248da168SKshitiz Godara		};
27248da168SKshitiz Godara
28248da168SKshitiz Godara		i2c_tunnel: i2c-tunnel {
29248da168SKshitiz Godara			compatible = "google,cros-ec-i2c-tunnel";
30248da168SKshitiz Godara			google,remote-bus = <0>;
31248da168SKshitiz Godara			#address-cells = <1>;
32248da168SKshitiz Godara			#size-cells = <0>;
33248da168SKshitiz Godara		};
34248da168SKshitiz Godara
35248da168SKshitiz Godara		typec {
36248da168SKshitiz Godara			compatible = "google,cros-ec-typec";
37248da168SKshitiz Godara			#address-cells = <1>;
38248da168SKshitiz Godara			#size-cells = <0>;
39248da168SKshitiz Godara
40248da168SKshitiz Godara			usb_c0: connector@0 {
41248da168SKshitiz Godara				compatible = "usb-c-connector";
42248da168SKshitiz Godara				reg = <0>;
43248da168SKshitiz Godara				label = "left";
44248da168SKshitiz Godara				power-role = "dual";
45248da168SKshitiz Godara				data-role = "host";
46248da168SKshitiz Godara				try-power-role = "source";
47248da168SKshitiz Godara			};
48248da168SKshitiz Godara
49248da168SKshitiz Godara			usb_c1: connector@1 {
50248da168SKshitiz Godara				compatible = "usb-c-connector";
51248da168SKshitiz Godara				reg = <1>;
52248da168SKshitiz Godara				label = "right";
53248da168SKshitiz Godara				power-role = "dual";
54248da168SKshitiz Godara				data-role = "host";
55248da168SKshitiz Godara				try-power-role = "source";
56248da168SKshitiz Godara			};
57248da168SKshitiz Godara		};
58248da168SKshitiz Godara	};
59248da168SKshitiz Godara};
60248da168SKshitiz Godara
61248da168SKshitiz Godara#include <arm/cros-ec-keyboard.dtsi>
62248da168SKshitiz Godara#include <arm/cros-ec-sbs.dtsi>
63248da168SKshitiz Godara
64248da168SKshitiz Godaraap_h1_spi: &spi14 {
65248da168SKshitiz Godara	status = "okay";
66248da168SKshitiz Godara
67248da168SKshitiz Godara	pinctrl-0 = <&qup_spi14_data_clk>, <&qup_spi14_cs_gpio_init_high>, <&qup_spi14_cs_gpio>;
68248da168SKshitiz Godara	cs-gpios = <&tlmm 59 GPIO_ACTIVE_LOW>;
69248da168SKshitiz Godara
70248da168SKshitiz Godara	cr50: tpm@0 {
71248da168SKshitiz Godara		compatible = "google,cr50";
72248da168SKshitiz Godara		reg = <0>;
73248da168SKshitiz Godara		pinctrl-names = "default";
74248da168SKshitiz Godara		pinctrl-0 = <&h1_ap_int_odl>;
75248da168SKshitiz Godara		spi-max-frequency = <800000>;
76248da168SKshitiz Godara		interrupt-parent = <&tlmm>;
77248da168SKshitiz Godara		interrupts = <104 IRQ_TYPE_EDGE_RISING>;
78248da168SKshitiz Godara	};
79248da168SKshitiz Godara};
80248da168SKshitiz Godara
81248da168SKshitiz Godara&tlmm {
82ec0872a6SKrzysztof Kozlowski	ap_ec_int_l: ap-ec-int-l-state {
83248da168SKshitiz Godara		pins = "gpio18";
84248da168SKshitiz Godara		function = "gpio";
85248da168SKshitiz Godara		bias-pull-up;
86248da168SKshitiz Godara	};
87248da168SKshitiz Godara
88ec0872a6SKrzysztof Kozlowski	h1_ap_int_odl: h1-ap-int-odl-state {
89248da168SKshitiz Godara		pins = "gpio104";
90248da168SKshitiz Godara		function = "gpio";
91248da168SKshitiz Godara		bias-pull-up;
92248da168SKshitiz Godara	};
93248da168SKshitiz Godara
94ec0872a6SKrzysztof Kozlowski	qup_spi10_cs_gpio_init_high: qup-spi10-cs-gpio-init-high-state {
95248da168SKshitiz Godara		pins = "gpio43";
96*d0ca0de6SKrzysztof Kozlowski		function = "gpio";
97248da168SKshitiz Godara		output-high;
98248da168SKshitiz Godara	};
99248da168SKshitiz Godara
100ec0872a6SKrzysztof Kozlowski	qup_spi14_cs_gpio_init_high: qup-spi14-cs-gpio-init-high-state {
101248da168SKshitiz Godara		pins = "gpio59";
102*d0ca0de6SKrzysztof Kozlowski		function = "gpio";
103248da168SKshitiz Godara		output-high;
104248da168SKshitiz Godara	};
105248da168SKshitiz Godara};
106