blob: 5e188fc444a6b3fa1231319fca6b9d5a6a32ce56 [file] [log] [blame]
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2020, Google LLC
*
* P21 Type-c device-tree.
*/
#include <dt-bindings/usb/pd.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/samsung.h>
#include <dt-bindings/pinctrl/gs101.h>
&hsi2c_12{
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
fusb307b: fusb307b@50 {
status = "disabled";
compatible = "fusb307b";
/* 52 on reworked maran */
reg = <0x50>;
pinctrl-names = "default";
pinctrl-0 = <&usb_pd_irq>;
interrupt-parent = <&gpa8>;
usbpd,usbpd_int = <&gpa8 2 GPIO_ACTIVE_LOW>;
usb-psy-name = "usb";
chg-psy-name = "gcpm";
no-bc-12;
/*
* uic = <&max77729_uic>;
* uic-io = <0x1>;
*/
ls = <&slg_pld>;
conn = <&usb_con>;
orientation-switch;
usb_con: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
self-powered;
op-sink-microwatt = <2600000>;
usb-role-switch;
source-pdos = <PDO_FIXED(5000, 900,
PDO_FIXED_SUSPEND |
PDO_FIXED_USB_COMM |
PDO_FIXED_DATA_SWAP |
PDO_FIXED_DUAL_ROLE)>;
sink-pdos = <PDO_FIXED(5000, 3000,
PDO_FIXED_USB_COMM |
PDO_FIXED_DATA_SWAP |
PDO_FIXED_DUAL_ROLE)
PDO_FIXED(9000, 2000, 0)>;
port {
#address-cells = <1>;
#size-cells = <0>;
mux_notification_source: endpoint@0 {
reg = <0>;
remote-endpoint = <&mux_notification_sink>;
};
};
};
port {
#address-cells = <1>;
#size-cells = <0>;
mux_notification_sink: endpoint@0 {
reg = <0>;
remote-endpoint = <&mux_notification_source>;
};
};
};
slg_pld:slg46826@8 {
status = "disabled";
compatible = "slg46826";
reg = <0x8>;
};
max20339_ovp: max20339ovp@35 {
/*
* Enabling in bootloader instead of disabling so that
* kernel changes can be merged independently.
*/
status = "okay";
compatible = "max20339ovp";
reg = <0x35>;
/* OVP interrupt on MW pmic GPIO6 */
max20339,irq-gpio = <&max777x9_gpio 5 GPIO_ACTIVE_LOW>;
/* LoadSwitch 1 and LoadSwitch 2 mapped as gpios. */
max20339_gpio: max20339_gpio {
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
};
};
max77759tcpc: max77759tcpc@25 {
status = "okay";
dev-name = "max77759tcpc";
compatible = "max77759tcpc";
/* 52 on reworked maran */
reg = <0x25>;
pinctrl-names = "default";
pinctrl-0 = <&usb_pd_irq>;
interrupt-parent = <&gpa8>;
usbpd,usbpd_int = <&gpa8 2 GPIO_ACTIVE_LOW>;
usb-psy-name = "usb";
chg-psy-name = "gcpm";
in-switch-gpio = <&max20339_gpio 4 GPIO_ACTIVE_HIGH>;
max20339,ovp = <&max20339_ovp>;
conn = <&conn>;
orientation-switch;
conn: connector {
compatible = "usb-c-connector";
label = "USB-C";
data-role = "dual";
power-role = "dual";
try-power-role = "sink";
self-powered;
op-sink-microwatt = <2600000>;
new-source-frs-typec-current = <FRS_5V_1P5A>;
usb-role-switch;
slow-charger-loop;
/*
* b/174044466: Extboost can only do ~1A.
* However, max77759 operating in reverse boost
* mode (0xA) can do till 1.5A.
* Since extboost is the primary path, set this
* to 900mA.
*/
source-pdos = <PDO_FIXED(5000, 900,
PDO_FIXED_SUSPEND |
PDO_FIXED_USB_COMM |
PDO_FIXED_DATA_SWAP |
PDO_FIXED_DUAL_ROLE)>;
sink-pdos = <PDO_FIXED(5000, 3000,
PDO_FIXED_DATA_SWAP |
PDO_FIXED_USB_COMM |
PDO_FIXED_HIGHER_CAP |
PDO_FIXED_DUAL_ROLE)
PDO_FIXED(9000, 2200, 0)
PDO_PPS_APDO(5000, 11000, 3000)>;
sink-vdos = <VDO_IDH(/* usbh */ 1, /* usbd */ 1, IDH_PTYPE_PERIPH,
/* is_modal */ 0, IDH_PTYPE_DFP_HOST, /* conn */ 2,
0x18D1)
VDO_CERT(0x0)
VDO_PRODUCT(0x4EE1, 0x0)
VDO_UFP(UFP_VDO_VER1_2, DEV_USB2_CAPABLE | DEV_USB3_CAPABLE,
UFP_RECEPTACLE, /* rsvd */ 0, AMA_VCONN_NOT_REQ,
/* rsvd */ 0, UFP_ALTMODE_NOT_SUPP, UFP_USB32_GEN1)
/* padding */ 0
VDO_DFP(DFP_VDO_VER1_1, HOST_USB2_CAPABLE | HOST_USB3_CAPABLE,
DFP_RECEPTACLE, /* pnum */ 0)>;
sink-vdos-v1 = <VDO_IDH(/* usbh */ 1, /* usbd */ 1, IDH_PTYPE_PERIPH,
/* is_modal */ 0, /* rsvd */ 0, /* rsvd */ 0,
0x18D1)
VDO_CERT(0x0)
VDO_PRODUCT(0x4EE1, 0x0)>;
port {
#address-cells = <1>;
#size-cells = <0>;
mux_notification_src: endpoint@0 {
reg = <0>;
remote-endpoint = <&mux_notification_snk>;
};
};
};
port {
#address-cells = <1>;
#size-cells = <0>;
mux_notification_snk: endpoint@0 {
reg = <0>;
remote-endpoint = <&mux_notification_src>;
};
};
/* EXT_BST_EN exposed as GPIO */
max77759_tcpc_gpio: max77759_tcpc_gpio {
gpio-controller;
#gpio-cells = <2>;
ngpios = <1>;
};
};
};
&hsi2c12_bus {
samsung,pins = "gpp23-4", "gpp23-5";
samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
};
&pinctrl_1 {
usb_pd_irq: usb-pd-irq {
samsung,pins = "gpa8-2";
samsung,pin-function = <EXYNOS_PIN_FUNC_EINT>;
samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
};
};
/ {
fragment@typec {
target-path = "/";
__overlay__ {
google,usbc_port_cooling_dev {
extcon = <&max77759tcpc>;
compatible = "google,usbc_port_cooling_dev";
google,usb-cd-polling-interval-ms = <5000>;
google,usb-cd-connected-interval-ms = <700>;
google,usb-cd-unplug-interval-sec = <2>;
#cooling-cells = <2>;
};
};
};
};