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 | * Parameter/response length is implicit in the structs. Some underlying | 553 | * Parameter/response length is implicit in the structs. Some underlying |
| 554 | * communication protocols (I2C, SPI) may add length or checksum headers, but | 554 | * communication protocols (I2C, SPI) may add length or checksum headers, but |
| 555 | * those are implementation-dependent and not defined here. | 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 | * Get protocol version, used to deal with non-backward compatible protocol | 565 | * Get protocol version, used to deal with non-backward compatible protocol |
| 563 | * changes. | 566 | * changes. |
| 564 | */ | 567 | */ |
| 565 | #define EC_CMD_PROTO_VERSION 0x00 | 568 | #define EC_CMD_PROTO_VERSION 0x0000 |
| 566 | 569 | ||
| 567 | /** | 570 | /** |
| 568 | * struct ec_response_proto_version - Response to the proto version command. | 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 | * Hello. This is a simple command to test the EC is responsive to | 579 | * Hello. This is a simple command to test the EC is responsive to |
| 577 | * commands. | 580 | * commands. |
| 578 | */ | 581 | */ |
| 579 | #define EC_CMD_HELLO 0x01 | 582 | #define EC_CMD_HELLO 0x0001 |
| 580 | 583 | ||
| 581 | /** | 584 | /** |
| 582 | * struct ec_params_hello - Parameters to the hello command. | 585 | * struct ec_params_hello - Parameters to the hello command. |
| @@ -595,7 +598,7 @@ struct ec_response_hello { · 12 unmodified lines | |||
| 595 | } __ec_align4; | 598 | } __ec_align4; |
| 596 | 599 | ||
| 597 | /* Get version number */ | 600 | /* Get version number */ |
| 598 | #define EC_CMD_GET_VERSION 0x02 | 601 | #define EC_CMD_GET_VERSION 0x0002 |
| 599 | 602 | ||
| 600 | enum ec_current_image { | 603 | enum ec_current_image { |
| 601 | EC_IMAGE_UNKNOWN = 0, | 604 | EC_IMAGE_UNKNOWN = 0, |
| @@ -618,7 +621,7 @@ struct ec_response_get_version { · 16 unmodified lines | |||
| 618 | } __ec_align4; | 621 | } __ec_align4; |
| 619 | 622 | ||
| 620 | /* Read test */ | 623 | /* Read test */ |
| 621 | #define EC_CMD_READ_TEST 0x03 | 624 | #define EC_CMD_READ_TEST 0x0003 |
| 622 | 625 | ||
| 623 | /** | 626 | /** |
| 624 | * struct ec_params_read_test - Parameters for the read test command. | 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 | * Response is null-terminated string. | 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 | /* Get chip info */ | 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 | * struct ec_response_get_chip_info - Response to the get chip info command. | 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 | } __ec_align4; | 664 | } __ec_align4; |
| 662 | 665 | ||
| 663 | /* Get board HW version */ | 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 | * struct ec_response_board_version - Response to the board version command. | 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 | * Response is params.size bytes of data. | 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 | * struct ec_params_read_memmap - Parameters for the read memory map command. | 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 | } __ec_align1; | 695 | } __ec_align1; |
| 693 | 696 | ||
| 694 | /* Read versions supported for a command */ | 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 | * struct ec_params_get_cmd_versions - Parameters for the get command versions. | 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 | * lpc must read the status from the command register. Attempting this on | 730 | * lpc must read the status from the command register. Attempting this on |
| 728 | * lpc will overwrite the args/parameter space and corrupt its data. | 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 | /* Avoid using ec_status which is for return values */ | 735 | /* Avoid using ec_status which is for return values */ |
| 733 | enum ec_comms_status { | 736 | enum ec_comms_status { |
| @@ -744,7 +747,7 @@ struct ec_response_get_comms_status { · 10 unmodified lines | |||
| 744 | } __ec_align4; | 747 | } __ec_align4; |
| 745 | 748 | ||
| 746 | /* Fake a variety of responses, purely for testing purposes. */ | 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 | /* Tell the EC what to send back to us. */ | 752 | /* Tell the EC what to send back to us. */ |
| 750 | struct ec_params_test_protocol { | 753 | struct ec_params_test_protocol { |
| @@ -759,7 +762,7 @@ struct ec_response_test_protocol { · 8 unmodified lines | |||
| 759 | } __ec_align4; | 762 | } __ec_align4; |
| 760 | 763 | ||
| 761 | /* Get protocol information */ | 764 | /* Get protocol information */ |
| 762 | #define EC_CMD_GET_PROTOCOL_INFO 0x0b | 765 | #define EC_CMD_GET_PROTOCOL_INFO 0x000B |
| 763 | 766 | ||
| 764 | /* Flags for ec_response_get_protocol_info.flags */ | 767 | /* Flags for ec_response_get_protocol_info.flags */ |
| 765 | /* EC_RES_IN_PROGRESS may be returned if a command is slow */ | 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 | } __ec_align4; | 808 | } __ec_align4; |
| 806 | 809 | ||
| 807 | /* More than one command can use these structs to get/set parameters. */ | 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 | /* List the features supported by the firmware */ | 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 | /* Supported features */ | 817 | /* Supported features */ |
| 815 | enum ec_feature_code { | 818 | enum ec_feature_code { |
| @@ -933,7 +936,7 @@ struct ec_response_get_features { · 117 unmodified lines | |||
| 933 | /* Flash commands */ | 936 | /* Flash commands */ |
| 934 | 937 | ||
| 935 | /* Get flash info */ | 938 | /* Get flash info */ |
| 936 | #define EC_CMD_FLASH_INFO 0x10 | 939 | #define EC_CMD_FLASH_INFO 0x0010 |
| 937 | 940 | ||
| 938 | /** | 941 | /** |
| 939 | * struct ec_response_flash_info - Response to the flash info command. | 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 | * Response is params.size bytes of data. | 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 | * struct ec_params_flash_read - Parameters for the flash read command. | 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 | } __ec_align4; | 1016 | } __ec_align4; |
| 1014 | 1017 | ||
| 1015 | /* Write flash */ | 1018 | /* Write flash */ |
| 1016 | #define EC_CMD_FLASH_WRITE 0x12 | 1019 | #define EC_CMD_FLASH_WRITE 0x0012 |
| 1017 | #define EC_VER_FLASH_WRITE 1 | 1020 | #define EC_VER_FLASH_WRITE 1 |
| 1018 | 1021 | ||
| 1019 | /* Version 0 of the flash command supported only 64 bytes of data */ | 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 | } __ec_align4; | 1034 | } __ec_align4; |
| 1032 | 1035 | ||
| 1033 | /* Erase flash */ | 1036 | /* Erase flash */ |
| 1034 | #define EC_CMD_FLASH_ERASE 0x13 | 1037 | #define EC_CMD_FLASH_ERASE 0x0013 |
| 1035 | 1038 | ||
| 1036 | /** | 1039 | /** |
| 1037 | * struct ec_params_flash_erase - Parameters for the flash erase command. | 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 | * If mask=0, simply returns the current flags state. | 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 | #define EC_VER_FLASH_PROTECT 1 /* Command version 1 */ | 1060 | #define EC_VER_FLASH_PROTECT 1 /* Command version 1 */ |
| 1058 | 1061 | ||
| 1059 | /* Flags for flash protection */ | 1062 | /* Flags for flash protection */ |
| @@ -1110,7 +1113,7 @@ struct ec_response_flash_protect { · 50 unmodified lines | |||
| 1110 | */ | 1113 | */ |
| 1111 | 1114 | ||
| 1112 | /* Get the region offset/size */ | 1115 | /* Get the region offset/size */ |
| 1113 | #define EC_CMD_FLASH_REGION_INFO 0x16 | 1116 | #define EC_CMD_FLASH_REGION_INFO 0x0016 |
| 1114 | #define EC_VER_FLASH_REGION_INFO 1 | 1117 | #define EC_VER_FLASH_REGION_INFO 1 |
| 1115 | 1118 | ||
| 1116 | enum ec_flash_region { | 1119 | enum ec_flash_region { |
| @@ -1142,7 +1145,7 @@ struct ec_response_flash_region_info { · 25 unmodified lines | |||
| 1142 | } __ec_align4; | 1145 | } __ec_align4; |
| 1143 | 1146 | ||
| 1144 | /* Read/write VbNvContext */ | 1147 | /* Read/write VbNvContext */ |
| 1145 | #define EC_CMD_VBNV_CONTEXT 0x17 | 1148 | #define EC_CMD_VBNV_CONTEXT 0x0017 |
| 1146 | #define EC_VER_VBNV_CONTEXT 1 | 1149 | #define EC_VER_VBNV_CONTEXT 1 |
| 1147 | #define EC_VBNV_BLOCK_SIZE 16 | 1150 | #define EC_VBNV_BLOCK_SIZE 16 |
| 1148 | 1151 | ||
| @@ -1164,7 +1167,7 @@ struct ec_response_vbnvcontext { · 15 unmodified lines | |||
| 1164 | /* PWM commands */ | 1167 | /* PWM commands */ |
| 1165 | 1168 | ||
| 1166 | /* Get fan target RPM */ | 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 | struct ec_response_pwm_get_fan_rpm { | 1172 | struct ec_response_pwm_get_fan_rpm { |
| 1170 | uint32_t rpm; | 1173 | uint32_t rpm; |
| @@ -1178,7 +1181,7 @@ struct ec_params_pwm_set_fan_target_rpm { · 7 unmodified lines | |||
| 1178 | } __ec_align_size1; | 1181 | } __ec_align_size1; |
| 1179 | 1182 | ||
| 1180 | /* Get keyboard backlight */ | 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 | struct ec_response_pwm_get_keyboard_backlight { | 1186 | struct ec_response_pwm_get_keyboard_backlight { |
| 1184 | uint8_t percent; | 1187 | uint8_t percent; |
| @@ -1186,20 +1189,20 @@ struct ec_response_pwm_get_keyboard_backlight { · 1 unmodified line | |||
| 1186 | } __ec_align1; | 1189 | } __ec_align1; |
| 1187 | 1190 | ||
| 1188 | /* Set keyboard backlight */ | 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 | struct ec_params_pwm_set_keyboard_backlight { | 1194 | struct ec_params_pwm_set_keyboard_backlight { |
| 1192 | uint8_t percent; | 1195 | uint8_t percent; |
| 1193 | } __ec_align1; | 1196 | } __ec_align1; |
| 1194 | 1197 | ||
| 1195 | /* Set target fan PWM duty cycle */ | 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 | struct ec_params_pwm_set_fan_duty { | 1201 | struct ec_params_pwm_set_fan_duty { |
| 1199 | uint32_t percent; | 1202 | uint32_t percent; |
| 1200 | } __ec_align4; | 1203 | } __ec_align4; |
| 1201 | 1204 | ||
| 1202 | #define EC_CMD_PWM_SET_DUTY 0x25 | 1205 | #define EC_CMD_PWM_SET_DUTY 0x0025 |
| 1203 | /* 16 bit duty cycle, 0xffff = 100% */ | 1206 | /* 16 bit duty cycle, 0xffff = 100% */ |
| 1204 | #define EC_PWM_MAX_DUTY 0xffff | 1207 | #define EC_PWM_MAX_DUTY 0xffff |
| 1205 | 1208 | ||
| @@ -1219,7 +1222,7 @@ struct ec_params_pwm_set_duty { · 13 unmodified lines | |||
| 1219 | uint8_t index; /* Type-specific index, or 0 if unique */ | 1222 | uint8_t index; /* Type-specific index, or 0 if unique */ |
| 1220 | } __ec_align4; | 1223 | } __ec_align4; |
| 1221 | 1224 | ||
| 1222 | #define EC_CMD_PWM_GET_DUTY 0x26 | 1225 | #define EC_CMD_PWM_GET_DUTY 0x0026 |
| 1223 | 1226 | ||
| 1224 | struct ec_params_pwm_get_duty { | 1227 | struct ec_params_pwm_get_duty { |
| 1225 | uint8_t pwm_type; /* ec_pwm_type */ | 1228 | uint8_t pwm_type; /* ec_pwm_type */ |
| @@ -1237,7 +1240,7 @@ struct ec_response_pwm_get_duty { · 11 unmodified lines | |||
| 1237 | * into a subcommand. We'll make separate structs for subcommands with | 1240 | * into a subcommand. We'll make separate structs for subcommands with |
| 1238 | * different input args, so that we know how much to expect. | 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 | struct rgb_s { | 1245 | struct rgb_s { |
| 1243 | uint8_t r, g, b; | 1246 | uint8_t r, g, b; |
| @@ -1431,7 +1434,7 @@ enum lightbar_command { · 187 unmodified lines | |||
| 1431 | /*****************************************************************************/ | 1434 | /*****************************************************************************/ |
| 1432 | /* LED control commands */ | 1435 | /* LED control commands */ |
| 1433 | 1436 | ||
| 1434 | #define EC_CMD_LED_CONTROL 0x29 | 1437 | #define EC_CMD_LED_CONTROL 0x0029 |
| 1435 | 1438 | ||
| 1436 | enum ec_led_id { | 1439 | enum ec_led_id { |
| 1437 | /* LED to indicate battery state of charge */ | 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 | /* Verified boot hash command */ | 1493 | /* Verified boot hash command */ |
| 1491 | #define EC_CMD_VBOOT_HASH 0x2A | 1494 | #define EC_CMD_VBOOT_HASH 0x002A |
| 1492 | 1495 | ||
| 1493 | struct ec_params_vboot_hash { | 1496 | struct ec_params_vboot_hash { |
| 1494 | uint8_t cmd; /* enum ec_vboot_hash_cmd */ | 1497 | uint8_t cmd; /* enum ec_vboot_hash_cmd */ |
| @@ -1540,7 +1543,7 @@ enum ec_vboot_hash_status { · 45 unmodified lines | |||
| 1540 | * Motion sense commands. We'll make separate structs for sub-commands with | 1543 | * Motion sense commands. We'll make separate structs for sub-commands with |
| 1541 | * different input args, so that we know how much to expect. | 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 | /* Motion sense commands */ | 1548 | /* Motion sense commands */ |
| 1546 | enum motionsense_command { | 1549 | enum motionsense_command { |
| @@ -1804,7 +1807,7 @@ struct ec_response_motion_sense { · 257 unmodified lines | |||
| 1804 | /* USB charging control commands */ | 1807 | /* USB charging control commands */ |
| 1805 | 1808 | ||
| 1806 | /* Set USB port charging mode */ | 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 | struct ec_params_usb_charge_set_mode { | 1812 | struct ec_params_usb_charge_set_mode { |
| 1810 | uint8_t usb_port_id; | 1813 | uint8_t usb_port_id; |
| @@ -1818,7 +1821,7 @@ struct ec_params_usb_charge_set_mode { · 7 unmodified lines | |||
| 1818 | #define EC_PSTORE_SIZE_MAX 64 | 1821 | #define EC_PSTORE_SIZE_MAX 64 |
| 1819 | 1822 | ||
| 1820 | /* Get persistent storage info */ | 1823 | /* Get persistent storage info */ |
| 1821 | #define EC_CMD_PSTORE_INFO 0x40 | 1824 | #define EC_CMD_PSTORE_INFO 0x0040 |
| 1822 | 1825 | ||
| 1823 | struct ec_response_pstore_info { | 1826 | struct ec_response_pstore_info { |
| 1824 | /* Persistent storage size, in bytes */ | 1827 | /* Persistent storage size, in bytes */ |
| @@ -1832,7 +1835,7 @@ struct ec_response_pstore_info { · 7 unmodified lines | |||
| 1832 | * | 1835 | * |
| 1833 | * Response is params.size bytes of data. | 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 | struct ec_params_pstore_read { | 1840 | struct ec_params_pstore_read { |
| 1838 | uint32_t offset; /* Byte offset to read */ | 1841 | uint32_t offset; /* Byte offset to read */ |
| @@ -1840,7 +1843,7 @@ struct ec_params_pstore_read { · 1 unmodified line | |||
| 1840 | } __ec_align4; | 1843 | } __ec_align4; |
| 1841 | 1844 | ||
| 1842 | /* Write persistent storage */ | 1845 | /* Write persistent storage */ |
| 1843 | #define EC_CMD_PSTORE_WRITE 0x42 | 1846 | #define EC_CMD_PSTORE_WRITE 0x0042 |
| 1844 | 1847 | ||
| 1845 | struct ec_params_pstore_write { | 1848 | struct ec_params_pstore_write { |
| 1846 | uint32_t offset; /* Byte offset to write */ | 1849 | uint32_t offset; /* Byte offset to write */ |
| @@ -1861,12 +1864,12 @@ struct ec_response_rtc { · 14 unmodified lines | |||
| 1861 | } __ec_align4; | 1864 | } __ec_align4; |
| 1862 | 1865 | ||
| 1863 | /* These use ec_response_rtc */ | 1866 | /* These use ec_response_rtc */ |
| 1864 | #define EC_CMD_RTC_GET_VALUE 0x44 | 1867 | #define EC_CMD_RTC_GET_VALUE 0x0044 |
| 1865 | #define EC_CMD_RTC_GET_ALARM 0x45 | 1868 | #define EC_CMD_RTC_GET_ALARM 0x0045 |
| 1866 | 1869 | ||
| 1867 | /* These all use ec_params_rtc */ | 1870 | /* These all use ec_params_rtc */ |
| 1868 | #define EC_CMD_RTC_SET_VALUE 0x46 | 1871 | #define EC_CMD_RTC_SET_VALUE 0x0046 |
| 1869 | #define EC_CMD_RTC_SET_ALARM 0x47 | 1872 | #define EC_CMD_RTC_SET_ALARM 0x0047 |
| 1870 | 1873 | ||
| 1871 | /* Pass as time param to SET_ALARM to clear the current alarm */ | 1874 | /* Pass as time param to SET_ALARM to clear the current alarm */ |
| 1872 | #define EC_RTC_ALARM_CLEAR 0 | 1875 | #define EC_RTC_ALARM_CLEAR 0 |
| @@ -1878,8 +1881,8 @@ struct ec_response_rtc { · 5 unmodified lines | |||
| 1878 | #define EC_PORT80_SIZE_MAX 32 | 1881 | #define EC_PORT80_SIZE_MAX 32 |
| 1879 | 1882 | ||
| 1880 | /* Get last port80 code from previous boot */ | 1883 | /* Get last port80 code from previous boot */ |
| 1881 | #define EC_CMD_PORT80_LAST_BOOT 0x48 | 1884 | #define EC_CMD_PORT80_LAST_BOOT 0x0048 |
| 1882 | #define EC_CMD_PORT80_READ 0x48 | 1885 | #define EC_CMD_PORT80_READ 0x0048 |
| 1883 | 1886 | ||
| 1884 | enum ec_port80_subcmd { | 1887 | enum ec_port80_subcmd { |
| 1885 | EC_PORT80_GET_INFO = 0, | 1888 | EC_PORT80_GET_INFO = 0, |
| @@ -1920,8 +1923,8 @@ struct ec_response_port80_last_boot { · 34 unmodified lines | |||
| 1920 | * Version 1 separates the CPU thermal limits from the fan control. | 1923 | * Version 1 separates the CPU thermal limits from the fan control. |
| 1921 | */ | 1924 | */ |
| 1922 | 1925 | ||
| 1923 | #define EC_CMD_THERMAL_SET_THRESHOLD 0x50 | 1926 | #define EC_CMD_THERMAL_SET_THRESHOLD 0x0050 |
| 1924 | #define EC_CMD_THERMAL_GET_THRESHOLD 0x51 | 1927 | #define EC_CMD_THERMAL_GET_THRESHOLD 0x0051 |
| 1925 | 1928 | ||
| 1926 | /* The version 0 structs are opaque. You have to know what they are for | 1929 | /* The version 0 structs are opaque. You have to know what they are for |
| 1927 | * the get/set commands to make any sense. | 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 | /* Toggle automatic fan control */ | 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 | /* Get TMP006 calibration data */ | 1991 | /* Get TMP006 calibration data */ |
| 1989 | #define EC_CMD_TMP006_GET_CALIBRATION 0x53 | 1992 | #define EC_CMD_TMP006_GET_CALIBRATION 0x0053 |
| 1990 | 1993 | ||
| 1991 | struct ec_params_tmp006_get_calibration { | 1994 | struct ec_params_tmp006_get_calibration { |
| 1992 | uint8_t index; | 1995 | uint8_t index; |
| @@ -2000,7 +2003,7 @@ struct ec_response_tmp006_get_calibration { · 7 unmodified lines | |||
| 2000 | } __ec_align4; | 2003 | } __ec_align4; |
| 2001 | 2004 | ||
| 2002 | /* Set TMP006 calibration data */ | 2005 | /* Set TMP006 calibration data */ |
| 2003 | #define EC_CMD_TMP006_SET_CALIBRATION 0x54 | 2006 | #define EC_CMD_TMP006_SET_CALIBRATION 0x0054 |
| 2004 | 2007 | ||
| 2005 | struct ec_params_tmp006_set_calibration { | 2008 | struct ec_params_tmp006_set_calibration { |
| 2006 | uint8_t index; | 2009 | uint8_t index; |
| @@ -2012,7 +2015,7 @@ struct ec_params_tmp006_set_calibration { · 5 unmodified lines | |||
| 2012 | } __ec_align4; | 2015 | } __ec_align4; |
| 2013 | 2016 | ||
| 2014 | /* Read raw TMP006 data */ | 2017 | /* Read raw TMP006 data */ |
| 2015 | #define EC_CMD_TMP006_GET_RAW 0x55 | 2018 | #define EC_CMD_TMP006_GET_RAW 0x0055 |
| 2016 | 2019 | ||
| 2017 | struct ec_params_tmp006_get_raw { | 2020 | struct ec_params_tmp006_get_raw { |
| 2018 | uint8_t index; | 2021 | uint8_t index; |
| @@ -2036,12 +2039,12 @@ struct ec_response_tmp006_get_raw { · 17 unmodified lines | |||
| 2036 | * to obtain the instantaneous state, use EC_CMD_MKBP_INFO with the type | 2039 | * to obtain the instantaneous state, use EC_CMD_MKBP_INFO with the type |
| 2037 | * EC_MKBP_INFO_CURRENT and event EC_MKBP_EVENT_KEY_MATRIX. | 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 | * Provide information about various MKBP things. See enum ec_mkbp_info_type. | 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 | struct ec_response_mkbp_info { | 2049 | struct ec_response_mkbp_info { |
| 2047 | uint32_t rows; | 2050 | uint32_t rows; |
| @@ -2095,7 +2098,7 @@ enum ec_mkbp_info_type { · 47 unmodified lines | |||
| 2095 | }; | 2098 | }; |
| 2096 | 2099 | ||
| 2097 | /* Simulate key press */ | 2100 | /* Simulate key press */ |
| 2098 | #define EC_CMD_MKBP_SIMULATE_KEY 0x62 | 2101 | #define EC_CMD_MKBP_SIMULATE_KEY 0x0062 |
| 2099 | 2102 | ||
| 2100 | struct ec_params_mkbp_simulate_key { | 2103 | struct ec_params_mkbp_simulate_key { |
| 2101 | uint8_t col; | 2104 | uint8_t col; |
| @@ -2104,8 +2107,8 @@ struct ec_params_mkbp_simulate_key { · 2 unmodified lines | |||
| 2104 | } __ec_align1; | 2107 | } __ec_align1; |
| 2105 | 2108 | ||
| 2106 | /* Configure keyboard scanning */ | 2109 | /* Configure keyboard scanning */ |
| 2107 | #define EC_CMD_MKBP_SET_CONFIG 0x64 | 2110 | #define EC_CMD_MKBP_SET_CONFIG 0x0064 |
| 2108 | #define EC_CMD_MKBP_GET_CONFIG 0x65 | 2111 | #define EC_CMD_MKBP_GET_CONFIG 0x0065 |
| 2109 | 2112 | ||
| 2110 | /* flags */ | 2113 | /* flags */ |
| 2111 | enum mkbp_config_flags { | 2114 | enum mkbp_config_flags { |
| @@ -2158,7 +2161,7 @@ struct ec_response_mkbp_get_config { · 46 unmodified lines | |||
| 2158 | } __ec_align_size1; | 2161 | } __ec_align_size1; |
| 2159 | 2162 | ||
| 2160 | /* Run the key scan emulation */ | 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 | enum ec_keyscan_seq_cmd { | 2166 | enum ec_keyscan_seq_cmd { |
| 2164 | EC_KEYSCAN_SEQ_STATUS = 0, /* Get status information */ | 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 | * The device replies with UNAVAILABLE if there aren't any pending events. | 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 | enum ec_mkbp_event { | 2227 | enum ec_mkbp_event { |
| 2225 | /* Keyboard matrix changed. The event data is the new matrix state. */ | 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 | /* Temperature sensor commands */ | 2301 | /* Temperature sensor commands */ |
| 2299 | 2302 | ||
| 2300 | /* Read temperature sensor info */ | 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 | struct ec_params_temp_sensor_get_info { | 2306 | struct ec_params_temp_sensor_get_info { |
| 2304 | uint8_t id; | 2307 | uint8_t id; |
| @@ -2333,30 +2336,30 @@ struct ec_response_host_event_mask { · 28 unmodified lines | |||
| 2333 | } __ec_align4; | 2336 | } __ec_align4; |
| 2334 | 2337 | ||
| 2335 | /* These all use ec_response_host_event_mask */ | 2338 | /* These all use ec_response_host_event_mask */ |
| 2336 | #define EC_CMD_HOST_EVENT_GET_B 0x87 | 2339 | #define EC_CMD_HOST_EVENT_GET_B 0x0087 |
| 2337 | #define EC_CMD_HOST_EVENT_GET_SMI_MASK 0x88 | 2340 | #define EC_CMD_HOST_EVENT_GET_SMI_MASK 0x0088 |
| 2338 | #define EC_CMD_HOST_EVENT_GET_SCI_MASK 0x89 | 2341 | #define EC_CMD_HOST_EVENT_GET_SCI_MASK 0x0089 |
| 2339 | #define EC_CMD_HOST_EVENT_GET_WAKE_MASK 0x8d | 2342 | #define EC_CMD_HOST_EVENT_GET_WAKE_MASK 0x008D |
| 2340 | 2343 | ||
| 2341 | /* These all use ec_params_host_event_mask */ | 2344 | /* These all use ec_params_host_event_mask */ |
| 2342 | #define EC_CMD_HOST_EVENT_SET_SMI_MASK 0x8a | 2345 | #define EC_CMD_HOST_EVENT_SET_SMI_MASK 0x008A |
| 2343 | #define EC_CMD_HOST_EVENT_SET_SCI_MASK 0x8b | 2346 | #define EC_CMD_HOST_EVENT_SET_SCI_MASK 0x008B |
| 2344 | #define EC_CMD_HOST_EVENT_CLEAR 0x8c | 2347 | #define EC_CMD_HOST_EVENT_CLEAR 0x008C |
| 2345 | #define EC_CMD_HOST_EVENT_SET_WAKE_MASK 0x8e | 2348 | #define EC_CMD_HOST_EVENT_SET_WAKE_MASK 0x008E |
| 2346 | #define EC_CMD_HOST_EVENT_CLEAR_B 0x8f | 2349 | #define EC_CMD_HOST_EVENT_CLEAR_B 0x008F |
| 2347 | 2350 | ||
| 2348 | /*****************************************************************************/ | 2351 | /*****************************************************************************/ |
| 2349 | /* Switch commands */ | 2352 | /* Switch commands */ |
| 2350 | 2353 | ||
| 2351 | /* Enable/disable LCD backlight */ | 2354 | /* Enable/disable LCD backlight */ |
| 2352 | #define EC_CMD_SWITCH_ENABLE_BKLIGHT 0x90 | 2355 | #define EC_CMD_SWITCH_ENABLE_BKLIGHT 0x0090 |
| 2353 | 2356 | ||
| 2354 | struct ec_params_switch_enable_backlight { | 2357 | struct ec_params_switch_enable_backlight { |
| 2355 | uint8_t enabled; | 2358 | uint8_t enabled; |
| 2356 | } __ec_align1; | 2359 | } __ec_align1; |
| 2357 | 2360 | ||
| 2358 | /* Enable/disable WLAN/Bluetooth */ | 2361 | /* Enable/disable WLAN/Bluetooth */ |
| 2359 | #define EC_CMD_SWITCH_ENABLE_WIRELESS 0x91 | 2362 | #define EC_CMD_SWITCH_ENABLE_WIRELESS 0x0091 |
| 2360 | #define EC_VER_SWITCH_ENABLE_WIRELESS 1 | 2363 | #define EC_VER_SWITCH_ENABLE_WIRELESS 1 |
| 2361 | 2364 | ||
| 2362 | /* Version 0 params; no response */ | 2365 | /* Version 0 params; no response */ |
| @@ -2396,7 +2399,7 @@ struct ec_response_switch_enable_wireless_v1 { · 33 unmodified lines | |||
| 2396 | /* GPIO commands. Only available on EC if write protect has been disabled. */ | 2399 | /* GPIO commands. Only available on EC if write protect has been disabled. */ |
| 2397 | 2400 | ||
| 2398 | /* Set GPIO output value */ | 2401 | /* Set GPIO output value */ |
| 2399 | #define EC_CMD_GPIO_SET 0x92 | 2402 | #define EC_CMD_GPIO_SET 0x0092 |
| 2400 | 2403 | ||
| 2401 | struct ec_params_gpio_set { | 2404 | struct ec_params_gpio_set { |
| 2402 | char name[32]; | 2405 | char name[32]; |
| @@ -2404,7 +2407,7 @@ struct ec_params_gpio_set { · 1 unmodified line | |||
| 2404 | } __ec_align1; | 2407 | } __ec_align1; |
| 2405 | 2408 | ||
| 2406 | /* Get GPIO value */ | 2409 | /* Get GPIO value */ |
| 2407 | #define EC_CMD_GPIO_GET 0x93 | 2410 | #define EC_CMD_GPIO_GET 0x0093 |
| 2408 | 2411 | ||
| 2409 | /* Version 0 of input params and response */ | 2412 | /* Version 0 of input params and response */ |
| 2410 | struct ec_params_gpio_get { | 2413 | struct ec_params_gpio_get { |
| @@ -2458,7 +2461,7 @@ enum gpio_get_subcmd { · 47 unmodified lines | |||
| 2458 | */ | 2461 | */ |
| 2459 | 2462 | ||
| 2460 | /* Read I2C bus */ | 2463 | /* Read I2C bus */ |
| 2461 | #define EC_CMD_I2C_READ 0x94 | 2464 | #define EC_CMD_I2C_READ 0x0094 |
| 2462 | 2465 | ||
| 2463 | struct ec_params_i2c_read { | 2466 | struct ec_params_i2c_read { |
| 2464 | uint16_t addr; /* 8-bit address (7-bit shifted << 1) */ | 2467 | uint16_t addr; /* 8-bit address (7-bit shifted << 1) */ |
| @@ -2472,7 +2475,7 @@ struct ec_response_i2c_read { · 7 unmodified lines | |||
| 2472 | } __ec_align2; | 2475 | } __ec_align2; |
| 2473 | 2476 | ||
| 2474 | /* Write I2C bus */ | 2477 | /* Write I2C bus */ |
| 2475 | #define EC_CMD_I2C_WRITE 0x95 | 2478 | #define EC_CMD_I2C_WRITE 0x0095 |
| 2476 | 2479 | ||
| 2477 | struct ec_params_i2c_write { | 2480 | struct ec_params_i2c_write { |
| 2478 | uint16_t data; | 2481 | uint16_t data; |
| @@ -2488,7 +2491,7 @@ struct ec_params_i2c_write { · 9 unmodified lines | |||
| 2488 | /* Force charge state machine to stop charging the battery or force it to | 2491 | /* Force charge state machine to stop charging the battery or force it to |
| 2489 | * discharge the battery. | 2492 | * discharge the battery. |
| 2490 | */ | 2493 | */ |
| 2491 | #define EC_CMD_CHARGE_CONTROL 0x96 | 2494 | #define EC_CMD_CHARGE_CONTROL 0x0096 |
| 2492 | #define EC_VER_CHARGE_CONTROL 1 | 2495 | #define EC_VER_CHARGE_CONTROL 1 |
| 2493 | 2496 | ||
| 2494 | enum ec_charge_control_mode { | 2497 | enum ec_charge_control_mode { |
| @@ -2504,7 +2507,7 @@ struct ec_params_charge_control { · 9 unmodified lines | |||
| 2504 | /*****************************************************************************/ | 2507 | /*****************************************************************************/ |
| 2505 | 2508 | ||
| 2506 | /* Snapshot console output buffer for use by EC_CMD_CONSOLE_READ. */ | 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 | * Read data from the saved snapshot. If the subcmd parameter is | 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 | * Response is null-terminated string. Empty string, if there is no more | 2521 | * Response is null-terminated string. Empty string, if there is no more |
| 2519 | * remaining output. | 2522 | * remaining output. |
| 2520 | */ | 2523 | */ |
| 2521 | #define EC_CMD_CONSOLE_READ 0x98 | 2524 | #define EC_CMD_CONSOLE_READ 0x0098 |
| 2522 | 2525 | ||
| 2523 | enum ec_console_read_subcmd { | 2526 | enum ec_console_read_subcmd { |
| 2524 | CONSOLE_READ_NEXT = 0, | 2527 | CONSOLE_READ_NEXT = 0, |
| @@ -2538,8 +2541,7 @@ struct ec_params_console_read_v1 { · 13 unmodified lines | |||
| 2538 | * EC_RES_SUCCESS if the command was successful. | 2541 | * EC_RES_SUCCESS if the command was successful. |
| 2539 | * EC_RES_ERROR if the cut off command failed. | 2542 | * EC_RES_ERROR if the cut off command failed. |
| 2540 | */ | 2543 | */ |
| 2541 | 2544 | #define EC_CMD_BATTERY_CUT_OFF 0x0099 | |
| 2542 | #define EC_CMD_BATTERY_CUT_OFF 0x99 | ||
| 2543 | 2545 | ||
| 2544 | #define EC_BATTERY_CUTOFF_FLAG_AT_SHUTDOWN (1 << 0) | 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 | * Switch USB mux or return to automatic switching. | 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 | struct ec_params_usb_mux { | 2560 | struct ec_params_usb_mux { |
| 2559 | uint8_t mux; | 2561 | uint8_t mux; |
| @@ -2570,7 +2572,7 @@ enum ec_ldo_state { · 10 unmodified lines | |||
| 2570 | /* | 2572 | /* |
| 2571 | * Switch on/off a LDO. | 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 | struct ec_params_ldo_set { | 2577 | struct ec_params_ldo_set { |
| 2576 | uint8_t index; | 2578 | uint8_t index; |
| @@ -2580,7 +2582,7 @@ struct ec_params_ldo_set { · 3 unmodified lines | |||
| 2580 | /* | 2582 | /* |
| 2581 | * Get LDO state. | 2583 | * Get LDO state. |
| 2582 | */ | 2584 | */ |
| 2583 | #define EC_CMD_LDO_GET 0x9c | 2585 | #define EC_CMD_LDO_GET 0x009C |
| 2584 | 2586 | ||
| 2585 | struct ec_params_ldo_get { | 2587 | struct ec_params_ldo_get { |
| 2586 | uint8_t index; | 2588 | uint8_t index; |
| @@ -2596,7 +2598,7 @@ struct ec_response_ldo_get { · 9 unmodified lines | |||
| 2596 | /* | 2598 | /* |
| 2597 | * Get power info. | 2599 | * Get power info. |
| 2598 | */ | 2600 | */ |
| 2599 | #define EC_CMD_POWER_INFO 0x9d | 2601 | #define EC_CMD_POWER_INFO 0x009D |
| 2600 | 2602 | ||
| 2601 | struct ec_response_power_info { | 2603 | struct ec_response_power_info { |
| 2602 | uint32_t usb_dev_type; | 2604 | uint32_t usb_dev_type; |
| @@ -2609,7 +2611,7 @@ struct ec_response_power_info { · 6 unmodified lines | |||
| 2609 | /*****************************************************************************/ | 2611 | /*****************************************************************************/ |
| 2610 | /* I2C passthru command */ | 2612 | /* I2C passthru command */ |
| 2611 | 2613 | ||
| 2612 | #define EC_CMD_I2C_PASSTHRU 0x9e | 2614 | #define EC_CMD_I2C_PASSTHRU 0x009E |
| 2613 | 2615 | ||
| 2614 | /* Read data; if not present, message is a write */ | 2616 | /* Read data; if not present, message is a write */ |
| 2615 | #define EC_I2C_FLAG_READ (1 << 15) | 2617 | #define EC_I2C_FLAG_READ (1 << 15) |
| @@ -2644,7 +2646,7 @@ struct ec_response_i2c_passthru { · 28 unmodified lines | |||
| 2644 | /*****************************************************************************/ | 2646 | /*****************************************************************************/ |
| 2645 | /* Power button hang detect */ | 2647 | /* Power button hang detect */ |
| 2646 | 2648 | ||
| 2647 | #define EC_CMD_HANG_DETECT 0x9f | 2649 | #define EC_CMD_HANG_DETECT 0x009F |
| 2648 | 2650 | ||
| 2649 | /* Reasons to start hang detection timer */ | 2651 | /* Reasons to start hang detection timer */ |
| 2650 | /* Power button pressed */ | 2652 | /* Power button pressed */ |
| @@ -2703,7 +2705,7 @@ struct ec_params_hang_detect { · 52 unmodified lines | |||
| 2703 | * This is the single catch-all host command to exchange data regarding the | 2705 | * This is the single catch-all host command to exchange data regarding the |
| 2704 | * charge state machine (v2 and up). | 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 | /* Subcommands for this host command */ | 2710 | /* Subcommands for this host command */ |
| 2709 | enum charge_state_command { | 2711 | enum charge_state_command { |
| @@ -2774,7 +2776,7 @@ struct ec_response_charge_state { · 64 unmodified lines | |||
| 2774 | /* | 2776 | /* |
| 2775 | * Set maximum battery charging current. | 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 | struct ec_params_current_limit { | 2781 | struct ec_params_current_limit { |
| 2780 | uint32_t limit; /* in mA */ | 2782 | uint32_t limit; /* in mA */ |
| @@ -2794,7 +2796,7 @@ struct ec_params_external_power_limit_v1 { · 13 unmodified lines | |||
| 2794 | #define EC_POWER_LIMIT_NONE 0xffff | 2796 | #define EC_POWER_LIMIT_NONE 0xffff |
| 2795 | 2797 | ||
| 2796 | /* Inform the EC when entering a sleep state */ | 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 | enum host_sleep_event { | 2801 | enum host_sleep_event { |
| 2800 | HOST_SLEEP_EVENT_S3_SUSPEND = 1, | 2802 | HOST_SLEEP_EVENT_S3_SUSPEND = 1, |
| @@ -2868,14 +2870,14 @@ struct ec_response_host_sleep_event_v1 { · 67 unmodified lines | |||
| 2868 | /* Smart battery pass-through */ | 2870 | /* Smart battery pass-through */ |
| 2869 | 2871 | ||
| 2870 | /* Get / Set 16-bit smart battery registers */ | 2872 | /* Get / Set 16-bit smart battery registers */ |
| 2871 | #define EC_CMD_SB_READ_WORD 0xb0 | 2873 | #define EC_CMD_SB_READ_WORD 0x00B0 |
| 2872 | #define EC_CMD_SB_WRITE_WORD 0xb1 | 2874 | #define EC_CMD_SB_WRITE_WORD 0x00B1 |
| 2873 | 2875 | ||
| 2874 | /* Get / Set string smart battery parameters | 2876 | /* Get / Set string smart battery parameters |
| 2875 | * formatted as SMBUS "block". | 2877 | * formatted as SMBUS "block". |
| 2876 | */ | 2878 | */ |
| 2877 | #define EC_CMD_SB_READ_BLOCK 0xb2 | 2879 | #define EC_CMD_SB_READ_BLOCK 0x00B2 |
| 2878 | #define EC_CMD_SB_WRITE_BLOCK 0xb3 | 2880 | #define EC_CMD_SB_WRITE_BLOCK 0x00B3 |
| 2879 | 2881 | ||
| 2880 | struct ec_params_sb_rd { | 2882 | struct ec_params_sb_rd { |
| 2881 | uint8_t reg; | 2883 | uint8_t reg; |
| @@ -2908,7 +2910,7 @@ struct ec_params_sb_wr_block { · 26 unmodified lines | |||
| 2908 | * requested value. | 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 | enum ec_battery_vendor_param_mode { | 2915 | enum ec_battery_vendor_param_mode { |
| 2914 | BATTERY_VENDOR_PARAM_MODE_GET = 0, | 2916 | BATTERY_VENDOR_PARAM_MODE_GET = 0, |
| @@ -3024,7 +3026,7 @@ struct ec_response_codec_gain { · 109 unmodified lines | |||
| 3024 | * TODO(crosbug.com/p/23747): This is a confusing name, since it doesn't | 3026 | * TODO(crosbug.com/p/23747): This is a confusing name, since it doesn't |
| 3025 | * necessarily reboot the EC. Rename to "image" or something similar? | 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 | /* Command */ | 3031 | /* Command */ |
| 3030 | enum ec_reboot_cmd { | 3032 | enum ec_reboot_cmd { |
| @@ -3052,7 +3054,7 @@ struct ec_params_reboot_ec { · 21 unmodified lines | |||
| 3052 | * Returns variable-length platform-dependent panic information. See panic.h | 3054 | * Returns variable-length platform-dependent panic information. See panic.h |
| 3053 | * for details. | 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 | * Use EC_CMD_REBOOT_EC to reboot the EC more politely. | 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 | * Resend last response (not supported on LPC). | 3268 | * Resend last response (not supported on LPC). |
| @@ -3269,7 +3271,7 @@ enum mkbp_cec_event { · 2 unmodified lines | |||
| 3269 | * there was no previous command, or the previous command's response was too | 3271 | * there was no previous command, or the previous command's response was too |
| 3270 | * big to save. | 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 | * This header byte on a command indicate version 0. Any header byte less | 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 | * The old EC interface must not use commands 0xdc or higher. | 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 | #endif /* !__ACPI__ */ | 3288 | #endif /* !__ACPI__ */ |
| 3287 | 3289 | ||
| @@ -3293,7 +3295,7 @@ enum mkbp_cec_event { · 5 unmodified lines | |||
| 3293 | */ | 3295 | */ |
| 3294 | 3296 | ||
| 3295 | /* EC to PD MCU exchange status command */ | 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 | /* Status of EC being sent to PD */ | 3300 | /* Status of EC being sent to PD */ |
| 3299 | struct ec_params_pd_status { | 3301 | struct ec_params_pd_status { |
| @@ -3307,7 +3309,7 @@ struct ec_response_pd_status { · 7 unmodified lines | |||
| 3307 | } __ec_align_size1; | 3309 | } __ec_align_size1; |
| 3308 | 3310 | ||
| 3309 | /* Set USB type-C port role and muxes */ | 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 | enum usb_pd_control_role { | 3314 | enum usb_pd_control_role { |
| 3313 | USB_PD_CTRL_ROLE_NO_CHANGE = 0, | 3315 | USB_PD_CTRL_ROLE_NO_CHANGE = 0, |
| @@ -3360,7 +3362,7 @@ struct ec_response_usb_pd_control_v1 { · 46 unmodified lines | |||
| 3360 | char state[32]; | 3362 | char state[32]; |
| 3361 | } __ec_align1; | 3363 | } __ec_align1; |
| 3362 | 3364 | ||
| 3363 | #define EC_CMD_USB_PD_PORTS 0x102 | 3365 | #define EC_CMD_USB_PD_PORTS 0x0102 |
| 3364 | 3366 | ||
| 3365 | /* Maximum number of PD ports on a device, num_ports will be <= this */ | 3367 | /* Maximum number of PD ports on a device, num_ports will be <= this */ |
| 3366 | #define EC_USB_PD_MAX_PORTS 8 | 3368 | #define EC_USB_PD_MAX_PORTS 8 |
| @@ -3369,7 +3371,7 @@ struct ec_response_usb_pd_ports { · 2 unmodified lines | |||
| 3369 | uint8_t num_ports; | 3371 | uint8_t num_ports; |
| 3370 | } __ec_align1; | 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 | #define PD_POWER_CHARGING_PORT 0xff | 3376 | #define PD_POWER_CHARGING_PORT 0xff |
| 3375 | struct ec_params_usb_pd_power_info { | 3377 | struct ec_params_usb_pd_power_info { |
| @@ -3536,7 +3538,7 @@ struct mcdp_info { · 160 unmodified lines | |||
| 3536 | #define MCDP_FAMILY(family) ((family[0] << 8) | family[1]) | 3538 | #define MCDP_FAMILY(family) ((family[0] << 8) | family[1]) |
| 3537 | 3539 | ||
| 3538 | /* Get info about USB-C SS muxes */ | 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 | struct ec_params_usb_pd_mux_info { | 3543 | struct ec_params_usb_pd_mux_info { |
| 3542 | uint8_t port; /* USB-C port number */ | 3544 | uint8_t port; /* USB-C port number */ |
| @@ -3551,6 +3553,41 @@ struct ec_params_usb_pd_mux_info { · 8 unmodified lines | |||
| 3551 | struct ec_response_usb_pd_mux_info { | 3553 | struct ec_response_usb_pd_mux_info { |
| 3552 | uint8_t flags; /* USB_PD_MUX_*-encoded USB mux state */ | 3554 | uint8_t flags; /* USB_PD_MUX_*-encoded USB mux state */ |
| 3553 | } __ec_align1; | 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 | /* |