Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-18 Thread Greg KH
On Wed, Sep 18, 2019 at 10:14:51AM -0500, Pierre-Louis Bossart wrote:
> On 9/18/19 8:54 AM, Greg KH wrote:
> > On Wed, Sep 18, 2019 at 03:53:02PM +0200, Greg KH wrote:
> > > On Wed, Sep 18, 2019 at 08:48:33AM -0500, Pierre-Louis Bossart wrote:
> > > > On 9/18/19 7:06 AM, Greg KH wrote:
> > > > > On Tue, Sep 17, 2019 at 09:29:52AM -0500, Pierre-Louis Bossart wrote:
> > > > > > On 9/17/19 12:55 AM, Greg KH wrote:
> > > > > > > On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart 
> > > > > > > wrote:
> > > > > > > > +/**
> > > > > > > > + * sdw_intel_probe() - SoundWire Intel probe routine
> > > > > > > > + * @parent_handle: ACPI parent handle
> > > > > > > > + * @res: resource data
> > > > > > > > + *
> > > > > > > > + * This creates SoundWire Master and Slave devices below the 
> > > > > > > > controller.
> > > > > > > > + * All the information necessary is stored in the context, and 
> > > > > > > > the res
> > > > > > > > + * argument pointer can be freed after this step.
> > > > > > > > + */
> > > > > > > > +struct sdw_intel_ctx
> > > > > > > > +*sdw_intel_probe(struct sdw_intel_res *res)
> > > > > > > > +{
> > > > > > > > +   return sdw_intel_probe_controller(res);
> > > > > > > > +}
> > > > > > > > +EXPORT_SYMBOL(sdw_intel_probe);
> > > > > > > > +
> > > > > > > > +/**
> > > > > > > > + * sdw_intel_startup() - SoundWire Intel startup
> > > > > > > > + * @ctx: SoundWire context allocated in the probe
> > > > > > > > + *
> > > > > > > > + */
> > > > > > > > +int sdw_intel_startup(struct sdw_intel_ctx *ctx)
> > > > > > > > +{
> > > > > > > > +   return sdw_intel_startup_controller(ctx);
> > > > > > > > +}
> > > > > > > > +EXPORT_SYMBOL(sdw_intel_startup);
> > > > > > > 
> > > > > > > Why are you exporting these functions if no one calls them?
> > > > > > 
> > > > > > They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: 
> > > > > > Intel:
> > > > > > add SoundWire configuration interface'
> > > > > 
> > > > > That wasn't obvious :)
> > > > > 
> > > > > Also, why not EXPORT_SYMBOL_GPL()?  :)
> > > > 
> > > > Since the beginning of this SoundWire work, the intent what that the 
> > > > code
> > > > could be reused in non-GPL open-source circles, hence the dual license 
> > > > and
> > > > EXPORT_SYMBOL.
> > > 
> > > Hah, you _have_ talked to your lawyers about this, right?
> > > 
> > > You have a chance to do something like this for header files, for .c
> > > files, good luck.  That's going to be a hard road to go down.  Many have
> > > tried in the past, all but 1 have failed.
> > 
> > Also note, the last I checked, the _default_ license for Linux kernel
> > code from Intel was GPLv2.  If you got an exception for this, please
> > work with your legal council on how to do this "properly" as that was
> > part of getting that exception, right?
> > 
> > If you didn't get the exception, um, you have some people to go talk to,
> > and how come I am the one asking you about this?  :(
> 
> All the legal due-diligence was done when SoundWire was initially
> contributed in 2018. You asked that question at the time and I will point
> you to the email exchange Alan Cox and you had on this topic [1].
> 
> [1] https://patchwork.kernel.org/patch/10015813/

Yes, that is fine, what I am saying here is that you are now asking the
community to do this for you.  You said in this thread:

> For this series I added a disclaimer in the cover letter that those
> parts need to be reviewed further to make sure there are no conflicts
> with GPL.

Why are you sending code out that you think might have conflicts before
your lawyers have reviewed it?  That's just screaming for problems in
the future (hint, you distributed something in the previous emails...)

Again, go and get this sorted out before dumping that kind of work on
the community as this is something that you are having to deal with
(i.e. it is self-inflicted).  Don't make others do this for you here in
public.

Otherwise I will probably just purposefully tell you the wrong thing,
and then watch what kind of fun your lawyers will have :)

