OSDN Git Service

soundwire: qcom: prepare for handling different register layouts
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 18 Apr 2023 09:54:45 +0000 (11:54 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 8 May 2023 07:31:34 +0000 (13:01 +0530)
commit6378fe11207ab1f203d089af3e7db336f0b9f299
tree625a96297b7079d806ab5a39f71c1204ead732f4
parent6f76e79153d588ebb00becbfc200ec3b983e353e
soundwire: qcom: prepare for handling different register layouts

Currently the driver supports Qualcomm Soundwire controller versions
from v1.3 till v1.7 which mostly have same register layout.  With
coming Qualcomm Soundwire v2.0, several registers were moved and
changed, thus a different register layout will have to be supported.

Prepare for this by:
1. Renaming few register defines to indicate v1.3 (earliest supported)
   version,
2. Add a simple table for mapping register to its offset,
3. Change the code to use the mapping table.

Since only few registers differ, this solution seems easier then
switching to regmap fields.

Reviewed-by: Srinivas Kandagagatla <srinivas.kandagatla@linaro.org>
Tested-by: Srinivas Kandagagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230418095447.577001-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/qcom.c