From: Bard Liao <yung-chuan.liao@linux.intel.com>
To: linux-sound@vger.kernel.org, broonie@kernel.org, tiwai@suse.de,
vkoul@kernel.org
Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org,
pierre-louis.bossart@linux.dev, bard.liao@intel.com
Subject: [PATCH v2 10/16] soundwire: intel_auxdevice: add indirection for BPT send_async/wait
Date: Mon, 24 Feb 2025 14:44:44 +0800 [thread overview]
Message-ID: <20250224064451.33772-11-yung-chuan.liao@linux.intel.com> (raw)
In-Reply-To: <20250224064451.33772-1-yung-chuan.liao@linux.intel.com>
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
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>
---
drivers/soundwire/intel_auxdevice.c | 24 ++++++++++++++++++++++++
include/linux/soundwire/sdw_intel.h | 4 ++++
2 files changed, 28 insertions(+)
diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index dee126f6d9d5..5ea6399e6c9b 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -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);
@@ -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,
};
/*
diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h
index 580086417e4b..493d9de4e472 100644
--- a/include/linux/soundwire/sdw_intel.h
+++ b/include/linux/soundwire/sdw_intel.h
@@ -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;
--
2.43.0
next prev parent reply other threads:[~2025-02-24 6:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 6:44 [PATCH v2 00/16] SoundWire/ASoC: add SDW BPT/BRA support Bard Liao
2025-02-24 6:44 ` [PATCH v2 01/16] Documentation: driver: add SoundWire BRA description Bard Liao
2025-02-24 6:44 ` [PATCH v2 02/16] soundwire: cadence: add BTP support for DP0 Bard Liao
2025-02-24 6:44 ` [PATCH v2 03/16] soundwire: extend sdw_stream_type to BPT Bard Liao
2025-02-24 6:44 ` [PATCH v2 04/16] soundwire: stream: extend sdw_alloc_stream() to take 'type' parameter Bard Liao
2025-02-24 6:44 ` [PATCH v2 05/16] soundwire: stream: special-case the bus compute_params() routine Bard Liao
2025-02-24 6:44 ` [PATCH v2 06/16] soundwire: stream: reuse existing code for BPT stream Bard Liao
2025-02-24 6:44 ` [PATCH v2 07/16] soundwire: bus: add send_async/wait APIs for BPT protocol Bard Liao
2025-02-24 6:44 ` [PATCH v2 08/16] soundwire: bus: add bpt_stream pointer Bard Liao
2025-02-24 6:44 ` [PATCH v2 09/16] soundwire: cadence: add BTP/BRA helpers to format data Bard Liao
2025-02-27 6:43 ` Vinod Koul
2025-02-24 6:44 ` Bard Liao [this message]
2025-02-24 6:44 ` [PATCH v2 11/16] ASoC: SOF: Intel: hda-sdw-bpt: add helpers for SoundWire BPT DMA Bard Liao
2025-02-24 14:07 ` Mark Brown
2025-02-24 6:44 ` [PATCH v2 12/16] soundwire: intel: add BPT context definition Bard Liao
2025-02-24 6:44 ` [PATCH v2 13/16] soundwire: intel_ace2x: add BPT send_async/wait callbacks Bard Liao
2025-02-24 6:44 ` [PATCH v2 14/16] ASoC: SOF: Intel: hda-sdw-bpt: add CHAIN_DMA support Bard Liao
2025-02-24 14:08 ` Mark Brown
2025-02-24 6:44 ` [PATCH v2 15/16] soundwire: debugfs: add interface for BPT/BRA transfers Bard Liao
2025-02-24 6:44 ` [PATCH v2 16/16] ASoC: rt711-sdca: add DP0 support Bard Liao
2025-02-24 14:13 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250224064451.33772-11-yung-chuan.liao@linux.intel.com \
--to=yung-chuan.liao@linux.intel.com \
--cc=bard.liao@intel.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=pierre-louis.bossart@linux.dev \
--cc=tiwai@suse.de \
--cc=vinod.koul@linaro.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox