Lines Matching +full:ec +full:- +full:pwm
2 * Use of this source code is governed by a BSD-style license that can be
6 /* Host communication command constants for Chrome EC */
18 * - CMD is the command code. (defined by EC_CMD_ constants)
19 * - ERR is the error code. (defined by EC_RES_ constants)
20 * - Px is the optional payload.
23 * - S is the checksum which is the sum of all payload bytes.
53 /* The actual block is 0x800-0x8ff, but some BIOSes think it's 0x880-0x8ff
59 /* EC command register bit functions */
61 #define EC_LPC_CMDR_PENDING (1 << 1) /* Write pending to EC */
62 #define EC_LPC_CMDR_BUSY (1 << 2) /* EC is busy processing a command */
77 #define EC_MEMMAP_ID_VERSION 0x22 /* Version of data in 0x20 - 0x2f */
78 #define EC_MEMMAP_THERMAL_VERSION 0x23 /* Version of data in 0x00 - 0x1f */
79 #define EC_MEMMAP_BATTERY_VERSION 0x24 /* Version of data in 0x40 - 0x7f */
80 #define EC_MEMMAP_SWITCHES_VERSION 0x25 /* Version of data in 0x30 - 0x33 */
81 #define EC_MEMMAP_EVENTS_VERSION 0x26 /* Version of data in 0x34 - 0x3f */
112 * reporting a temperature range of 200K to 454K = -73C to 181C.
151 * is pre-processed to handle constants but the ASL compiler is unable to
165 /* EC has written a byte in the data register and host hasn't read it yet */
167 /* Host has written a command/data byte and the EC hasn't read it yet */
169 /* EC is processing a command */
171 /* Last write to EC was a command, not data */
173 /* EC is in burst mode. Unsupported by Chrome EC, so this bit is never set */
183 * EC is busy. This covers both the EC processing a command, and the host has
184 * written a new command but the EC hasn't picked it up yet.
209 * Host event codes. Note these are 1-based, not 0-based, because ACPI query
210 * EC command uses code 0 to mean "no event pending". We explicitly specify
230 * EC has finished initializing the host interface. The host can check
232 * determine when the EC is ready to accept subsequent commands.
248 * not initialized on the EC, or improperly configured on the host.
253 #define EC_HOST_EVENT_MASK(event_code) (1UL << ((event_code) - 1))
272 * If EC gets a command and this flag is not set, this is an old-style command.
274 * unknown length. EC must respond with an old-style response (that is,
279 * Args are from EC. Data area at EC_LPC_ADDR_HOST_PARAM contains response.
281 * If EC responds to a command and this flag is not set, this is an old-style
282 * response. Command version is 0 and response data from EC is at
296 * N+3 8-bit checksum of bytes 0..N+2
303 * M+2 8-bit checksum of bytes 0..M+1
328 * 3+ structs are being used. Usage is bus-dependent.
338 * EC will return EC_RES_INVALID_HEADER if it receives a header with a
364 /* Version 3 response from EC */
389 * Each command is an 8-byte command value. Commands which take params or
394 * those are implementation-dependent and not defined here.
401 * Get protocol version, used to deal with non-backward compatible protocol
411 * Hello. This is a simple command to test the EC is responsive to
434 /* Null-terminated version strings for RO, RW */
437 char reserved[32]; /* Was previously RW-B string */
456 * Response is null-terminated string.
464 /* Null-terminated strings */
478 * Read memory-mapped data.
480 * This is an alternate interface to memory-mapped data for bus protocols
481 * which don't support direct-mapped memory - I2C, SPI, etc.
508 * Check EC communcations status (busy). This is needed on i2c/spi but not
509 * on lpc since it has its own out-of-band busy indicator.
531 /* Tell the EC what to send back to us. */
639 /* RO flash code protected when the EC boots */
642 * RO flash code protected now. If this bit is set, at-boot status cannot
650 /* Error - at least one bank of flash is stuck locked, and cannot be unlocked */
653 * Error - flash protection is in inconsistent state. At least one bank of
655 * re-requesting the desired flags, or by a hard reset if that fails.
658 /* Entile flash code protected when the EC boots */
680 * Note: commands 0x14 - 0x19 version 0 were old commands to get/set flash
689 /* Region which holds read-only EC image */
691 /* Region which holds rewritable EC image */
694 * Region which should be write-protected in the factory (a superset of
731 /* PWM commands */
762 /* Set target fan PWM duty cycle */
810 uint8_t battery_threshold[LB_BATTERY_LEVELS - 1];
817 struct rgb_s color[8]; /* 0-3 are Google colors */
920 * Other values means the LED is control by PWM.
964 EC_VBOOT_HASH_TYPE_SHA256 = 0, /* SHA-256 */
975 * If one of these is specified, the EC will automatically update offset and
1030 /* Real-time clock */
1113 /* MKBP - Matrix KeyBoard Protocol */
1169 * minimum post-scan relax time. Once we finish a scan we check
1203 * Indicates this scan was processed by the EC. Due to timing, some
1265 * Note: host commands 0x80 - 0x87 are reserved to avoid conflict with ACPI
1316 /* GPIO commands. Only available on EC if write protect has been disabled. */
1343 uint16_t addr; /* 8-bit address (7-bit shifted << 1) */
1357 uint16_t addr; /* 8-bit address (7-bit shifted << 1) */
1382 * Response is null-terminated string. Empty string, if there is no more
1392 * For unsupported battery, just don't implement this command and lets EC
1524 /* Smart battery pass-through */
1526 /* Get / Set 16-bit smart battery registers */
1560 * Default mode is VBOOT_MODE_NORMAL if EC did not receive this command.
1577 * TODO: this is a confusing name, since it doesn't necessarily reboot the EC.
1587 /* (command 3 was jump to RW-B) */
1588 EC_REBOOT_COLD = 4, /* Cold-reboot */
1590 EC_REBOOT_HIBERNATE = 6 /* Hibernate EC */
1603 * Get information on last EC panic.
1605 * Returns variable-length platform-dependent panic information. See panic.h
1620 * This reads from ACPI memory space on the EC (EC_ACPI_MEM_*).
1624 * - Write EC_CMD_ACPI_READ to EC_LPC_ADDR_ACPI_CMD
1625 * - Wait for EC_LPC_CMDR_PENDING bit to clear
1626 * - Write address to EC_LPC_ADDR_ACPI_DATA
1627 * - Wait for EC_LPC_CMDR_DATA bit to set
1628 * - Read value from EC_LPC_ADDR_ACPI_DATA
1635 * This reads from ACPI memory space on the EC (EC_ACPI_MEM_*).
1639 * - Write EC_CMD_ACPI_WRITE to EC_LPC_ADDR_ACPI_CMD
1640 * - Wait for EC_LPC_CMDR_PENDING bit to clear
1641 * - Write address to EC_LPC_ADDR_ACPI_DATA
1642 * - Wait for EC_LPC_CMDR_PENDING bit to clear
1643 * - Write value to EC_LPC_ADDR_ACPI_DATA
1650 * This clears the lowest-order bit in the currently pending host events, and
1651 * sets the result code to the 1-based index of the bit (event 0x00000001 = 1,
1660 * Test location; writing value here updates test compliment byte to (0xff -
1666 /* Keyboard backlight brightness percent (0 - 100) */
1684 * This command will work even when the EC LPC interface is busy, because the
1685 * reboot command is processed at interrupt level. Note that when the EC
1688 * Use EC_CMD_REBOOT_EC to reboot the EC more politely.
1695 * Returns EC_RES_UNAVAILABLE if there is no response available - for example,
1703 * than this means that we are talking to an old EC which doesn't support
1709 * The old EC interface must not use commands 0dc or higher.