From: David Henningsson <david.henningsson@canonical.com>
To: "Lin, Mengdong" <mengdong.lin@intel.com>
Cc: "tiwai@suse.de" <tiwai@suse.de>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [RFC PATCH] ALSA : hda - not use assigned converters for all unused pins
Date: Fri, 20 Sep 2013 11:32:11 +0200 [thread overview]
Message-ID: <523C161B.9050502@canonical.com> (raw)
In-Reply-To: <F46914AEC2663F4A9BB62374E5EEF8F80137789B@SHSMSX101.ccr.corp.intel.com>
On 09/20/2013 10:00 AM, Lin, Mengdong wrote:
> Hi David,
>
> Sorry, I missed your mail. Please see comments below ...
>
>> -----Original Message-----
>> From: David Henningsson [mailto:david.henningsson@canonical.com]
>> Sent: Tuesday, September 17, 2013 6:40 AM
>
>>> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
>>> index 3d8cd044..4960695 100644
>>> --- a/sound/pci/hda/patch_hdmi.c
>>> +++ b/sound/pci/hda/patch_hdmi.c
>>> @@ -1152,29 +1152,34 @@ static void haswell_config_cvts(struct
>> hda_codec *codec,
>>> int pin_id, int mux_id)
>>> {
>>> struct hdmi_spec *spec = codec->spec;
>>> - struct hdmi_spec_per_pin *per_pin;
>>> - int pin_idx, mux_idx;
>>> + hda_nid_t pin_nid;
>>> + int pin_idx, cvt_idx;
>>> int curr;
>>> - int err;
>>> -
>>> - for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
>>> - per_pin = get_pin(spec, pin_idx);
>>> + struct hdmi_spec_per_cvt *per_cvt;
>>>
>>> + /* configure all 3 pins, including "no physical connection" ones */
>>> + for (pin_nid = 5; pin_nid < 8; pin_nid++) {
>>
>> It might not be so future proof to hard code nid IDs here (even if it should be
>> safe right now?). Perhaps more elegant to go through the entire codec->nids
>> array like being done here:
>>
>> http://lxr.linux.no/linux+*/sound/pci/hda/hda_auto_parser.c#L188
>>
>> The nid's wcaps is cached so it does not mean additional reads from the codec.
>
> Xingchao defined haswell_config_cvts() to configure converters on codec->pins before.
> But codec->pins does not include the pins programmed by BIOS as "No physical connections" (like port B in the OEM machine).
> So I change the code from using codec->pins to hard coded NIDs. It's not graceful and the NIDs may change in the future.
>
> There is another option to change add_pin() to not overlook such "no connection" pins for Haswell.
I was suggesting to do something like this in haswell_config_cvts:
int end_nid = codec->start_nid + codec->num_nodes;
for (nid = codec->start_nid; nid < end_nid; nid++) {
unsigned int wid_caps = get_wcaps(codec, nid);
if (get_wcaps_type(wid_caps) != AC_WID_PIN)
continue;
/* etc */
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
next prev parent reply other threads:[~2013-09-20 9:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 2:40 [RFC PATCH] ALSA : hda - not use assigned converters for all unused pins mengdong.lin
2013-09-16 22:40 ` David Henningsson
2013-09-20 8:00 ` Lin, Mengdong
2013-09-20 9:32 ` David Henningsson [this message]
2013-09-20 14:48 ` Lin, Mengdong
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=523C161B.9050502@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=mengdong.lin@intel.com \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.