From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vinod.koul@intel.com>,
liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org,
Jeeja KP <jeeja.kp@intel.com>,
patches.audio@intel.com
Subject: Re: [PATCH v4 1/7] ASoC: hda - add ASoC HDA codec match function
Date: Tue, 26 May 2015 07:24:03 +0200 [thread overview]
Message-ID: <s5h617f29os.wl-tiwai@suse.de> (raw)
In-Reply-To: <20150525135854.GV21391@sirena.org.uk>
At Mon, 25 May 2015 14:58:54 +0100,
Mark Brown wrote:
>
> On Mon, May 25, 2015 at 01:55:59PM +0200, Takashi Iwai wrote:
> > Vinod Koul wrote:
>
> > > The hdac core doesn't actually do matching. If you see the match
> > > function provided by core (hda_bus_match), it is a wrapper and
> > > actual matching for legacy devices is being done in legacy code, see
> > > hda_codec_match. This match function expects the hdac_device to be
> > > wrapped in legacy hda_codec, which we don't need here.
>
> > > So for ASoC we are embedding hdac_device in soc_hda_codec and using
> > > the vendor_id and revision_id to match, so hda to write a new one.
>
> You keep on describing what the code does; I can mostly see what the
> code does (and could probably figure out extra bits if I wasn't getting
> scared off by what I do see) - that's basically what I'm flagging as an
> issue. What I'm having trouble seeing is why this makes sense. The
> question isn't what, it's why.
OK, let's see below.
> > > I do not mind if we commonize this and have common match function in
> > > hdac, if legacy is happy with it. Or perhaps the move to core later on
> > > as ASoC HDA matures, either way whatever you n Takashi agree with
> > > would be okay by me.
>
> > This is the next step. It would need a fairly big amount of rewrite
> > in each legacy HDA codec driver, and I don't want it for 4.2.
>
> So how does this actually work then? If we need to rework all the HDA
> CODEC drivers before they work with this new HDA bus (or at least this
> new HDA bus when used with controllers that implement a custom match
> function) then does it make sense to start trying to use it now?
>
> I would have expected this to be the /first/ step - refactor the
> existing HDA code, then add new users.
I don't agree with it.
> > Once when we get the common criteria for matching (both for asoc and
> > legacy), we can move to the unified match method.
>
> I really don't understand this idea that we need to work out what the
> common criteria for matching are, HDA is an enumerable bus isn't it?
The common match method *does* exist. It's just shifted to two parts,
one for ASoC and one for legacy, because of two different objects.
> > That said, the reason for individual match mechanism is not to break
> > the legacy hda code. If anyone can provide a patch to achieve that
> > within 100 LOCs and without regression, I'd happily take it :)
>
> Another way of looking at this is to ask why the CODEC driver matching
> can't continue to work the way it currently does - we're transitioning
> to a bus (which makes sense as a cleanup) but I've not seen any reason
> articulated for tying that up the merge of the Sky Lake code and it
> seems like we're not very near being in a position to be able to do
> that. Or could we just keep the bigger hda_codec struct around in the
> bus code for now even if it winds up being bloated?
The most of needed changes are not about hda_bus stuff. This has been
already done for 4.2, in for-next branch. The rest works for HDA
legacy codes are rather self-contained, further refactoring of the
legacy code itself. This refactoring has little merit from
functionality POV; the move to hda_bus was already finished, and user
would see no difference at all. The resultant code wouldn't be much
better from readability POV, rather the size would bloat. (Remember
that standardization means nothing but limited customization.)
One of few merits would a possible common match method in hda/bus, but
that's all. So it's prioritized low for now.
> Like I say it's all the why questions that aren't making sense to me
> beyond the "we're too scared to touch the existing code" ones.
Avoiding a regression is the very first priority, indeed, for a driver
like HDA, which is over 10 years old, fat, complex for literally
thousands of various devices, and still with millions of users and
> I'm also wondering how this interacts with the Tegra HDA device by the
> way...
It's a part of HDA legacy. No difference from any other HDA devices.
What's the problem with Tegra?
thanks,
Takashi
next prev parent reply other threads:[~2015-05-26 5:24 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 10:53 [PATCH v4 0/7] ASoC: intel - add skylake PCM driver Vinod Koul
2015-05-11 10:53 ` [PATCH v4 1/7] ASoC: hda - add ASoC HDA codec match function Vinod Koul
2015-05-22 12:56 ` Mark Brown
2015-05-22 13:35 ` Takashi Iwai
2015-05-22 17:41 ` Mark Brown
2015-05-22 18:13 ` Takashi Iwai
2015-05-23 5:51 ` Vinod Koul
2015-05-25 10:48 ` Mark Brown
2015-05-25 11:21 ` Vinod Koul
2015-05-25 11:55 ` Takashi Iwai
2015-05-25 13:58 ` Mark Brown
2015-05-26 5:24 ` Takashi Iwai [this message]
2015-05-26 13:32 ` Mark Brown
2015-05-26 13:41 ` Takashi Iwai
2015-05-26 19:43 ` Mark Brown
2015-05-27 6:05 ` Takashi Iwai
2015-05-27 18:34 ` Mark Brown
2015-05-27 19:17 ` Takashi Iwai
2015-05-28 19:53 ` Mark Brown
2015-05-29 4:58 ` Takashi Iwai
2015-05-29 8:15 ` Vinod Koul
2015-05-29 17:35 ` Mark Brown
2015-06-01 5:05 ` Vinod Koul
2015-06-02 10:38 ` Mark Brown
2015-06-02 12:25 ` Vinod Koul
2015-05-11 10:54 ` [PATCH v4 2/7] ALSA: hda - add new HDA registers Vinod Koul
2015-05-22 12:58 ` Mark Brown
2015-05-22 13:32 ` Takashi Iwai
2015-05-11 10:54 ` [PATCH v4 3/7] ASoC: hda - add asoc hda core bus, controller and stream helpers Vinod Koul
2015-05-26 18:51 ` Mark Brown
2015-05-27 5:40 ` Vinod Koul
2015-05-11 10:54 ` [PATCH v4 4/7] ASoC: intel - add Skylake HDA platform driver Vinod Koul
2015-05-11 10:54 ` [PATCH v4 5/7] ASoC: intel - add Skylake HDA audio driver Vinod Koul
2015-05-29 17:41 ` Mark Brown
2015-05-29 18:25 ` Takashi Iwai
2015-06-02 10:45 ` Mark Brown
2015-06-02 10:53 ` Takashi Iwai
2015-06-02 11:07 ` Mark Brown
2015-06-02 11:57 ` Takashi Iwai
2015-06-02 12:39 ` Vinod Koul
2015-06-02 14:30 ` Mark Brown
2015-06-01 5:13 ` Vinod Koul
2015-06-01 5:32 ` Takashi Iwai
2015-06-02 10:42 ` Mark Brown
2015-06-02 10:48 ` Takashi Iwai
2015-06-02 11:10 ` Mark Brown
2015-06-02 11:44 ` Takashi Iwai
2015-06-02 12:29 ` Vinod Koul
2015-05-11 10:54 ` [PATCH v4 6/7] ASoC: intel - add makefile support for SKL driver Vinod Koul
2015-05-11 10:54 ` [PATCH v4 7/7] ASoC: intel - adds support for decoupled mode in skl driver Vinod Koul
2015-05-22 12:20 ` [PATCH v4 0/7] ASoC: intel - add skylake PCM driver Vinod Koul
2015-05-22 13:12 ` Mark Brown
2015-05-25 6:57 ` Takashi Iwai
2015-05-25 11:24 ` Vinod Koul
2015-05-25 11:58 ` Takashi Iwai
2015-05-26 4:14 ` Vinod Koul
2015-05-26 5:27 ` Takashi Iwai
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=s5h617f29os.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jeeja.kp@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=vinod.koul@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;
as well as URLs for NNTP newsgroup(s).