public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Huacai Chen <chenhuacai@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org, alsa-devel@alsa-project.org,
	Zhangjin Wu <wuzhangjin@gmail.com>, Hua Yan <yanh@lemote.com>,
	Fuxin Zhang <zhangfx@lemote.com>,
	linux-kernel@vger.kernel.org, Hongliang Tao <taohl@lemote.com>,
	Huacai Chen <chenhc@lemote.com>
Subject: Re: [alsa-devel] [PATCH V4 12/16] ALSA: HDA: Make hda sound card usable	for Loongson.
Date: Fri, 03 Aug 2012 11:24:38 +0200	[thread overview]
Message-ID: <s5hobmsqqeh.wl%tiwai@suse.de> (raw)
In-Reply-To: <1343977571-2292-13-git-send-email-chenhc@lemote.com>

At Fri,  3 Aug 2012 15:06:07 +0800,
Huacai Chen wrote:
> 
> Lemote A1004(Laptop) and A1205(All-In-One) use Conexant's hda codec,
> this patch modify patch_conexant.c to add Lemote specific code.
> 
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> Signed-off-by: Hongliang Tao <taohl@lemote.com>
> Signed-off-by: Hua Yan <yanh@lemote.com>
> Cc: alsa-devel@alsa-project.org

Doesn't the recent kernel work as is?  Which kernel have you tested?
If it doesn't work with the recent kernel, it's likely just because
the pins aren't set properly by BIOS or whatever.

In general, we avoid to add this kind of quirks any longer.
If the problem is only about the pin configuration, you can add the
pin table in the driver.


thanks,

Takashi

