From: Takashi Iwai on
At Mon, 1 Mar 2010 19:27:53 +0800,
Wei Ni wrote:
>
> Hi, Takashi
> I developed the hdmi audio driver for new chipset MCP89 and GT21x.
> The new HAD controller and codec support standard HDMI operation.
>
> I attached the patch file, please check it.

Thanks. A brief review comments below.


> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index d5c93ad..fbf2c29 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -267,7 +267,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
> #define RIRB_INT_MASK 0x05
>
> /* STATESTS int mask: S3,SD2,SD1,SD0 */
> -#define AZX_MAX_CODECS 4
> +#define AZX_MAX_CODECS 8

Changing this blindly to all codecs seems a bit dangerous.
We have bad experiences regarding the codec probing, and probing more
codec slots may result in unexpected behavior with the older chip.

Do you know which controller chip supports more than 4 slots?


> +struct hdmi_audio_infoframe {
> + u8 type; /* 0x84 */
> + u8 ver; /* 0x01 */
> + u8 len; /* 0x0a */
> +
> + u8 checksum; /* PB0 */
> + u8 CC02_CT47; /* CC in bits 0:2, CT in 4:7 */
> + u8 SS01_SF24;
> + u8 CXT04;
> + u8 CA;
> + u8 LFEPBL01_LSV36_DM_INH7;
....

Let's merge the stuff with patch_intelhdmi.c later...


> +static void hdmi_get_show_eld(struct hda_codec *codec, hda_nid_t pin_nid,
> + struct hdmi_eld *eld)
> +{
> + if (!snd_hdmi_get_eld(eld, codec, pin_nid))
> + snd_hdmi_show_eld(eld);

So, now this module depends on the ELD helper?
Then we need to change Makefile and Kconfig as well.
Right now, the eld helper is built into intel-hdmi module. Now this
is needed to be individual or built-in snd-hda-codec.


thanks,

Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Wei Ni on
Hi, Takashi
1. About AZX_MAX_CODECS, on our new chipset, the codec_mask=0x31, it means
the codec connect on the slot0, slot4, slot5, and on some GT2xx, the codec
will connect to slot6 or slot7, although these chip at most have 4 codecs.
So I change the AZX_MAX_CODECS to 8 directly.
In hda_intel.c, the azx_command_addr(), azx_response_addr(), and
azx_codec_create() use the AZX_MAX_CODECS, if it set as 4, the driver will
not detect the codecs which connect to slot4~7.

2. yes, it's better to merge the hdmi common codes.

3. About ELD, yes, we need to change the Makefile and Kconfig as well.
Could you help me to change it.

Thanks
Wei.

-----Original Message-----
From: Takashi Iwai [mailto:tiwai(a)suse.de]
Sent: Tuesday, March 02, 2010 4:00 PM
To: Wei Ni
Cc: 'Pavel Hofman'; 'alsa-devel'; 'linux-kernel'; 'akpm'
Subject: Re: [alsa-devel] [PATCH]Support MCP89 and GT21x hdmi audio

At Mon, 1 Mar 2010 19:27:53 +0800,
Wei Ni wrote:
>
> Hi, Takashi
> I developed the hdmi audio driver for new chipset MCP89 and GT21x.
> The new HAD controller and codec support standard HDMI operation.
>
> I attached the patch file, please check it.

Thanks. A brief review comments below.


> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index d5c93ad..fbf2c29 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -267,7 +267,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
> #define RIRB_INT_MASK 0x05
>
> /* STATESTS int mask: S3,SD2,SD1,SD0 */
> -#define AZX_MAX_CODECS 4
> +#define AZX_MAX_CODECS 8

Changing this blindly to all codecs seems a bit dangerous.
We have bad experiences regarding the codec probing, and probing more
codec slots may result in unexpected behavior with the older chip.

Do you know which controller chip supports more than 4 slots?


> +struct hdmi_audio_infoframe {
> + u8 type; /* 0x84 */
> + u8 ver; /* 0x01 */
> + u8 len; /* 0x0a */
> +
> + u8 checksum; /* PB0 */
> + u8 CC02_CT47; /* CC in bits 0:2, CT in 4:7 */
> + u8 SS01_SF24;
> + u8 CXT04;
> + u8 CA;
> + u8 LFEPBL01_LSV36_DM_INH7;
....

Let's merge the stuff with patch_intelhdmi.c later...


> +static void hdmi_get_show_eld(struct hda_codec *codec, hda_nid_t pin_nid,
> + struct hdmi_eld *eld)
> +{
> + if (!snd_hdmi_get_eld(eld, codec, pin_nid))
> + snd_hdmi_show_eld(eld);

So, now this module depends on the ELD helper?
Then we need to change Makefile and Kconfig as well.
Right now, the eld helper is built into intel-hdmi module. Now this
is needed to be individual or built-in snd-hda-codec.


thanks,

Takashi
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Takashi Iwai on
At Tue, 2 Mar 2010 17:43:28 +0800,
Wei Ni wrote:
>
> Hi, Takashi
> 1. About AZX_MAX_CODECS, on our new chipset, the codec_mask=0x31, it means
> the codec connect on the slot0, slot4, slot5, and on some GT2xx, the codec
> will connect to slot6 or slot7, although these chip at most have 4 codecs.
> So I change the AZX_MAX_CODECS to 8 directly.
> In hda_intel.c, the azx_command_addr(), azx_response_addr(), and
> azx_codec_create() use the AZX_MAX_CODECS, if it set as 4, the driver will
> not detect the codecs which connect to slot4~7.

Yeah, I understand it. But, as mentioned, changing this to *all*
controller chips is dangerous.
We have already a quirk for controller chips to set max codecs depending
on the chip model. Right now, only teradici chip sets to 1.

So, add "#define AZX_DEFAULT_CODECS 4", and use this value unless
azx_max_codecs[] is defined. And, for the new controller chip
supporting more than 4, it can has 8 in azx_max_codecs[].

Is it feasible?

> 2. yes, it's better to merge the hdmi common codes.
> 3. About ELD, yes, we need to change the Makefile and Kconfig as well.
> Could you help me to change it.

In sound/pci/hda/Makefile, hda_eld.c is built into snd-hda-codec-intelhdmi
by the following rule:

snd-hda-codec-intelhdmi-objs := patch_intelhdmi.o hda_eld.o

Since now hda_eld.c is used in two modules, this has to be in the common
place, such as snd-hda-codec. For this, uncomment the line:

# snd-hda-codec-$(CONFIG_SND_HDA_ELD) += hda_eld.o

and remove hda_eld.o from snd-hda-codec-intelhdmi-objs line.

For Kconfig, right now we have the definition

config SND_HDA_ELD
def_bool y
depends on SND_HDA_CODEC_INTELHDMI

Change depends on like

depends on SND_HDA_CODEC_INTELHDMI || SND_HDA_CODEC_NVHDMI

This can be done via "select" instead. But, we'd merge all hdmi codes
later, so which way to choose is no big matter.


thanks,

Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Wei Ni on
Yes, you are right. We should use quirk to set max codecs.

Thanks a lot
Wei.


-----Original Message-----
From: Takashi Iwai [mailto:tiwai(a)suse.de]
Sent: Tuesday, March 02, 2010 5:55 PM
To: Wei Ni
Cc: 'Pavel Hofman'; 'alsa-devel'; 'linux-kernel'; 'akpm'
Subject: Re: [alsa-devel] [PATCH]Support MCP89 and GT21x hdmi audio

At Tue, 2 Mar 2010 17:43:28 +0800,
Wei Ni wrote:
>
> Hi, Takashi
> 1. About AZX_MAX_CODECS, on our new chipset, the codec_mask=0x31, it means
> the codec connect on the slot0, slot4, slot5, and on some GT2xx, the codec
> will connect to slot6 or slot7, although these chip at most have 4 codecs.
> So I change the AZX_MAX_CODECS to 8 directly.
> In hda_intel.c, the azx_command_addr(), azx_response_addr(), and
> azx_codec_create() use the AZX_MAX_CODECS, if it set as 4, the driver will
> not detect the codecs which connect to slot4~7.

Yeah, I understand it. But, as mentioned, changing this to *all*
controller chips is dangerous.
We have already a quirk for controller chips to set max codecs depending
on the chip model. Right now, only teradici chip sets to 1.

So, add "#define AZX_DEFAULT_CODECS 4", and use this value unless
azx_max_codecs[] is defined. And, for the new controller chip
supporting more than 4, it can has 8 in azx_max_codecs[].

Is it feasible?

> 2. yes, it's better to merge the hdmi common codes.
> 3. About ELD, yes, we need to change the Makefile and Kconfig as well.
> Could you help me to change it.

In sound/pci/hda/Makefile, hda_eld.c is built into snd-hda-codec-intelhdmi
by the following rule:

snd-hda-codec-intelhdmi-objs := patch_intelhdmi.o hda_eld.o

Since now hda_eld.c is used in two modules, this has to be in the common
place, such as snd-hda-codec. For this, uncomment the line:

# snd-hda-codec-$(CONFIG_SND_HDA_ELD) += hda_eld.o

and remove hda_eld.o from snd-hda-codec-intelhdmi-objs line.

For Kconfig, right now we have the definition

config SND_HDA_ELD
def_bool y
depends on SND_HDA_CODEC_INTELHDMI

Change depends on like

depends on SND_HDA_CODEC_INTELHDMI || SND_HDA_CODEC_NVHDMI

This can be done via "select" instead. But, we'd merge all hdmi codes
later, so which way to choose is no big matter.


thanks,

Takashi
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Wei Ni on
Ok, it's no problems.

-----Original Message-----
From: Takashi Iwai [mailto:tiwai(a)suse.de]
Sent: Tuesday, March 02, 2010 6:43 PM
To: Wei Ni
Cc: 'Pavel Hofman'; 'alsa-devel'; 'linux-kernel'; 'akpm'
Subject: Re: [alsa-devel] [PATCH]Support MCP89 and GT21x hdmi audio

At Tue, 2 Mar 2010 18:03:15 +0800,
Wei Ni wrote:
>
> Yes, you are right. We should use quirk to set max codecs.

Also, could you split to two patches, one for extending max codecs for
the new controller and one for the new HDMI codec support?


thanks,

Takashi
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/