This change is required for compilation of embedded controller firmware to work properly (See CONFIG_HOSTCMD_SECTION_SORTED).
Unified · Split
| @@ -553,6 +553,9 @@ struct ec_host_response { · 552 unmodified lines | ||
| 553 | 553 | * Parameter/response length is implicit in the structs. Some underlying |
| 554 | 554 | * communication protocols (I2C, SPI) may add length or checksum headers, but |
| 555 | 555 | * those are implementation-dependent and not defined here. |
| 556 | + * | |
| 557 | + * All commands MUST be #defined to be 4-digit UPPER CASE hex values | |
| 558 | + * (e.g., 0x00AB, not 0xab) for CONFIG_HOSTCMD_SECTION_SORTED to work. | |
| 556 | 559 | */ |
| 557 | 560 | |
| 558 | 561 | /*****************************************************************************/ |
| @@ -562,7 +565,7 @@ struct ec_host_response { · 3 unmodified lines | ||
| 562 | 565 | * Get protocol version, used to deal with non-backward compatible protocol |
| 563 | 566 | * changes. |
| 564 | 567 | */ |
| 565 | −#define EC_CMD_PROTO_VERSION 0x00 | |
| 568 | +#define EC_CMD_PROTO_VERSION 0x0000 | |
| 566 | 569 | |
| 567 | 570 | /** |
| 568 | 571 | * struct ec_response_proto_version - Response to the proto version command. |
| @@ -576,7 +579,7 @@ struct ec_response_proto_version { · 7 unmodified lines | ||
| 576 | 579 | * Hello. This is a simple command to test the EC is responsive to |
| 577 | 580 | * commands. |
| 578 | 581 | */ |
| 579 | −#define EC_CMD_HELLO 0x01 | |
| 582 | +#define EC_CMD_HELLO 0x0001 | |
| 580 | 583 | |
| 581 | 584 | /** |
| 582 | 585 | * struct ec_params_hello - Parameters to the hello command. |
| @@ -595,7 +598,7 @@ struct ec_response_hello { · 12 unmodified lines | ||
| 595 | 598 | } __ec_align4; |
| 596 | 599 | |
| 597 | 600 | /* Get version number */ |
| 598 | −#define EC_CMD_GET_VERSION 0x02 | |
| 601 | +#define EC_CMD_GET_VERSION 0x0002 | |
| 599 | 602 | |
| 600 | 603 | enum ec_current_image { |
| 601 | 604 | EC_IMAGE_UNKNOWN = 0, |
| @@ -618,7 +621,7 @@ struct ec_response_get_version { · 16 unmodified lines | ||
| 618 | 621 | } __ec_align4; |
| 619 | 622 | |
| 620 | 623 | /* Read test */ |
| 621 | −#define EC_CMD_READ_TEST 0x03 | |
| 624 | +#define EC_CMD_READ_TEST 0x0003 | |
| 622 | 625 | |
| 623 | 626 | /** |
| 624 | 627 | * struct ec_params_read_test - Parameters for the read test command. |
| @@ -643,10 +646,10 @@ struct ec_response_read_test { · 18 unmodified lines | ||
| 643 | 646 | * |
| 644 | 647 | * Response is null-terminated string. |
| 645 | 648 | */ |
| 646 | −#define EC_CMD_GET_BUILD_INFO 0x04 | |
| 649 | +#define EC_CMD_GET_BUILD_INFO 0x0004 | |
| 647 | 650 | |
| 648 | 651 | /* Get chip info */ |
| 649 | −#define EC_CMD_GET_CHIP_INFO 0x05 | |
| 652 | +#define EC_CMD_GET_CHIP_INFO 0x0005 | |
| 650 | 653 | |
| 651 | 654 | /** |
| 652 | 655 | * struct ec_response_get_chip_info - Response to the get chip info command. |
| @@ -661,7 +664,7 @@ struct ec_response_get_chip_info { · 8 unmodified lines | ||
| 661 | 664 | } __ec_align4; |
| 662 | 665 | |
| 663 | 666 | /* Get board HW version */ |
| 664 | −#define EC_CMD_GET_BOARD_VERSION 0x06 | |
| 667 | +#define EC_CMD_GET_BOARD_VERSION 0x0006 | |
| 665 | 668 | |
| 666 | 669 | /** |
| 667 | 670 | * struct ec_response_board_version - Response to the board version command. |
| @@ -679,7 +682,7 @@ struct ec_response_board_version { · 11 unmodified lines | ||
| 679 | 682 | * |
| 680 | 683 | * Response is params.size bytes of data. |
| 681 | 684 | */ |
| 682 | −#define EC_CMD_READ_MEMMAP 0x07 | |
| 685 | +#define EC_CMD_READ_MEMMAP 0x0007 | |
| 683 | 686 | |
| 684 | 687 | /** |
| 685 | 688 | * struct ec_params_read_memmap - Parameters for the read memory map command. |
| @@ -692,7 +695,7 @@ struct ec_params_read_memmap { · 6 unmodified lines | ||
| 692 | 695 | } __ec_align1; |
| 693 | 696 | |
| 694 | 697 | /* Read versions supported for a command */ |
| 695 | −#define EC_CMD_GET_CMD_VERSIONS 0x08 | |
| 698 | +#define EC_CMD_GET_CMD_VERSIONS 0x0008 | |
| 696 | 699 | |
| 697 | 700 | /** |
| 698 | 701 | * struct ec_params_get_cmd_versions - Parameters for the get command versions. |
| @@ -727,7 +730,7 @@ struct ec_response_get_cmd_versions { · 28 unmodified lines | ||
| 727 | 730 | * lpc must read the status from the command register. Attempting this on |
| 728 | 731 | * lpc will overwrite the args/parameter space and corrupt its data. |
| 729 | 732 | */ |
| 730 | −#define EC_CMD_GET_COMMS_STATUS 0x09 | |
| 733 | +#define EC_CMD_GET_COMMS_STATUS 0x0009 | |
| 731 | 734 | |
| 732 | 735 | /* Avoid using ec_status which is for return values */ |
| 733 | 736 | enum ec_comms_status { |
| @@ -744,7 +747,7 @@ struct ec_response_get_comms_status { · 10 unmodified lines | ||
| 744 | 747 | } __ec_align4; |
| 745 | 748 | |
| 746 | 749 | /* Fake a variety of responses, purely for testing purposes. */ |
| 747 | −#define EC_CMD_TEST_PROTOCOL 0x0a | |
| 750 | +#define EC_CMD_TEST_PROTOCOL 0x000A | |
| 748 | 751 | |
| 749 | 752 | /* Tell the EC what to send back to us. */ |
| 750 | 753 | struct ec_params_test_protocol { |
| @@ -759,7 +762,7 @@ struct ec_response_test_protocol { · 8 unmodified lines | ||
| 759 | 762 | } __ec_align4; |
| 760 | 763 | |
| 761 | 764 | /* Get protocol information */ |
| 762 | −#define EC_CMD_GET_PROTOCOL_INFO 0x0b | |
| 765 | +#define EC_CMD_GET_PROTOCOL_INFO 0x000B | |
| 763 | 766 | |
| 764 | 767 | /* Flags for ec_response_get_protocol_info.flags */ |
| 765 | 768 | /* EC_RES_IN_PROGRESS may be returned if a command is slow */ |
| @@ -805,11 +808,11 @@ struct ec_response_get_set_value { · 39 unmodified lines | ||
| 805 | 808 | } __ec_align4; |
| 806 | 809 | |
| 807 | 810 | /* More than one command can use these structs to get/set parameters. */ |
| 808 | −#define EC_CMD_GSV_PAUSE_IN_S5 0x0c | |
| 811 | +#define EC_CMD_GSV_PAUSE_IN_S5 0x000C | |
| 809 | 812 | |
| 810 | 813 | /*****************************************************************************/ |
| 811 | 814 | /* List the features supported by the firmware */ |
| 812 | −#define EC_CMD_GET_FEATURES 0x0d | |
| 815 | +#define EC_CMD_GET_FEATURES 0x000D | |
| 813 | 816 | |
| 814 | 817 | /* Supported features */ |
| 815 | 818 | enum ec_feature_code { |
| @@ -933,7 +936,7 @@ struct ec_response_get_features { · 117 unmodified lines | ||
| 933 | 936 | /* Flash commands */ |
| 934 | 937 | |
| 935 | 938 | /* Get flash info */ |
| 936 | −#define EC_CMD_FLASH_INFO 0x10 | |
| 939 | +#define EC_CMD_FLASH_INFO 0x0010 | |
| 937 | 940 | |
| 938 | 941 | /** |
| 939 | 942 | * struct ec_response_flash_info - Response to the flash info command. |
| @@ -1000,7 +1003,7 @@ struct ec_response_flash_info_1 { · 60 unmodified lines | ||
| 1000 | 1003 | * |
| 1001 | 1004 | * Response is params.size bytes of data. |
| 1002 | 1005 | */ |
| 1003 | −#define EC_CMD_FLASH_READ 0x11 | |
| 1006 | +#define EC_CMD_FLASH_READ 0x0011 | |
| 1004 | 1007 | |
| 1005 | 1008 | /** |
| 1006 | 1009 | * struct ec_params_flash_read - Parameters for the flash read command. |
| @@ -1013,7 +1016,7 @@ struct ec_params_flash_read { · 6 unmodified lines | ||
| 1013 | 1016 | } __ec_align4; |
| 1014 | 1017 | |
| 1015 | 1018 | /* Write flash */ |
| 1016 | −#define EC_CMD_FLASH_WRITE 0x12 | |
| 1019 | +#define EC_CMD_FLASH_WRITE 0x0012 | |
| 1017 | 1020 | #define EC_VER_FLASH_WRITE 1 |
| 1018 | 1021 | |
| 1019 | 1022 | /* Version 0 of the flash command supported only 64 bytes of data */ |
| @@ -1031,7 +1034,7 @@ struct ec_params_flash_write { · 11 unmodified lines | ||
| 1031 | 1034 | } __ec_align4; |
| 1032 | 1035 | |
| 1033 | 1036 | /* Erase flash */ |
| 1034 | −#define EC_CMD_FLASH_ERASE 0x13 | |
| 1037 | +#define EC_CMD_FLASH_ERASE 0x0013 | |
| 1035 | 1038 | |
| 1036 | 1039 | /** |
| 1037 | 1040 | * struct ec_params_flash_erase - Parameters for the flash erase command. |
| @@ -1053,7 +1056,7 @@ struct ec_params_flash_erase { · 15 unmodified lines | ||
| 1053 | 1056 | * |
| 1054 | 1057 | * If mask=0, simply returns the current flags state. |
| 1055 | 1058 | */ |
| 1056 | −#define EC_CMD_FLASH_PROTECT 0x15 | |
| 1059 | +#define EC_CMD_FLASH_PROTECT 0x0015 | |
| 1057 | 1060 | #define EC_VER_FLASH_PROTECT 1 /* Command version 1 */ |
| 1058 | 1061 | |
| 1059 | 1062 | /* Flags for flash protection */ |
| @@ -1110,7 +1113,7 @@ struct ec_response_flash_protect { · 50 unmodified lines | ||
| 1110 | 1113 | */ |
| 1111 | 1114 | |
| 1112 | 1115 | /* Get the region offset/size */ |
| 1113 | −#define EC_CMD_FLASH_REGION_INFO 0x16 | |
| 1116 | +#define EC_CMD_FLASH_REGION_INFO 0x0016 | |
| 1114 | 1117 | #define EC_VER_FLASH_REGION_INFO 1 |
| 1115 | 1118 | |
| 1116 | 1119 | enum ec_flash_region { |
| @@ -1142,7 +1145,7 @@ struct ec_response_flash_region_info { · 25 unmodified lines | ||
| 1142 | 1145 | } __ec_align4; |
| 1143 | 1146 | |
| 1144 | 1147 | /* Read/write VbNvContext */ |
| 1145 | −#define EC_CMD_VBNV_CONTEXT 0x17 | |
| 1148 | +#define EC_CMD_VBNV_CONTEXT 0x0017 | |
| 1146 | 1149 | #define EC_VER_VBNV_CONTEXT 1 |
| 1147 | 1150 | #define EC_VBNV_BLOCK_SIZE 16 |
| 1148 | 1151 | |
| @@ -1164,7 +1167,7 @@ struct ec_response_vbnvcontext { · 15 unmodified lines | ||
| 1164 | 1167 | /* PWM commands */ |
| 1165 | 1168 | |
| 1166 | 1169 | /* Get fan target RPM */ |
| 1167 | −#define EC_CMD_PWM_GET_FAN_TARGET_RPM 0x20 | |
| 1170 | +#define EC_CMD_PWM_GET_FAN_TARGET_RPM 0x0020 | |
| 1168 | 1171 | |
| 1169 | 1172 | struct ec_response_pwm_get_fan_rpm { |
| 1170 | 1173 | uint32_t rpm; |
| @@ -1178,7 +1181,7 @@ struct ec_params_pwm_set_fan_target_rpm { · 7 unmodified lines | ||
| 1178 | 1181 | } __ec_align_size1; |
| 1179 | 1182 | |
| 1180 | 1183 | /* Get keyboard backlight */ |
| 1181 | −#define EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT 0x22 | |
| 1184 | +#define EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT 0x0022 | |
| 1182 | 1185 | |
| 1183 | 1186 | struct ec_response_pwm_get_keyboard_backlight { |
| 1184 | 1187 | uint8_t percent; |
| @@ -1186,20 +1189,20 @@ struct ec_response_pwm_get_keyboard_backlight { · 1 unmodified line | ||
| 1186 | 1189 | } __ec_align1; |
| 1187 | 1190 | |
| 1188 | 1191 | /* Set keyboard backlight */ |
| 1189 | −#define EC_CMD_PWM_SET_KEYBOARD_BACKLIGHT 0x23 | |
| 1192 | +#define EC_CMD_PWM_SET_KEYBOARD_BACKLIGHT 0x0023 | |
| 1190 | 1193 | |
| 1191 | 1194 | struct ec_params_pwm_set_keyboard_backlight { |
| 1192 | 1195 | uint8_t percent; |
| 1193 | 1196 | } __ec_align1; |
| 1194 | 1197 | |
| 1195 | 1198 | /* Set target fan PWM duty cycle */ |
| 1196 | −#define EC_CMD_PWM_SET_FAN_DUTY 0x24 | |
| 1199 | +#define EC_CMD_PWM_SET_FAN_DUTY 0x0024 | |
| 1197 | 1200 | |
| 1198 | 1201 | struct ec_params_pwm_set_fan_duty { |
| 1199 | 1202 | uint32_t percent; |
| 1200 | 1203 | } __ec_align4; |
| 1201 | 1204 | |
| 1202 | −#define EC_CMD_PWM_SET_DUTY 0x25 | |
| 1205 | +#define EC_CMD_PWM_SET_DUTY 0x0025 | |
| 1203 | 1206 | /* 16 bit duty cycle, 0xffff = 100% */ |
| 1204 | 1207 | #define EC_PWM_MAX_DUTY 0xffff |
| 1205 | 1208 | |
| @@ -1219,7 +1222,7 @@ struct ec_params_pwm_set_duty { · 13 unmodified lines | ||
| 1219 | 1222 | uint8_t index; /* Type-specific index, or 0 if unique */ |
| 1220 | 1223 | } __ec_align4; |
| 1221 | 1224 | |
| 1222 | −#define EC_CMD_PWM_GET_DUTY 0x26 | |
| 1225 | +#define EC_CMD_PWM_GET_DUTY 0x0026 | |
| 1223 | 1226 | |
| 1224 | 1227 | struct ec_params_pwm_get_duty { |
| 1225 | 1228 | uint8_t pwm_type; /* ec_pwm_type */ |
| @@ -1237,7 +1240,7 @@ struct ec_response_pwm_get_duty { · 11 unmodified lines | ||
| 1237 | 1240 | * into a subcommand. We'll make separate structs for subcommands with |
| 1238 | 1241 | * different input args, so that we know how much to expect. |
| 1239 | 1242 | */ |
| 1240 | −#define EC_CMD_LIGHTBAR_CMD 0x28 | |
| 1243 | +#define EC_CMD_LIGHTBAR_CMD 0x0028 | |
| 1241 | 1244 | |
| 1242 | 1245 | struct rgb_s { |
| 1243 | 1246 | uint8_t r, g, b; |
| @@ -1431,7 +1434,7 @@ enum lightbar_command { · 187 unmodified lines | ||
| 1431 | 1434 | /*****************************************************************************/ |
| 1432 | 1435 | /* LED control commands */ |
| 1433 | 1436 | |
| 1434 | −#define EC_CMD_LED_CONTROL 0x29 | |
| 1437 | +#define EC_CMD_LED_CONTROL 0x0029 | |
| 1435 | 1438 | |
| 1436 | 1439 | enum ec_led_id { |
| 1437 | 1440 | /* LED to indicate battery state of charge */ |
| @@ -1488,7 +1491,7 @@ struct ec_response_led_control { · 50 unmodified lines | ||
| 1488 | 1491 | */ |
| 1489 | 1492 | |
| 1490 | 1493 | /* Verified boot hash command */ |
| 1491 | −#define EC_CMD_VBOOT_HASH 0x2A | |
| 1494 | +#define EC_CMD_VBOOT_HASH 0x002A | |
| 1492 | 1495 | |
| 1493 | 1496 | struct ec_params_vboot_hash { |
| 1494 | 1497 | uint8_t cmd; /* enum ec_vboot_hash_cmd */ |
| @@ -1540,7 +1543,7 @@ enum ec_vboot_hash_status { · 45 unmodified lines | ||
| 1540 | 1543 | * Motion sense commands. We'll make separate structs for sub-commands with |
| 1541 | 1544 | * different input args, so that we know how much to expect. |
| 1542 | 1545 | */ |
| 1543 | −#define EC_CMD_MOTION_SENSE_CMD 0x2B | |
| 1546 | +#define EC_CMD_MOTION_SENSE_CMD 0x002B | |
| 1544 | 1547 | |
| 1545 | 1548 | /* Motion sense commands */ |
| 1546 | 1549 | enum motionsense_command { |
| @@ -1804,7 +1807,7 @@ struct ec_response_motion_sense { · 257 unmodified lines | ||
| 1804 | 1807 | /* USB charging control commands */ |
| 1805 | 1808 | |
| 1806 | 1809 | /* Set USB port charging mode */ |
| 1807 | −#define EC_CMD_USB_CHARGE_SET_MODE 0x30 | |
| 1810 | +#define EC_CMD_USB_CHARGE_SET_MODE 0x0030 | |
| 1808 | 1811 | |
| 1809 | 1812 | struct ec_params_usb_charge_set_mode { |
| 1810 | 1813 | uint8_t usb_port_id; |
| @@ -1818,7 +1821,7 @@ struct ec_params_usb_charge_set_mode { · 7 unmodified lines | ||
| 1818 | 1821 | #define EC_PSTORE_SIZE_MAX 64 |
| 1819 | 1822 | |
| 1820 | 1823 | /* Get persistent storage info */ |
| 1821 | −#define EC_CMD_PSTORE_INFO 0x40 | |
| 1824 | +#define EC_CMD_PSTORE_INFO 0x0040 | |
| 1822 | 1825 | |
| 1823 | 1826 | struct ec_response_pstore_info { |
| 1824 | 1827 | /* Persistent storage size, in bytes */ |
| @@ -1832,7 +1835,7 @@ struct ec_response_pstore_info { · 7 unmodified lines | ||
| 1832 | 1835 | * |
| 1833 | 1836 | * Response is params.size bytes of data. |
| 1834 | 1837 | */ |
| 1835 | −#define EC_CMD_PSTORE_READ 0x41 | |
| 1838 | +#define EC_CMD_PSTORE_READ 0x0041 | |
| 1836 | 1839 | |
| 1837 | 1840 | struct ec_params_pstore_read { |
| 1838 | 1841 | uint32_t offset; /* Byte offset to read */ |
| @@ -1840,7 +1843,7 @@ struct ec_params_pstore_read { · 1 unmodified line | ||
| 1840 | 1843 | } __ec_align4; |
| 1841 | 1844 | |
| 1842 | 1845 | /* Write persistent storage */ |
| 1843 | −#define EC_CMD_PSTORE_WRITE 0x42 | |
| 1846 | +#define EC_CMD_PSTORE_WRITE 0x0042 | |
| 1844 | 1847 | |
| 1845 | 1848 | struct ec_params_pstore_write { |
| 1846 | 1849 | uint32_t offset; /* Byte offset to write */ |
| @@ -1861,12 +1864,12 @@ struct ec_response_rtc { · 14 unmodified lines | ||
| 1861 | 1864 | } __ec_align4; |
| 1862 | 1865 | |
| 1863 | 1866 | /* These use ec_response_rtc */ |
| 1864 | −#define EC_CMD_RTC_GET_VALUE 0x44 | |
| 1865 | −#define EC_CMD_RTC_GET_ALARM 0x45 | |
| 1867 | +#define EC_CMD_RTC_GET_VALUE 0x0044 | |
| 1868 | +#define EC_CMD_RTC_GET_ALARM 0x0045 | |
| 1866 | 1869 | |
| 1867 | 1870 | /* These all use ec_params_rtc */ |
| 1868 | −#define EC_CMD_RTC_SET_VALUE 0x46 | |
| 1869 | −#define EC_CMD_RTC_SET_ALARM 0x47 | |
| 1871 | +#define EC_CMD_RTC_SET_VALUE 0x0046 | |
| 1872 | +#define EC_CMD_RTC_SET_ALARM 0x0047 | |
| 1870 | 1873 | |
| 1871 | 1874 | /* Pass as time param to SET_ALARM to clear the current alarm */ |
| 1872 | 1875 | #define EC_RTC_ALARM_CLEAR 0 |
| @@ -1878,8 +1881,8 @@ struct ec_response_rtc { · 5 unmodified lines | ||
| 1878 | 1881 | #define EC_PORT80_SIZE_MAX 32 |
| 1879 | 1882 | |
| 1880 | 1883 | /* Get last port80 code from previous boot */ |
| 1881 | −#define EC_CMD_PORT80_LAST_BOOT 0x48 | |
| 1882 | −#define EC_CMD_PORT80_READ 0x48 | |
| 1884 | +#define EC_CMD_PORT80_LAST_BOOT 0x0048 | |
| 1885 | +#define EC_CMD_PORT80_READ 0x0048 | |
| 1883 | 1886 | |
| 1884 | 1887 | enum ec_port80_subcmd { |
| 1885 | 1888 | EC_PORT80_GET_INFO = 0, |
| @@ -1920,8 +1923,8 @@ struct ec_response_port80_last_boot { · 34 unmodified lines | ||
| 1920 | 1923 | * Version 1 separates the CPU thermal limits from the fan control. |
| 1921 | 1924 | */ |
| 1922 | 1925 | |
| 1923 | −#define EC_CMD_THERMAL_SET_THRESHOLD 0x50 | |
| 1924 | −#define EC_CMD_THERMAL_GET_THRESHOLD 0x51 | |
| 1926 | +#define EC_CMD_THERMAL_SET_THRESHOLD 0x0050 | |
| 1927 | +#define EC_CMD_THERMAL_GET_THRESHOLD 0x0051 | |
| 1925 | 1928 | |
| 1926 | 1929 | /* The version 0 structs are opaque. You have to know what they are for |
| 1927 | 1930 | * the get/set commands to make any sense. |
| @@ -1983,10 +1986,10 @@ struct ec_params_thermal_set_threshold_v1 { · 55 unmodified lines | ||
| 1983 | 1986 | /****************************************************************************/ |
| 1984 | 1987 | |
| 1985 | 1988 | /* Toggle automatic fan control */ |
| 1986 | −#define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x52 | |
| 1989 | +#define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x0052 | |
| 1987 | 1990 | |
| 1988 | 1991 | /* Get TMP006 calibration data */ |
| 1989 | −#define EC_CMD_TMP006_GET_CALIBRATION 0x53 | |
| 1992 | +#define EC_CMD_TMP006_GET_CALIBRATION 0x0053 | |
| 1990 | 1993 | |
| 1991 | 1994 | struct ec_params_tmp006_get_calibration { |
| 1992 | 1995 | uint8_t index; |
| @@ -2000,7 +2003,7 @@ struct ec_response_tmp006_get_calibration { · 7 unmodified lines | ||
| 2000 | 2003 | } __ec_align4; |
| 2001 | 2004 | |
| 2002 | 2005 | /* Set TMP006 calibration data */ |
| 2003 | −#define EC_CMD_TMP006_SET_CALIBRATION 0x54 | |
| 2006 | +#define EC_CMD_TMP006_SET_CALIBRATION 0x0054 | |
| 2004 | 2007 | |
| 2005 | 2008 | struct ec_params_tmp006_set_calibration { |
| 2006 | 2009 | uint8_t index; |
| @@ -2012,7 +2015,7 @@ struct ec_params_tmp006_set_calibration { · 5 unmodified lines | ||
| 2012 | 2015 | } __ec_align4; |
| 2013 | 2016 | |
| 2014 | 2017 | /* Read raw TMP006 data */ |
| 2015 | −#define EC_CMD_TMP006_GET_RAW 0x55 | |
| 2018 | +#define EC_CMD_TMP006_GET_RAW 0x0055 | |
| 2016 | 2019 | |
| 2017 | 2020 | struct ec_params_tmp006_get_raw { |
| 2018 | 2021 | uint8_t index; |
| @@ -2036,12 +2039,12 @@ struct ec_response_tmp006_get_raw { · 17 unmodified lines | ||
| 2036 | 2039 | * to obtain the instantaneous state, use EC_CMD_MKBP_INFO with the type |
| 2037 | 2040 | * EC_MKBP_INFO_CURRENT and event EC_MKBP_EVENT_KEY_MATRIX. |
| 2038 | 2041 | */ |
| 2039 | −#define EC_CMD_MKBP_STATE 0x60 | |
| 2042 | +#define EC_CMD_MKBP_STATE 0x0060 | |
| 2040 | 2043 | |
| 2041 | 2044 | /* |
| 2042 | 2045 | * Provide information about various MKBP things. See enum ec_mkbp_info_type. |
| 2043 | 2046 | */ |
| 2044 | −#define EC_CMD_MKBP_INFO 0x61 | |
| 2047 | +#define EC_CMD_MKBP_INFO 0x0061 | |
| 2045 | 2048 | |
| 2046 | 2049 | struct ec_response_mkbp_info { |
| 2047 | 2050 | uint32_t rows; |
| @@ -2095,7 +2098,7 @@ enum ec_mkbp_info_type { · 47 unmodified lines | ||
| 2095 | 2098 | }; |
| 2096 | 2099 | |
| 2097 | 2100 | /* Simulate key press */ |
| 2098 | −#define EC_CMD_MKBP_SIMULATE_KEY 0x62 | |
| 2101 | +#define EC_CMD_MKBP_SIMULATE_KEY 0x0062 | |
| 2099 | 2102 | |
| 2100 | 2103 | struct ec_params_mkbp_simulate_key { |
| 2101 | 2104 | uint8_t col; |
| @@ -2104,8 +2107,8 @@ struct ec_params_mkbp_simulate_key { · 2 unmodified lines | ||
| 2104 | 2107 | } __ec_align1; |
| 2105 | 2108 | |
| 2106 | 2109 | /* Configure keyboard scanning */ |
| 2107 | −#define EC_CMD_MKBP_SET_CONFIG 0x64 | |
| 2108 | −#define EC_CMD_MKBP_GET_CONFIG 0x65 | |
| 2110 | +#define EC_CMD_MKBP_SET_CONFIG 0x0064 | |
| 2111 | +#define EC_CMD_MKBP_GET_CONFIG 0x0065 | |
| 2109 | 2112 | |
| 2110 | 2113 | /* flags */ |
| 2111 | 2114 | enum mkbp_config_flags { |
| @@ -2158,7 +2161,7 @@ struct ec_response_mkbp_get_config { · 46 unmodified lines | ||
| 2158 | 2161 | } __ec_align_size1; |
| 2159 | 2162 | |
| 2160 | 2163 | /* Run the key scan emulation */ |
| 2161 | −#define EC_CMD_KEYSCAN_SEQ_CTRL 0x66 | |
| 2164 | +#define EC_CMD_KEYSCAN_SEQ_CTRL 0x0066 | |
| 2162 | 2165 | |
| 2163 | 2166 | enum ec_keyscan_seq_cmd { |
| 2164 | 2167 | EC_KEYSCAN_SEQ_STATUS = 0, /* Get status information */ |
| @@ -2219,7 +2222,7 @@ struct ec_result_keyscan_seq_ctrl { · 54 unmodified lines | ||
| 2219 | 2222 | * |
| 2220 | 2223 | * The device replies with UNAVAILABLE if there aren't any pending events. |
| 2221 | 2224 | */ |
| 2222 | −#define EC_CMD_GET_NEXT_EVENT 0x67 | |
| 2225 | +#define EC_CMD_GET_NEXT_EVENT 0x0067 | |
| 2223 | 2226 | |
| 2224 | 2227 | enum ec_mkbp_event { |
| 2225 | 2228 | /* Keyboard matrix changed. The event data is the new matrix state. */ |
| @@ -2298,7 +2301,7 @@ struct ec_response_get_next_event_v1 { · 72 unmodified lines | ||
| 2298 | 2301 | /* Temperature sensor commands */ |
| 2299 | 2302 | |
| 2300 | 2303 | /* Read temperature sensor info */ |
| 2301 | −#define EC_CMD_TEMP_SENSOR_GET_INFO 0x70 | |
| 2304 | +#define EC_CMD_TEMP_SENSOR_GET_INFO 0x0070 | |
| 2302 | 2305 | |
| 2303 | 2306 | struct ec_params_temp_sensor_get_info { |
| 2304 | 2307 | uint8_t id; |
| @@ -2333,30 +2336,30 @@ struct ec_response_host_event_mask { · 28 unmodified lines | ||
| 2333 | 2336 | } __ec_align4; |
| 2334 | 2337 | |
| 2335 | 2338 | /* These all use ec_response_host_event_mask */ |
| 2336 | −#define EC_CMD_HOST_EVENT_GET_B 0x87 | |
| 2337 | −#define EC_CMD_HOST_EVENT_GET_SMI_MASK 0x88 | |
| 2338 | −#define EC_CMD_HOST_EVENT_GET_SCI_MASK 0x89 | |
| 2339 | −#define EC_CMD_HOST_EVENT_GET_WAKE_MASK 0x8d | |
| 2339 | +#define EC_CMD_HOST_EVENT_GET_B 0x0087 | |
| 2340 | +#define EC_CMD_HOST_EVENT_GET_SMI_MASK 0x0088 | |
| 2341 | +#define EC_CMD_HOST_EVENT_GET_SCI_MASK 0x0089 | |
| 2342 | +#define EC_CMD_HOST_EVENT_GET_WAKE_MASK 0x008D | |
| 2340 | 2343 | |
| 2341 | 2344 | /* These all use ec_params_host_event_mask */ |
| 2342 | −#define EC_CMD_HOST_EVENT_SET_SMI_MASK 0x8a | |
| 2343 | −#define EC_CMD_HOST_EVENT_SET_SCI_MASK 0x8b | |
| 2344 | −#define EC_CMD_HOST_EVENT_CLEAR 0x8c | |
| 2345 | −#define EC_CMD_HOST_EVENT_SET_WAKE_MASK 0x8e | |
| 2346 | −#define EC_CMD_HOST_EVENT_CLEAR_B 0x8f | |
| 2345 | +#define EC_CMD_HOST_EVENT_SET_SMI_MASK 0x008A | |
| 2346 | +#define EC_CMD_HOST_EVENT_SET_SCI_MASK 0x008B | |
| 2347 | +#define EC_CMD_HOST_EVENT_CLEAR 0x008C | |
| 2348 | +#define EC_CMD_HOST_EVENT_SET_WAKE_MASK 0x008E | |
| 2349 | +#define EC_CMD_HOST_EVENT_CLEAR_B 0x008F | |
| 2347 | 2350 | |
| 2348 | 2351 | /*****************************************************************************/ |
| 2349 | 2352 | /* Switch commands */ |
| 2350 | 2353 | |
| 2351 | 2354 | /* Enable/disable LCD backlight */ |
| 2352 | −#define EC_CMD_SWITCH_ENABLE_BKLIGHT 0x90 | |
| 2355 | +#define EC_CMD_SWITCH_ENABLE_BKLIGHT 0x0090 | |
| 2353 | 2356 | |
| 2354 | 2357 | struct ec_params_switch_enable_backlight { |
| 2355 | 2358 | uint8_t enabled; |
| 2356 | 2359 | } __ec_align1; |
| 2357 | 2360 | |
| 2358 | 2361 | /* Enable/disable WLAN/Bluetooth */ |
| 2359 | −#define EC_CMD_SWITCH_ENABLE_WIRELESS 0x91 | |
| 2362 | +#define EC_CMD_SWITCH_ENABLE_WIRELESS 0x0091 | |
| 2360 | 2363 | #define EC_VER_SWITCH_ENABLE_WIRELESS 1 |
| 2361 | 2364 | |
| 2362 | 2365 | /* Version 0 params; no response */ |
| @@ -2396,7 +2399,7 @@ struct ec_response_switch_enable_wireless_v1 { · 33 unmodified lines | ||
| 2396 | 2399 | /* GPIO commands. Only available on EC if write protect has been disabled. */ |
| 2397 | 2400 | |
| 2398 | 2401 | /* Set GPIO output value */ |
| 2399 | −#define EC_CMD_GPIO_SET 0x92 | |
| 2402 | +#define EC_CMD_GPIO_SET 0x0092 | |
| 2400 | 2403 | |
| 2401 | 2404 | struct ec_params_gpio_set { |
| 2402 | 2405 | char name[32]; |
| @@ -2404,7 +2407,7 @@ struct ec_params_gpio_set { · 1 unmodified line | ||
| 2404 | 2407 | } __ec_align1; |
| 2405 | 2408 | |
| 2406 | 2409 | /* Get GPIO value */ |
| 2407 | −#define EC_CMD_GPIO_GET 0x93 | |
| 2410 | +#define EC_CMD_GPIO_GET 0x0093 | |
| 2408 | 2411 | |
| 2409 | 2412 | /* Version 0 of input params and response */ |
| 2410 | 2413 | struct ec_params_gpio_get { |
| @@ -2458,7 +2461,7 @@ enum gpio_get_subcmd { · 47 unmodified lines | ||
| 2458 | 2461 | */ |
| 2459 | 2462 | |
| 2460 | 2463 | /* Read I2C bus */ |
| 2461 | −#define EC_CMD_I2C_READ 0x94 | |
| 2464 | +#define EC_CMD_I2C_READ 0x0094 | |
| 2462 | 2465 | |
| 2463 | 2466 | struct ec_params_i2c_read { |
| 2464 | 2467 | uint16_t addr; /* 8-bit address (7-bit shifted << 1) */ |
| @@ -2472,7 +2475,7 @@ struct ec_response_i2c_read { · 7 unmodified lines | ||
| 2472 | 2475 | } __ec_align2; |
| 2473 | 2476 | |
| 2474 | 2477 | /* Write I2C bus */ |
| 2475 | −#define EC_CMD_I2C_WRITE 0x95 | |
| 2478 | +#define EC_CMD_I2C_WRITE 0x0095 | |
| 2476 | 2479 | |
| 2477 | 2480 | struct ec_params_i2c_write { |
| 2478 | 2481 | uint16_t data; |
| @@ -2488,7 +2491,7 @@ struct ec_params_i2c_write { · 9 unmodified lines | ||
| 2488 | 2491 | /* Force charge state machine to stop charging the battery or force it to |
| 2489 | 2492 | * discharge the battery. |
| 2490 | 2493 | */ |
| 2491 | −#define EC_CMD_CHARGE_CONTROL 0x96 | |
| 2494 | +#define EC_CMD_CHARGE_CONTROL 0x0096 | |
| 2492 | 2495 | #define EC_VER_CHARGE_CONTROL 1 |
| 2493 | 2496 | |
| 2494 | 2497 | enum ec_charge_control_mode { |
| @@ -2504,7 +2507,7 @@ struct ec_params_charge_control { · 9 unmodified lines | ||
| 2504 | 2507 | /*****************************************************************************/ |
| 2505 | 2508 | |
| 2506 | 2509 | /* Snapshot console output buffer for use by EC_CMD_CONSOLE_READ. */ |
| 2507 | −#define EC_CMD_CONSOLE_SNAPSHOT 0x97 | |
| 2510 | +#define EC_CMD_CONSOLE_SNAPSHOT 0x0097 | |
| 2508 | 2511 | |
| 2509 | 2512 | /* |
| 2510 | 2513 | * Read data from the saved snapshot. If the subcmd parameter is |
| @@ -2518,7 +2521,7 @@ struct ec_params_charge_control { · 7 unmodified lines | ||
| 2518 | 2521 | * Response is null-terminated string. Empty string, if there is no more |
| 2519 | 2522 | * remaining output. |
| 2520 | 2523 | */ |
| 2521 | −#define EC_CMD_CONSOLE_READ 0x98 | |
| 2524 | +#define EC_CMD_CONSOLE_READ 0x0098 | |
| 2522 | 2525 | |
| 2523 | 2526 | enum ec_console_read_subcmd { |
| 2524 | 2527 | CONSOLE_READ_NEXT = 0, |
| @@ -2538,8 +2541,7 @@ struct ec_params_console_read_v1 { · 13 unmodified lines | ||
| 2538 | 2541 | * EC_RES_SUCCESS if the command was successful. |
| 2539 | 2542 | * EC_RES_ERROR if the cut off command failed. |
| 2540 | 2543 | */ |
| 2541 | − | |
| 2542 | −#define EC_CMD_BATTERY_CUT_OFF 0x99 | |
| 2544 | +#define EC_CMD_BATTERY_CUT_OFF 0x0099 | |
| 2543 | 2545 | |
| 2544 | 2546 | #define EC_BATTERY_CUTOFF_FLAG_AT_SHUTDOWN (1 << 0) |
| 2545 | 2547 | |
| @@ -2553,7 +2555,7 @@ struct ec_params_battery_cutoff { · 7 unmodified lines | ||
| 2553 | 2555 | /* |
| 2554 | 2556 | * Switch USB mux or return to automatic switching. |
| 2555 | 2557 | */ |
| 2556 | −#define EC_CMD_USB_MUX 0x9a | |
| 2558 | +#define EC_CMD_USB_MUX 0x009A | |
| 2557 | 2559 | |
| 2558 | 2560 | struct ec_params_usb_mux { |
| 2559 | 2561 | uint8_t mux; |
| @@ -2570,7 +2572,7 @@ enum ec_ldo_state { · 10 unmodified lines | ||
| 2570 | 2572 | /* |
| 2571 | 2573 | * Switch on/off a LDO. |
| 2572 | 2574 | */ |
| 2573 | −#define EC_CMD_LDO_SET 0x9b | |
| 2575 | +#define EC_CMD_LDO_SET 0x009B | |
| 2574 | 2576 | |
| 2575 | 2577 | struct ec_params_ldo_set { |
| 2576 | 2578 | uint8_t index; |
| @@ -2580,7 +2582,7 @@ struct ec_params_ldo_set { · 3 unmodified lines | ||
| 2580 | 2582 | /* |
| 2581 | 2583 | * Get LDO state. |
| 2582 | 2584 | */ |
| 2583 | −#define EC_CMD_LDO_GET 0x9c | |
| 2585 | +#define EC_CMD_LDO_GET 0x009C | |
| 2584 | 2586 | |
| 2585 | 2587 | struct ec_params_ldo_get { |
| 2586 | 2588 | uint8_t index; |
| @@ -2596,7 +2598,7 @@ struct ec_response_ldo_get { · 9 unmodified lines | ||
| 2596 | 2598 | /* |
| 2597 | 2599 | * Get power info. |
| 2598 | 2600 | */ |
| 2599 | −#define EC_CMD_POWER_INFO 0x9d | |
| 2601 | +#define EC_CMD_POWER_INFO 0x009D | |
| 2600 | 2602 | |
| 2601 | 2603 | struct ec_response_power_info { |
| 2602 | 2604 | uint32_t usb_dev_type; |
| @@ -2609,7 +2611,7 @@ struct ec_response_power_info { · 6 unmodified lines | ||
| 2609 | 2611 | /*****************************************************************************/ |
| 2610 | 2612 | /* I2C passthru command */ |
| 2611 | 2613 | |
| 2612 | −#define EC_CMD_I2C_PASSTHRU 0x9e | |
| 2614 | +#define EC_CMD_I2C_PASSTHRU 0x009E | |
| 2613 | 2615 | |
| 2614 | 2616 | /* Read data; if not present, message is a write */ |
| 2615 | 2617 | #define EC_I2C_FLAG_READ (1 << 15) |
| @@ -2644,7 +2646,7 @@ struct ec_response_i2c_passthru { · 28 unmodified lines | ||
| 2644 | 2646 | /*****************************************************************************/ |
| 2645 | 2647 | /* Power button hang detect */ |
| 2646 | 2648 | |
| 2647 | −#define EC_CMD_HANG_DETECT 0x9f | |
| 2649 | +#define EC_CMD_HANG_DETECT 0x009F | |
| 2648 | 2650 | |
| 2649 | 2651 | /* Reasons to start hang detection timer */ |
| 2650 | 2652 | /* Power button pressed */ |
| @@ -2703,7 +2705,7 @@ struct ec_params_hang_detect { · 52 unmodified lines | ||
| 2703 | 2705 | * This is the single catch-all host command to exchange data regarding the |
| 2704 | 2706 | * charge state machine (v2 and up). |
| 2705 | 2707 | */ |
| 2706 | −#define EC_CMD_CHARGE_STATE 0xa0 | |
| 2708 | +#define EC_CMD_CHARGE_STATE 0x00A0 | |
| 2707 | 2709 | |
| 2708 | 2710 | /* Subcommands for this host command */ |
| 2709 | 2711 | enum charge_state_command { |
| @@ -2774,7 +2776,7 @@ struct ec_response_charge_state { · 64 unmodified lines | ||
| 2774 | 2776 | /* |
| 2775 | 2777 | * Set maximum battery charging current. |
| 2776 | 2778 | */ |
| 2777 | −#define EC_CMD_CHARGE_CURRENT_LIMIT 0xa1 | |
| 2779 | +#define EC_CMD_CHARGE_CURRENT_LIMIT 0x00A1 | |
| 2778 | 2780 | |
| 2779 | 2781 | struct ec_params_current_limit { |
| 2780 | 2782 | uint32_t limit; /* in mA */ |
| @@ -2794,7 +2796,7 @@ struct ec_params_external_power_limit_v1 { · 13 unmodified lines | ||
| 2794 | 2796 | #define EC_POWER_LIMIT_NONE 0xffff |
| 2795 | 2797 | |
| 2796 | 2798 | /* Inform the EC when entering a sleep state */ |
| 2797 | −#define EC_CMD_HOST_SLEEP_EVENT 0xa9 | |
| 2799 | +#define EC_CMD_HOST_SLEEP_EVENT 0x00A9 | |
| 2798 | 2800 | |
| 2799 | 2801 | enum host_sleep_event { |
| 2800 | 2802 | HOST_SLEEP_EVENT_S3_SUSPEND = 1, |
| @@ -2868,14 +2870,14 @@ struct ec_response_host_sleep_event_v1 { · 67 unmodified lines | ||
| 2868 | 2870 | /* Smart battery pass-through */ |
| 2869 | 2871 | |
| 2870 | 2872 | /* Get / Set 16-bit smart battery registers */ |
| 2871 | −#define EC_CMD_SB_READ_WORD 0xb0 | |
| 2872 | −#define EC_CMD_SB_WRITE_WORD 0xb1 | |
| 2873 | +#define EC_CMD_SB_READ_WORD 0x00B0 | |
| 2874 | +#define EC_CMD_SB_WRITE_WORD 0x00B1 | |
| 2873 | 2875 | |
| 2874 | 2876 | /* Get / Set string smart battery parameters |
| 2875 | 2877 | * formatted as SMBUS "block". |
| 2876 | 2878 | */ |
| 2877 | −#define EC_CMD_SB_READ_BLOCK 0xb2 | |
| 2878 | −#define EC_CMD_SB_WRITE_BLOCK 0xb3 | |
| 2879 | +#define EC_CMD_SB_READ_BLOCK 0x00B2 | |
| 2880 | +#define EC_CMD_SB_WRITE_BLOCK 0x00B3 | |
| 2879 | 2881 | |
| 2880 | 2882 | struct ec_params_sb_rd { |
| 2881 | 2883 | uint8_t reg; |
| @@ -2908,7 +2910,7 @@ struct ec_params_sb_wr_block { · 26 unmodified lines | ||
| 2908 | 2910 | * requested value. |
| 2909 | 2911 | */ |
| 2910 | 2912 | |
| 2911 | −#define EC_CMD_BATTERY_VENDOR_PARAM 0xb4 | |
| 2913 | +#define EC_CMD_BATTERY_VENDOR_PARAM 0x00B4 | |
| 2912 | 2914 | |
| 2913 | 2915 | enum ec_battery_vendor_param_mode { |
| 2914 | 2916 | BATTERY_VENDOR_PARAM_MODE_GET = 0, |
| @@ -3024,7 +3026,7 @@ struct ec_response_codec_gain { · 109 unmodified lines | ||
| 3024 | 3026 | * TODO(crosbug.com/p/23747): This is a confusing name, since it doesn't |
| 3025 | 3027 | * necessarily reboot the EC. Rename to "image" or something similar? |
| 3026 | 3028 | */ |
| 3027 | −#define EC_CMD_REBOOT_EC 0xd2 | |
| 3029 | +#define EC_CMD_REBOOT_EC 0x00D2 | |
| 3028 | 3030 | |
| 3029 | 3031 | /* Command */ |
| 3030 | 3032 | enum ec_reboot_cmd { |
| @@ -3052,7 +3054,7 @@ struct ec_params_reboot_ec { · 21 unmodified lines | ||
| 3052 | 3054 | * Returns variable-length platform-dependent panic information. See panic.h |
| 3053 | 3055 | * for details. |
| 3054 | 3056 | */ |
| 3055 | −#define EC_CMD_GET_PANIC_INFO 0xd3 | |
| 3057 | +#define EC_CMD_GET_PANIC_INFO 0x00D3 | |
| 3056 | 3058 | |
| 3057 | 3059 | /*****************************************************************************/ |
| 3058 | 3060 | /* |
| @@ -3260,7 +3262,7 @@ enum mkbp_cec_event { · 201 unmodified lines | ||
| 3260 | 3262 | * |
| 3261 | 3263 | * Use EC_CMD_REBOOT_EC to reboot the EC more politely. |
| 3262 | 3264 | */ |
| 3263 | −#define EC_CMD_REBOOT 0xd1 /* Think "die" */ | |
| 3265 | +#define EC_CMD_REBOOT 0x00D1 /* Think "die" */ | |
| 3264 | 3266 | |
| 3265 | 3267 | /* |
| 3266 | 3268 | * Resend last response (not supported on LPC). |
| @@ -3269,7 +3271,7 @@ enum mkbp_cec_event { · 2 unmodified lines | ||
| 3269 | 3271 | * there was no previous command, or the previous command's response was too |
| 3270 | 3272 | * big to save. |
| 3271 | 3273 | */ |
| 3272 | −#define EC_CMD_RESEND_RESPONSE 0xdb | |
| 3274 | +#define EC_CMD_RESEND_RESPONSE 0x00DB | |
| 3273 | 3275 | |
| 3274 | 3276 | /* |
| 3275 | 3277 | * This header byte on a command indicate version 0. Any header byte less |
| @@ -3281,7 +3283,7 @@ enum mkbp_cec_event { · 5 unmodified lines | ||
| 3281 | 3283 | * |
| 3282 | 3284 | * The old EC interface must not use commands 0xdc or higher. |
| 3283 | 3285 | */ |
| 3284 | −#define EC_CMD_VERSION0 0xdc | |
| 3286 | +#define EC_CMD_VERSION0 0x00DC | |
| 3285 | 3287 | |
| 3286 | 3288 | #endif /* !__ACPI__ */ |
| 3287 | 3289 | |
| @@ -3293,7 +3295,7 @@ enum mkbp_cec_event { · 5 unmodified lines | ||
| 3293 | 3295 | */ |
| 3294 | 3296 | |
| 3295 | 3297 | /* EC to PD MCU exchange status command */ |
| 3296 | −#define EC_CMD_PD_EXCHANGE_STATUS 0x100 | |
| 3298 | +#define EC_CMD_PD_EXCHANGE_STATUS 0x0100 | |
| 3297 | 3299 | |
| 3298 | 3300 | /* Status of EC being sent to PD */ |
| 3299 | 3301 | struct ec_params_pd_status { |
| @@ -3307,7 +3309,7 @@ struct ec_response_pd_status { · 7 unmodified lines | ||
| 3307 | 3309 | } __ec_align_size1; |
| 3308 | 3310 | |
| 3309 | 3311 | /* Set USB type-C port role and muxes */ |
| 3310 | −#define EC_CMD_USB_PD_CONTROL 0x101 | |
| 3312 | +#define EC_CMD_USB_PD_CONTROL 0x0101 | |
| 3311 | 3313 | |
| 3312 | 3314 | enum usb_pd_control_role { |
| 3313 | 3315 | USB_PD_CTRL_ROLE_NO_CHANGE = 0, |
| @@ -3360,7 +3362,7 @@ struct ec_response_usb_pd_control_v1 { · 46 unmodified lines | ||
| 3360 | 3362 | char state[32]; |
| 3361 | 3363 | } __ec_align1; |
| 3362 | 3364 | |
| 3363 | −#define EC_CMD_USB_PD_PORTS 0x102 | |
| 3365 | +#define EC_CMD_USB_PD_PORTS 0x0102 | |
| 3364 | 3366 | |
| 3365 | 3367 | /* Maximum number of PD ports on a device, num_ports will be <= this */ |
| 3366 | 3368 | #define EC_USB_PD_MAX_PORTS 8 |
| @@ -3369,7 +3371,7 @@ struct ec_response_usb_pd_ports { · 2 unmodified lines | ||
| 3369 | 3371 | uint8_t num_ports; |
| 3370 | 3372 | } __ec_align1; |
| 3371 | 3373 | |
| 3372 | −#define EC_CMD_USB_PD_POWER_INFO 0x103 | |
| 3374 | +#define EC_CMD_USB_PD_POWER_INFO 0x0103 | |
| 3373 | 3375 | |
| 3374 | 3376 | #define PD_POWER_CHARGING_PORT 0xff |
| 3375 | 3377 | struct ec_params_usb_pd_power_info { |
| @@ -3536,7 +3538,7 @@ struct mcdp_info { · 160 unmodified lines | ||
| 3536 | 3538 | #define MCDP_FAMILY(family) ((family[0] << 8) | family[1]) |
| 3537 | 3539 | |
| 3538 | 3540 | /* Get info about USB-C SS muxes */ |
| 3539 | −#define EC_CMD_USB_PD_MUX_INFO 0x11a | |
| 3541 | +#define EC_CMD_USB_PD_MUX_INFO 0x011A | |
| 3540 | 3542 | |
| 3541 | 3543 | struct ec_params_usb_pd_mux_info { |
| 3542 | 3544 | uint8_t port; /* USB-C port number */ |
| @@ -3551,6 +3553,41 @@ struct ec_params_usb_pd_mux_info { · 8 unmodified lines | ||
| 3551 | 3553 | struct ec_response_usb_pd_mux_info { |
| 3552 | 3554 | uint8_t flags; /* USB_PD_MUX_*-encoded USB mux state */ |
| 3553 | 3555 | } __ec_align1; |
| 3556 | +/*****************************************************************************/ | |
| 3557 | +/* | |
| 3558 | + * Reserve a range of host commands for board-specific, experimental, or | |
| 3559 | + * special purpose features. These can be (re)used without updating this file. | |
| 3560 | + * | |
| 3561 | + * CAUTION: Don't go nuts with this. Shipping products should document ALL | |
| 3562 | + * their EC commands for easier development, testing, debugging, and support. | |
| 3563 | + * | |
| 3564 | + * All commands MUST be #defined to be 4-digit UPPER CASE hex values | |
| 3565 | + * (e.g., 0x00AB, not 0xab) for CONFIG_HOSTCMD_SECTION_SORTED to work. | |
| 3566 | + * | |
| 3567 | + * In your experimental code, you may want to do something like this: | |
| 3568 | + * | |
| 3569 | + * #define EC_CMD_MAGIC_FOO 0x0000 | |
| 3570 | + * #define EC_CMD_MAGIC_BAR 0x0001 | |
| 3571 | + * #define EC_CMD_MAGIC_HEY 0x0002 | |
| 3572 | + * | |
| 3573 | + * DECLARE_PRIVATE_HOST_COMMAND(EC_CMD_MAGIC_FOO, magic_foo_handler, | |
| 3574 | + * EC_VER_MASK(0); | |
| 3575 | + * | |
| 3576 | + * DECLARE_PRIVATE_HOST_COMMAND(EC_CMD_MAGIC_BAR, magic_bar_handler, | |
| 3577 | + * EC_VER_MASK(0); | |
| 3578 | + * | |
| 3579 | + * DECLARE_PRIVATE_HOST_COMMAND(EC_CMD_MAGIC_HEY, magic_hey_handler, | |
| 3580 | + * EC_VER_MASK(0); | |
| 3581 | + */ | |
| 3582 | +#define EC_CMD_BOARD_SPECIFIC_BASE 0x3E00 | |
| 3583 | +#define EC_CMD_BOARD_SPECIFIC_LAST 0x3FFF | |
| 3584 | + | |
| 3585 | +/* | |
| 3586 | + * Given the private host command offset, calculate the true private host | |
| 3587 | + * command value. | |
| 3588 | + */ | |
| 3589 | +#define EC_PRIVATE_HOST_COMMAND_VALUE(command) \ | |
| 3590 | + (EC_CMD_BOARD_SPECIFIC_BASE + (command)) | |
| 3554 | 3591 | |
| 3555 | 3592 | /*****************************************************************************/ |
| 3556 | 3593 | /* |