Commit fb2dc6a0 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Vinod Koul

soundwire: intel: add debugfs callbacks in hw_ops

No functionality change, only add indirection for debugfs helpers.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221111013135.38289-3-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent b3ad31f3
...@@ -1423,6 +1423,9 @@ static int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop) ...@@ -1423,6 +1423,9 @@ static int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
} }
const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops = { const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops = {
.debugfs_init = intel_debugfs_init,
.debugfs_exit = intel_debugfs_exit,
.pre_bank_switch = intel_pre_bank_switch, .pre_bank_switch = intel_pre_bank_switch,
.post_bank_switch = intel_post_bank_switch, .post_bank_switch = intel_post_bank_switch,
}; };
...@@ -1614,7 +1617,7 @@ int intel_link_startup(struct auxiliary_device *auxdev) ...@@ -1614,7 +1617,7 @@ int intel_link_startup(struct auxiliary_device *auxdev)
goto err_power_up; goto err_power_up;
} }
intel_debugfs_init(sdw); sdw_intel_debugfs_init(sdw);
/* start bus */ /* start bus */
ret = intel_start_bus(sdw); ret = intel_start_bus(sdw);
...@@ -1685,7 +1688,7 @@ static void intel_link_remove(struct auxiliary_device *auxdev) ...@@ -1685,7 +1688,7 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
* SDW_INTEL_CLK_STOP_NOT_ALLOWED * SDW_INTEL_CLK_STOP_NOT_ALLOWED
*/ */
if (!bus->prop.hw_disabled) { if (!bus->prop.hw_disabled) {
intel_debugfs_exit(sdw); sdw_intel_debugfs_exit(sdw);
sdw_cdns_enable_interrupt(cdns, false); sdw_cdns_enable_interrupt(cdns, false);
} }
sdw_bus_master_delete(bus); sdw_bus_master_delete(bus);
......
...@@ -61,4 +61,20 @@ struct sdw_intel_link_dev { ...@@ -61,4 +61,20 @@ struct sdw_intel_link_dev {
#define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \ #define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \
container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev) container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev)
#define SDW_INTEL_CHECK_OPS(sdw, cb) ((sdw) && (sdw)->link_res && (sdw)->link_res->hw_ops && \
(sdw)->link_res->hw_ops->cb)
#define SDW_INTEL_OPS(sdw, cb) ((sdw)->link_res->hw_ops->cb)
static inline void sdw_intel_debugfs_init(struct sdw_intel *sdw)
{
if (SDW_INTEL_CHECK_OPS(sdw, debugfs_init))
SDW_INTEL_OPS(sdw, debugfs_init)(sdw);
}
static inline void sdw_intel_debugfs_exit(struct sdw_intel *sdw)
{
if (SDW_INTEL_CHECK_OPS(sdw, debugfs_exit))
SDW_INTEL_OPS(sdw, debugfs_exit)(sdw);
}
#endif /* __SDW_INTEL_LOCAL_H */ #endif /* __SDW_INTEL_LOCAL_H */
...@@ -297,10 +297,15 @@ irqreturn_t sdw_intel_thread(int irq, void *dev_id); ...@@ -297,10 +297,15 @@ irqreturn_t sdw_intel_thread(int irq, void *dev_id);
struct sdw_intel; struct sdw_intel;
/* struct intel_sdw_hw_ops - SoundWire ops for Intel platforms. /* struct intel_sdw_hw_ops - SoundWire ops for Intel platforms.
* @debugfs_init: initialize all debugfs capabilities
* @debugfs_exit: close and cleanup debugfs capabilities
* @pre_bank_switch: helper for bus management * @pre_bank_switch: helper for bus management
* @post_bank_switch: helper for bus management * @post_bank_switch: helper for bus management
*/ */
struct sdw_intel_hw_ops { struct sdw_intel_hw_ops {
void (*debugfs_init)(struct sdw_intel *sdw);
void (*debugfs_exit)(struct sdw_intel *sdw);
int (*pre_bank_switch)(struct sdw_intel *sdw); int (*pre_bank_switch)(struct sdw_intel *sdw);
int (*post_bank_switch)(struct sdw_intel *sdw); int (*post_bank_switch)(struct sdw_intel *sdw);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment