All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Abdelghani Ouchabane <abdelghani@ezono.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: "modprobe snd_hda_intel" crashes on my hardware
Date: Tue, 27 Sep 2011 15:18:38 +0200	[thread overview]
Message-ID: <4E81CD2E.2010009@ladisch.de> (raw)
In-Reply-To: <4E817010.7030607@ezono.com>

This looks like a patch, not like a crash report.

Please check linux/Documentation/SubmittingPatches.

Abdelghani Ouchabane wrote:
> +    /* THis is added because Ezono sound card doesn't support auto detection */

         "This"

_All_ VT1708 chips support autodetection; the registers just have to be
initialized correctly by the BIOS.

> +    /* Port_A PW0 */
> +    snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, 0x00);
> +    snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, 0xf0);
> +    snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, 0x00);
> +    snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0x00);
> ...

A table of initialization values that gets written in a loop would look
less ugly.

>  static int patch_vt1708(struct hda_codec *codec)
>  {
>  	struct via_spec *spec;
> @@ -902,7 +945,10 @@ static int patch_vt1708(struct hda_codec
>  		return -ENOMEM;
>  
>  	codec->spec = spec;
> -
> +	
> +	/* Init Ezono Sound card */
> +	ezono_vt1708_init(codec);
> +	

Please don't add whitespace to empty lines.

This initialization gets applied to _all_ VT1708 chips; thus it will
break all non-Ezono machines.

The driver has to check whether it is running on this particular model
of an Ezono computer.  The correct way to do this is to check the PCI
IDs:

> 00:1b.0 0403: 8086:27d8
> ...
> Subsystem Id: 0xffffffff

Oh well, somebody forgot to initialize them.  Probably the same BIOS
programmer that forgot to initialize the VT1708 registers.

Another way would be to check the DMI strings.

> Manufacturer:      
> Product Name:      
> Product Version:   

Or not.  Who wrote that BIOS?  Somebody whose brain was damaged by too
much ultrasound?


Anyway, you could just override the pin configs with a HDA patch file.
Ensure that your kernel is compiled with CONFIG_SND_HDA_PATCH_LOADER;
then create a file /lib/firmware/forgotten-ezono-hda-settings with the
following contents:

[codec]
0x11061708 0xffffffff 2
[pincfg]
0x1c 0x0000f000
0x1d 0x00a0f040
0x1f 0x0100f010
0x20 0x0020f000
0x22 0x0000f002
0x23 0x0000f004

Then load the snd-hda-intel driver with the parameter
"patch=forgotten-ezono-hda-settings", either by adding that
parameter to the modprobe command line, or by putting the line

  options snd-hda-intel patch=forgotten-ezono-hda-settings

into a .conf file in /etc/modprobe.d/.


Regards,
Clemens

  reply	other threads:[~2011-09-27 13:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27  6:41 "modprobe snd_hda_intel" crashes on my hardware Abdelghani Ouchabane
2011-09-27 13:18 ` Clemens Ladisch [this message]
2011-09-27 12:20   ` Abdelghani Ouchabane
2011-09-28  4:01   ` Raymond Yau
2011-09-28  6:15   ` Abdelghani Ouchabane
2011-09-28  6:50   ` Abdelghani Ouchabane
2011-09-28  6:54   ` Abdelghani Ouchabane
2011-09-28  7:10   ` Abdelghani Ouchabane
2011-09-28  6:00 ` Takashi Iwai
2011-09-28  6:24   ` Abdelghani Ouchabane
2011-09-28  9:07     ` Takashi Iwai
2011-09-28  9:50       ` Paul Menzel
2011-09-28  8:34         ` Abdelghani Ouchabane
2011-09-28 13:42         ` Takashi Iwai
2011-09-28  6:51   ` Abdelghani Ouchabane
2011-09-28  7:00   ` Abdelghani Ouchabane
2011-09-28  7:54   ` Abdelghani Ouchabane
2011-09-28  8:20     ` Abdelghani Ouchabane
2011-09-28 13:43     ` Takashi Iwai
2011-09-28 12:22       ` Abdelghani Ouchabane
2011-09-28 14:23         ` Takashi Iwai
2011-09-28 12:51           ` Abdelghani Ouchabane
2011-09-28 14:58             ` Takashi Iwai
2011-09-28 13:19               ` Abdelghani Ouchabane
2011-09-28 15:01             ` Clemens Ladisch
2011-09-28 13:22               ` Abdelghani Ouchabane
  -- strict thread matches above, loose matches on Subject: below --
2011-09-27  5:42 Abdelghani Ouchabane
2011-09-27  5:46 ` Abdelghani Ouchabane

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=4E81CD2E.2010009@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=abdelghani@ezono.com \
    --cc=alsa-devel@alsa-project.org \
    /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.