thanks,

greg k-h


Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-18 Thread Pierre-Louis Bossart

On 9/18/19 8:54 AM, Greg KH wrote:

On Wed, Sep 18, 2019 at 03:53:02PM +0200, Greg KH wrote:

On Wed, Sep 18, 2019 at 08:48:33AM -0500, Pierre-Louis Bossart wrote:

On 9/18/19 7:06 AM, Greg KH wrote:

On Tue, Sep 17, 2019 at 09:29:52AM -0500, Pierre-Louis Bossart wrote:

On 9/17/19 12:55 AM, Greg KH wrote:

On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:

+/**
+ * sdw_intel_probe() - SoundWire Intel probe routine
+ * @parent_handle: ACPI parent handle
+ * @res: resource data
+ *
+ * This creates SoundWire Master and Slave devices below the controller.
+ * All the information necessary is stored in the context, and the res
+ * argument pointer can be freed after this step.
+ */
+struct sdw_intel_ctx
+*sdw_intel_probe(struct sdw_intel_res *res)
+{
+   return sdw_intel_probe_controller(res);
+}
+EXPORT_SYMBOL(sdw_intel_probe);
+
+/**
+ * sdw_intel_startup() - SoundWire Intel startup
+ * @ctx: SoundWire context allocated in the probe
+ *
+ */
+int sdw_intel_startup(struct sdw_intel_ctx *ctx)
+{
+   return sdw_intel_startup_controller(ctx);
+}
+EXPORT_SYMBOL(sdw_intel_startup);


Why are you exporting these functions if no one calls them?


They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: Intel:
add SoundWire configuration interface'


That wasn't obvious :)

Also, why not EXPORT_SYMBOL_GPL()?  :)


Since the beginning of this SoundWire work, the intent what that the code
could be reused in non-GPL open-source circles, hence the dual license and
EXPORT_SYMBOL.


Hah, you _have_ talked to your lawyers about this, right?

You have a chance to do something like this for header files, for .c
files, good luck.  That's going to be a hard road to go down.  Many have
tried in the past, all but 1 have failed.


Also note, the last I checked, the _default_ license for Linux kernel
code from Intel was GPLv2.  If you got an exception for this, please
work with your legal council on how to do this "properly" as that was
part of getting that exception, right?

If you didn't get the exception, um, you have some people to go talk to,
and how come I am the one asking you about this?  :(


All the legal due-diligence was done when SoundWire was initially 
contributed in 2018. You asked that question at the time and I will 
point you to the email exchange Alan Cox and you had on this topic [1].


[1] https://patchwork.kernel.org/patch/10015813/



Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-18 Thread Greg KH
On Wed, Sep 18, 2019 at 03:53:02PM +0200, Greg KH wrote:
> On Wed, Sep 18, 2019 at 08:48:33AM -0500, Pierre-Louis Bossart wrote:
> > On 9/18/19 7:06 AM, Greg KH wrote:
> > > On Tue, Sep 17, 2019 at 09:29:52AM -0500, Pierre-Louis Bossart wrote:
> > > > On 9/17/19 12:55 AM, Greg KH wrote:
> > > > > On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:
> > > > > > +/**
> > > > > > + * sdw_intel_probe() - SoundWire Intel probe routine
> > > > > > + * @parent_handle: ACPI parent handle
> > > > > > + * @res: resource data
> > > > > > + *
> > > > > > + * This creates SoundWire Master and Slave devices below the 
> > > > > > controller.
> > > > > > + * All the information necessary is stored in the context, and the 
> > > > > > res
> > > > > > + * argument pointer can be freed after this step.
> > > > > > + */
> > > > > > +struct sdw_intel_ctx
> > > > > > +*sdw_intel_probe(struct sdw_intel_res *res)
> > > > > > +{
> > > > > > +   return sdw_intel_probe_controller(res);
> > > > > > +}
> > > > > > +EXPORT_SYMBOL(sdw_intel_probe);
> > > > > > +
> > > > > > +/**
> > > > > > + * sdw_intel_startup() - SoundWire Intel startup
> > > > > > + * @ctx: SoundWire context allocated in the probe
> > > > > > + *
> > > > > > + */
> > > > > > +int sdw_intel_startup(struct sdw_intel_ctx *ctx)
> > > > > > +{
> > > > > > +   return sdw_intel_startup_controller(ctx);
> > > > > > +}
> > > > > > +EXPORT_SYMBOL(sdw_intel_startup);
> > > > > 
> > > > > Why are you exporting these functions if no one calls them?
> > > > 
> > > > They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: 
> > > > Intel:
> > > > add SoundWire configuration interface'
> > > 
> > > That wasn't obvious :)
> > > 
> > > Also, why not EXPORT_SYMBOL_GPL()?  :)
> > 
> > Since the beginning of this SoundWire work, the intent what that the code
> > could be reused in non-GPL open-source circles, hence the dual license and
> > EXPORT_SYMBOL.
> 
> Hah, you _have_ talked to your lawyers about this, right?
> 
> You have a chance to do something like this for header files, for .c
> files, good luck.  That's going to be a hard road to go down.  Many have
> tried in the past, all but 1 have failed.

Also note, the last I checked, the _default_ license for Linux kernel
code from Intel was GPLv2.  If you got an exception for this, please
work with your legal council on how to do this "properly" as that was
part of getting that exception, right?

If you didn't get the exception, um, you have some people to go talk to,
and how come I am the one asking you about this?  :(

thanks,

greg k-h


Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-18 Thread Greg KH
On Wed, Sep 18, 2019 at 08:48:33AM -0500, Pierre-Louis Bossart wrote:
> On 9/18/19 7:06 AM, Greg KH wrote:
> > On Tue, Sep 17, 2019 at 09:29:52AM -0500, Pierre-Louis Bossart wrote:
> > > On 9/17/19 12:55 AM, Greg KH wrote:
> > > > On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:
> > > > > +/**
> > > > > + * sdw_intel_probe() - SoundWire Intel probe routine
> > > > > + * @parent_handle: ACPI parent handle
> > > > > + * @res: resource data
> > > > > + *
> > > > > + * This creates SoundWire Master and Slave devices below the 
> > > > > controller.
> > > > > + * All the information necessary is stored in the context, and the 
> > > > > res
> > > > > + * argument pointer can be freed after this step.
> > > > > + */
> > > > > +struct sdw_intel_ctx
> > > > > +*sdw_intel_probe(struct sdw_intel_res *res)
> > > > > +{
> > > > > + return sdw_intel_probe_controller(res);
> > > > > +}
> > > > > +EXPORT_SYMBOL(sdw_intel_probe);
> > > > > +
> > > > > +/**
> > > > > + * sdw_intel_startup() - SoundWire Intel startup
> > > > > + * @ctx: SoundWire context allocated in the probe
> > > > > + *
> > > > > + */
> > > > > +int sdw_intel_startup(struct sdw_intel_ctx *ctx)
> > > > > +{
> > > > > + return sdw_intel_startup_controller(ctx);
> > > > > +}
> > > > > +EXPORT_SYMBOL(sdw_intel_startup);
> > > > 
> > > > Why are you exporting these functions if no one calls them?
> > > 
> > > They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: Intel:
> > > add SoundWire configuration interface'
> > 
> > That wasn't obvious :)
> > 
> > Also, why not EXPORT_SYMBOL_GPL()?  :)
> 
> Since the beginning of this SoundWire work, the intent what that the code
> could be reused in non-GPL open-source circles, hence the dual license and
> EXPORT_SYMBOL.

Hah, you _have_ talked to your lawyers about this, right?

You have a chance to do something like this for header files, for .c
files, good luck.  That's going to be a hard road to go down.  Many have
tried in the past, all but 1 have failed.

> That said, there are cases where the code only makes sense for Linux, or
> relies on symbols that are exported with EXPORT_SYMBOL_GPL, in those cases
> we rely on GPLv2 and EXPORT_SYMBOL_GPL. For this series I added a disclaimer
> in the cover letter that those parts need to be reviewed further to make
> sure there are no conflicts with GPL.

Please do that with your lawyers, do not require developers to do legal
work for you, that's just mean :(

