[PATCH 3/3] soundwire: bus_type: add sdw_master_device support
Vinod Koul
vkoul at kernel.org
Mon May 11 13:41:08 CEST 2020
On 11-05-20, 11:34, Liao, Bard wrote:
>
>
> > -----Original Message-----
> > From: Vinod Koul <vkoul at kernel.org>
> > Sent: Monday, May 11, 2020 5:00 PM
> > To: Liao, Bard <bard.liao at intel.com>
> > Cc: Bard Liao <yung-chuan.liao at linux.intel.com>; alsa-devel at alsa-project.org;
> > linux-kernel at vger.kernel.org; tiwai at suse.de; broonie at kernel.org;
> > gregkh at linuxfoundation.org; jank at cadence.com;
> > srinivas.kandagatla at linaro.org; rander.wang at linux.intel.com;
> > ranjani.sridharan at linux.intel.com; hui.wang at canonical.com; pierre-
> > louis.bossart at linux.intel.com; Kale, Sanyog R <sanyog.r.kale at intel.com>;
> > Blauciak, Slawomir <slawomir.blauciak at intel.com>; Lin, Mengdong
> > <mengdong.lin at intel.com>
> > Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support
> >
> > On 11-05-20, 08:04, Liao, Bard wrote:
> > > > -----Original Message-----
> > > > From: Vinod Koul <vkoul at kernel.org>
> > > > Sent: Monday, May 11, 2020 2:32 PM
> > > > To: Bard Liao <yung-chuan.liao at linux.intel.com>
> > > > Cc: alsa-devel at alsa-project.org; linux-kernel at vger.kernel.org;
> > > > tiwai at suse.de; broonie at kernel.org; gregkh at linuxfoundation.org;
> > > > jank at cadence.com; srinivas.kandagatla at linaro.org;
> > > > rander.wang at linux.intel.com; ranjani.sridharan at linux.intel.com;
> > > > hui.wang at canonical.com; pierre- louis.bossart at linux.intel.com; Kale,
> > > > Sanyog R <sanyog.r.kale at intel.com>; Blauciak, Slawomir
> > > > <slawomir.blauciak at intel.com>; Lin, Mengdong
> > > > <mengdong.lin at intel.com>; Liao, Bard <bard.liao at intel.com>
> > > > Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device
> > > > support
> > > >
> > > > On 30-04-20, 02:51, Bard Liao wrote:
> > > > > @@ -24,9 +24,14 @@ int sdw_bus_master_add(struct sdw_bus *bus,
> > > > > struct
> > > > device *parent,
> > > > > struct sdw_master_prop *prop = NULL;
> > > > > int ret;
> > > > >
> > > > > - if (!bus->dev) {
> > > > > - pr_err("SoundWire bus has no device\n");
> > > > > - return -ENODEV;
> > > >
> > > > This check is removed and not moved into sdw_master_device_add()
> > > > either, can you add here or in patch 1 and keep checking the parent
> > > > device please
> > >
> > > We will set bus->dev = &md->dev in the end of sdw_master_device_add().
> >
> > We need to test if this is valid or not :)
> >
> > > That's why we remove the test. But now I am wandering does it make
> > > sense to set bus->dev = &md->dev? Maybe it makes more sense to set
> > > bus->dev = sdw control device.
> > > A follow up question is that should slave device a child of bus device
> > > or master device? I would prefer bus device if it makes sense.
> > > I will check bus->dev and parent and remove bus->dev = &md->dev in the
> > > next version.
> >
> > the parent is bus->dev and sdw_master_device created would be child of this
> > and should be set as such. You can remove it from bus object and keep in
> > sdw_master_device object, that is fine by me.
>
> Looks like we don't need the parent and fwnode parameter since we can
> get them from bus->dev 😊
Quite right
> > The sdw_slave is child of sdw_master_device now and looks to be set correct.
>
> So, it will be
> bus device
> -> master device
> -> slave device
> right?
yes
>
> I have a question here. We have pm supported on bus and slave devices,
> but not master device. Will pm work with this architecture?
> Can it be
> bus device
> -> master device & slave device?
yes it would and you should check it out. The pm (runtime_pm) works well
with child devices and parents, so we need to ensure that parents are
set properly.
Thanks
--
~Vinod
More information about the Alsa-devel
mailing list