Quoting Srinivasa Rao Mandadapu (2022-06-08 07:02:09) > Validate software clock gating required or not and do software > clock gating on hclk if soundwire is operational and keep it > running by adding flag in private dat structure. > This is to avoid conflict between older architectures, > where software clock gating is not required and on latest > architectues, where software clock gating is mandatory. This talks about software clock gating but the code is getting a reset and asserting it. Is that because the power on reset value of the clock gating is to have hardware clock gating disabled, but some earlier code is enabling hardware clock gating? > > Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@xxxxxxxxxxx> > Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> > --- > drivers/soundwire/qcom.c | 27 ++++++++++++++++++++------- > 1 file changed, 20 insertions(+), 7 deletions(-) > > diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c > index 38c3bf5..ebd7479 100644 > --- a/drivers/soundwire/qcom.c > +++ b/drivers/soundwire/qcom.c > @@ -659,7 +665,8 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl) > val = FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_ROW_CTRL_BMSK, ctrl->rows_index); > val |= FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_COL_CTRL_BMSK, ctrl->cols_index); > > - reset_control_reset(ctrl->audio_cgcr); > + if (ctrl->audio_cgcr) > + reset_control_reset(ctrl->audio_cgcr); > > ctrl->reg_write(ctrl, SWRM_MCP_FRAME_CTRL_BANK_ADDR(0), val); > > @@ -1494,7 +1506,8 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev) > qcom_swrm_get_device_status(ctrl); > sdw_handle_slave_status(&ctrl->bus, ctrl->status); > } else { > - reset_control_reset(ctrl->audio_cgcr); > + if (ctrl->audio_cgcr) > + reset_control_reset(ctrl->audio_cgcr); reset_control_reset() is a no-op if the pointer is NULL so the if condition is not necessary in the above two statements.