thanks,

greg k-h


Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-18 Thread Pierre-Louis Bossart

On 9/18/19 7:06 AM, Greg KH wrote:

On Tue, Sep 17, 2019 at 09:29:52AM -0500, Pierre-Louis Bossart wrote:

On 9/17/19 12:55 AM, Greg KH wrote:

On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:

+/**
+ * sdw_intel_probe() - SoundWire Intel probe routine
+ * @parent_handle: ACPI parent handle
+ * @res: resource data
+ *
+ * This creates SoundWire Master and Slave devices below the controller.
+ * All the information necessary is stored in the context, and the res
+ * argument pointer can be freed after this step.
+ */
+struct sdw_intel_ctx
+*sdw_intel_probe(struct sdw_intel_res *res)
+{
+   return sdw_intel_probe_controller(res);
+}
+EXPORT_SYMBOL(sdw_intel_probe);
+
+/**
+ * sdw_intel_startup() - SoundWire Intel startup
+ * @ctx: SoundWire context allocated in the probe
+ *
+ */
+int sdw_intel_startup(struct sdw_intel_ctx *ctx)
+{
+   return sdw_intel_startup_controller(ctx);
+}
+EXPORT_SYMBOL(sdw_intel_startup);


Why are you exporting these functions if no one calls them?


They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: Intel:
add SoundWire configuration interface'


That wasn't obvious :)

Also, why not EXPORT_SYMBOL_GPL()?  :)


Since the beginning of this SoundWire work, the intent what that the 
code could be reused in non-GPL open-source circles, hence the dual 
license and EXPORT_SYMBOL.
That said, there are cases where the code only makes sense for Linux, or 
relies on symbols that are exported with EXPORT_SYMBOL_GPL, in those 
cases we rely on GPLv2 and EXPORT_SYMBOL_GPL. For this series I added a 
disclaimer in the cover letter that those parts need to be reviewed 
further to make sure there are no conflicts with GPL.
This is an RFC-level contribution to check if my understanding of the 
bus/device/driver model is aligned with recommendations. I've already 
made local improvements by fixing bisect issues, removing warnings, 
improved some sequences, and that GPL question will be revisited before 
I send a formal patch.


Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-18 Thread Greg KH
On Tue, Sep 17, 2019 at 09:29:52AM -0500, Pierre-Louis Bossart wrote:
> On 9/17/19 12:55 AM, Greg KH wrote:
> > On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:
> > > +/**
> > > + * sdw_intel_probe() - SoundWire Intel probe routine
> > > + * @parent_handle: ACPI parent handle
> > > + * @res: resource data
> > > + *
> > > + * This creates SoundWire Master and Slave devices below the controller.
> > > + * All the information necessary is stored in the context, and the res
> > > + * argument pointer can be freed after this step.
> > > + */
> > > +struct sdw_intel_ctx
> > > +*sdw_intel_probe(struct sdw_intel_res *res)
> > > +{
> > > + return sdw_intel_probe_controller(res);
> > > +}
> > > +EXPORT_SYMBOL(sdw_intel_probe);
> > > +
> > > +/**
> > > + * sdw_intel_startup() - SoundWire Intel startup
> > > + * @ctx: SoundWire context allocated in the probe
> > > + *
> > > + */
> > > +int sdw_intel_startup(struct sdw_intel_ctx *ctx)
> > > +{
> > > + return sdw_intel_startup_controller(ctx);
> > > +}
> > > +EXPORT_SYMBOL(sdw_intel_startup);
> > 
> > Why are you exporting these functions if no one calls them?
> 
> They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: Intel:
> add SoundWire configuration interface'

That wasn't obvious :)

Also, why not EXPORT_SYMBOL_GPL()?  :)

thanks,

greg k-h


