Skip to content

Commit 7f17a73

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: intel_auxdevice: add indirection for BPT send_async/wait
Mirror abstraction added for master ops. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Tested-by: shumingf@realtek.com Link: https://lore.kernel.org/r/20250227140615.8147-11-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 8eb5d7a commit 7f17a73

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

drivers/soundwire/intel_auxdevice.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,27 @@ static bool is_wake_capable(struct sdw_slave *slave)
7979
return false;
8080
}
8181

82+
static int generic_bpt_send_async(struct sdw_bus *bus, struct sdw_slave *slave,
83+
struct sdw_bpt_msg *msg)
84+
{
85+
struct sdw_cdns *cdns = bus_to_cdns(bus);
86+
struct sdw_intel *sdw = cdns_to_intel(cdns);
87+
88+
if (sdw->link_res->hw_ops->bpt_send_async)
89+
return sdw->link_res->hw_ops->bpt_send_async(sdw, slave, msg);
90+
return -EOPNOTSUPP;
91+
}
92+
93+
static int generic_bpt_wait(struct sdw_bus *bus, struct sdw_slave *slave, struct sdw_bpt_msg *msg)
94+
{
95+
struct sdw_cdns *cdns = bus_to_cdns(bus);
96+
struct sdw_intel *sdw = cdns_to_intel(cdns);
97+
98+
if (sdw->link_res->hw_ops->bpt_wait)
99+
return sdw->link_res->hw_ops->bpt_wait(sdw, slave, msg);
100+
return -EOPNOTSUPP;
101+
}
102+
82103
static int generic_pre_bank_switch(struct sdw_bus *bus)
83104
{
84105
struct sdw_cdns *cdns = bus_to_cdns(bus);
@@ -267,6 +288,9 @@ static struct sdw_master_ops sdw_intel_ops = {
267288
.get_device_num = intel_get_device_num_ida,
268289
.put_device_num = intel_put_device_num_ida,
269290
.new_peripheral_assigned = generic_new_peripheral_assigned,
291+
292+
.bpt_send_async = generic_bpt_send_async,
293+
.bpt_wait = generic_bpt_wait,
270294
};
271295

272296
/*

include/linux/soundwire/sdw_intel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ struct sdw_intel_hw_ops {
436436
bool (*sync_check_cmdsync_unlocked)(struct sdw_intel *sdw);
437437

438438
void (*program_sdi)(struct sdw_intel *sdw, int dev_num);
439+
440+
int (*bpt_send_async)(struct sdw_intel *sdw, struct sdw_slave *slave,
441+
struct sdw_bpt_msg *msg);
442+
int (*bpt_wait)(struct sdw_intel *sdw, struct sdw_slave *slave, struct sdw_bpt_msg *msg);
439443
};
440444

441445
extern const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops;

0 commit comments

Comments
 (0)