All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: ALSA <alsa-devel@alsa-project.org>,
	tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	Vinod Koul <vkoul@kernel.org>,
	broonie@kernel.org, Shreyas NC <shreyas.nc@intel.com>
Subject: [PATCH v6 09/13] soundwire: Remove cdns_master_ops
Date: Thu, 26 Apr 2018 18:50:05 +0530	[thread overview]
Message-ID: <1524748809-21860-10-git-send-email-vkoul@kernel.org> (raw)
In-Reply-To: <1524748809-21860-1-git-send-email-vkoul@kernel.org>

From: Shreyas NC <shreyas.nc@intel.com>

There can be instances where drivers using Cadence IP might want
to set sdw_master_ops differently per instance of it's use, so
remove the cdns_master_ops and export the APIs.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/soundwire/cadence_master.c | 17 ++++++-----------
 drivers/soundwire/cadence_master.h |  8 ++++++++
 drivers/soundwire/intel.c          | 11 +++++++++--
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 3a9b1462039b..b0c09efd8f83 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -396,7 +396,7 @@ static int cdns_prep_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int *cmd)
 	return 0;
 }
 
-static enum sdw_command_response
+enum sdw_command_response
 cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
 {
 	struct sdw_cdns *cdns = bus_to_cdns(bus);
@@ -422,8 +422,9 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
 exit:
 	return ret;
 }
+EXPORT_SYMBOL(cdns_xfer_msg);
 
-static enum sdw_command_response
+enum sdw_command_response
 cdns_xfer_msg_defer(struct sdw_bus *bus,
 		struct sdw_msg *msg, struct sdw_defer *defer)
 {
@@ -443,8 +444,9 @@ cdns_xfer_msg_defer(struct sdw_bus *bus,
 
 	return _cdns_xfer_msg(cdns, msg, cmd, 0, msg->len, true);
 }
+EXPORT_SYMBOL(cdns_xfer_msg_defer);
 
-static enum sdw_command_response
+enum sdw_command_response
 cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num)
 {
 	struct sdw_cdns *cdns = bus_to_cdns(bus);
@@ -456,6 +458,7 @@ cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num)
 
 	return cdns_program_scp_addr(cdns, &msg);
 }
+EXPORT_SYMBOL(cdns_reset_page_addr);
 
 /*
  * IRQ handling
@@ -727,14 +730,6 @@ int sdw_cdns_init(struct sdw_cdns *cdns)
 }
 EXPORT_SYMBOL(sdw_cdns_init);
 
-struct sdw_master_ops sdw_cdns_master_ops = {
-	.read_prop = sdw_master_read_prop,
-	.xfer_msg = cdns_xfer_msg,
-	.xfer_msg_defer = cdns_xfer_msg_defer,
-	.reset_page_addr = cdns_reset_page_addr,
-};
-EXPORT_SYMBOL(sdw_cdns_master_ops);
-
 /**
  * sdw_cdns_probe() - Cadence probe routine
  * @cdns: Cadence instance
diff --git a/drivers/soundwire/cadence_master.h b/drivers/soundwire/cadence_master.h
index beaf6c9804eb..3ec74fa5f4f9 100644
--- a/drivers/soundwire/cadence_master.h
+++ b/drivers/soundwire/cadence_master.h
@@ -44,5 +44,13 @@ irqreturn_t sdw_cdns_thread(int irq, void *dev_id);
 int sdw_cdns_init(struct sdw_cdns *cdns);
 int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns);
 
+enum sdw_command_response
+cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg);
 
+enum sdw_command_response
+cdns_xfer_msg_defer(struct sdw_bus *bus,
+		struct sdw_msg *msg, struct sdw_defer *defer);
+
+enum sdw_command_response
+cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num);
 #endif /* __SDW_CADENCE_H */
diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 86a7bd1fc912..aa0c60133de5 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -252,6 +252,13 @@ static int intel_prop_read(struct sdw_bus *bus)
 	return 0;
 }
 
+static struct sdw_master_ops sdw_intel_ops = {
+	.read_prop = sdw_master_read_prop,
+	.xfer_msg = cdns_xfer_msg,
+	.xfer_msg_defer = cdns_xfer_msg_defer,
+	.reset_page_addr = cdns_reset_page_addr,
+};
+
 /*
  * probe and init
  */
@@ -276,8 +283,8 @@ static int intel_probe(struct platform_device *pdev)
 	sdw_cdns_probe(&sdw->cdns);
 
 	/* Set property read ops */
-	sdw_cdns_master_ops.read_prop = intel_prop_read;
-	sdw->cdns.bus.ops = &sdw_cdns_master_ops;
+	sdw_intel_ops.read_prop = intel_prop_read;
+	sdw->cdns.bus.ops = &sdw_intel_ops;
 
 	platform_set_drvdata(pdev, sdw);
 
-- 
2.7.4

  parent reply	other threads:[~2018-04-26 13:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 13:19 [PATCH v6 00/13] soundwire: Add stream support Vinod Koul
2018-04-26 13:19 ` [PATCH v6 01/13] Documentation: soundwire: Add more documentation Vinod Koul
2018-04-26 13:19 ` [PATCH v6 02/13] soundwire: Add support for SoundWire stream management Vinod Koul
2018-04-26 13:19 ` [PATCH v6 03/13] soundwire: Add support for port management Vinod Koul
2018-04-26 13:20 ` [PATCH v6 04/13] soundwire: Add Master and Slave port programming Vinod Koul
2018-04-26 13:20 ` [PATCH v6 05/13] soundwire: Add helpers for ports operations Vinod Koul
2018-04-26 13:20 ` [PATCH v6 06/13] soundwire: Add bank switch routine Vinod Koul
2018-04-26 13:20 ` [PATCH v6 07/13] soundwire: Add stream configuration APIs Vinod Koul
2018-04-26 13:20 ` [PATCH v6 08/13] ASoC: Add SoundWire stream programming interface Vinod Koul
2018-05-09  8:55   ` Mark Brown
2018-04-26 13:20 ` Vinod Koul [this message]
2018-04-26 13:20 ` [PATCH v6 10/13] soundwire: cdns: Add port routines Vinod Koul
2018-04-26 13:20 ` [PATCH v6 11/13] soundwire: cdns: Add stream routines Vinod Koul
2018-04-26 13:20 ` [PATCH v6 12/13] soundwire: intel: Add stream initialization Vinod Koul
2018-04-26 13:20 ` [PATCH v6 13/13] soundwire: intel: Add audio DAI ops Vinod Koul
2018-04-27 13:23 ` [PATCH v6 00/13] soundwire: Add stream support Pierre-Louis Bossart
2018-05-06  5:45 ` Vinod Koul
2018-05-11 11:48   ` Vinod Koul
2018-05-11 13:27     ` Greg KH
2018-05-11 16:30       ` Vinod

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=1524748809-21860-10-git-send-email-vkoul@kernel.org \
    --to=vkoul@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shreyas.nc@intel.com \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.