Re: [alsa-devel] [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-17 Thread Pierre-Louis Bossart

On 9/17/19 12:55 AM, Greg KH wrote:

On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:

+/**
+ * sdw_intel_probe() - SoundWire Intel probe routine
+ * @parent_handle: ACPI parent handle
+ * @res: resource data
+ *
+ * This creates SoundWire Master and Slave devices below the controller.
+ * All the information necessary is stored in the context, and the res
+ * argument pointer can be freed after this step.
+ */
+struct sdw_intel_ctx
+*sdw_intel_probe(struct sdw_intel_res *res)
+{
+   return sdw_intel_probe_controller(res);
+}
+EXPORT_SYMBOL(sdw_intel_probe);
+
+/**
+ * sdw_intel_startup() - SoundWire Intel startup
+ * @ctx: SoundWire context allocated in the probe
+ *
+ */
+int sdw_intel_startup(struct sdw_intel_ctx *ctx)
+{
+   return sdw_intel_startup_controller(ctx);
+}
+EXPORT_SYMBOL(sdw_intel_startup);


Why are you exporting these functions if no one calls them?


They are used in the next series, see '[RFC PATCH 04/12] ASoC: SOF: 
Intel: add SoundWire configuration interface'


+int hda_sdw_startup(struct snd_sof_dev *sdev)
+{
+   struct sof_intel_hda_dev *hdev;
+   int ret;
+
+   hdev = sdev->pdata->hw_pdata;
+
+   ret = sdw_intel_startup(hdev->sdw);
+   if (ret < 0)
+   return ret;
+   hda_sdw_int_enable(sdev, true);
+
+   return ret;
+}

These 4 functions sdw_intel_acpi_scan, sdw_intel_probe, 
sdw_intel_startup and sdw_intel_exit are the interface between the ASoC 
world and the Soundwire/Intel module.


I split the patches in two series to make the review and integration 
easier on maintainers. The first one is strictly contained within the 
driver/soundwire directory while will impact the soundwire and ASoC trees.


Re: [RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-16 Thread Greg KH
On Mon, Sep 16, 2019 at 04:23:41PM -0500, Pierre-Louis Bossart wrote:
> +/**
> + * sdw_intel_probe() - SoundWire Intel probe routine
> + * @parent_handle: ACPI parent handle
> + * @res: resource data
> + *
> + * This creates SoundWire Master and Slave devices below the controller.
> + * All the information necessary is stored in the context, and the res
> + * argument pointer can be freed after this step.
> + */
> +struct sdw_intel_ctx
> +*sdw_intel_probe(struct sdw_intel_res *res)
> +{
> + return sdw_intel_probe_controller(res);
> +}
> +EXPORT_SYMBOL(sdw_intel_probe);
> +
> +/**
> + * sdw_intel_startup() - SoundWire Intel startup
> + * @ctx: SoundWire context allocated in the probe
> + *
> + */
> +int sdw_intel_startup(struct sdw_intel_ctx *ctx)
> +{
> + return sdw_intel_startup_controller(ctx);
> +}
> +EXPORT_SYMBOL(sdw_intel_startup);

Why are you exporting these functions if no one calls them?

thanks,

greg k-h


[RFC PATCH 8/9] soundwire: intel: remove platform devices and provide new interface

2019-09-16 Thread Pierre-Louis Bossart
Use sdw_master_device and driver instead of platform devices

To quote GregKH:

"Don't mess with a platform device unless you really have no other
possible choice. And even then, don't do it and try to do something
else. Platform devices are really abused, don't perpetuate it "

In addition, rather than a plain-vanilla init/exit, this patch
provides 3 steps in the initialization (ACPI scan, probe, startup)
which make it easier to verify support and allocate required resources
as early as possible, and conversely help make the startup
lighter-weight with only hardware register setup.

The data structures are also consolidated in a single file and
comments added to help follow what is used for what.

Signed-off-by: Pierre-Louis Bossart 
---
 drivers/soundwire/intel.c   |  90 +
 drivers/soundwire/intel.h   |  22 +--
 drivers/soundwire/intel_init.c  | 293 +++-
 include/linux/soundwire/sdw_intel.h |  86 +++-
 4 files changed, 344 insertions(+), 147 deletions(-)

diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 8a1f6c627788..267e0fad7494 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -92,8 +92,6 @@
 #define SDW_ALH_STRMZCFG_DMAT  GENMASK(7, 0)
 #define SDW_ALH_STRMZCFG_CHN   GENMASK(19, 16)
 
-#define SDW_INTEL_QUIRK_MASK_BUS_DISABLE   BIT(1)
-
 enum intel_pdi_type {
INTEL_PDI_IN = 0,
INTEL_PDI_OUT = 1,
@@ -909,24 +907,23 @@ static int intel_init(struct sdw_intel *sdw)
 /*
  * probe and init
  */
-static int intel_probe(struct platform_device *pdev)
+static int intel_master_probe(struct sdw_master_device *md, void *link_ctx)
 {
-   struct sdw_cdns_stream_config config;
struct sdw_intel *sdw;
int ret;
 
-   sdw = devm_kzalloc(>dev, sizeof(*sdw), GFP_KERNEL);
+   sdw = devm_kzalloc(>dev, sizeof(*sdw), GFP_KERNEL);
if (!sdw)
return -ENOMEM;
 
-   sdw->instance = pdev->id;
-   sdw->link_res = dev_get_platdata(>dev);
-   sdw->cdns.dev = >dev;
+   sdw->instance = md->link_id;
+   sdw->link_res = link_ctx;
+   sdw->cdns.dev = >dev;
sdw->cdns.registers = sdw->link_res->registers;
-   sdw->cdns.instance = sdw->instance;
+   sdw->cdns.instance = md->link_id;
sdw->cdns.msg_count = 0;
-   sdw->cdns.bus.dev = >dev;
-   sdw->cdns.bus.link_id = pdev->id;
+   sdw->cdns.bus.dev = >dev;
+   sdw->cdns.bus.link_id = md->link_id;
 
sdw_cdns_probe(>cdns);
 
@@ -934,16 +931,50 @@ static int intel_probe(struct platform_device *pdev)
sdw_intel_ops.read_prop = intel_prop_read;
sdw->cdns.bus.ops = _intel_ops;
 
-   platform_set_drvdata(pdev, sdw);
+   md->pdata = sdw;
+
+   /* set driver data, accessed by snd_soc_dai_set_drvdata() */
+   dev_set_drvdata(>dev, >cdns);
 
ret = sdw_add_bus_master(>cdns.bus);
if (ret) {
-   dev_err(>dev, "sdw_add_bus_master fail: %d\n", ret);
+   dev_err(>dev, "sdw_add_bus_master fail: %d\n", ret);
return ret;
}
 
if (sdw->cdns.bus.prop.hw_disabled) {
-   dev_info(>dev, "SoundWire master %d is disabled, 
ignoring\n",
+   dev_info(>dev, "SoundWire master %d is disabled, 
ignoring\n",
+sdw->cdns.bus.link_id);
+   return 0;
+   }
+
+   /* Acquire IRQ */
+   ret = request_threaded_irq(sdw->link_res->irq,
+  sdw_cdns_irq, sdw_cdns_thread,
+  IRQF_SHARED, KBUILD_MODNAME, >cdns);
+   if (ret < 0) {
+   dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling 
device\n",
+   sdw->link_res->irq);
+   goto err_init;
+   }
+
+   return 0;
+
+err_init:
+   sdw_delete_bus_master(>cdns.bus);
+   return ret;
+}
+
+static int intel_master_startup(struct sdw_master_device *md)
+{
+   struct sdw_cdns_stream_config config;
+   struct sdw_intel *sdw;
+   int ret;
+
+   sdw = md->pdata;
+
+   if (sdw->cdns.bus.prop.hw_disabled) {
+   dev_info(>dev, "SoundWire master %d is disabled, 
ignoring\n",
 sdw->cdns.bus.link_id);
return 0;
}
@@ -961,16 +992,6 @@ static int intel_probe(struct platform_device *pdev)
 
intel_pdi_ch_update(sdw);
 
-   /* Acquire IRQ */
-   ret = request_threaded_irq(sdw->link_res->irq,
-  sdw_cdns_irq, sdw_cdns_thread,
-  IRQF_SHARED, KBUILD_MODNAME, >cdns);
-   if (ret < 0) {
-   dev_err(sdw->cdns.dev, "unable to grab IRQ %d, disabling 
device\n",
-   sdw->link_res->irq);
-   goto err_init;
-   }
-
ret = sdw_cdns_enable_interrupt(>cdns, true);
if (ret < 0) {
dev_err(sdw->cdns.dev, "cannot enable