Merge tag 'sound-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-2.6-microblaze.git] / sound / soc / codecs / rt711-sdw.c
index 7efff13..f0a0691 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/soundwire/sdw.h>
 #include <linux/soundwire/sdw_type.h>
+#include <linux/soundwire/sdw_registers.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
 #include <sound/soc.h>
@@ -337,11 +338,15 @@ static int rt711_update_status(struct sdw_slave *slave,
 static int rt711_read_prop(struct sdw_slave *slave)
 {
        struct sdw_slave_prop *prop = &slave->prop;
-       int nval, i, num_of_ports = 1;
+       int nval, i;
        u32 bit;
        unsigned long addr;
        struct sdw_dpn_prop *dpn;
 
+       prop->scp_int1_mask = SDW_SCP_INT1_IMPL_DEF | SDW_SCP_INT1_BUS_CLASH |
+               SDW_SCP_INT1_PARITY;
+       prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY;
+
        prop->paging_support = false;
 
        /* first we need to allocate memory for set bits in port lists */
@@ -349,7 +354,6 @@ static int rt711_read_prop(struct sdw_slave *slave)
        prop->sink_ports = 0x8; /* BITMAP:  00001000 */
 
        nval = hweight32(prop->source_ports);
-       num_of_ports += nval;
        prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval,
                                                sizeof(*prop->src_dpn_prop),
                                                GFP_KERNEL);
@@ -369,7 +373,6 @@ static int rt711_read_prop(struct sdw_slave *slave)
 
        /* do this again for sink now */
        nval = hweight32(prop->sink_ports);
-       num_of_ports += nval;
        prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval,
                                                sizeof(*prop->sink_dpn_prop),
                                                GFP_KERNEL);
@@ -387,17 +390,6 @@ static int rt711_read_prop(struct sdw_slave *slave)
                i++;
        }
 
-       /* Allocate port_ready based on num_of_ports */
-       slave->port_ready = devm_kcalloc(&slave->dev, num_of_ports,
-                                       sizeof(*slave->port_ready),
-                                       GFP_KERNEL);
-       if (!slave->port_ready)
-               return -ENOMEM;
-
-       /* Initialize completion */
-       for (i = 0; i < num_of_ports; i++)
-               init_completion(&slave->port_ready[i]);
-
        /* set the timeout values */
        prop->clk_stop_timeout = 20;
 
@@ -479,7 +471,7 @@ static int rt711_sdw_remove(struct sdw_slave *slave)
 }
 
 static const struct sdw_device_id rt711_id[] = {
-       SDW_SLAVE_ENTRY(0x025d, 0x711, 0),
+       SDW_SLAVE_ENTRY_EXT(0x025d, 0x711, 0x2, 0, 0),
        {},
 };
 MODULE_DEVICE_TABLE(sdw, rt711_id);
@@ -491,6 +483,10 @@ static int __maybe_unused rt711_dev_suspend(struct device *dev)
        if (!rt711->hw_init)
                return 0;
 
+       cancel_delayed_work_sync(&rt711->jack_detect_work);
+       cancel_delayed_work_sync(&rt711->jack_btn_check_work);
+       cancel_work_sync(&rt711->calibration_work);
+
        regcache_cache_only(rt711->regmap, true);
 
        return 0;