summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiranjan H Y <niranjan.hy@ti.com>2025-12-15 18:32:19 +0300
committerMark Brown <broonie@kernel.org>2025-12-18 11:21:51 +0300
commit961f20faa4b950c449dc98fa95a056ef368a24fc (patch)
tree9d8f466daba0e9d237d6081fe0a6d2d4b6679fbc
parentca8f3611dcf85489cae315f4844cccf858bbe9b3 (diff)
downloadlinux-961f20faa4b950c449dc98fa95a056ef368a24fc.tar.xz
ASoC: tas2783A: read slave properties from acpi table
Currently device is using hardcoded slave properties using the .read_prop callback from "struct sdw_slave_ops". This patch removes this and uses the sdw_slave_read_prop API to read the data directly from the ACPI table. Signed-off-by: Niranjan H Y <niranjan.hy@ti.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251215153219.810-8-niranjan.hy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/tas2783-sdw.c66
1 files changed, 5 insertions, 61 deletions
diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c
index 679fb5cb194e..af812f95a4ba 100644
--- a/sound/soc/codecs/tas2783-sdw.c
+++ b/sound/soc/codecs/tas2783-sdw.c
@@ -1060,66 +1060,6 @@ static s32 tas_init(struct tas2783_prv *tas_dev)
return ret;
}
-static s32 tas_read_prop(struct sdw_slave *slave)
-{
- struct sdw_slave_prop *prop = &slave->prop;
- s32 nval;
- s32 i, j;
- u32 bit;
- unsigned long addr;
- struct sdw_dpn_prop *dpn;
-
- prop->scp_int1_mask =
- SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
- prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY;
-
- prop->paging_support = true;
-
- /* first we need to allocate memory for set bits in port lists */
- prop->source_ports = 0x04; /* BITMAP: 00000100 */
- prop->sink_ports = 0x2; /* BITMAP: 00000010 */
-
- nval = hweight32(prop->source_ports);
- prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval,
- sizeof(*prop->src_dpn_prop), GFP_KERNEL);
- if (!prop->src_dpn_prop)
- return -ENOMEM;
-
- i = 0;
- dpn = prop->src_dpn_prop;
- addr = prop->source_ports;
- for_each_set_bit(bit, &addr, 32) {
- dpn[i].num = bit;
- dpn[i].type = SDW_DPN_FULL;
- dpn[i].simple_ch_prep_sm = false;
- dpn[i].ch_prep_timeout = 10;
- i++;
- }
-
- /* do this again for sink now */
- nval = hweight32(prop->sink_ports);
- prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval,
- sizeof(*prop->sink_dpn_prop), GFP_KERNEL);
- if (!prop->sink_dpn_prop)
- return -ENOMEM;
-
- j = 0;
- dpn = prop->sink_dpn_prop;
- addr = prop->sink_ports;
- for_each_set_bit(bit, &addr, 32) {
- dpn[j].num = bit;
- dpn[j].type = SDW_DPN_FULL;
- dpn[j].simple_ch_prep_sm = false;
- dpn[j].ch_prep_timeout = 10;
- j++;
- }
-
- /* set the timeout values */
- prop->clk_stop_timeout = 200;
-
- return 0;
-}
-
static s32 tas2783_sdca_dev_suspend(struct device *dev)
{
struct tas2783_prv *tas_dev = dev_get_drvdata(dev);
@@ -1272,7 +1212,6 @@ static s32 tas_update_status(struct sdw_slave *slave,
}
static const struct sdw_slave_ops tas_sdw_ops = {
- .read_prop = tas_read_prop,
.update_status = tas_update_status,
};
@@ -1290,6 +1229,11 @@ static s32 tas_sdw_probe(struct sdw_slave *peripheral,
struct sdca_function_data *function_data = NULL;
int ret, i;
+ ret = sdw_slave_read_prop(peripheral);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "slave property read failed");
+
tas_dev = devm_kzalloc(dev, sizeof(*tas_dev), GFP_KERNEL);
if (!tas_dev)
return dev_err_probe(dev, -ENOMEM,