From: Greg KH <gregkh@linuxfoundation.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
srinivas.kandagatla@linaro.org, rander.wang@linux.intel.com,
hui.wang@canonical.com, pierre-louis.bossart@linux.intel.com,
sanyog.r.kale@intel.com, bard.liao@intel.com
Subject: Re: [PATCH] soundwire: intel: move to auxiliary bus
Date: Tue, 23 Mar 2021 08:37:56 +0100 [thread overview]
Message-ID: <YFma1ClahDe2bZhR@kroah.com> (raw)
In-Reply-To: <YFmPTkNkX6QPWiCa@vkoul-mobl.Dlink>
On Tue, Mar 23, 2021 at 12:18:46PM +0530, Vinod Koul wrote:
> On 23-03-21, 08:43, Bard Liao wrote:
> > From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> >
> > Now that the auxiliary_bus exists, there's no reason to use platform
> > devices as children of a PCI device any longer.
> >
> > This patch refactors the code by extending a basic auxiliary device
> > with Intel link-specific structures that need to be passed between
> > controller and link levels. This refactoring is much cleaner with no
> > need for cross-pointers between device and link structures.
> >
> > Note that the auxiliary bus API has separate init and add steps, which
> > requires more attention in the error unwinding paths. The main loop
> > needs to deal with kfree() and auxiliary_device_uninit() for the
> > current iteration before jumping to the common label which releases
> > everything allocated in prior iterations.
> >
> > Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
> > Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> > Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> > ---
> > drivers/soundwire/Kconfig | 1 +
> > drivers/soundwire/intel.c | 52 ++++----
> > drivers/soundwire/intel.h | 14 +-
> > drivers/soundwire/intel_init.c | 190 +++++++++++++++++++---------
> > include/linux/soundwire/sdw_intel.h | 6 +-
> > 5 files changed, 175 insertions(+), 88 deletions(-)
> >
> > diff --git a/drivers/soundwire/Kconfig b/drivers/soundwire/Kconfig
> > index 016e74230bb7..2b7795233282 100644
> > --- a/drivers/soundwire/Kconfig
> > +++ b/drivers/soundwire/Kconfig
> > @@ -25,6 +25,7 @@ config SOUNDWIRE_INTEL
> > tristate "Intel SoundWire Master driver"
> > select SOUNDWIRE_CADENCE
> > select SOUNDWIRE_GENERIC_ALLOCATION
> > + select AUXILIARY_BUS
> > depends on ACPI && SND_SOC
> > help
> > SoundWire Intel Master driver.
> > diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
> > index d2254ee2fee2..039a101982c9 100644
> > --- a/drivers/soundwire/intel.c
> > +++ b/drivers/soundwire/intel.c
> > @@ -11,7 +11,7 @@
> > #include <linux/module.h>
> > #include <linux/interrupt.h>
> > #include <linux/io.h>
> > -#include <linux/platform_device.h>
> > +#include <linux/auxiliary_bus.h>
> > #include <sound/pcm_params.h>
> > #include <linux/pm_runtime.h>
> > #include <sound/soc.h>
> > @@ -1331,9 +1331,10 @@ static int intel_init(struct sdw_intel *sdw)
> > /*
> > * probe and init
> > */
> > -static int intel_master_probe(struct platform_device *pdev)
> > +static int intel_link_probe(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id)
> > {
> > - struct device *dev = &pdev->dev;
> > + struct device *dev = &auxdev->dev;
> > + struct sdw_intel_link_dev *ldev = auxiliary_dev_to_sdw_intel_link_dev(auxdev);
>
> Do we need another abstractions for resources here, why not aux dev
> creation set the resources required and we skip this step...
>
> > struct sdw_intel *sdw;
> > struct sdw_cdns *cdns;
> > struct sdw_bus *bus;
> > @@ -1346,14 +1347,14 @@ static int intel_master_probe(struct platform_device *pdev)
> > cdns = &sdw->cdns;
> > bus = &cdns->bus;
> >
> > - sdw->instance = pdev->id;
> > - sdw->link_res = dev_get_platdata(dev);
> > + sdw->instance = auxdev->id;
>
> so auxdev has id and still we pass id as argument :( Not sure if folks
> can fix this now
That's odd, yeah, it should be fixed.
greg k-h
next prev parent reply other threads:[~2021-03-23 7:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 0:43 [PATCH] soundwire: intel: move to auxiliary bus Bard Liao
2021-03-23 6:48 ` Vinod Koul
2021-03-23 7:37 ` Greg KH [this message]
2021-03-23 17:29 ` Pierre-Louis Bossart
2021-03-24 10:50 ` Vinod Koul
2021-03-24 15:03 ` Pierre-Louis Bossart
2021-03-23 7:37 ` Greg KH
2021-03-23 18:04 ` Pierre-Louis Bossart
2021-03-23 18:32 ` Greg KH
2021-03-23 19:14 ` Pierre-Louis Bossart
2021-03-24 9:30 ` Greg KH
2021-03-24 14:55 ` Pierre-Louis Bossart
2021-03-24 15:36 ` Greg KH
2021-03-26 16:24 ` Pierre-Louis Bossart
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=YFma1ClahDe2bZhR@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alsa-devel@alsa-project.org \
--cc=bard.liao@intel.com \
--cc=hui.wang@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/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