Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Unbenannt
Wednesday, June 24th, 2009 at 3:13:52pm UTC 

  1. *************** struct ad198x_spec {
  2. *** 72,77 ****
  3.          hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
  4.  
  5.          unsigned int jack_present :1;
  6.  
  7.   #ifdef CONFIG_SND_HDA_POWER_SAVE
  8.          struct hda_loopback_check loopback;
  9. --- 72,78 ----
  10.          hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
  11.  
  12.          unsigned int jack_present :1;
  13. +        unsigned int inv_jack_detect:1;
  14.  
  15.   #ifdef CONFIG_SND_HDA_POWER_SAVE
  16.          struct hda_loopback_check loopback;
  17. *************** static struct hda_input_mux ad1986a_automic_capture_source = {
  18. *** 669,707 ****
  19.          },
  20.   };
  21.  
  22. - static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
  23.          HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
  24.          HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
  25. -        HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
  26. -        HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
  27. -        HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
  28. -        HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
  29. -        HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
  30. -        HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
  31. -        HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
  32. -        HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
  33. -        HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
  34. -        {
  35. -                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  36. -                .name = "Capture Source",
  37. -                .info = ad198x_mux_enum_info,
  38. -                .get = ad198x_mux_enum_get,
  39. -                .put = ad198x_mux_enum_put,
  40. -        },
  41. -        {
  42. -                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  43. -                .name = "External Amplifier",
  44. -                .info = ad198x_eapd_info,
  45. -                .get = ad198x_eapd_get,
  46. -                .put = ad198x_eapd_put,
  47. -                .private_value = 0x1b | (1 << 8), /* port-D, inversed */
  48. -        },
  49.          { } /* end */
  50.   };
  51.  
  52. - static struct snd_kcontrol_new ad1986a_samsung_mixers[] = {
  53. -        HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
  54. -        HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
  55.          HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
  56.          HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
  57.          HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
  58. --- 670,682 ----
  59.          },
  60.   };
  61.  
  62. + static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = {
  63.          HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
  64.          HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
  65.          { } /* end */
  66.   };
  67.  
  68. + static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
  69.          HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
  70.          HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
  71.          HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
  72. *************** static void ad1986a_hp_automute(struct hda_codec *codec)
  73. *** 776,783 ****
  74.          unsigned int present;
  75.  
  76.          present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0);
  77. -        /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */
  78. -        spec->jack_present = !(present & 0x80000000);
  79.          ad1986a_update_hp(codec);
  80.   }
  81.  
  82. --- 757,765 ----
  83.          unsigned int present;
  84.  
  85.          present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0);
  86. +        spec->jack_present = !!(present & 0x80000000);
  87. +        if (spec->inv_jack_detect)
  88. +                spec->jack_present = !spec->jack_present;
  89.          ad1986a_update_hp(codec);
  90.   }
  91.  
  92. *************** static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol,
  93. *** 816,822 ****
  94.          return change;
  95.   }
  96.  
  97. - static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = {
  98.          HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
  99.          {
  100.                  .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  101. --- 798,804 ----
  102.          return change;
  103.   }
  104.  
  105. + static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
  106.          HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
  107.          {
  108.                  .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  109. *************** static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = {
  110. *** 826,858 ****
  111.                  .put = ad1986a_hp_master_sw_put,
  112.                  .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
  113.          },
  114. -        HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
  115. -        HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
  116. -        HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
  117. -        HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
  118. -        HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
  119. -        HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
  120. -        HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
  121. -        HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
  122. -        HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
  123. -        {
  124. -                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  125. -                .name = "Capture Source",
  126. -                .info = ad198x_mux_enum_info,
  127. -                .get = ad198x_mux_enum_get,
  128. -                .put = ad198x_mux_enum_put,
  129. -        },
  130. -        {
  131. -                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  132. -                .name = "External Amplifier",
  133. -                .info = ad198x_eapd_info,
  134. -                .get = ad198x_eapd_get,
  135. -                .put = ad198x_eapd_put,
  136. -                .private_value = 0x1b | (1 << 8), /* port-D, inversed */
  137. -        },
  138.          { } /* end */
  139.   };
  140.  
  141.   /*
  142.    * initialization verbs
  143.    */
  144. --- 808,817 ----
  145.                  .put = ad1986a_hp_master_sw_put,
  146.                  .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
  147.          },
  148.          { } /* end */
  149.   };
  150.  
  151. +
  152.   /*
  153.    * initialization verbs
  154.    */
  155. *************** enum {
  156. *** 991,996 ****
  157.          AD1986A_LAPTOP_AUTOMUTE,
  158.          AD1986A_ULTRA,
  159.          AD1986A_SAMSUNG,
  160.          AD1986A_MODELS
  161.   };
  162.  
  163. --- 971,977 ----
  164.          AD1986A_LAPTOP_AUTOMUTE,
  165.          AD1986A_ULTRA,
  166.          AD1986A_SAMSUNG,
  167. +        AD1986A_SAMSUNG_P50,
  168.          AD1986A_MODELS
  169.   };
  170.  
  171. *************** static const char *ad1986a_models[AD1986A_MODELS] = {
  172. *** 1002,1007 ****
  173.          [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute",
  174.          [AD1986A_ULTRA]         = "ultra",
  175.          [AD1986A_SAMSUNG]       = "samsung",
  176.   };
  177.  
  178.   static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
  179. --- 983,989 ----
  180.          [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute",
  181.          [AD1986A_ULTRA]         = "ultra",
  182.          [AD1986A_SAMSUNG]       = "samsung",
  183. +        [AD1986A_SAMSUNG_P50]   = "samsung-p50",
  184.   };
  185.  
  186.   static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
  187. *************** static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
  188. *** 1024,1029 ****
  189.          SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
  190.          SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
  191.          SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
  192.          SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
  193.          SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG),
  194.          SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
  195. --- 1006,1012 ----
  196.          SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
  197.          SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
  198.          SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
  199. +        SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
  200.          SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
  201.          SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG),
  202.          SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
  203. *************** static int patch_ad1986a(struct hda_codec *codec)
  204. *** 1111,1117 ****
  205.                  spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
  206.                  break;
  207.          case AD1986A_LAPTOP_EAPD:
  208. -                spec->mixers[0] = ad1986a_laptop_eapd_mixers;
  209.                  spec->num_init_verbs = 2;
  210.                  spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  211.                  spec->multiout.max_channels = 2;
  212. --- 1094,1103 ----
  213.                  spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
  214.                  break;
  215.          case AD1986A_LAPTOP_EAPD:
  216. +                spec->num_mixers = 3;
  217. +                spec->mixers[0] = ad1986a_laptop_master_mixers;
  218. +                spec->mixers[1] = ad1986a_laptop_eapd_mixers;
  219. +                spec->mixers[2] = ad1986a_laptop_intmic_mixers;
  220.                  spec->num_init_verbs = 2;
  221.                  spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  222.                  spec->multiout.max_channels = 2;
  223. *************** static int patch_ad1986a(struct hda_codec *codec)
  224. *** 1122,1128 ****
  225.                  spec->input_mux = &ad1986a_laptop_eapd_capture_source;
  226.                  break;
  227.          case AD1986A_SAMSUNG:
  228. -                spec->mixers[0] = ad1986a_samsung_mixers;
  229.                  spec->num_init_verbs = 3;
  230.                  spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  231.                  spec->init_verbs[2] = ad1986a_automic_verbs;
  232. --- 1108,1116 ----
  233.                  spec->input_mux = &ad1986a_laptop_eapd_capture_source;
  234.                  break;
  235.          case AD1986A_SAMSUNG:
  236. +                spec->num_mixers = 2;
  237. +                spec->mixers[0] = ad1986a_laptop_master_mixers;
  238. +                spec->mixers[1] = ad1986a_laptop_eapd_mixers;
  239.                  spec->num_init_verbs = 3;
  240.                  spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  241.                  spec->init_verbs[2] = ad1986a_automic_verbs;
  242. *************** static int patch_ad1986a(struct hda_codec *codec)
  243. *** 1135,1142 ****
  244.                  codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
  245.                  codec->patch_ops.init = ad1986a_automic_init;
  246.                  break;
  247.          case AD1986A_LAPTOP_AUTOMUTE:
  248. -                spec->mixers[0] = ad1986a_laptop_automute_mixers;
  249.                  spec->num_init_verbs = 3;
  250.                  spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  251.                  spec->init_verbs[2] = ad1986a_hp_init_verbs;
  252. --- 1123,1150 ----
  253.                  codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
  254.                  codec->patch_ops.init = ad1986a_automic_init;
  255.                  break;
  256. +        case AD1986A_SAMSUNG_P50:
  257. +                spec->num_mixers = 2;
  258. +                spec->mixers[0] = ad1986a_automute_master_mixers;
  259. +                spec->mixers[1] = ad1986a_laptop_eapd_mixers;
  260. +                spec->num_init_verbs = 4;
  261. +                spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  262. +                spec->init_verbs[2] = ad1986a_automic_verbs;
  263. +                spec->init_verbs[3] = ad1986a_hp_init_verbs;
  264. +                spec->multiout.max_channels = 2;
  265. +                spec->multiout.num_dacs = 1;
  266. +                spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
  267. +                if (!is_jack_available(codec, 0x25))
  268. +                        spec->multiout.dig_out_nid = 0;
  269. +                spec->input_mux = &ad1986a_automic_capture_source;
  270. +                codec->patch_ops.unsol_event = ad1986a_samsung_p50_unsol_event;
  271. +                codec->patch_ops.init = ad1986a_samsung_p50_init;
  272. +                break;
  273.          case AD1986A_LAPTOP_AUTOMUTE:
  274. +                spec->num_mixers = 3;
  275. +                spec->mixers[0] = ad1986a_automute_master_mixers;
  276. +                spec->mixers[1] = ad1986a_laptop_eapd_mixers;
  277. +                spec->mixers[2] = ad1986a_laptop_intmic_mixers;
  278.                  spec->num_init_verbs = 3;
  279.                  spec->init_verbs[1] = ad1986a_eapd_init_verbs;
  280.                  spec->init_verbs[2] = ad1986a_hp_init_verbs;
  281. *************** static int patch_ad1986a(struct hda_codec *codec)
  282. *** 1148,1153 ****
  283.                  spec->input_mux = &ad1986a_laptop_eapd_capture_source;
  284.                  codec->patch_ops.unsol_event = ad1986a_hp_unsol_event;
  285.                  codec->patch_ops.init = ad1986a_hp_init;
  286.                  break;
  287.          case AD1986A_ULTRA:
  288.                  spec->mixers[0] = ad1986a_laptop_eapd_mixers;
  289. --- 1156,1165 ----
  290.                  spec->input_mux = &ad1986a_laptop_eapd_capture_source;
  291.                  codec->patch_ops.unsol_event = ad1986a_hp_unsol_event;
  292.                  codec->patch_ops.init = ad1986a_hp_init;
  293. +                /* Lenovo N100 seems to report the reversed bit
  294. +                 * for HP jack-sensing
  295. +                 */
  296. +                spec->inv_jack_detect = 1;
  297.                  break;
  298.          case AD1986A_ULTRA:
  299.                  spec->mixers[0] = ad1986a_laptop_eapd_mixers;

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right