> ---
>  include/linux/pci_ids.h        |    2 +
>  sound/pci/hda/patch_conexant.c |   52 ++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 52 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index fc35260..b28270e 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2918,3 +2918,5 @@
>  #define PCI_DEVICE_ID_XEN_PLATFORM	0x0001
>  
>  #define PCI_VENDOR_ID_OCZ		0x1b85
> +
> +#define PCI_VENDOR_ID_LEMOTE		0x1c06
> diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
> index 1436118..6bbac39 100644
> --- a/sound/pci/hda/patch_conexant.c
> +++ b/sound/pci/hda/patch_conexant.c
> @@ -142,6 +142,7 @@ struct conexant_spec {
>  	unsigned int thinkpad:1;
>  	unsigned int hp_laptop:1;
>  	unsigned int asus:1;
> +	unsigned int lemote:1;
>  	unsigned int pin_eapd_ctrls:1;
>  	unsigned int fixup_stereo_dmic:1;
>  
> @@ -2280,7 +2281,7 @@ static void cxt5066_automic(struct hda_codec *codec)
>  		cxt5066_thinkpad_automic(codec);
>  	else if (spec->hp_laptop)
>  		cxt5066_hp_laptop_automic(codec);
> -	else if (spec->asus)
> +	else if (spec->asus || spec->lemote)
>  		cxt5066_asus_automic(codec);
>  }
>  
> @@ -2913,6 +2914,32 @@ static const struct hda_verb cxt5066_init_verbs_hp_laptop[] = {
>  	{ } /* end */
>  };
>  
> +static struct hda_verb cxt5066_init_verbs_lemote[] = {
> +	{0x14, AC_VERB_SET_CONNECT_SEL, 0x0}, /* ADC1: Connection index: 0 */
> +	{0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
> +	{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT},
> +
> +	/* DAC2: unused */
> +	{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
> +
> +	/* ADC2, ADC3: unused */
> +	{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
> +	{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
> +	{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
> +	{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
> +	{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
> +	{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
> +	{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
> +	{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
> +
> +	/* Disable digital microphone port */
> +	{0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
> +
> +	/* Disable SPDIF */
> +	{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
> +	{ } /* end */
> +};
> +
>  /* initialize jack-sensing, too */
>  static int cxt5066_init(struct hda_codec *codec)
>  {
> @@ -2950,6 +2977,8 @@ enum {
>  	CXT5066_THINKPAD,	/* Lenovo ThinkPad T410s, others? */
>  	CXT5066_ASUS,		/* Asus K52JU, Lenovo G560 - Int mic at 0x1a and Ext mic at 0x1b */
>  	CXT5066_HP_LAPTOP,      /* HP Laptop */
> +	CXT5066_LEMOTE_A1004,   /* Lemote Laptop A1004 */
> +	CXT5066_LEMOTE_A1205,   /* Lemote All-In-One A1205 */
>  	CXT5066_AUTO,		/* BIOS auto-parser */
>  	CXT5066_MODELS
>  };
> @@ -2963,6 +2992,8 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
>  	[CXT5066_THINKPAD]	= "thinkpad",
>  	[CXT5066_ASUS]		= "asus",
>  	[CXT5066_HP_LAPTOP]	= "hp-laptop",
> +	[CXT5066_LEMOTE_A1004]  = "lemote-laptop-a1004",
> +	[CXT5066_LEMOTE_A1205]  = "lemote-aio-a1205",
>  	[CXT5066_AUTO]		= "auto",
>  };
>  
> @@ -2995,6 +3026,8 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
>  	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo U350", CXT5066_ASUS),
>  	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
>  	SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO),
> +	SND_PCI_QUIRK(PCI_VENDOR_ID_LEMOTE, 0x2011, "Lemote A1004", CXT5066_LEMOTE_A1004),
> +	SND_PCI_QUIRK(PCI_VENDOR_ID_LEMOTE, 0x2012, "Lemote A1205", CXT5066_LEMOTE_A1205),
>  	SND_PCI_QUIRK(0x1b0a, 0x2092, "CyberpowerPC Gamer Xplorer N57001", CXT5066_AUTO),
>  	{}
>  };
> @@ -3075,7 +3108,22 @@ static int patch_cxt5066(struct hda_codec *codec)
>  		spec->port_d_mode = 0;
>  		spec->mic_boost = 3; /* default 30dB gain */
>  		break;
> -
> +	case CXT5066_LEMOTE_A1004:
> +	case CXT5066_LEMOTE_A1205:
> +		codec->patch_ops.init = cxt5066_init;
> +		codec->patch_ops.unsol_event = cxt5066_unsol_event;
> +		spec->init_verbs[spec->num_init_verbs] =
> +			cxt5066_init_verbs_lemote;
> +		spec->num_init_verbs++;
> +		spec->lemote = 1;
> +		spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
> +		spec->mixers[spec->num_mixers++] = cxt5066_mixers;
> +		/* no S/PDIF out */
> +		/* input source automatically selected */
> +		spec->input_mux = NULL;
> +		spec->port_d_mode = 0;
> +		spec->mic_boost = 3; /* default 30dB gain */
> +		break;
>  	case CXT5066_OLPC_XO_1_5:
>  		codec->patch_ops.init = cxt5066_olpc_init;
>  		codec->patch_ops.unsol_event = cxt5066_olpc_unsol_event;
> -- 
> 1.7.7.3
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

  reply	other threads:[~2012-08-03  9:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  7:05 [PATCH V4 00/16] MIPS: Add Loongson-3 based machines support Huacai Chen
2012-08-03  7:05 ` [PATCH V4 01/16] MIPS: Loongson: Add basic Loongson-3 definition Huacai Chen
2012-08-03  7:05 ` [PATCH V4 02/16] MIPS: Loongson: Add basic Loongson-3 CPU support Huacai Chen
2012-08-03  7:05 ` [PATCH V4 03/16] MIPS: Loongson 3: Add Lemote-3A machtypes definition Huacai Chen
2012-08-03  7:05 ` [PATCH V4 04/16] MIPS: Loongson: Make Loongson-3 to use BCD format for RTC Huacai Chen
2012-08-03  7:06 ` [PATCH V4 05/16] MIPS: Loongson: Add UEFI-like firmware interface support Huacai Chen
2012-08-03  7:06 ` [PATCH V4 06/16] MIPS: Loongson 3: Add HT-linked PCI support Huacai Chen
2012-08-03  7:06 ` [PATCH V4 07/16] MIPS: Loongson 3: Add IRQ init and dispatch support Huacai Chen
2012-08-03  7:06 ` [PATCH V4 08/16] MIPS: Loongson 3: Add serial port support Huacai Chen
2012-08-03  7:06 ` [PATCH V4 09/16] MIPS: Loongson: Add swiotlb to support big memory (>4GB) Huacai Chen
2012-08-03  7:06 ` [PATCH V4 10/16] MIPS: Loongson: Add Loongson-3 Kconfig options Huacai Chen
2012-08-03  7:06 ` [PATCH V4 11/16] drm/radeon: Make radeon card usable for Loongson Huacai Chen
2012-08-03  8:01   ` Michel Dänzer
2012-08-03 10:29     ` Huacai Chen
2012-08-03  7:06 ` [PATCH V4 12/16] ALSA: HDA: Make hda sound " Huacai Chen
2012-08-03  9:24   ` Takashi Iwai [this message]
2012-08-03 10:36     ` [alsa-devel] " Huacai Chen
2012-08-03 14:56       ` Takashi Iwai
2012-08-03  7:06 ` [PATCH V4 13/16] MIPS: Loongson 3: Add Loongson-3 SMP support Huacai Chen
2012-08-03  7:06 ` [PATCH V4 14/16] MIPS: Loongson 3: Add CPU hotplug support Huacai Chen
2012-08-03  7:06 ` [PATCH V4 15/16] MIPS: Fix poweroff failure when HOTPLUG_CPU configured Huacai Chen
2012-08-03  7:06 ` [PATCH V4 16/16] MIPS: Loongson: Add a Loongson-3 default config file Huacai Chen

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=s5hobmsqqeh.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=chenhc@lemote.com \
    --cc=chenhuacai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=taohl@lemote.com \
    --cc=wuzhangjin@gmail.com \
    --cc=yanh@lemote.com \
    --cc=zhangfx@lemote.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