Add assign function in cmdq helper which assign constant value into internal register by index.
Showing the changes to include/linux (2 of 3 files). Show all
Unified · Split
| @@ -59,6 +59,7 @@ enum cmdq_code { · 58 unmodified lines | ||
| 59 | 59 | CMDQ_CODE_JUMP = 0x10, |
| 60 | 60 | CMDQ_CODE_WFE = 0x20, |
| 61 | 61 | CMDQ_CODE_EOC = 0x40, |
| 62 | + CMDQ_CODE_LOGIC = 0xa0, | |
| 62 | 63 | }; |
| 63 | 64 | |
| 64 | 65 | enum cmdq_cb_status { |
| @@ -152,6 +152,20 @@ int cmdq_pkt_poll(struct cmdq_pkt *pkt, u8 subsys, · 151 unmodified lines | ||
| 152 | 152 | */ |
| 153 | 153 | int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 subsys, |
| 154 | 154 | u16 offset, u32 value, u32 mask); |
| 155 | + | |
| 156 | +/** | |
| 157 | + * cmdq_pkt_assign() - Append logic assign command to the CMDQ packet, ask GCE | |
| 158 | + * to execute an instruction that set a constant value into | |
| 159 | + * internal register and use as value, mask or address in | |
| 160 | + * read/write instruction. | |
| 161 | + * @pkt: the CMDQ packet | |
| 162 | + * @reg_idx: the CMDQ internal register ID | |
| 163 | + * @value: the specified value | |
| 164 | + * | |
| 165 | + * Return: 0 for success; else the error code is returned | |
| 166 | + */ | |
| 167 | +int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); | |
| 168 | + | |
| 155 | 169 | /** |
| 156 | 170 | * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ |
| 157 | 171 | * packet and call back at the end of done packet |