Skip to content

Commit b6234bc

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: intel: add register_dai callback in hw_ops
No functionality change, only add indirection for DAI registration helper. 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]>
1 parent fb2dc6a commit b6234bc

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

drivers/soundwire/intel.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,8 @@ const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops = {
14261426
.debugfs_init = intel_debugfs_init,
14271427
.debugfs_exit = intel_debugfs_exit,
14281428

1429+
.register_dai = intel_register_dai,
1430+
14291431
.pre_bank_switch = intel_pre_bank_switch,
14301432
.post_bank_switch = intel_post_bank_switch,
14311433
};
@@ -1611,7 +1613,7 @@ int intel_link_startup(struct auxiliary_device *auxdev)
16111613
goto err_init;
16121614

16131615
/* Register DAIs */
1614-
ret = intel_register_dai(sdw);
1616+
ret = sdw_intel_register_dai(sdw);
16151617
if (ret) {
16161618
dev_err(dev, "DAI registration failed: %d\n", ret);
16171619
goto err_power_up;

drivers/soundwire/intel.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,11 @@ static inline void sdw_intel_debugfs_exit(struct sdw_intel *sdw)
7777
SDW_INTEL_OPS(sdw, debugfs_exit)(sdw);
7878
}
7979

80+
static inline int sdw_intel_register_dai(struct sdw_intel *sdw)
81+
{
82+
if (SDW_INTEL_CHECK_OPS(sdw, register_dai))
83+
return SDW_INTEL_OPS(sdw, register_dai)(sdw);
84+
return -ENOTSUPP;
85+
}
86+
8087
#endif /* __SDW_INTEL_LOCAL_H */

include/linux/soundwire/sdw_intel.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,16 @@ struct sdw_intel;
299299
/* struct intel_sdw_hw_ops - SoundWire ops for Intel platforms.
300300
* @debugfs_init: initialize all debugfs capabilities
301301
* @debugfs_exit: close and cleanup debugfs capabilities
302+
* @register_dai: read all PDI information and register DAIs
302303
* @pre_bank_switch: helper for bus management
303304
* @post_bank_switch: helper for bus management
304305
*/
305306
struct sdw_intel_hw_ops {
306307
void (*debugfs_init)(struct sdw_intel *sdw);
307308
void (*debugfs_exit)(struct sdw_intel *sdw);
308309

310+
int (*register_dai)(struct sdw_intel *sdw);
311+
309312
int (*pre_bank_switch)(struct sdw_intel *sdw);
310313
int (*post_bank_switch)(struct sdw_intel *sdw);
311314
};

0 commit comments

Comments
 (0)