Skip to content

Commit

Permalink
soundwire: intel_auxdevice: add indirection for BPT send_async/wait
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pierre-Louis Bossart authored and Vinod Koul committed Mar 10, 2025
1 parent 8eb5d7a commit 7f17a73
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/soundwire/intel_auxdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ static bool is_wake_capable(struct sdw_slave *slave)
return false;
}

static int generic_bpt_send_async(struct sdw_bus *bus, struct sdw_slave *slave,
struct sdw_bpt_msg *msg)
{
struct sdw_cdns *cdns = bus_to_cdns(bus);
struct sdw_intel *sdw = cdns_to_intel(cdns);

if (sdw->link_res->hw_ops->bpt_send_async)
return sdw->link_res->hw_ops->bpt_send_async(sdw, slave, msg);
return -EOPNOTSUPP;
}

static int generic_bpt_wait(struct sdw_bus *bus, struct sdw_slave *slave, struct sdw_bpt_msg *msg)
{
struct sdw_cdns *cdns = bus_to_cdns(bus);
struct sdw_intel *sdw = cdns_to_intel(cdns);

if (sdw->link_res->hw_ops->bpt_wait)
return sdw->link_res->hw_ops->bpt_wait(sdw, slave, msg);
return -EOPNOTSUPP;
}

static int generic_pre_bank_switch(struct sdw_bus *bus)
{
struct sdw_cdns *cdns = bus_to_cdns(bus);
Expand Down Expand Up @@ -267,6 +288,9 @@ static struct sdw_master_ops sdw_intel_ops = {
.get_device_num = intel_get_device_num_ida,
.put_device_num = intel_put_device_num_ida,
.new_peripheral_assigned = generic_new_peripheral_assigned,

.bpt_send_async = generic_bpt_send_async,
.bpt_wait = generic_bpt_wait,
};

/*
Expand Down
4 changes: 4 additions & 0 deletions include/linux/soundwire/sdw_intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ struct sdw_intel_hw_ops {
bool (*sync_check_cmdsync_unlocked)(struct sdw_intel *sdw);

void (*program_sdi)(struct sdw_intel *sdw, int dev_num);

int (*bpt_send_async)(struct sdw_intel *sdw, struct sdw_slave *slave,
struct sdw_bpt_msg *msg);
int (*bpt_wait)(struct sdw_intel *sdw, struct sdw_slave *slave, struct sdw_bpt_msg *msg);
};

extern const struct sdw_intel_hw_ops sdw_intel_cnl_hw_ops;
Expand Down

0 comments on commit 7f17a73

Please sign in to comment.