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.
Showing the changes to include/linux/platform_data (1 of 2 files). Show all
Unified · Split
| @@ -4457,13 +4457,15 @@ struct ec_params_cec_write { · 4456 unmodified lines | |||
| 4457 | /** | 4457 | /** |
| 4458 | * struct ec_params_cec_set - CEC parameters set | 4458 | * struct ec_params_cec_set - CEC parameters set |
| 4459 | * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS | 4459 | * @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 CEC | 4461 | * @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 is | 4462 | * or 1 to enable CEC functionality, in case cmd is |
| 4462 | * CEC_CMD_LOGICAL_ADDRESS, this field encodes the requested logical | 4463 | * CEC_CMD_LOGICAL_ADDRESS, this field encodes the requested logical |
| 4463 | * address between 0 and 15 or 0xff to unregister | 4464 | * address between 0 and 15 or 0xff to unregister |
| 4464 | */ | 4465 | */ |
| 4465 | struct ec_params_cec_set { | 4466 | 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; | ||
| 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 get | 4476 | * struct ec_params_cec_get - CEC parameters get |
| 4475 | * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS | 4477 | * @cmd: parameter type, can be CEC_CMD_ENABLE or CEC_CMD_LOGICAL_ADDRESS |
| 4478 | * @port: CEC port to get the parameter on | ||
| 4476 | */ | 4479 | */ |
| 4477 | struct ec_params_cec_get { | 4480 | 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; | ||
| 4479 | } __ec_align1; | 4483 | } __ec_align1; |
| 4480 | 4484 | ||
| 4481 | /** | 4485 | /** |