aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2021-01-28 16:09:24 +0000
committerSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2021-02-10 18:02:47 +0000
commit078a188dd5173a7c7a4b4a560481d63f3ae22d1f (patch)
treed5f2eadcc6062728267b38b772937cb2c9df079a
parent7ada89c82f0ac444c29b77f39127761106fff096 (diff)
soundwire: qcom: extract version field
Extract version field to major, minor and step, so that we can add dynamic version checks to read/writes. This will help for controller versions that need specific bits to be programmed. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
-rw-r--r--drivers/soundwire/qcom.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 36e273795cbe6..0a70852114881 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -110,7 +110,9 @@ struct qcom_swrm_ctrl {
u8 wr_cmd_id;
u8 rd_cmd_id;
int irq;
- unsigned int version;
+ u8 version_major;
+ u8 version_minor;
+ u8 version_step;
int num_din_ports;
int num_dout_ports;
int cols_index;
@@ -961,7 +963,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)
prop->default_col = data->default_cols;
prop->default_row = data->default_rows;
- ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &ctrl->version);
+ ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &val);
ret = devm_request_threaded_irq(dev, ctrl->irq, NULL,
qcom_swrm_irq_handler,
@@ -980,14 +982,17 @@ static int qcom_swrm_probe(struct platform_device *pdev)
goto err_clk;
}
+ ctrl->version_major = (val >> 24) & 0xff;
+ ctrl->version_minor = (val >> 16) & 0xff;
+ ctrl->version_step = val & 0xffff;
+
qcom_swrm_init(ctrl);
ret = qcom_swrm_register_dais(ctrl);
if (ret)
goto err_master_add;
dev_info(dev, "Qualcomm Soundwire controller v%x.%x.%x Registered\n",
- (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
- ctrl->version & 0xffff);
+ ctrl->version_major, ctrl->version_minor, ctrl->version_step);
return 0;