Convert field TCPC_MSG_HDR_INFO_REV from register TCPC_MSG_HDR_INFO to using GENMASK() and FIELD_PREP() so as to keep using a similar approach for all fields.
Unified · Split
| @@ -456,7 +456,7 @@ static int tcpci_set_roles(struct tcpc_dev *tcpc, bool attached, · 455 unmodified lines | |||
| 456 | unsigned int reg; | 456 | unsigned int reg; |
| 457 | int ret; | 457 | int ret; |
| 458 | 458 | ||
| 459 | reg = PD_REV20 << TCPC_MSG_HDR_INFO_REV_SHIFT; | 459 | reg = FIELD_PREP(TCPC_MSG_HDR_INFO_REV, PD_REV20); |
| 460 | if (role == TYPEC_SOURCE) | 460 | if (role == TYPEC_SOURCE) |
| 461 | reg |= TCPC_MSG_HDR_INFO_PWR_ROLE; | 461 | reg |= TCPC_MSG_HDR_INFO_PWR_ROLE; |
| 462 | if (data == TYPEC_HOST) | 462 | if (data == TYPEC_HOST) |
| @@ -129,9 +129,8 @@ · 128 unmodified lines | |||
| 129 | 129 | ||
| 130 | #define TCPC_MSG_HDR_INFO 0x2e | 130 | #define TCPC_MSG_HDR_INFO 0x2e |
| 131 | #define TCPC_MSG_HDR_INFO_DATA_ROLE BIT(3) | 131 | #define TCPC_MSG_HDR_INFO_DATA_ROLE BIT(3) |
| 132 | #define TCPC_MSG_HDR_INFO_REV GENMASK(2, 1) | ||
| 132 | #define TCPC_MSG_HDR_INFO_PWR_ROLE BIT(0) | 133 | #define TCPC_MSG_HDR_INFO_PWR_ROLE BIT(0) |
| 133 | #define TCPC_MSG_HDR_INFO_REV_SHIFT 1 | ||
| 134 | #define TCPC_MSG_HDR_INFO_REV_MASK 0x3 | ||
| 135 | 134 | ||
| 136 | #define TCPC_RX_DETECT 0x2f | 135 | #define TCPC_RX_DETECT 0x2f |
| 137 | #define TCPC_RX_DETECT_HARD_RESET BIT(5) | 136 | #define TCPC_RX_DETECT_HARD_RESET BIT(5) |