Commit c91605f4 authored by Shreyas NC's avatar Shreyas NC Committed by Vinod Koul

soundwire: Remove cdns_master_ops

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: default avatarShreyas NC <shreyas.nc@intel.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 97349b60
...@@ -396,7 +396,7 @@ static int cdns_prep_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int *cmd) ...@@ -396,7 +396,7 @@ static int cdns_prep_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int *cmd)
return 0; return 0;
} }
static enum sdw_command_response enum sdw_command_response
cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg) cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
{ {
struct sdw_cdns *cdns = bus_to_cdns(bus); struct sdw_cdns *cdns = bus_to_cdns(bus);
...@@ -422,8 +422,9 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg) ...@@ -422,8 +422,9 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
exit: exit:
return ret; return ret;
} }
EXPORT_SYMBOL(cdns_xfer_msg);
static enum sdw_command_response enum sdw_command_response
cdns_xfer_msg_defer(struct sdw_bus *bus, cdns_xfer_msg_defer(struct sdw_bus *bus,
struct sdw_msg *msg, struct sdw_defer *defer) struct sdw_msg *msg, struct sdw_defer *defer)
{ {
...@@ -443,8 +444,9 @@ cdns_xfer_msg_defer(struct sdw_bus *bus, ...@@ -443,8 +444,9 @@ cdns_xfer_msg_defer(struct sdw_bus *bus,
return _cdns_xfer_msg(cdns, msg, cmd, 0, msg->len, true); 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) cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num)
{ {
struct sdw_cdns *cdns = bus_to_cdns(bus); struct sdw_cdns *cdns = bus_to_cdns(bus);
...@@ -456,6 +458,7 @@ cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num) ...@@ -456,6 +458,7 @@ cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num)
return cdns_program_scp_addr(cdns, &msg); return cdns_program_scp_addr(cdns, &msg);
} }
EXPORT_SYMBOL(cdns_reset_page_addr);
/* /*
* IRQ handling * IRQ handling
...@@ -727,14 +730,6 @@ int sdw_cdns_init(struct sdw_cdns *cdns) ...@@ -727,14 +730,6 @@ int sdw_cdns_init(struct sdw_cdns *cdns)
} }
EXPORT_SYMBOL(sdw_cdns_init); 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 * sdw_cdns_probe() - Cadence probe routine
* @cdns: Cadence instance * @cdns: Cadence instance
......
...@@ -44,5 +44,13 @@ irqreturn_t sdw_cdns_thread(int irq, void *dev_id); ...@@ -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_init(struct sdw_cdns *cdns);
int sdw_cdns_enable_interrupt(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 */ #endif /* __SDW_CADENCE_H */
...@@ -252,6 +252,13 @@ static int intel_prop_read(struct sdw_bus *bus) ...@@ -252,6 +252,13 @@ static int intel_prop_read(struct sdw_bus *bus)
return 0; 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 * probe and init
*/ */
...@@ -276,8 +283,8 @@ static int intel_probe(struct platform_device *pdev) ...@@ -276,8 +283,8 @@ static int intel_probe(struct platform_device *pdev)
sdw_cdns_probe(&sdw->cdns); sdw_cdns_probe(&sdw->cdns);
/* Set property read ops */ /* Set property read ops */
sdw_cdns_master_ops.read_prop = intel_prop_read; sdw_intel_ops.read_prop = intel_prop_read;
sdw->cdns.bus.ops = &sdw_cdns_master_ops; sdw->cdns.bus.ops = &sdw_intel_ops;
platform_set_drvdata(pdev, sdw); platform_set_drvdata(pdev, sdw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment