]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soundwire: mipi-disco: add support for peripheral channelprepare timeout
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 3 Oct 2024 07:06:47 +0000 (15:06 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 3 Oct 2024 07:58:51 +0000 (13:28 +0530)
The DisCo for SoundWire 2.0 spec renamed the
'mipi-sdw-slave-channelprepare-timeout', add support for the new
definition in backwards-compatible ways.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20241003070650.62787-12-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/mipi_disco.c

index 5f42d23bbc850b7f00d1bf23f90d77f7b7087b98..6feba5631eae8212aeb3eaafe9607d7a0a863c49 100644 (file)
@@ -344,6 +344,7 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
        struct device *dev = &slave->dev;
        struct fwnode_handle *port;
        int nval;
+       int ret;
 
        device_property_read_u32(dev, "mipi-sdw-sw-interface-revision",
                                 &prop->mipi_revision);
@@ -366,8 +367,11 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
        device_property_read_u32(dev, "mipi-sdw-clockstopprepare-timeout",
                                 &prop->clk_stop_timeout);
 
-       device_property_read_u32(dev, "mipi-sdw-slave-channelprepare-timeout",
-                                &prop->ch_prep_timeout);
+       ret = device_property_read_u32(dev, "mipi-sdw-peripheral-channelprepare-timeout",
+                                      &prop->ch_prep_timeout);
+       if (ret < 0)
+               device_property_read_u32(dev, "mipi-sdw-slave-channelprepare-timeout",
+                                        &prop->ch_prep_timeout);
 
        device_property_read_u32(dev,
                        "mipi-sdw-clockstopprepare-hard-reset-behavior",