ASoC/soundwire: intel: pass hdac_bus pointer for link management
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 15 May 2023 07:10:22 +0000 (15:10 +0800)
committerVinod Koul <vkoul@kernel.org>
Sat, 27 May 2023 10:36:45 +0000 (16:06 +0530)
The hdac_bus pointer is used to access the extended link information
and handle power management. Pass it from the SOF driver down to the
auxiliary devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230515071042.2038-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.h
drivers/soundwire/intel_init.c
include/linux/soundwire/sdw_intel.h
sound/soc/sof/intel/hda.c

index 1b23292bb8bed84ec2054825b97d674501cb489d..cf9db4906de4e140b1da610d65bf60de06767c19 100644 (file)
@@ -4,6 +4,8 @@
 #ifndef __SDW_INTEL_LOCAL_H
 #define __SDW_INTEL_LOCAL_H
 
+struct hdac_bus;
+
 /**
  * struct sdw_intel_link_res - Soundwire Intel link resource structure,
  * typically populated by the controller driver.
@@ -23,6 +25,7 @@
  * @link_mask: global mask needed for power-up/down sequences
  * @cdns: Cadence master descriptor
  * @list: used to walk-through all masters exposed by the same controller
+ * @hbus: hdac_bus pointer, needed for power management
  */
 struct sdw_intel_link_res {
        const struct sdw_intel_hw_ops *hw_ops;
@@ -42,6 +45,7 @@ struct sdw_intel_link_res {
        u32 link_mask;
        struct sdw_cdns *cdns;
        struct list_head list;
+       struct hdac_bus *hbus;
 };
 
 struct sdw_intel {
index 43d339c6bceea7e7e7c503dcc1bde68e98bbecef..c918d2b81cc30da6b6d851bfcb81e92b714f45c4 100644 (file)
@@ -84,6 +84,8 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res *
        link->shim_mask = &ctx->shim_mask;
        link->link_mask = ctx->link_mask;
 
+       link->hbus = res->hbus;
+
        /* now follow the two-step init/add sequence */
        ret = auxiliary_device_init(auxdev);
        if (ret < 0) {
index 88eb5bf98140c1ca271cb186e64b8ed97b7bc88a..c4281aa06e2e0020dd0f17e922b7cb791d696213 100644 (file)
@@ -269,6 +269,8 @@ struct sdw_intel_slave_id {
        struct sdw_slave_id id;
 };
 
+struct hdac_bus;
+
 /**
  * struct sdw_intel_ctx - context allocated by the controller
  * driver probe
@@ -324,6 +326,7 @@ struct sdw_intel_ctx {
  * @shim_base: sdw shim base.
  * @alh_base: sdw alh base.
  * @ext: extended HDaudio link support
+ * @hbus: hdac_bus pointer, needed for power management
  */
 struct sdw_intel_res {
        const struct sdw_intel_hw_ops *hw_ops;
@@ -339,6 +342,7 @@ struct sdw_intel_res {
        u32 shim_base;
        u32 alh_base;
        bool ext;
+       struct hdac_bus *hbus;
 };
 
 /*
index 793baf60c78b85a3a9cdb36dd1f798ccb469c522..4d48f4018617dbee5a036d7071188b7d3a812336 100644 (file)
@@ -189,6 +189,7 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev)
        res.ops = &sdw_callback;
        res.dev = sdev->dev;
        res.clock_stop_quirks = sdw_clock_stop_quirks;
+       res.hbus = sof_to_bus(sdev);
 
        /*
         * ops and arg fields are not populated for now,