]> Git Repo - linux.git/commitdiff
soundwire: intel: add in-band wake callbacks in hw_ops
authorPierre-Louis Bossart <[email protected]>
Fri, 11 Nov 2022 01:31:33 +0000 (09:31 +0800)
committerVinod Koul <[email protected]>
Wed, 23 Nov 2022 14:41:49 +0000 (20:11 +0530)
No functionality change, only add indirection for in-band wake
management helpers.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Rander Wang <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
drivers/soundwire/intel.c
drivers/soundwire/intel.h
include/linux/soundwire/sdw_intel.h

index 2320f1b8a2d10f4066120fc63cc82d37aa5d62ed..ea6479b4010deed7592ea5cf2b6fb9491fd467fe 100644 (file)
@@ -1437,6 +1437,9 @@ const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops = {
        .link_power_up = intel_link_power_up,
        .link_power_down = intel_link_power_down,
 
+       .shim_check_wake = intel_shim_check_wake,
+       .shim_wake = intel_shim_wake,
+
        .pre_bank_switch = intel_pre_bank_switch,
        .post_bank_switch = intel_post_bank_switch,
 };
@@ -1720,11 +1723,11 @@ int intel_link_process_wakeen_event(struct auxiliary_device *auxdev)
                return 0;
        }
 
-       if (!intel_shim_check_wake(sdw))
+       if (!sdw_intel_shim_check_wake(sdw))
                return 0;
 
        /* disable WAKEEN interrupt ASAP to prevent interrupt flood */
-       intel_shim_wake(sdw, false);
+       sdw_intel_shim_wake(sdw, false);
 
        /*
         * resume the Master, which will generate a bus reset and result in
@@ -1852,7 +1855,7 @@ static int __maybe_unused intel_suspend(struct device *dev)
                                 */
                                dev_err(dev, "%s: invalid config: parent is suspended\n", __func__);
                        } else {
-                               intel_shim_wake(sdw, false);
+                               sdw_intel_shim_wake(sdw, false);
                        }
                }
 
@@ -1987,7 +1990,7 @@ static int __maybe_unused intel_resume_runtime(struct device *dev)
        }
 
        /* unconditionally disable WAKEEN interrupt */
-       intel_shim_wake(sdw, false);
+       sdw_intel_shim_wake(sdw, false);
 
        clock_stop_quirks = sdw->link_res->clock_stop_quirks;
 
index 0f63e758413210258938f6359faa652ad47872b5..9ac3397757a07284705fea742d9db31dc5a59e9c 100644 (file)
@@ -132,4 +132,17 @@ static inline int sdw_intel_link_power_down(struct sdw_intel *sdw)
        return -ENOTSUPP;
 }
 
+static inline int sdw_intel_shim_check_wake(struct sdw_intel *sdw)
+{
+       if (SDW_INTEL_CHECK_OPS(sdw, shim_check_wake))
+               return SDW_INTEL_OPS(sdw, shim_check_wake)(sdw);
+       return -ENOTSUPP;
+}
+
+static inline void sdw_intel_shim_wake(struct sdw_intel *sdw, bool wake_enable)
+{
+       if (SDW_INTEL_CHECK_OPS(sdw, shim_wake))
+               SDW_INTEL_OPS(sdw, shim_wake)(sdw, wake_enable);
+}
+
 #endif /* __SDW_INTEL_LOCAL_H */
index 81430201b8b9daadc8a020da7e46f45251025daa..0942cd46409534a01b5fdf1831c8bcde78835b91 100644 (file)
@@ -307,6 +307,8 @@ struct sdw_intel;
  * @stop_bus: stop all bus
  * @link_power_up: power-up using chip-specific helpers
  * @link_power_down: power-down with chip-specific helpers
+ * @shim_check_wake: check if a wake was received
+ * @shim_wake: enable/disable in-band wake management
  * @pre_bank_switch: helper for bus management
  * @post_bank_switch: helper for bus management
  */
@@ -325,6 +327,9 @@ struct sdw_intel_hw_ops {
        int (*link_power_up)(struct sdw_intel *sdw);
        int (*link_power_down)(struct sdw_intel *sdw);
 
+       int  (*shim_check_wake)(struct sdw_intel *sdw);
+       void (*shim_wake)(struct sdw_intel *sdw, bool wake_enable);
+
        int (*pre_bank_switch)(struct sdw_intel *sdw);
        int (*post_bank_switch)(struct sdw_intel *sdw);
 };
This page took 0.070818 seconds and 4 git commands to generate.