quoted hunk ↗ jump to hunk
+/**
+ * mucse_mbx_powerup - Echo fw to powerup
+ * @hw: pointer to the HW structure
+ * @is_powerup: true for powerup, false for powerdown
+ *
+ * mucse_mbx_powerup echo fw to change working frequency
+ * to normal after received true, and reduce working frequency
+ * if false.
+ *
+ * Return: 0 on success, negative errno on failure
+ **/
+int mucse_mbx_powerup(struct mucse_hw *hw, bool is_powerup)
+{
+ struct mbx_fw_cmd_req req = {};
+ int len;
+ int err;
+
+ build_powerup(&req, is_powerup);
+ len = le16_to_cpu(req.datalen);
+ mutex_lock(&hw->mbx.lock);
+
+ if (is_powerup) {
+ err = mucse_write_posted_mbx(hw, (u32 *)&req,
+ len);
+ } else {
+ err = mucse_write_mbx_pf(hw, (u32 *)&req,
+ len);
+ }
It looks odd that this is asymmetric. Why is a different low level
function used between power up and power down?
quoted hunk ↗ jump to hunk
+int mucse_mbx_reset_hw(struct mucse_hw *hw)
+{
+ struct mbx_fw_cmd_reply reply = {};
+ struct mbx_fw_cmd_req req = {};
+
+ build_reset_hw_req(&req);
+ return mucse_fw_send_cmd_wait(hw, &req, &reply);
+}
And this uses a third low level API different to power up and power
down?
Andrew