History

media: cros-ec-cec: Support multiple ports in set/get host commands

Reuse the top four bits of the cmd field to specify the port number. The reason for doing this as opposed to adding a separate uint8_t field is it avoids the need to add new versions of these commands. The change is backwards compatible since these bits were previously always zero, so the default behaviour is to always operate on port 0.

Reka Norman committed 3 years ago

Commit e90bd1f1 parent 4d0e1792 files · +8 −2Browse files

Showing the changes to include/linux/platform_data (1 of 2 files). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+6−2
@@ -4457,13 +4457,15 @@ struct ec_params_cec_write { · 4456 unmodified lines
44574457 /**
44584458 * struct ec_params_cec_set - CEC parameters set
44594459 * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
4460+ * @port: CEC port to set the parameter on
44604461 * @val: in case cmd is CEC_CMD_ENABLE, this field can be 0 to disable CEC
44614462 * or 1 to enable CEC functionality, in case cmd is
44624463 * CEC_CMD_LOGICAL_ADDRESS, this field encodes the requested logical
44634464 * address between 0 and 15 or 0xff to unregister
44644465 */
44654466 struct ec_params_cec_set {
4466− uint8_t cmd; /* enum cec_command */
4467+ uint8_t cmd : 4; /* enum cec_command */
4468+ uint8_t port : 4;
44674469 uint8_t val;
44684470 } __ec_align1;
44694471
@@ -4473,9 +4475,11 @@ struct ec_params_cec_set { · 3 unmodified lines
44734475 /**
44744476 * struct ec_params_cec_get - CEC parameters get
44754477 * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
4478+ * @port: CEC port to get the parameter on
44764479 */
44774480 struct ec_params_cec_get {
4478− uint8_t cmd; /* enum cec_command */
4481+ uint8_t cmd : 4; /* enum cec_command */
4482+ uint8_t port : 4;
44794483 } __ec_align1;
44804484
44814485 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t