diff options
Diffstat (limited to 'zephyr/program/nissa/pujjo')
-rw-r--r-- | zephyr/program/nissa/pujjo/cbi.dtsi | 190 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/generated.dtsi | 277 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/keyboard.dtsi | 48 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/motionsense.dtsi | 245 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/overlay.dtsi | 371 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/power_signals.dtsi | 220 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/project.conf | 33 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/project.overlay | 13 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/pujjo_vif.xml | 350 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/charger.c | 64 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/fan.c | 42 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/form_factor.c | 78 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/hdmi.c | 12 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/keyboard.c | 29 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/led.c | 134 | ||||
-rw-r--r-- | zephyr/program/nissa/pujjo/src/usbc.c | 227 |
16 files changed, 0 insertions, 2333 deletions
diff --git a/zephyr/program/nissa/pujjo/cbi.dtsi b/zephyr/program/nissa/pujjo/cbi.dtsi deleted file mode 100644 index 02057140a5..0000000000 --- a/zephyr/program/nissa/pujjo/cbi.dtsi +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - /* Pujjo-specific fw_config fields. */ - nissa-fw-config { - /* - * FW_CONFIG field to enable KB back light or not. - */ - kb-bl { - enum-name = "FW_KB_BL"; - start = <3>; - size = <1>; - - no-kb-bl { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_KB_BL_NOT_PRESENT"; - value = <0>; - }; - kb-bl-present { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_KB_BL_PRESENT"; - value = <1>; - }; - }; - - /* - * FW_CONFIG field for KB PWB present or not. - */ - kb-pwb { - enum-name = "FW_KB_PWB"; - start = <4>; - size = <1>; - - no-kb-pwb { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_KB_PWB_NOT_PRESENT"; - value = <0>; - }; - kb-pwb-present { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_KB_PWB_PRESENT"; - value = <1>; - }; - }; - - /* - * FW_CONFIG field for tablet present or not. - */ - tablet { - enum-name = "FW_TABLET"; - start = <5>; - size = <1>; - - no-tablet { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_TABLET_NOT_PRESENT"; - value = <0>; - }; - tablet-present { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_TABLET_PRESENT"; - value = <1>; - }; - }; - - /* - * FW_CONFIG field for LTE board present or not. - * - * start = <6>; - * size = <1>; - */ - - /* - * FW_CONFIG field for SD card present or not. - * - * start = <7>; - * size = <1>; - */ - - /* - * FW_CONFIG field for pen present or not. - */ - pen { - enum-name = "FW_PEN"; - start = <8>; - size = <1>; - - no-pen { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_PEN_NOT_PRESENT"; - value = <0>; - }; - pen-present { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "FW_PEN_PRESENT"; - value = <1>; - }; - }; - - /* - * FW_CONFIG field for WF camera present or not. - * - * start = <9>; - * size = <1>; - */ - - /* - * FW_CONFIG field for multiple thermal table. - */ - therm-table { - enum-name = "THERM_TABLE"; - start = <10>; - size = <2>; - - therm-table-1 { - compatible = "cros-ec,cbi-fw-config-value"; - enum-name = "THERM_TABLE_1"; - value = <1>; - }; - }; - - /* - * FW_CONFIG field for multiple audio module. - * - * start = <12>; - * size = <3>; - */ - - /* - * FW_CONFIG field for EXT_VR. - * - * start = <15>; - * size = <1>; - */ - - /* - * FW_CONFIG field for multiple wi-fi SAR. - * - * start = <16>; - * size = <2>; - */ - }; - - /* Pujjo-specific ssfc fields. */ - cbi-ssfc { - compatible = "cros-ec,cbi-ssfc"; - /* - * SSFC field to identify BASE motion sensor. - */ - base-sensor { - enum-name = "BASE_SENSOR"; - size = <2>; - - base_sensor_0: bmi323 { - compatible = "cros-ec,cbi-ssfc-value"; - status = "okay"; - value = <0>; - default; - }; - base_sensor_1: lsm6dsm { - compatible = "cros-ec,cbi-ssfc-value"; - status = "okay"; - value = <1>; - }; - }; - - /* - * SSFC field to identify LID motion sensor. - */ - lid-sensor { - enum-name = "LID_SENSOR"; - size = <2>; - - lid_sensor_0: bma422 { - compatible = "cros-ec,cbi-ssfc-value"; - status = "okay"; - value = <0>; - default; - }; - lid_sensor_1: lis2dw12 { - compatible = "cros-ec,cbi-ssfc-value"; - status = "okay"; - value = <1>; - }; - }; - }; -}; diff --git a/zephyr/program/nissa/pujjo/generated.dtsi b/zephyr/program/nissa/pujjo/generated.dtsi deleted file mode 100644 index 46da0e4a02..0000000000 --- a/zephyr/program/nissa/pujjo/generated.dtsi +++ /dev/null @@ -1,277 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - * - * This file is auto-generated - do not edit! - */ - -/ { - - named-adc-channels { - compatible = "named-adc-channels"; - - adc_ec_vsense_pp1050_proc: ec_vsense_pp1050_proc { - enum-name = "ADC_PP1050_PROC"; - io-channels = <&adc0 4>; - }; - adc_ec_vsense_pp3300_s5: ec_vsense_pp3300_s5 { - enum-name = "ADC_PP3300_S5"; - io-channels = <&adc0 6>; - }; - adc_temp_sensor_1: temp_sensor_1 { - enum-name = "ADC_TEMP_SENSOR_1"; - io-channels = <&adc0 0>; - }; - adc_temp_sensor_2: temp_sensor_2 { - enum-name = "ADC_TEMP_SENSOR_2"; - io-channels = <&adc0 1>; - }; - adc_temp_sensor_3: temp_sensor_3 { - enum-name = "ADC_TEMP_SENSOR_3"; - io-channels = <&adc0 10>; - }; - }; - - named-gpios { - compatible = "named-gpios"; - - gpio_acc_int_l: acc_int_l { - gpios = <&gpio5 0 GPIO_INPUT>; - }; - gpio_all_sys_pwrgd: all_sys_pwrgd { - gpios = <&gpioa 7 GPIO_INPUT>; - }; - gpio_ccd_mode_odl: ccd_mode_odl { - gpios = <&gpioe 5 GPIO_INPUT>; - enum-name = "GPIO_CCD_MODE_ODL"; - }; - gpio_cpu_c10_gate_l: cpu_c10_gate_l { - gpios = <&gpio6 7 GPIO_INPUT>; - }; - gpio_ec_battery_pres_odl: ec_battery_pres_odl { - gpios = <&gpioa 3 GPIO_INPUT>; - enum-name = "GPIO_BATT_PRES_ODL"; - }; - gpio_ec_cbi_wp: ec_cbi_wp { - gpios = <&gpio7 4 GPIO_OUTPUT>; - }; - gpio_ec_edp_bl_en_od: ec_edp_bl_en_od { - gpios = <&gpiod 3 GPIO_ODR_HIGH>; - enum-name = "GPIO_ENABLE_BACKLIGHT"; - }; - gpio_ec_entering_rw: ec_entering_rw { - gpios = <&gpio0 3 GPIO_OUTPUT>; - enum-name = "GPIO_ENTERING_RW"; - }; - gpio_ec_gsc_packet_mode: ec_gsc_packet_mode { - gpios = <&gpio7 5 GPIO_OUTPUT>; - enum-name = "GPIO_PACKET_MODE_EN"; - }; - gpio_ec_kso_02_inv: ec_kso_02_inv { - gpios = <&gpio1 7 (GPIO_OUTPUT_LOW | GPIO_ACTIVE_LOW)>; - }; - gpio_ec_pch_wake_odl: ec_pch_wake_odl { - gpios = <&gpiob 0 GPIO_ODR_LOW>; - }; - gpio_ec_prochot_odl: ec_prochot_odl { - gpios = <&gpiof 1 GPIO_ODR_HIGH>; - }; - gpio_ec_soc_dsw_pwrok: ec_soc_dsw_pwrok { - gpios = <&gpio6 1 GPIO_OUTPUT>; - }; - gpio_ec_soc_hdmi_hpd: ec_soc_hdmi_hpd { - gpios = <&gpioe 4 GPIO_OUTPUT>; - }; - gpio_ec_soc_int_odl: ec_soc_int_odl { - gpios = <&gpio8 0 GPIO_ODR_HIGH>; - enum-name = "GPIO_EC_INT_L"; - }; - gpio_ec_soc_pch_pwrok_od: ec_soc_pch_pwrok_od { - gpios = <&gpio7 2 GPIO_ODR_HIGH>; - }; - gpio_ec_soc_pwr_btn_odl: ec_soc_pwr_btn_odl { - gpios = <&gpioc 1 GPIO_ODR_HIGH>; - enum-name = "GPIO_PCH_PWRBTN_L"; - }; - gpio_ec_soc_rsmrst_l: ec_soc_rsmrst_l { - gpios = <&gpioa 6 GPIO_OUTPUT>; - }; - gpio_ec_soc_rtcrst: ec_soc_rtcrst { - gpios = <&gpio7 6 GPIO_OUTPUT>; - }; - gpio_ec_soc_sys_pwrok: ec_soc_sys_pwrok { - gpios = <&gpio3 7 GPIO_OUTPUT>; - }; - gpio_ec_soc_vccst_pwrgd_od: ec_soc_vccst_pwrgd_od { - gpios = <&gpioa 4 GPIO_ODR_HIGH>; - }; - gpio_ec_wp_odl: ec_wp_odl { - gpios = <&gpioa 1 (GPIO_INPUT | GPIO_ACTIVE_LOW)>; - }; - gpio_en_kb_bl: en_kb_bl { - gpios = <&gpioa 0 GPIO_OUTPUT>; - enum-name = "GPIO_EN_KEYBOARD_BACKLIGHT"; - }; - gpio_en_pp3300_s5: en_pp3300_s5 { - gpios = <&gpiob 6 GPIO_OUTPUT>; - enum-name = "GPIO_TEMP_SENSOR_POWER"; - }; - gpio_en_pp5000_pen_x: en_pp5000_pen_x { - gpios = <&gpioe 2 GPIO_OUTPUT>; - }; - gpio_en_pp5000_s5: en_pp5000_s5 { - gpios = <&gpio4 0 GPIO_OUTPUT>; - }; - gpio_en_slp_z: en_slp_z { - gpios = <&gpioe 1 GPIO_OUTPUT>; - }; - gpio_en_usb_a0_vbus: en_usb_a0_vbus { - gpios = <&gpio9 1 GPIO_OUTPUT>; - }; - gpio_gsc_ec_pwr_btn_odl: gsc_ec_pwr_btn_odl { - gpios = <&gpio0 0 GPIO_INPUT_PULL_UP>; - enum-name = "GPIO_POWER_BUTTON_L"; - }; - gpio_hdmi_sel: hdmi_sel { - gpios = <&gpioc 6 GPIO_OUTPUT>; - }; - gpio_imu_int_l: imu_int_l { - gpios = <&gpio5 6 GPIO_INPUT>; - }; - gpio_imvp91_vrrdy_od: imvp91_vrrdy_od { - gpios = <&gpio4 3 GPIO_INPUT>; - }; - gpio_lid_open: lid_open { - gpios = <&gpiod 2 GPIO_INPUT>; - enum-name = "GPIO_LID_OPEN"; - }; - gpio_pen_detect_odl: pen_detect_odl { - gpios = <&gpio9 6 GPIO_INPUT_PULL_UP>; - }; - gpio_pg_pp1050_mem_s3_od: pg_pp1050_mem_s3_od { - gpios = <&gpiof 0 GPIO_INPUT>; - }; - gpio_pg_pp5000_s5_od: pg_pp5000_s5_od { - gpios = <&gpio4 2 GPIO_INPUT>; - }; - gpio_rsmrst_pwrgd_l: rsmrst_pwrgd_l { - gpios = <&gpio9 4 GPIO_INPUT_PULL_UP>; - }; - gpio_slp_s0_l: slp_s0_l { - gpios = <&gpio9 7 GPIO_INPUT>; - }; - gpio_slp_s3_l: slp_s3_l { - gpios = <&gpioa 5 GPIO_INPUT>; - }; - gpio_slp_s4_l: slp_s4_l { - gpios = <&gpio7 0 GPIO_INPUT>; - }; - gpio_slp_sus_l: slp_sus_l { - gpios = <&gpio6 2 GPIO_INPUT>; - }; - gpio_sub_usb_a1_ilimit_sdp: sub_usb_a1_ilimit_sdp { - gpios = <&gpiod 5 GPIO_OUTPUT>; - enum-name = "GPIO_USB2_ILIM_SEL"; - }; - gpio_sys_rst_odl: sys_rst_odl { - gpios = <&gpioc 5 GPIO_ODR_HIGH>; - }; - gpio_tablet_mode_l: tablet_mode_l { - gpios = <&gpio9 5 GPIO_INPUT>; - enum-name = "GPIO_TABLET_MODE_L"; - }; - gpio_usb_a0_ilimit_sdp: usb_a0_ilimit_sdp { - gpios = <&gpio8 5 GPIO_OUTPUT>; - enum-name = "GPIO_USB1_ILIM_SEL"; - }; - gpio_usb_c0_int_odl: usb_c0_int_odl { - gpios = <&gpio0 1 GPIO_INPUT_PULL_UP>; - }; - gpio_vccin_aux_vid0: vccin_aux_vid0 { - gpios = <&gpio9 2 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; - }; - gpio_vccin_aux_vid1: vccin_aux_vid1 { - gpios = <&gpioe 3 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; - }; - gpio_voldn_btn_odl: voldn_btn_odl { - gpios = <&gpio9 3 GPIO_INPUT_PULL_UP>; - enum-name = "GPIO_VOLUME_DOWN_L"; - }; - gpio_volup_btn_odl: volup_btn_odl { - gpios = <&gpioa 2 GPIO_INPUT_PULL_UP>; - enum-name = "GPIO_VOLUME_UP_L"; - }; - }; - - named-i2c-ports { - compatible = "named-i2c-ports"; - - i2c_ec_i2c_eeprom: ec_i2c_eeprom { - i2c-port = <&i2c0_0>; - enum-names = "I2C_PORT_EEPROM"; - }; - i2c_ec_i2c_sensor: ec_i2c_sensor { - i2c-port = <&i2c1_0>; - enum-names = "I2C_PORT_SENSOR"; - }; - i2c_ec_i2c_usb_c0: ec_i2c_usb_c0 { - i2c-port = <&i2c3_0>; - enum-names = "I2C_PORT_USB_C0_TCPC"; - }; - i2c_ec_i2c_batt: ec_i2c_batt { - i2c-port = <&i2c7_0>; - enum-names = "I2C_PORT_BATTERY"; - }; - }; -}; - -&adc0 { - status = "okay"; - pinctrl-0 = <&adc0_chan0_gp45 - &adc0_chan1_gp44 - &adc0_chan4_gp41 - &adc0_chan6_gp34 - &adc0_chan10_gpe0>; - pinctrl-names = "default"; -}; - - -&i2c0_0 { - status = "okay"; - pinctrl-0 = <&i2c0_0_sda_scl_gpb4_b5>; - pinctrl-names = "default"; -}; - -&i2c1_0 { - status = "okay"; - pinctrl-0 = <&i2c1_0_sda_scl_gp87_90>; - pinctrl-names = "default"; -}; - -&i2c3_0 { - status = "okay"; - pinctrl-0 = <&i2c3_0_sda_scl_gpd0_d1>; - pinctrl-names = "default"; -}; - -&i2c7_0 { - status = "okay"; - pinctrl-0 = <&i2c7_0_sda_scl_gpb2_b3>; - pinctrl-names = "default"; -}; - -&i2c_ctrl0 { - status = "okay"; -}; - -&i2c_ctrl1 { - status = "okay"; -}; - -&i2c_ctrl3 { - status = "okay"; -}; - -&i2c_ctrl7 { - status = "okay"; -}; diff --git a/zephyr/program/nissa/pujjo/keyboard.dtsi b/zephyr/program/nissa/pujjo/keyboard.dtsi deleted file mode 100644 index 00610e4e18..0000000000 --- a/zephyr/program/nissa/pujjo/keyboard.dtsi +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - kblight { - compatible = "cros-ec,kblight-pwm"; - pwms = <&pwm6 6 PWM_HZ(2400) PWM_POLARITY_NORMAL>; - }; -}; - -&pwm6 { - status = "okay"; - clock-bus = "NPCX_CLOCK_BUS_LFCLK"; - pinctrl-0 = <&pwm6_gpc0>; - pinctrl-names = "default"; -}; - -&cros_kb_raw { - status = "okay"; - /* No KSO2 (it's inverted and implemented by GPIO) */ - pinctrl-0 = < - &ksi0_gp31 - &ksi1_gp30 - &ksi2_gp27 - &ksi3_gp26 - &ksi4_gp25 - &ksi5_gp24 - &ksi6_gp23 - &ksi7_gp22 - &kso00_gp21 - &kso01_gp20 - &kso03_gp16 - &kso04_gp15 - &kso05_gp14 - &kso06_gp13 - &kso07_gp12 - &kso08_gp11 - &kso09_gp10 - &kso10_gp07 - &kso11_gp06 - &kso12_gp05 - &kso13_gp04 - &kso14_gp82 - >; - pinctrl-names = "default"; -}; diff --git a/zephyr/program/nissa/pujjo/motionsense.dtsi b/zephyr/program/nissa/pujjo/motionsense.dtsi deleted file mode 100644 index af21e0509e..0000000000 --- a/zephyr/program/nissa/pujjo/motionsense.dtsi +++ /dev/null @@ -1,245 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include <dt-bindings/motionsense/utils.h> - - -/ { - aliases { - /* - * Interrupt bindings for sensor devices. - */ - bmi3xx-int = &base_accel; - lsm6dsm-int = &base_accel; - lis2dw12-int = &lid_accel; - bma4xx-int = &lid_accel; - }; - - /* - * Declare mutexes used by sensor drivers. - * A mutex node is used to create an instance of mutex_t. - * A mutex node is referenced by a sensor node if the - * corresponding sensor driver needs to use the - * instance of the mutex. - */ - motionsense-mutex { - compatible = "cros-ec,motionsense-mutex"; - lid_mutex: lid-mutex { - }; - - base_mutex: base-mutex { - }; - }; - - /* Rotation matrix used by drivers. */ - motionsense-rotation-ref { - compatible = "cros-ec,motionsense-rotation-ref"; - lid_rot_ref: lid-rotation-ref { - mat33 = <0 (-1) 0 - (-1) 0 0 - 0 0 (-1)>; - }; - - lid_rot_lis2dw12: lid-rotation-lis2dw12 { - mat33 = <0 (-1) 0 - (-1) 0 0 - 0 0 (-1)>; - }; - - base_rot_ref: base-rotation-ref { - mat33 = <0 1 0 - (-1) 0 0 - 0 0 1>; - }; - - base_rot_lsm6dsm: base-rotation-lsm6dsm { - mat33 = <1 0 0 - 0 1 0 - 0 0 1>; - }; - }; - - /* - * Driver specific data. A driver-specific data can be shared with - * different motion sensors while they are using the same driver. - * - * If a node's compatible starts with "cros-ec,accelgyro-", it is for - * a common structure defined in accelgyro.h. - * e.g) compatible = "cros-ec,accelgyro-als-drv-data" is for - * "struct als_drv_data_t" in accelgyro.h - */ - motionsense-sensor-data { - bmi323_data: bmi323-drv-data { - compatible = "cros-ec,drvdata-bmi3xx"; - status = "okay"; - }; - - lsm6dsm_data_accel: lsm6dsm-accel-drv-data { - compatible = "cros-ec,drvdata-lsm6dsm"; - status = "okay"; - }; - - lsm6dsm_data_gyro: lsm6dsm-gyro-drv-data { - compatible = "cros-ec,drvdata-lsm6dsm"; - status = "okay"; - }; - - bma422_data: bma422-drv-data { - compatible = "cros-ec,drvdata-bma4xx"; - status = "okay"; - }; - - lis2dw12_data: lis2dw12-drv-data { - compatible = "cros-ec,drvdata-lis2dw12"; - status = "okay"; - }; - }; - - /* - * List of motion sensors that creates motion_sensors array. - * The nodelabel "lid_accel" and "base_accel" are used to indicate - * motion sensor IDs for lid angle calculation. - * TODO(b/238139272): The first entries of the array must be - * accelerometers,then gyroscope. Fix this dependency in the DTS - * processing which makes the devicetree entries independent. - */ - motionsense-sensor { - lid_accel: lid-accel { - compatible = "cros-ec,bma4xx"; - status = "okay"; - - active-mask = "SENSOR_ACTIVE_S0_S3"; - location = "MOTIONSENSE_LOC_LID"; - mutex = <&lid_mutex>; - port = <&i2c_ec_i2c_sensor>; - rot-standard-ref = <&lid_rot_ref>; - default-range = <2>; - drv-data = <&bma422_data>; - configs { - compatible = - "cros-ec,motionsense-sensor-config"; - ec-s0 { - odr = <(10000 | ROUND_UP_FLAG)>; - }; - ec-s3 { - odr = <(10000 | ROUND_UP_FLAG)>; - }; - }; - }; - - base_accel: base-accel { - compatible = "cros-ec,bmi3xx-accel"; - status = "okay"; - - active-mask = "SENSOR_ACTIVE_S0_S3"; - location = "MOTIONSENSE_LOC_BASE"; - mutex = <&base_mutex>; - port = <&i2c_ec_i2c_sensor>; - rot-standard-ref = <&base_rot_ref>; - drv-data = <&bmi323_data>; - configs { - compatible = - "cros-ec,motionsense-sensor-config"; - ec-s0 { - odr = <(10000 | ROUND_UP_FLAG)>; - }; - ec-s3 { - odr = <(10000 | ROUND_UP_FLAG)>; - }; - }; - }; - - base_gyro: base-gyro { - compatible = "cros-ec,bmi3xx-gyro"; - status = "okay"; - - active-mask = "SENSOR_ACTIVE_S0_S3"; - location = "MOTIONSENSE_LOC_BASE"; - mutex = <&base_mutex>; - port = <&i2c_ec_i2c_sensor>; - rot-standard-ref = <&base_rot_ref>; - drv-data = <&bmi323_data>; - }; - }; - - motionsense-sensor-alt { - alt_lid_accel: alt-lid-accel { - compatible = "cros-ec,lis2dw12"; - status = "okay"; - - active-mask = "SENSOR_ACTIVE_S0_S3"; - location = "MOTIONSENSE_LOC_LID"; - mutex = <&lid_mutex>; - port = <&i2c_ec_i2c_sensor>; - rot-standard-ref = <&lid_rot_lis2dw12>; - default-range = <2>; - drv-data = <&lis2dw12_data>; - i2c-spi-addr-flags = "LIS2DWL_ADDR1_FLAGS"; - alternate-for = <&lid_accel>; - alternate-ssfc-indicator = <&lid_sensor_1>; - configs { - compatible = - "cros-ec,motionsense-sensor-config"; - ec-s0 { - odr = <(10000 | ROUND_UP_FLAG)>; - }; - ec-s3 { - odr = <(10000 | ROUND_UP_FLAG)>; - }; - }; - }; - - alt_base_accel: alt-base-accel { - compatible = "cros-ec,lsm6dsm-accel"; - status = "okay"; - - active-mask = "SENSOR_ACTIVE_S0_S3"; - location = "MOTIONSENSE_LOC_BASE"; - mutex = <&base_mutex>; - port = <&i2c_ec_i2c_sensor>; - rot-standard-ref = <&base_rot_lsm6dsm>; - drv-data = <&lsm6dsm_data_accel>; - alternate-for = <&base_accel>; - alternate-ssfc-indicator = <&base_sensor_1>; - configs { - compatible = - "cros-ec,motionsense-sensor-config"; - ec-s0 { - odr = <(10000 | ROUND_UP_FLAG)>; - ec-rate = <(100 * USEC_PER_MSEC)>; - }; - ec-s3 { - odr = <(10000 | ROUND_UP_FLAG)>; - ec-rate = <0>; - }; - }; - }; - - alt_base_gyro: alt-base-gyro { - compatible = "cros-ec,lsm6dsm-gyro"; - status = "okay"; - - active-mask = "SENSOR_ACTIVE_S0_S3"; - location = "MOTIONSENSE_LOC_BASE"; - mutex = <&base_mutex>; - port = <&i2c_ec_i2c_sensor>; - rot-standard-ref = <&base_rot_lsm6dsm>; - drv-data = <&lsm6dsm_data_gyro>; - default-range = <(1000 | ROUND_UP_FLAG)>; /* dps */ - alternate-for = <&base_gyro>; - alternate-ssfc-indicator = <&base_sensor_1>; - }; - }; - - motionsense-sensor-info { - compatible = "cros-ec,motionsense-sensor-info"; - - /* - * list of GPIO interrupts that have to - * be enabled at initial stage - */ - sensor-irqs = <&int_imu &int_lid_accel>; - }; -}; diff --git a/zephyr/program/nissa/pujjo/overlay.dtsi b/zephyr/program/nissa/pujjo/overlay.dtsi deleted file mode 100644 index cb20ec6554..0000000000 --- a/zephyr/program/nissa/pujjo/overlay.dtsi +++ /dev/null @@ -1,371 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include <cros/thermistor/thermistor.dtsi> -#include <dt-bindings/usb_pd_tcpm.h> - -/ { - aliases { - gpio-cbi-wp = &gpio_ec_cbi_wp; - gpio-wp = &gpio_ec_wp_odl; - int-wp = &int_wp_l; - gpio-kbd-kso2 = &gpio_ec_kso_02_inv; - }; - - ec-console { - compatible = "ec-console"; - disabled = "events", "lpc", "hostcmd"; - }; - - batteries { - default_battery: smp { - compatible = "smp,l22m3pg0", "battery-smart"; - }; - smp_l22m3pg1 { - compatible = "smp,l22m3pg1", "battery-smart"; - }; - sunwoda_l22d3pg0 { - compatible = "sunwoda,l22d3pg0", "battery-smart"; - }; - sunwoda_l22d3pg1 { - compatible = "sunwoda,l22d3pg1", "battery-smart"; - }; - celxpert_l22c3pg0 { - compatible = "celxpert,l22c3pg0", "battery-smart"; - }; - }; - - hibernate-wake-pins { - compatible = "cros-ec,hibernate-wake-pins"; - wakeup-irqs = < - &int_power_button - &int_lid_open - >; - }; - - gpio-interrupts { - compatible = "cros-ec,gpio-interrupts"; - - int_power_button: power_button { - irq-pin = <&gpio_gsc_ec_pwr_btn_odl>; - flags = <GPIO_INT_EDGE_BOTH>; - handler = "power_button_interrupt"; - }; - int_wp_l: wp_l { - irq-pin = <&gpio_ec_wp_odl>; - flags = <GPIO_INT_EDGE_BOTH>; - handler = "switch_interrupt"; - }; - int_lid_open: lid_open { - irq-pin = <&gpio_lid_open>; - flags = <GPIO_INT_EDGE_BOTH>; - handler = "lid_interrupt"; - }; - int_tablet_mode: tablet_mode { - irq-pin = <&gpio_tablet_mode_l>; - flags = <GPIO_INT_EDGE_BOTH>; - handler = "gmr_tablet_switch_isr"; - }; - int_imu: ec_imu { - irq-pin = <&gpio_imu_int_l>; - flags = <GPIO_INT_EDGE_FALLING>; - handler = "motion_interrupt"; - }; - int_lid_accel: lid_accel { - irq-pin = <&gpio_acc_int_l>; - flags = <GPIO_INT_EDGE_FALLING>; - handler = "lid_accel_interrupt"; - }; - int_vol_down: vol_down { - irq-pin = <&gpio_voldn_btn_odl>; - flags = <GPIO_INT_EDGE_BOTH>; - handler = "button_interrupt"; - }; - int_vol_up: vol_up { - irq-pin = <&gpio_volup_btn_odl>; - flags = <GPIO_INT_EDGE_BOTH>; - handler = "button_interrupt"; - }; - int_usb_c0: usb_c0 { - irq-pin = <&gpio_usb_c0_int_odl>; - flags = <GPIO_INT_EDGE_FALLING>; - handler = "usb_interrupt"; - }; - }; - - named-gpios { - gpio_sb_2: sb_2 { - gpios = <&gpiod 4 GPIO_OUTPUT>; - no-auto-init; - }; - - gpio_sb_3: sb_3 { - gpios = <&gpiof 5 (GPIO_OPEN_DRAIN | GPIO_VOLTAGE_1P8)>; - no-auto-init; - }; - gpio_sb_4: sb_4 { - gpios = <&gpiof 4 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; - no-auto-init; - }; - gpio_fan_enable: fan-enable { - gpios = <&gpio6 3 GPIO_OUTPUT>; - no-auto-init; - }; - ec-i2c-sensor-scl { - gpios = <&gpio9 0 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; - }; - ec-i2c-sensor-sda { - gpios = <&gpio8 7 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>; - }; - gpio_power_led: power_led { - gpios = <&gpioc 2 GPIO_OUTPUT_LOW>; - }; - gpio_led_1_odl: led_1_odl { - gpios = <&gpioc 4 GPIO_OUTPUT_LOW>; - }; - gpio_led_2_odl: led_2_odl { - gpios = <&gpioc 3 GPIO_OUTPUT_LOW>; - }; - }; - - /* - * Aliases used for sub-board GPIOs. - */ - aliases { - /* - * Sub-board with type A USB, enable. - */ - gpio-en-usb-a1-vbus = &gpio_sb_2; - /* - * HPD pins for HDMI sub-board. - */ - gpio-hdmi-en-odl = &gpio_sb_3; - gpio-hpd-odl = &gpio_sb_4; - /* - * Enable S5 rails for LTE sub-board - */ - gpio-en-sub-s5-rails = &gpio_sb_2; - }; - - temp_cpu: cpu { - compatible = "cros-ec,temp-sensor-thermistor"; - thermistor = <&thermistor_3V3_51K1_47K_4050B>; - adc = <&adc_temp_sensor_1>; - }; - temp_ddr: ddr { - compatible = "cros-ec,temp-sensor-thermistor"; - thermistor = <&thermistor_3V3_51K1_47K_4050B>; - adc = <&adc_temp_sensor_2>; - }; - temp_ambient: ambient { - compatible = "cros-ec,temp-sensor-thermistor"; - thermistor = <&thermistor_3V3_51K1_47K_4050B>; - adc = <&adc_temp_sensor_3>; - }; - - named-temp-sensors { - compatible = "cros-ec,temp-sensors"; - cpu { - temp_fan_off = <35>; - temp_fan_max = <60>; - temp_host_high = <90>; - temp_host_halt = <100>; - temp_host_release_high = <85>; - power-good-pin = <&gpio_ec_soc_dsw_pwrok>; - sensor = <&temp_cpu>; - }; - ddr { - temp_fan_off = <35>; - temp_fan_max = <60>; - temp_host_high = <90>; - temp_host_halt = <100>; - temp_host_release_high = <85>; - power-good-pin = <&gpio_ec_soc_dsw_pwrok>; - sensor = <&temp_ddr>; - }; - ambient { - temp_fan_off = <35>; - temp_fan_max = <60>; - temp_host_high = <90>; - temp_host_halt = <100>; - temp_host_release_high = <85>; - power-good-pin = <&gpio_ec_soc_dsw_pwrok>; - sensor = <&temp_ambient>; - }; - }; - - usba { - compatible = "cros-ec,usba-port-enable-pins"; - /* - * sb_2 is only configured as GPIO when USB-A1 is present, - * but it's still safe to control when disabled. - * - * ILIM_SEL pins are referred to by legacy enum name, - * GPIO_USB*_ILIM_SEL. The one for port A1 is unused on - * sub-boards that don't have USB-A so is safe to control - * regardless of system configuration. - */ - enable-pins = <&gpio_en_usb_a0_vbus &gpio_sb_2>; - status = "okay"; - }; - - usbc { - #address-cells = <1>; - #size-cells = <0>; - - port0@0 { - compatible = "named-usbc-port"; - reg = <0>; - bc12 = <&bc12_port0>; - chg = <&chg_port0>; - tcpc = <&tcpc_port0>; - usb-mux-chain-0 { - compatible = "cros-ec,usb-mux-chain"; - usb-muxes = <&virtual_mux_0>; - }; - }; - port0-muxes { - virtual_mux_0: virtual-mux-0 { - compatible = "cros-ec,usbc-mux-virtual"; - }; - }; - }; - - fans { - compatible = "cros-ec,fans"; - - fan_0 { - pwms = <&pwm5 5 PWM_KHZ(1) PWM_POLARITY_NORMAL>; - rpm_min = <2200>; - rpm_start = <2200>; - rpm_max = <4200>; - tach = <&tach2>; - enable_gpio = <&gpio_fan_enable>; - }; - }; - - /* - * Declare unused GPIOs so that they are shut down - * and use minimal power - */ - unused-pins { - compatible = "unused-gpios"; - unused-gpios = - <&gpio3 3 0>, - <&gpio3 6 0>, - <&gpiod 7 0>, - <&gpiof 2 0>, - <&gpiof 3 0>; - }; -}; - -&thermistor_3V3_51K1_47K_4050B { - status = "okay"; -}; - -&adc_ec_vsense_pp3300_s5 { - /* - * Voltage divider on input has 47k upper and 220k lower legs with - * 2714 mV full-scale reading on the ADC. Apply the largest possible - * multiplier (without overflowing int32) to get the best possible - * approximation of the actual ratio, but derate by a factor of two to - * ensure unexpectedly high values won't overflow. - */ - mul = <(791261 / 2)>; - div = <(651975 / 2)>; -}; - -/* Set bus speeds for I2C */ -&i2c0_0 { - label = "I2C_EEPROM"; - clock-frequency = <I2C_BITRATE_FAST>; - - cbi_eeprom: eeprom@50 { - compatible = "atmel,at24"; - reg = <0x50>; - size = <2048>; - pagesize = <16>; - address-width = <8>; - timeout = <5>; - }; -}; - -&i2c1_0 { - label = "I2C_SENSOR"; - clock-frequency = <I2C_BITRATE_FAST>; -}; - -&i2c3_0 { - label = "I2C_USB_C0_TCPC"; - clock-frequency = <I2C_BITRATE_FAST_PLUS>; - - bc12_port0: pi3usb9201@5f { - compatible = "pericom,pi3usb9201"; - status = "okay"; - reg = <0x5f>; - /* - * BC1.2 interrupt is shared with TCPC, so - * IRQ is not specified here and handled by - * usb_c0_interrupt. - */ - }; - - chg_port0: isl923x@9 { - compatible = "intersil,isl923x"; - status = "okay"; - reg = <0x9>; - }; - - tcpc_port0: raa489000@22 { - compatible = "renesas,raa489000"; - reg = <0x22>; - tcpc-flags = <( - TCPC_FLAGS_TCPCI_REV2_0 | - TCPC_FLAGS_VBUS_MONITOR)>; - }; -}; - -&i2c7_0 { - label = "I2C_BATTERY"; - clock-frequency = <I2C_BITRATE_STANDARD>; -}; - -&pwm5_gpb7 { - drive-open-drain; -}; - -&pwm5 { - status = "okay"; - clock-bus = "NPCX_CLOCK_BUS_LFCLK"; - pinctrl-0 = <&pwm5_gpb7>; - pinctrl-names = "default"; -}; - -/* Tachometer for fan speed measurement */ -&tach2 { - status = "okay"; - pinctrl-0 = <&ta2_1_in_gp73>; - pinctrl-names = "default"; - port = <NPCX_TACH_PORT_A>; /* port-A is selected */ - sample-clk = <NPCX_TACH_FREQ_LFCLK>; /* Use LFCLK as sampling clock */ - pulses-per-round = <2>; /* number of pulses per round of encoder */ -}; - -/* host interface */ -&espi0 { - status = "okay"; - pinctrl-0 = <&espi_lpc_gp46_47_51_52_53_54_55_57>; - pinctrl-names = "default"; -}; - -/* - * Declare GPIOs that have leakage current caused by board issues here. NPCX ec - * will disable their input buffers before entering deep sleep and restore them - * after waking up automatically for better power consumption. - */ -&power_leakage_io { - leak-gpios = <&gpioa 4 0 - &gpiof 1 0>; -}; diff --git a/zephyr/program/nissa/pujjo/power_signals.dtsi b/zephyr/program/nissa/pujjo/power_signals.dtsi deleted file mode 100644 index 1d2b23069d..0000000000 --- a/zephyr/program/nissa/pujjo/power_signals.dtsi +++ /dev/null @@ -1,220 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - chosen { - intel-ap-pwrseq,espi = &espi0; - }; - - common-pwrseq { - compatible = "intel,ap-pwrseq"; - - sys-pwrok-delay = <10>; - all-sys-pwrgd-timeout = <20>; - }; - - pwr-en-pp5000-s5 { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "PP5000_S5 enable output to regulator"; - enum-name = "PWR_EN_PP5000_A"; - gpios = <&gpio4 0 0>; - output; - }; - pwr-en-pp3300-s5 { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "PP3300_S5 enable output to LS"; - enum-name = "PWR_EN_PP3300_A"; - gpios = <&gpiob 6 0>; - output; - }; - pwr-pg-ec-rsmrst-od { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "RSMRST power good from regulator"; - enum-name = "PWR_RSMRST"; - gpios = <&gpio9 4 0>; - interrupt-flags = <GPIO_INT_EDGE_BOTH>; - }; - pwr-ec-pch-rsmrst-odl { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "RSMRST output to PCH"; - enum-name = "PWR_EC_PCH_RSMRST"; - gpios = <&gpioa 6 0>; - output; - }; - pwr-slp-s0-l { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "SLP_S0_L input from PCH"; - enum-name = "PWR_SLP_S0"; - gpios = <&gpio9 7 GPIO_ACTIVE_LOW>; - interrupt-flags = <GPIO_INT_EDGE_BOTH>; - }; - pwr-slp-s3-l { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "SLP_S3_L input from PCH"; - enum-name = "PWR_SLP_S3"; - gpios = <&gpioa 5 GPIO_ACTIVE_LOW>; - interrupt-flags = <GPIO_INT_EDGE_BOTH>; - }; - pwr-slp-sus-l { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "SLP_SUS_L input from PCH"; - enum-name = "PWR_SLP_SUS"; - gpios = <&gpio6 2 GPIO_ACTIVE_LOW>; - interrupt-flags = <GPIO_INT_EDGE_BOTH>; - }; - pwr-ec-soc-dsw-pwrok { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "DSW_PWROK output to PCH"; - enum-name = "PWR_EC_SOC_DSW_PWROK"; - gpios = <&gpio6 1 0>; - output; - }; - pwr-vccst-pwrgd-od { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "VCCST_PWRGD output to PCH"; - enum-name = "PWR_VCCST_PWRGD"; - gpios = <&gpioa 4 GPIO_OPEN_DRAIN>; - output; - }; - pwr-imvp9-vrrdy-od { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "VRRDY input from IMVP9"; - enum-name = "PWR_IMVP9_VRRDY"; - gpios = <&gpio4 3 0>; - }; - pwr-pch-pwrok { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "PCH_PWROK output to PCH"; - enum-name = "PWR_PCH_PWROK"; - gpios = <&gpio7 2 GPIO_OPEN_DRAIN>; - output; - }; - pwr-ec-pch-sys-pwrok { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "SYS_PWROK output to PCH"; - enum-name = "PWR_EC_PCH_SYS_PWROK"; - gpios = <&gpio3 7 0>; - output; - }; - pwr-sys-rst-l { - compatible = "intel,ap-pwrseq-gpio"; - dbg-label = "SYS_RESET# output to PCH"; - enum-name = "PWR_SYS_RST"; - gpios = <&gpioc 5 (GPIO_ACTIVE_LOW|GPIO_OPEN_DRAIN)>; - output; - }; - pwr-slp-s4 { - compatible = "intel,ap-pwrseq-vw"; - dbg-label = "SLP_S4 virtual wire input from PCH"; - enum-name = "PWR_SLP_S4"; - virtual-wire = "ESPI_VWIRE_SIGNAL_SLP_S4"; - vw-invert; - }; - pwr-slp-s5 { - compatible = "intel,ap-pwrseq-vw"; - dbg-label = "SLP_S5 virtual wire input from PCH"; - enum-name = "PWR_SLP_S5"; - virtual-wire = "ESPI_VWIRE_SIGNAL_SLP_S5"; - vw-invert; - }; - pwr-all-sys-pwrgd { - compatible = "intel,ap-pwrseq-external"; - dbg-label = "Combined all power good"; - enum-name = "PWR_ALL_SYS_PWRGD"; - }; - pwr-adc-pp3300 { - compatible = "intel,ap-pwrseq-adc"; - dbg-label = "PP3300 PWROK (from ADC)"; - enum-name = "PWR_DSW_PWROK"; - trigger-high = <&cmp_pp3300_s5_high>; - trigger-low = <&cmp_pp3300_s5_low>; - }; - pwr-adc-pp1p05 { - compatible = "intel,ap-pwrseq-adc"; - dbg-label = "PP1P05 PWROK (from ADC)"; - enum-name = "PWR_PG_PP1P05"; - trigger-high = <&cmp_pp1p05_high>; - trigger-low = <&cmp_pp1p05_low>; - }; - - adc-cmp { - cmp_pp3300_s5_high: pp3300_high { - compatible = "nuvoton,adc-cmp"; - io-channels = <&adc0 6>; - comparison = "ADC_CMP_NPCX_GREATER"; - /* - * This is 90% of nominal voltage considering voltage - * divider on ADC input. - */ - threshold-mv = <2448>; - }; - cmp_pp3300_s5_low: pp3300_low { - compatible = "nuvoton,adc-cmp"; - io-channels = <&adc0 6>; - comparison = "ADC_CMP_NPCX_LESS_OR_EQUAL"; - threshold-mv = <2448>; - }; - cmp_pp1p05_high: pp1p05_high { - compatible = "nuvoton,adc-cmp"; - io-channels = <&adc0 4>; - comparison = "ADC_CMP_NPCX_GREATER"; - /* Setting at 90% of nominal voltage */ - threshold-mv = <945>; - }; - cmp_pp1p05_low: pp1p05_low { - compatible = "nuvoton,adc-cmp"; - io-channels = <&adc0 4>; - comparison = "ADC_CMP_NPCX_LESS_OR_EQUAL"; - threshold-mv = <945>; - }; - }; -}; - -/* - * Because the power signals directly reference the GPIOs, - * the correspinding named-gpios need to have no-auto-init set. - */ -&gpio_ec_soc_dsw_pwrok { - no-auto-init; -}; -&gpio_ec_soc_pch_pwrok_od { - no-auto-init; -}; -&gpio_ec_soc_rsmrst_l { - no-auto-init; -}; -&gpio_ec_soc_sys_pwrok { - no-auto-init; -}; -&gpio_ec_soc_vccst_pwrgd_od { - no-auto-init; -}; -&gpio_en_pp3300_s5 { - no-auto-init; -}; -&gpio_en_pp5000_s5 { - no-auto-init; -}; -&gpio_imvp91_vrrdy_od { - no-auto-init; -}; -&gpio_rsmrst_pwrgd_l { - no-auto-init; -}; -&gpio_slp_s0_l { - no-auto-init; -}; -&gpio_slp_s3_l { - no-auto-init; -}; -&gpio_slp_s4_l { - no-auto-init; -}; -&gpio_slp_sus_l { - no-auto-init; -}; -&gpio_sys_rst_odl { - no-auto-init; -}; diff --git a/zephyr/program/nissa/pujjo/project.conf b/zephyr/program/nissa/pujjo/project.conf deleted file mode 100644 index b9dc28b9cd..0000000000 --- a/zephyr/program/nissa/pujjo/project.conf +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2022 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -CONFIG_BOARD_PUJJO=y - -# Sensor drivers -CONFIG_PLATFORM_EC_ACCELGYRO_LSM6DSM=y -CONFIG_PLATFORM_EC_ACCEL_BMA4XX=y -CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C=y -CONFIG_PLATFORM_EC_ACCELGYRO_BMI3XX=y -CONFIG_PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT=y - -# Increase PD max power from default -CONFIG_PLATFORM_EC_PD_MAX_POWER_MW=65000 -CONFIG_PLATFORM_EC_PD_MAX_CURRENT_MA=3250 - -# LED -CONFIG_PLATFORM_EC_LED_PWM=n -CONFIG_PLATFORM_EC_LED_COMMON=y - -# CBI -CONFIG_PLATFORM_EC_BYPASS_CBI_EEPROM_WP_CHECK=y -CONFIG_PLATFORM_EC_SYSTEM_UNLOCKED=y - -# DPS -CONFIG_PLATFORM_EC_USB_PD_DPS=n - -# BTN -CONFIG_PLATFORM_EC_BUTTONS_RUNTIME_CONFIG=y - -# Charger -CONFIG_PLATFORM_EC_RAA489000_TRICKLE_CHARGE_CURRENT_256MA=y
\ No newline at end of file diff --git a/zephyr/program/nissa/pujjo/project.overlay b/zephyr/program/nissa/pujjo/project.overlay deleted file mode 100644 index e498775714..0000000000 --- a/zephyr/program/nissa/pujjo/project.overlay +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "../cbi.dtsi" - -#include "cbi.dtsi" -#include "generated.dtsi" -#include "keyboard.dtsi" -#include "motionsense.dtsi" -#include "overlay.dtsi" -#include "power_signals.dtsi" diff --git a/zephyr/program/nissa/pujjo/pujjo_vif.xml b/zephyr/program/nissa/pujjo/pujjo_vif.xml deleted file mode 100644 index b7d462584a..0000000000 --- a/zephyr/program/nissa/pujjo/pujjo_vif.xml +++ /dev/null @@ -1,350 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<vif:VIF xmlns:opt="http://usb.org/VendorInfoFileOptionalContent.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vif="http://usb.org/VendorInfoFile.xsd">
- <vif:VIF_Specification>3.19</vif:VIF_Specification>
- <vif:VIF_App>
- <vif:Vendor>USB-IF</vif:Vendor>
- <vif:Name>VIF Editor</vif:Name>
- <vif:Version>3.2.4.0</vif:Version>
- </vif:VIF_App>
- <vif:Vendor_Name>Google</vif:Vendor_Name>
- <vif:Model_Part_Number>Pujjo</vif:Model_Part_Number>
- <vif:Product_Revision>1</vif:Product_Revision>
- <vif:TID>0</vif:TID>
- <vif:VIF_Product_Type value="0">Port Product</vif:VIF_Product_Type>
- <vif:Certification_Type value="0">End Product</vif:Certification_Type>
- <vif:Product>
- <!--Product Level Content:-->
- </vif:Product>
- <vif:Component>
- <!--Component 0: Port 0-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Component-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Port_Label>0</vif:Port_Label>
- <vif:Connector_Type value="2">Type-C®</vif:Connector_Type>
- <vif:USB4_Supported value="false" />
- <vif:USB_PD_Support value="true" />
- <vif:PD_Port_Type value="4">DRP</vif:PD_Port_Type>
- <vif:Type_C_State_Machine value="2">DRP</vif:Type_C_State_Machine>
- <vif:Port_Battery_Powered value="true" />
- <vif:BC_1_2_Support value="2">Charging Port</vif:BC_1_2_Support>
- <vif:Captive_Cable value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;General PD-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:PD_Spec_Revision_Major value="3" />
- <vif:PD_Spec_Revision_Minor value="1" />
- <vif:PD_Spec_Version_Major value="1" />
- <vif:PD_Spec_Version_Minor value="3" />
- <vif:PD_Specification_Revision value="2">Revision 3</vif:PD_Specification_Revision>
- <vif:SOP_Capable value="true" />
- <vif:SOP_P_Capable value="true" />
- <vif:SOP_PP_Capable value="true" />
- <vif:SOP_P_Debug_Capable value="false" />
- <vif:SOP_PP_Debug_Capable value="false" />
- <vif:Manufacturer_Info_Supported_Port value="true" />
- <vif:Manufacturer_Info_VID_Port value="6353">18D1</vif:Manufacturer_Info_VID_Port>
- <vif:Manufacturer_Info_PID_Port value="20570">505A</vif:Manufacturer_Info_PID_Port>
- <vif:Chunking_Implemented_SOP value="true" />
- <vif:Unchunked_Extended_Messages_Supported value="false" />
- <vif:Security_Msgs_Supported_SOP value="false" />
- <vif:Unconstrained_Power value="false" />
- <vif:Num_Fixed_Batteries value="1" />
- <vif:Num_Swappable_Battery_Slots value="0" />
- <vif:ID_Header_Connector_Type_SOP value="2">USB Type-C® Receptacle</vif:ID_Header_Connector_Type_SOP>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;PD Capabilities-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:USB_Comms_Capable value="true" />
- <vif:DR_Swap_To_DFP_Supported value="true" />
- <vif:DR_Swap_To_UFP_Supported value="false" />
- <vif:VCONN_Swap_To_On_Supported value="true" />
- <vif:VCONN_Swap_To_Off_Supported value="true" />
- <vif:Responds_To_Discov_SOP_UFP value="false" />
- <vif:Responds_To_Discov_SOP_DFP value="true" />
- <vif:Attempts_Discov_SOP value="true" />
- <vif:Power_Interruption_Available value="0">No Interruption Possible</vif:Power_Interruption_Available>
- <vif:Data_Reset_Supported value="false" />
- <vif:Enter_USB_Supported value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;USB Type-C®-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Type_C_Can_Act_As_Host value="true" />
- <vif:Type_C_Can_Act_As_Device value="false" />
- <vif:Type_C_Implements_Try_SRC value="true" />
- <vif:Type_C_Implements_Try_SNK value="false" />
- <vif:Type_C_Supports_Audio_Accessory value="false" />
- <vif:Type_C_Is_VCONN_Powered_Accessory value="false" />
- <vif:Type_C_Is_Debug_Target_SRC value="true" />
- <vif:Type_C_Is_Debug_Target_SNK value="true" />
- <vif:RP_Value value="1">1.5A</vif:RP_Value>
- <vif:Type_C_Port_On_Hub value="false" />
- <vif:Type_C_Power_Source value="2">Both</vif:Type_C_Power_Source>
- <vif:Type_C_Sources_VCONN value="true" />
- <vif:Type_C_Is_Alt_Mode_Controller value="true" />
- <vif:Type_C_Is_Alt_Mode_Adapter value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Product Power-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Product_Total_Source_Power_mW value="15000">15000 mW</vif:Product_Total_Source_Power_mW>
- <vif:Port_Source_Power_Type value="0">Assured</vif:Port_Source_Power_Type>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;USB Host-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Host_Supports_USB_Data value="true" />
- <vif:Host_Speed value="1">USB 3.2 Gen 1x1</vif:Host_Speed>
- <vif:Host_Contains_Captive_Retimer value="false" />
- <vif:Host_Truncates_DP_For_tDHPResponse value="false" />
- <vif:Host_Is_Embedded value="false" />
- <vif:Host_Suspend_Supported value="true" />
- <vif:Is_DFP_On_Hub value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Battery Charging 1.2-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:BC_1_2_Charging_Port_Type value="1">CDP</vif:BC_1_2_Charging_Port_Type>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;PD Source-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:PD_Power_As_Source value="15000">15000 mW</vif:PD_Power_As_Source>
- <vif:EPR_Supported_As_Src value="false" />
- <vif:USB_Suspend_May_Be_Cleared value="false" />
- <vif:Sends_Pings value="false" />
- <vif:FR_Swap_Type_C_Current_Capability_As_Initial_Sink value="0">FR_Swap not supported</vif:FR_Swap_Type_C_Current_Capability_As_Initial_Sink>
- <vif:Master_Port value="false" />
- <vif:Num_Src_PDOs value="1" />
- <vif:PD_OC_Protection value="true" />
- <vif:PD_OCP_Method value="0">Over-Current Response</vif:PD_OCP_Method>
- <!--Bundle: SrcPdoList-->
- <vif:SrcPdoList>
- <vif:SrcPDO>
- <!--Source PDO 1-->
- <vif:Src_PDO_Supply_Type value="0">Fixed</vif:Src_PDO_Supply_Type>
- <vif:Src_PDO_Peak_Current value="0">100% IOC</vif:Src_PDO_Peak_Current>
- <vif:Src_PDO_Voltage value="100">5000 mV</vif:Src_PDO_Voltage>
- <vif:Src_PDO_Max_Current value="300">3000 mA</vif:Src_PDO_Max_Current>
- <vif:Src_PD_OCP_OC_Debounce value="0">0 msec</vif:Src_PD_OCP_OC_Debounce>
- <vif:Src_PD_OCP_OC_Threshold value="300">3000 mA</vif:Src_PD_OCP_OC_Threshold>
- </vif:SrcPDO>
- </vif:SrcPdoList>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;PD Sink-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:PD_Power_As_Sink value="60000">60000 mW</vif:PD_Power_As_Sink>
- <vif:EPR_Supported_As_Snk value="false" />
- <vif:No_USB_Suspend_May_Be_Set value="true" />
- <vif:GiveBack_May_Be_Set value="false" />
- <vif:Higher_Capability_Set value="false" />
- <vif:FR_Swap_Reqd_Type_C_Current_As_Initial_Source value="0">FR_Swap not supported</vif:FR_Swap_Reqd_Type_C_Current_As_Initial_Source>
- <vif:Num_Snk_PDOs value="3" />
- <!--Bundle: SnkPdoList-->
- <vif:SnkPdoList>
- <vif:SnkPDO>
- <!--Sink PDO 1-->
- <vif:Snk_PDO_Supply_Type value="0">Fixed</vif:Snk_PDO_Supply_Type>
- <vif:Snk_PDO_Voltage value="100">5000 mV</vif:Snk_PDO_Voltage>
- <vif:Snk_PDO_Op_Current value="300">3000 mA</vif:Snk_PDO_Op_Current>
- </vif:SnkPDO>
- <vif:SnkPDO>
- <!--Sink PDO 2-->
- <vif:Snk_PDO_Supply_Type value="1">Battery</vif:Snk_PDO_Supply_Type>
- <vif:Snk_PDO_Op_Power value="60">15000 mW</vif:Snk_PDO_Op_Power>
- <vif:Snk_PDO_Min_Voltage value="95">4750 mV</vif:Snk_PDO_Min_Voltage>
- <vif:Snk_PDO_Max_Voltage value="400">20000 mV</vif:Snk_PDO_Max_Voltage>
- </vif:SnkPDO>
- <vif:SnkPDO>
- <!--Sink PDO 3-->
- <vif:Snk_PDO_Supply_Type value="2">Variable</vif:Snk_PDO_Supply_Type>
- <vif:Snk_PDO_Min_Voltage value="95">4750 mV</vif:Snk_PDO_Min_Voltage>
- <vif:Snk_PDO_Max_Voltage value="400">20000 mV</vif:Snk_PDO_Max_Voltage>
- <vif:Snk_PDO_Op_Current value="300">3000 mA</vif:Snk_PDO_Op_Current>
- </vif:SnkPDO>
- </vif:SnkPdoList>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Dual Role-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Accepts_PR_Swap_As_Src value="true" />
- <vif:Accepts_PR_Swap_As_Snk value="true" />
- <vif:Requests_PR_Swap_As_Src value="true" />
- <vif:Requests_PR_Swap_As_Snk value="true" />
- <vif:FR_Swap_Supported_As_Initial_Sink value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;SOP Discover ID-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:XID_SOP value="0" />
- <vif:Data_Capable_As_USB_Host_SOP value="true" />
- <vif:Data_Capable_As_USB_Device_SOP value="false" />
- <vif:Product_Type_UFP_SOP value="0">Undefined</vif:Product_Type_UFP_SOP>
- <vif:Product_Type_DFP_SOP value="2">PDUSB Host</vif:Product_Type_DFP_SOP>
- <vif:DFP_VDO_Port_Number value="0" />
- <vif:Modal_Operation_Supported_SOP value="false" />
- <vif:USB_VID_SOP value="6353">18D1</vif:USB_VID_SOP>
- <vif:PID_SOP value="20570">505A</vif:PID_SOP>
- <vif:bcdDevice_SOP value="0">0000</vif:bcdDevice_SOP>
- </vif:Component>
- <vif:Component>
- <!--Component 1: Port 1-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Component-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Port_Label>1</vif:Port_Label>
- <vif:Connector_Type value="2">Type-C®</vif:Connector_Type>
- <vif:USB4_Supported value="false" />
- <vif:USB_PD_Support value="true" />
- <vif:PD_Port_Type value="4">DRP</vif:PD_Port_Type>
- <vif:Type_C_State_Machine value="2">DRP</vif:Type_C_State_Machine>
- <vif:Port_Battery_Powered value="true" />
- <vif:BC_1_2_Support value="2">Charging Port</vif:BC_1_2_Support>
- <vif:Captive_Cable value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;General PD-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:PD_Spec_Revision_Major value="3" />
- <vif:PD_Spec_Revision_Minor value="1" />
- <vif:PD_Spec_Version_Major value="1" />
- <vif:PD_Spec_Version_Minor value="3" />
- <vif:PD_Specification_Revision value="2">Revision 3</vif:PD_Specification_Revision>
- <vif:SOP_Capable value="true" />
- <vif:SOP_P_Capable value="true" />
- <vif:SOP_PP_Capable value="true" />
- <vif:SOP_P_Debug_Capable value="false" />
- <vif:SOP_PP_Debug_Capable value="false" />
- <vif:Manufacturer_Info_Supported_Port value="true" />
- <vif:Manufacturer_Info_VID_Port value="6353">18D1</vif:Manufacturer_Info_VID_Port>
- <vif:Manufacturer_Info_PID_Port value="20570">505A</vif:Manufacturer_Info_PID_Port>
- <vif:Chunking_Implemented_SOP value="true" />
- <vif:Unchunked_Extended_Messages_Supported value="false" />
- <vif:Security_Msgs_Supported_SOP value="false" />
- <vif:Unconstrained_Power value="false" />
- <vif:Num_Fixed_Batteries value="1" />
- <vif:Num_Swappable_Battery_Slots value="0" />
- <vif:ID_Header_Connector_Type_SOP value="2">USB Type-C® Receptacle</vif:ID_Header_Connector_Type_SOP>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;PD Capabilities-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:USB_Comms_Capable value="true" />
- <vif:DR_Swap_To_DFP_Supported value="true" />
- <vif:DR_Swap_To_UFP_Supported value="false" />
- <vif:VCONN_Swap_To_On_Supported value="true" />
- <vif:VCONN_Swap_To_Off_Supported value="true" />
- <vif:Responds_To_Discov_SOP_UFP value="false" />
- <vif:Responds_To_Discov_SOP_DFP value="true" />
- <vif:Attempts_Discov_SOP value="true" />
- <vif:Power_Interruption_Available value="0">No Interruption Possible</vif:Power_Interruption_Available>
- <vif:Data_Reset_Supported value="false" />
- <vif:Enter_USB_Supported value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;USB Type-C®-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Type_C_Can_Act_As_Host value="true" />
- <vif:Type_C_Can_Act_As_Device value="false" />
- <vif:Type_C_Implements_Try_SRC value="true" />
- <vif:Type_C_Implements_Try_SNK value="false" />
- <vif:Type_C_Supports_Audio_Accessory value="false" />
- <vif:Type_C_Is_VCONN_Powered_Accessory value="false" />
- <vif:Type_C_Is_Debug_Target_SRC value="true" />
- <vif:Type_C_Is_Debug_Target_SNK value="true" />
- <vif:RP_Value value="1">1.5A</vif:RP_Value>
- <vif:Type_C_Port_On_Hub value="false" />
- <vif:Type_C_Power_Source value="2">Both</vif:Type_C_Power_Source>
- <vif:Type_C_Sources_VCONN value="true" />
- <vif:Type_C_Is_Alt_Mode_Controller value="true" />
- <vif:Type_C_Is_Alt_Mode_Adapter value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Product Power-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Product_Total_Source_Power_mW value="15000">15000 mW</vif:Product_Total_Source_Power_mW>
- <vif:Port_Source_Power_Type value="0">Assured</vif:Port_Source_Power_Type>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;USB Host-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Host_Supports_USB_Data value="true" />
- <vif:Host_Speed value="1">USB 3.2 Gen 1x1</vif:Host_Speed>
- <vif:Host_Contains_Captive_Retimer value="true" />
- <vif:Host_Truncates_DP_For_tDHPResponse value="false" />
- <vif:Host_Is_Embedded value="false" />
- <vif:Host_Suspend_Supported value="true" />
- <vif:Is_DFP_On_Hub value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Battery Charging 1.2-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:BC_1_2_Charging_Port_Type value="1">CDP</vif:BC_1_2_Charging_Port_Type>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;PD Source-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:PD_Power_As_Source value="15000">15000 mW</vif:PD_Power_As_Source>
- <vif:EPR_Supported_As_Src value="false" />
- <vif:USB_Suspend_May_Be_Cleared value="false" />
- <vif:Sends_Pings value="false" />
- <vif:FR_Swap_Type_C_Current_Capability_As_Initial_Sink value="0">FR_Swap not supported</vif:FR_Swap_Type_C_Current_Capability_As_Initial_Sink>
- <vif:Master_Port value="false" />
- <vif:Num_Src_PDOs value="1" />
- <vif:PD_OC_Protection value="true" />
- <vif:PD_OCP_Method value="0">Over-Current Response</vif:PD_OCP_Method>
- <!--Bundle: SrcPdoList-->
- <vif:SrcPdoList>
- <vif:SrcPDO>
- <!--Source PDO 1-->
- <vif:Src_PDO_Supply_Type value="0">Fixed</vif:Src_PDO_Supply_Type>
- <vif:Src_PDO_Peak_Current value="0">100% IOC</vif:Src_PDO_Peak_Current>
- <vif:Src_PDO_Voltage value="100">5000 mV</vif:Src_PDO_Voltage>
- <vif:Src_PDO_Max_Current value="300">3000 mA</vif:Src_PDO_Max_Current>
- <vif:Src_PD_OCP_OC_Debounce value="0">0 msec</vif:Src_PD_OCP_OC_Debounce>
- <vif:Src_PD_OCP_OC_Threshold value="300">3000 mA</vif:Src_PD_OCP_OC_Threshold>
- </vif:SrcPDO>
- </vif:SrcPdoList>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;PD Sink-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:PD_Power_As_Sink value="60000">60000 mW</vif:PD_Power_As_Sink>
- <vif:EPR_Supported_As_Snk value="false" />
- <vif:No_USB_Suspend_May_Be_Set value="true" />
- <vif:GiveBack_May_Be_Set value="false" />
- <vif:Higher_Capability_Set value="false" />
- <vif:FR_Swap_Reqd_Type_C_Current_As_Initial_Source value="0">FR_Swap not supported</vif:FR_Swap_Reqd_Type_C_Current_As_Initial_Source>
- <vif:Num_Snk_PDOs value="3" />
- <!--Bundle: SnkPdoList-->
- <vif:SnkPdoList>
- <vif:SnkPDO>
- <!--Sink PDO 1-->
- <vif:Snk_PDO_Supply_Type value="0">Fixed</vif:Snk_PDO_Supply_Type>
- <vif:Snk_PDO_Voltage value="100">5000 mV</vif:Snk_PDO_Voltage>
- <vif:Snk_PDO_Op_Current value="300">3000 mA</vif:Snk_PDO_Op_Current>
- </vif:SnkPDO>
- <vif:SnkPDO>
- <!--Sink PDO 2-->
- <vif:Snk_PDO_Supply_Type value="1">Battery</vif:Snk_PDO_Supply_Type>
- <vif:Snk_PDO_Op_Power value="60">15000 mW</vif:Snk_PDO_Op_Power>
- <vif:Snk_PDO_Min_Voltage value="95">4750 mV</vif:Snk_PDO_Min_Voltage>
- <vif:Snk_PDO_Max_Voltage value="400">20000 mV</vif:Snk_PDO_Max_Voltage>
- </vif:SnkPDO>
- <vif:SnkPDO>
- <!--Sink PDO 3-->
- <vif:Snk_PDO_Supply_Type value="2">Variable</vif:Snk_PDO_Supply_Type>
- <vif:Snk_PDO_Min_Voltage value="95">4750 mV</vif:Snk_PDO_Min_Voltage>
- <vif:Snk_PDO_Max_Voltage value="400">20000 mV</vif:Snk_PDO_Max_Voltage>
- <vif:Snk_PDO_Op_Current value="300">3000 mA</vif:Snk_PDO_Op_Current>
- </vif:SnkPDO>
- </vif:SnkPdoList>
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;Dual Role-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:Accepts_PR_Swap_As_Src value="true" />
- <vif:Accepts_PR_Swap_As_Snk value="true" />
- <vif:Requests_PR_Swap_As_Src value="true" />
- <vif:Requests_PR_Swap_As_Snk value="true" />
- <vif:FR_Swap_Supported_As_Initial_Sink value="false" />
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <!--;SOP Discover ID-->
- <!--;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-->
- <vif:XID_SOP value="0" />
- <vif:Data_Capable_As_USB_Host_SOP value="true" />
- <vif:Data_Capable_As_USB_Device_SOP value="false" />
- <vif:Product_Type_UFP_SOP value="0">Undefined</vif:Product_Type_UFP_SOP>
- <vif:Product_Type_DFP_SOP value="2">PDUSB Host</vif:Product_Type_DFP_SOP>
- <vif:DFP_VDO_Port_Number value="1" />
- <vif:Modal_Operation_Supported_SOP value="false" />
- <vif:USB_VID_SOP value="6353">18D1</vif:USB_VID_SOP>
- <vif:PID_SOP value="20570">505A</vif:PID_SOP>
- <vif:bcdDevice_SOP value="0">0000</vif:bcdDevice_SOP>
- </vif:Component>
-</vif:VIF>
\ No newline at end of file diff --git a/zephyr/program/nissa/pujjo/src/charger.c b/zephyr/program/nissa/pujjo/src/charger.c deleted file mode 100644 index 8763f24793..0000000000 --- a/zephyr/program/nissa/pujjo/src/charger.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "battery.h" -#include "charger.h" -#include "charger/isl923x_public.h" -#include "console.h" -#include "driver/charger/isl923x.h" -#include "driver/tcpm/raa489000.h" -#include "extpower.h" -#include "hooks.h" -#include "nissa_common.h" -#include "usb_pd.h" - -#include <zephyr/logging/log.h> - -LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL); - -int extpower_is_present(void) -{ - int port; - int rv; - bool acok; - - for (port = 0; port < board_get_usb_pd_port_count(); port++) { - rv = raa489000_is_acok(port, &acok); - if ((rv == EC_SUCCESS) && acok) - return 1; - } - - return 0; -} - -/* - * Pujjo does not have a GPIO indicating whether extpower is present, - * so detect using the charger(s). - */ -__override void board_check_extpower(void) -{ - static int last_extpower_present; - int extpower_present = extpower_is_present(); - - if (last_extpower_present ^ extpower_present) - extpower_handle_update(extpower_present); - - last_extpower_present = extpower_present; -} - -__override void board_hibernate(void) -{ - /* Shut down the chargers */ - raa489000_hibernate(0, true); - LOG_INF("Charger(s) hibernated"); - cflush(); -} - -static void charger_prochot_init(void) -{ - isl923x_set_ac_prochot(CHARGER_SOLO, 3500); - isl923x_set_dc_prochot(CHARGER_SOLO, 6528); -} -DECLARE_HOOK(HOOK_INIT, charger_prochot_init, HOOK_PRIO_POST_FIRST); diff --git a/zephyr/program/nissa/pujjo/src/fan.c b/zephyr/program/nissa/pujjo/src/fan.c deleted file mode 100644 index 8b8634a653..0000000000 --- a/zephyr/program/nissa/pujjo/src/fan.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "cros_cbi.h" -#include "fan.h" -#include "gpio/gpio.h" -#include "hooks.h" -#include "nissa_common.h" - -#include <zephyr/devicetree.h> -#include <zephyr/drivers/gpio.h> -#include <zephyr/logging/log.h> - -LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL); - -/* - * Pujjo fan support - */ -static void fan_init(void) -{ - int ret; - uint32_t val; - /* - * Retrieve the fan config. - */ - ret = cros_cbi_get_fw_config(FW_FAN, &val); - if (ret != 0) { - LOG_ERR("Error retrieving CBI FW_CONFIG field %d", FW_FAN); - return; - } - if (val != FW_FAN_PRESENT) { - /* Disable the fan */ - fan_set_count(0); - } else { - /* Configure the fan enable GPIO */ - gpio_pin_configure_dt(GPIO_DT_FROM_NODELABEL(gpio_fan_enable), - GPIO_OUTPUT); - } -} -DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_POST_FIRST); diff --git a/zephyr/program/nissa/pujjo/src/form_factor.c b/zephyr/program/nissa/pujjo/src/form_factor.c deleted file mode 100644 index f160c88d78..0000000000 --- a/zephyr/program/nissa/pujjo/src/form_factor.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "accelgyro.h" -#include "button.h" -#include "cros_board_info.h" -#include "cros_cbi.h" -#include "driver/accel_bma4xx.h" -#include "driver/accel_lis2dw12_public.h" -#include "driver/accelgyro_bmi323.h" -#include "driver/accelgyro_lsm6dsm.h" -#include "gpio/gpio_int.h" -#include "hooks.h" -#include "motion_sense.h" -#include "motionsense_sensors.h" -#include "nissa_common.h" -#include "tablet_mode.h" - -#include <zephyr/devicetree.h> -#include <zephyr/logging/log.h> - -LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL); - -static bool use_alt_sensor; -static bool use_alt_lid_accel; - -void motion_interrupt(enum gpio_signal signal) -{ - if (use_alt_sensor) - lsm6dsm_interrupt(signal); - else - bmi3xx_interrupt(signal); -} - -void lid_accel_interrupt(enum gpio_signal signal) -{ - if (use_alt_lid_accel) - lis2dw12_interrupt(signal); - else - bma4xx_interrupt(signal); -} - -static void sensor_init(void) -{ - int ret; - uint32_t val; - /* check which sensors are installed */ - use_alt_sensor = cros_cbi_ssfc_check_match( - CBI_SSFC_VALUE_ID(DT_NODELABEL(base_sensor_1))); - use_alt_lid_accel = cros_cbi_ssfc_check_match( - CBI_SSFC_VALUE_ID(DT_NODELABEL(lid_sensor_1))); - - motion_sensors_check_ssfc(); - - /* Check if it's tablet or not */ - ret = cros_cbi_get_fw_config(FW_TABLET, &val); - if (ret != 0) { - LOG_ERR("Error retrieving CBI FW_CONFIG field %d", FW_TABLET); - return; - } - if (val == FW_TABLET_NOT_PRESENT) { - LOG_INF("Clamshell: disable motionsense function."); - motion_sensor_count = 0; - gmr_tablet_switch_disable(); - gpio_disable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_imu)); - gpio_pin_configure_dt(GPIO_DT_FROM_NODELABEL(gpio_imu_int_l), - GPIO_DISCONNECTED); - - LOG_INF("Clamshell: disable volume button function."); - button_disable_gpio(BUTTON_VOLUME_UP); - button_disable_gpio(BUTTON_VOLUME_DOWN); - } else { - LOG_INF("Tablet: Enable motionsense function."); - } -} -DECLARE_HOOK(HOOK_INIT, sensor_init, HOOK_PRIO_POST_I2C); diff --git a/zephyr/program/nissa/pujjo/src/hdmi.c b/zephyr/program/nissa/pujjo/src/hdmi.c deleted file mode 100644 index 9461e7c53e..0000000000 --- a/zephyr/program/nissa/pujjo/src/hdmi.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "nissa_hdmi.h" - -__override void nissa_configure_hdmi_power_gpios(void) -{ - /* Pujjo needs to drive VCC enable but not core rails */ - nissa_configure_hdmi_vcc(); -} diff --git a/zephyr/program/nissa/pujjo/src/keyboard.c b/zephyr/program/nissa/pujjo/src/keyboard.c deleted file mode 100644 index 1587030080..0000000000 --- a/zephyr/program/nissa/pujjo/src/keyboard.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "ec_commands.h" - -static const struct ec_response_keybd_config pujjo_kb = { - .num_top_row_keys = 10, - .action_keys = { - TK_BACK, /* T1 */ - TK_REFRESH, /* T2 */ - TK_FULLSCREEN, /* T3 */ - TK_OVERVIEW, /* T4 */ - TK_BRIGHTNESS_DOWN, /* T5 */ - TK_BRIGHTNESS_UP, /* T6 */ - TK_MICMUTE, /* T7 */ - TK_VOL_MUTE, /* T8 */ - TK_VOL_DOWN, /* T9 */ - TK_VOL_UP, /* T10 */ - }, - .capabilities = KEYBD_CAP_SCRNLOCK_KEY, -}; - -__override const struct ec_response_keybd_config * -board_vivaldi_keybd_config(void) -{ - return &pujjo_kb; -} diff --git a/zephyr/program/nissa/pujjo/src/led.c b/zephyr/program/nissa/pujjo/src/led.c deleted file mode 100644 index 4d859f2764..0000000000 --- a/zephyr/program/nissa/pujjo/src/led.c +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* Pujjo specific PWM LED settings: there are 2 LEDs on each side of the board, - * each one can be controlled separately. The LED colors are white or amber, - * and the default behavior is tied to the charging process: both sides are - * amber while charging the battery and white when the battery is charged. - */ - -#include "common.h" -#include "gpio.h" -#include "led_common.h" -#include "led_onoff_states.h" - -#define CPRINTS(format, args...) cprints(CC_CHARGER, format, ##args) -#define CPRINTF(format, args...) cprintf(CC_CHARGER, format, ##args) - -#define LED_OFF_LVL 1 -#define LED_ON_LVL 0 - -__override const int led_charge_lvl_1 = 5; - -__override const int led_charge_lvl_2 = 97; - -__override struct led_descriptor - led_bat_state_table[LED_NUM_STATES][LED_NUM_PHASES] = { - [STATE_CHARGING_LVL_1] = { { EC_LED_COLOR_RED, - LED_INDEFINITE } }, - [STATE_CHARGING_LVL_2] = { { EC_LED_COLOR_AMBER, - LED_INDEFINITE } }, - [STATE_CHARGING_FULL_CHARGE] = { { EC_LED_COLOR_GREEN, - LED_INDEFINITE } }, - [STATE_DISCHARGE_S0] = { { LED_OFF, LED_INDEFINITE } }, - [STATE_DISCHARGE_S3] = { { LED_OFF, LED_INDEFINITE } }, - [STATE_DISCHARGE_S5] = { { LED_OFF, LED_INDEFINITE } }, - [STATE_BATTERY_ERROR] = { { EC_LED_COLOR_RED, 1 * LED_ONE_SEC }, - { LED_OFF, 1 * LED_ONE_SEC } }, - [STATE_FACTORY_TEST] = { { EC_LED_COLOR_RED, 2 * LED_ONE_SEC }, - { EC_LED_COLOR_GREEN, - 2 * LED_ONE_SEC } }, - }; - -__override const struct led_descriptor - led_pwr_state_table[PWR_LED_NUM_STATES][LED_NUM_PHASES] = { - [PWR_LED_STATE_ON] = { { EC_LED_COLOR_WHITE, LED_INDEFINITE } }, - [PWR_LED_STATE_SUSPEND_AC] = { { EC_LED_COLOR_WHITE, - 3 * LED_ONE_SEC }, - { LED_OFF, 0.5 * LED_ONE_SEC } }, - [PWR_LED_STATE_SUSPEND_NO_AC] = { { EC_LED_COLOR_WHITE, - 3 * LED_ONE_SEC }, - { LED_OFF, - 0.5 * LED_ONE_SEC } }, - [PWR_LED_STATE_OFF] = { { LED_OFF, LED_INDEFINITE } }, - }; - -const enum ec_led_id supported_led_ids[] = { EC_LED_ID_BATTERY_LED, - EC_LED_ID_POWER_LED }; - -const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); - -__override void led_set_color_power(enum ec_led_colors color) -{ - if (color == EC_LED_COLOR_WHITE) - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_power_led), - LED_ON_LVL); - else - /* LED_OFF and unsupported colors */ - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_power_led), - LED_OFF_LVL); -} - -__override void led_set_color_battery(enum ec_led_colors color) -{ - switch (color) { - case EC_LED_COLOR_AMBER: - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_1_odl), - LED_ON_LVL); - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_2_odl), - LED_ON_LVL); - break; - case EC_LED_COLOR_RED: - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_1_odl), - LED_ON_LVL); - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_2_odl), - LED_OFF_LVL); - break; - case EC_LED_COLOR_GREEN: - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_1_odl), - LED_OFF_LVL); - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_2_odl), - LED_ON_LVL); - break; - default: /* LED_OFF and other unsupported colors */ - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_1_odl), - LED_OFF_LVL); - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_led_2_odl), - LED_OFF_LVL); - break; - } -} - -void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range) -{ - if (led_id == EC_LED_ID_BATTERY_LED) { - brightness_range[EC_LED_COLOR_RED] = 1; - brightness_range[EC_LED_COLOR_AMBER] = 1; - brightness_range[EC_LED_COLOR_GREEN] = 1; - } else if (led_id == EC_LED_ID_POWER_LED) { - brightness_range[EC_LED_COLOR_WHITE] = 1; - } -} - -int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) -{ - if (led_id == EC_LED_ID_BATTERY_LED) { - if (brightness[EC_LED_COLOR_RED] != 0) - led_set_color_battery(EC_LED_COLOR_RED); - else if (brightness[EC_LED_COLOR_AMBER] != 0) - led_set_color_battery(EC_LED_COLOR_AMBER); - else if (brightness[EC_LED_COLOR_GREEN] != 0) - led_set_color_battery(EC_LED_COLOR_GREEN); - else - led_set_color_battery(LED_OFF); - } else if (led_id == EC_LED_ID_POWER_LED) { - if (brightness[EC_LED_COLOR_WHITE] != 0) - led_set_color_power(EC_LED_COLOR_WHITE); - else - led_set_color_power(LED_OFF); - } - - return EC_SUCCESS; -} diff --git a/zephyr/program/nissa/pujjo/src/usbc.c b/zephyr/program/nissa/pujjo/src/usbc.c deleted file mode 100644 index ac93edfd7a..0000000000 --- a/zephyr/program/nissa/pujjo/src/usbc.c +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "charge_state_v2.h" -#include "chipset.h" -#include "driver/charger/isl923x_public.h" -#include "driver/retimer/anx7483_public.h" -#include "driver/tcpm/raa489000.h" -#include "driver/tcpm/tcpci.h" -#include "hooks.h" -#include "nissa_common.h" -#include "system.h" -#include "usb_mux.h" - -#include <zephyr/logging/log.h> - -LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL); - -int board_is_sourcing_vbus(int port) -{ - int regval; - - tcpc_read(port, TCPC_REG_POWER_STATUS, ®val); - return !!(regval & TCPC_REG_POWER_STATUS_SOURCING_VBUS); -} - -int board_set_active_charge_port(int port) -{ - int is_real_port = (port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT); - int i; - int old_port; - - if (!is_real_port && port != CHARGE_PORT_NONE) - return EC_ERROR_INVAL; - - old_port = charge_manager_get_active_charge_port(); - - LOG_INF("New chg p%d", port); - - /* Disable all ports. */ - if (port == CHARGE_PORT_NONE) { - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { - tcpc_write(i, TCPC_REG_COMMAND, - TCPC_REG_COMMAND_SNK_CTRL_LOW); - raa489000_enable_asgate(i, false); - } - - return EC_SUCCESS; - } - - /* Check if port is sourcing VBUS. */ - if (board_is_sourcing_vbus(port)) { - LOG_WRN("Skip enable p%d", port); - return EC_ERROR_INVAL; - } - - /* - * Turn off the other ports' sink path FETs, before enabling the - * requested charge port. - */ - for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { - if (i == port) - continue; - - if (tcpc_write(i, TCPC_REG_COMMAND, - TCPC_REG_COMMAND_SNK_CTRL_LOW)) - LOG_WRN("p%d: sink path disable failed.", i); - raa489000_enable_asgate(i, false); - } - - /* - * Stop the charger IC from switching while changing ports. Otherwise, - * we can overcurrent the adapter we're switching to. (crbug.com/926056) - */ - if (old_port != CHARGE_PORT_NONE) - charger_discharge_on_ac(1); - - /* Enable requested charge port. */ - if (raa489000_enable_asgate(port, true) || - tcpc_write(port, TCPC_REG_COMMAND, - TCPC_REG_COMMAND_SNK_CTRL_HIGH)) { - LOG_WRN("p%d: sink path enable failed.", port); - charger_discharge_on_ac(0); - return EC_ERROR_UNKNOWN; - } - - /* Allow the charger IC to begin/continue switching. */ - charger_discharge_on_ac(0); - - return EC_SUCCESS; -} - -uint16_t tcpc_get_alert_status(void) -{ - uint16_t status = 0; - int regval; - - /* - * The interrupt line is shared between the TCPC and BC1.2 detector IC. - * Therefore, go out and actually read the alert registers to report the - * alert status. - */ - if (!gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_usb_c0_int_odl))) { - if (!tcpc_read16(0, TCPC_REG_ALERT, ®val)) { - /* The TCPCI Rev 1.0 spec says to ignore bits 14:12. */ - if (!(tcpc_config[0].flags & TCPC_FLAGS_TCPCI_REV2_0)) - regval &= ~((1 << 14) | (1 << 13) | (1 << 12)); - - if (regval) - status |= PD_STATUS_TCPC_ALERT_0; - } - } - return status; -} - -void pd_power_supply_reset(int port) -{ - /* Disable VBUS */ - tcpc_write(port, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SRC_CTRL_LOW); - - /* Notify host of power info change. */ - pd_send_host_event(PD_EVENT_POWER_CHANGE); -} - -__override void typec_set_source_current_limit(int port, enum tcpc_rp_value rp) -{ - if (port < 0 || port >= CONFIG_USB_PD_PORT_MAX_COUNT) - return; - - raa489000_set_output_current(port, rp); -} - -int pd_set_power_supply_ready(int port) -{ - int rv; - - if (port >= CONFIG_USB_PD_PORT_MAX_COUNT) - return EC_ERROR_INVAL; - - /* Disable charging. */ - rv = tcpc_write(port, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SNK_CTRL_LOW); - if (rv) - return rv; - - /* Our policy is not to source VBUS when the AP is off. */ - if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) - return EC_ERROR_NOT_POWERED; - - /* Provide Vbus. */ - rv = tcpc_write(port, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SRC_CTRL_HIGH); - if (rv) - return rv; - - rv = raa489000_enable_asgate(port, true); - if (rv) - return rv; - - /* Notify host of power info change. */ - pd_send_host_event(PD_EVENT_POWER_CHANGE); - - return EC_SUCCESS; -} - -void board_reset_pd_mcu(void) -{ - /* - * TODO(b:147316511): could send a reset command to the TCPC here - * if needed. - */ -} - -/* - * Because the TCPCs and BC1.2 chips share interrupt lines, it's possible - * for an interrupt to be lost if one asserts the IRQ, the other does the same - * then the first releases it: there will only be one falling edge to trigger - * the interrupt, and the line will be held low. We handle this by running a - * deferred check after a falling edge to see whether the IRQ is still being - * asserted. If it is, we assume an interrupt may have been lost and we need - * to poll each chip for events again. - */ -#define USBC_INT_POLL_DELAY_US 5000 - -static void poll_c0_int(void); -DECLARE_DEFERRED(poll_c0_int); - -static void usbc_interrupt_trigger(int port) -{ - schedule_deferred_pd_interrupt(port); - usb_charger_task_set_event(port, USB_CHG_EVENT_BC12); -} - -static inline void poll_usb_gpio(int port, const struct gpio_dt_spec *gpio, - const struct deferred_data *ud) -{ - if (!gpio_pin_get_dt(gpio)) { - usbc_interrupt_trigger(port); - hook_call_deferred(ud, USBC_INT_POLL_DELAY_US); - } -} - -static void poll_c0_int(void) -{ - poll_usb_gpio(0, GPIO_DT_FROM_NODELABEL(gpio_usb_c0_int_odl), - &poll_c0_int_data); -} - -void usb_interrupt(enum gpio_signal signal) -{ - int port; - const struct deferred_data *ud; - - if (signal == GPIO_SIGNAL(DT_NODELABEL(gpio_usb_c0_int_odl))) { - port = 0; - ud = &poll_c0_int_data; - } - /* - * We've just been called from a falling edge, so there's definitely - * no lost IRQ right now. Cancel any pending check. - */ - hook_call_deferred(ud, -1); - /* Trigger polling of TCPC and BC1.2 in respective tasks */ - usbc_interrupt_trigger(port); - /* Check for lost interrupts in a bit */ - hook_call_deferred(ud, USBC_INT_POLL_DELAY_US); -} |