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
4457/**4457/**
4458 * struct ec_params_cec_set - CEC parameters set4458 * struct ec_params_cec_set - CEC parameters set
4459 * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS4459 * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
4460 * @port: CEC port to set the parameter on
4460 * @val: in case cmd is CEC_CMD_ENABLE, this field can be 0 to disable CEC4461 * @val: in case cmd is CEC_CMD_ENABLE, this field can be 0 to disable CEC
4461 * or 1 to enable CEC functionality, in case cmd is4462 * or 1 to enable CEC functionality, in case cmd is
4462 * CEC_CMD_LOGICAL_ADDRESS, this field encodes the requested logical4463 * CEC_CMD_LOGICAL_ADDRESS, this field encodes the requested logical
4463 * address between 0 and 15 or 0xff to unregister4464 * address between 0 and 15 or 0xff to unregister
4464 */4465 */
4465struct ec_params_cec_set {4466struct ec_params_cec_set {
4466 uint8_t cmd; /* enum cec_command */4467 uint8_t cmd : 4; /* enum cec_command */
4468 uint8_t port : 4;
4467 uint8_t val;4469 uint8_t val;
4468} __ec_align1;4470} __ec_align1;
4469 4471
@@ -4473,9 +4475,11 @@ struct ec_params_cec_set { · 3 unmodified lines
4473/**4475/**
4474 * struct ec_params_cec_get - CEC parameters get4476 * struct ec_params_cec_get - CEC parameters get
4475 * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS4477 * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS
4478 * @port: CEC port to get the parameter on
4476 */4479 */
4477struct ec_params_cec_get {4480struct ec_params_cec_get {
4478 uint8_t cmd; /* enum cec_command */4481 uint8_t cmd : 4; /* enum cec_command */
4482 uint8_t port : 4;
4479} __ec_align1;4483} __ec_align1;
4480 4484
4481/**4485/**

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