Changeset 757
- Timestamp:
- Mar 11, 2023, 11:24:27 PM (2 years ago)
- Location:
- GPL/branches/uniaud32-exp
- Files:
-
- 1 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-exp/alsa-kernel/core/control.c
r755 r757 1216 1216 int ret; 1217 1217 1218 down_read(&card->controls_rwsem); 1218 1219 kctl = snd_ctl_find_id(card, &control->id); 1219 if (kctl == NULL) 1220 return -ENOENT; 1220 if (kctl == NULL) { 1221 ret = -ENOENT; 1222 goto unlock; 1223 } 1221 1224 1222 1225 index_offset = snd_ctl_get_ioff(kctl, &control->id); 1223 1226 vd = &kctl->vd[index_offset]; 1224 if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) 1225 return -EPERM; 1227 if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) { 1228 ret = -EPERM; 1229 goto unlock; 1230 } 1226 1231 1227 1232 snd_ctl_build_ioff(&control->id, kctl, index_offset); … … 1233 1238 ret = __snd_ctl_elem_info(card, kctl, &info, NULL); 1234 1239 if (ret < 0) 1235 return ret;1240 goto unlock; 1236 1241 #endif 1237 1242 … … 1243 1248 snd_power_unref(card); 1244 1249 if (ret < 0) 1245 return ret;1250 goto unlock; 1246 1251 if (!snd_ctl_skip_validation(&info) && 1247 1252 sanity_check_elem_value(card, control, &info, pattern) < 0) { … … 1251 1256 control->id.subdevice, control->id.name, 1252 1257 control->id.index); 1253 return -EINVAL; 1254 } 1258 ret = -EINVAL; 1259 goto unlock; 1260 } 1261 unlock: 1262 up_read(&card->controls_rwsem); 1255 1263 return ret; 1256 1264 } … … 1266 1274 return PTR_ERR(control); 1267 1275 1268 down_read(&card->controls_rwsem);1269 1276 result = snd_ctl_elem_read(card, control); 1270 up_read(&card->controls_rwsem);1271 1277 if (result < 0) 1272 1278 goto error; -
GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_native.c
r756 r757 1460 1460 snd_pcm_state_t state) 1461 1461 { 1462 if (substream->runtime->trigger_master == substream) 1462 if (substream->runtime->trigger_master == substream) { 1463 1463 substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); 1464 substream->runtime->stop_operating = true; 1465 } 1464 1466 } 1465 1467 -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_codec.h
r756 r757 259 259 unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ 260 260 unsigned int forced_resume:1; /* forced resume for jack */ 261 unsigned int no_stream_clean_at_suspend:1; /* do not clean streams at suspend */ 262 unsigned int ctl_dev_id:1; /* old control element id build behaviour */ 261 263 262 264 #ifdef CONFIG_PM -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pcm.h
r756 r757 107 107 108 108 /* If you change this don't forget to change rates[] table in pcm_native.c */ 109 #define SNDRV_PCM_RATE_5512 (1 <<0) /* 5512Hz */110 #define SNDRV_PCM_RATE_8000 (1 <<1) /* 8000Hz */111 #define SNDRV_PCM_RATE_11025 (1 <<2) /* 11025Hz */112 #define SNDRV_PCM_RATE_16000 (1 <<3) /* 16000Hz */113 #define SNDRV_PCM_RATE_22050 (1 <<4) /* 22050Hz */114 #define SNDRV_PCM_RATE_32000 (1 <<5) /* 32000Hz */115 #define SNDRV_PCM_RATE_44100 (1 <<6) /* 44100Hz */116 #define SNDRV_PCM_RATE_48000 (1 <<7) /* 48000Hz */117 #define SNDRV_PCM_RATE_64000 (1 <<8) /* 64000Hz */118 #define SNDRV_PCM_RATE_88200 (1 <<9) /* 88200Hz */119 #define SNDRV_PCM_RATE_96000 (1 <<10)/* 96000Hz */120 #define SNDRV_PCM_RATE_176400 (1 <<11)/* 176400Hz */121 #define SNDRV_PCM_RATE_192000 (1 <<12)/* 192000Hz */122 #define SNDRV_PCM_RATE_352800 (1 <<13)/* 352800Hz */123 #define SNDRV_PCM_RATE_384000 (1 <<14)/* 384000Hz */124 125 #define SNDRV_PCM_RATE_CONTINUOUS (1 <<30)/* continuous range */126 #define SNDRV_PCM_RATE_KNOT (1 <<31)/* supports more non-continuos rates */109 #define SNDRV_PCM_RATE_5512 (1U<<0) /* 5512Hz */ 110 #define SNDRV_PCM_RATE_8000 (1U<<1) /* 8000Hz */ 111 #define SNDRV_PCM_RATE_11025 (1U<<2) /* 11025Hz */ 112 #define SNDRV_PCM_RATE_16000 (1U<<3) /* 16000Hz */ 113 #define SNDRV_PCM_RATE_22050 (1U<<4) /* 22050Hz */ 114 #define SNDRV_PCM_RATE_32000 (1U<<5) /* 32000Hz */ 115 #define SNDRV_PCM_RATE_44100 (1U<<6) /* 44100Hz */ 116 #define SNDRV_PCM_RATE_48000 (1U<<7) /* 48000Hz */ 117 #define SNDRV_PCM_RATE_64000 (1U<<8) /* 64000Hz */ 118 #define SNDRV_PCM_RATE_88200 (1U<<9) /* 88200Hz */ 119 #define SNDRV_PCM_RATE_96000 (1U<<10) /* 96000Hz */ 120 #define SNDRV_PCM_RATE_176400 (1U<<11) /* 176400Hz */ 121 #define SNDRV_PCM_RATE_192000 (1U<<12) /* 192000Hz */ 122 #define SNDRV_PCM_RATE_352800 (1U<<13) /* 352800Hz */ 123 #define SNDRV_PCM_RATE_384000 (1U<<14) /* 384000Hz */ 124 125 #define SNDRV_PCM_RATE_CONTINUOUS (1U<<30) /* continuous range */ 126 #define SNDRV_PCM_RATE_KNOT (1U<<31) /* supports more non-continuos rates */ 127 127 128 128 #define SNDRV_PCM_RATE_8000_44100 (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\ -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-dapm.h
r738 r757 17 17 18 18 struct device; 19 struct snd_pcm_substream; 19 20 struct snd_soc_pcm_runtime; 20 21 struct soc_enum; -
GPL/branches/uniaud32-exp/alsa-kernel/include/sound/version.h
r756 r757 1 1 /* include/version.h */ 2 #define CONFIG_SND_VERSION "6.1. 0"2 #define CONFIG_SND_VERSION "6.1.18" 3 3 #define CONFIG_SND_DATE "" -
GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asequencer.h
r756 r757 348 348 349 349 /* event filter flags */ 350 #define SNDRV_SEQ_FILTER_BROADCAST (1 <<0) /* accept broadcast messages */351 #define SNDRV_SEQ_FILTER_MULTICAST (1 <<1) /* accept multicast messages */352 #define SNDRV_SEQ_FILTER_BOUNCE (1 <<2) /* accept bounce event in error */353 #define SNDRV_SEQ_FILTER_USE_EVENT (1 <<31) /* use event filter */350 #define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */ 351 #define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */ 352 #define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */ 353 #define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */ 354 354 355 355 struct snd_seq_client_info { -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_bind.c
r750 r757 147 147 error: 148 148 snd_hda_codec_cleanup_for_unbind(codec); 149 codec->preset = NULL; 149 150 return err; 150 151 } … … 169 170 codec->patch_ops.free(codec); 170 171 snd_hda_codec_cleanup_for_unbind(codec); 172 codec->preset = NULL; 171 173 module_put(dev->driver->owner); 172 174 return 0; -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_codec.c
r756 r757 808 808 snd_array_free(&codec->spdif_out); 809 809 snd_array_free(&codec->verbs); 810 codec->preset = NULL;811 810 codec->follower_dig_outs = NULL; 812 811 codec->spdif_status_reset = 0; … … 941 940 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; 942 941 codec->core.dev.release = snd_hda_codec_dev_release; 943 codec->core.exec_verb = codec_exec_verb;944 942 codec->core.type = HDA_DEV_LEGACY; 945 943 … … 1012 1010 return -EINVAL; 1013 1011 1012 codec->core.exec_verb = codec_exec_verb; 1014 1013 codec->card = card; 1015 1014 codec->addr = codec_addr; … … 2904 2903 if (codec->patch_ops.suspend) 2905 2904 codec->patch_ops.suspend(codec); 2906 hda_cleanup_all_streams(codec); 2905 if (!codec->no_stream_clean_at_suspend) 2906 hda_cleanup_all_streams(codec); 2907 2907 state = hda_set_power_state(codec, AC_PWRST_D3); 2908 2908 update_power_acct(codec, true); … … 3409 3409 if (!kctl) 3410 3410 return -ENOMEM; 3411 if (addr > 0) 3411 /* Do not use the id.device field for MIXER elements. 3412 * This field is for real device numbers (like PCM) but codecs 3413 * are hidden components from the user space view (unrelated 3414 * to the mixer element identification). 3415 */ 3416 if (addr > 0 && codec->ctl_dev_id) 3412 3417 kctl->id.device = addr; 3413 3418 if (idx > 0) … … 3420 3425 * primary codec), then try another control index 3421 3426 */ 3422 if (!addr && codec->core.addr) 3427 if (!addr && codec->core.addr) { 3423 3428 addr = codec->core.addr; 3424 else if (!idx && !knew->index) { 3429 if (!codec->ctl_dev_id) 3430 idx += 10 * addr; 3431 } else if (!idx && !knew->index) { 3425 3432 idx = find_empty_mixer_ctl_idx(codec, 3426 3433 knew->name, 0); -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_controller.c
r756 r757 1261 1261 codec->jackpoll_interval = chip->jackpoll_interval; 1262 1262 codec->beep_mode = chip->beep_mode; 1263 codec->ctl_dev_id = chip->ctl_dev_id; 1263 1264 codecs++; 1264 1265 } -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_controller.h
r710 r757 125 125 int codec_probe_mask; /* copied from probe_mask option */ 126 126 unsigned int beep_mode; 127 bool ctl_dev_id; 127 128 128 129 #ifdef CONFIG_SND_HDA_PATCH_LOADER -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_intel.c
r756 r757 56 56 #include <linux/vgaarb.h> 57 57 #include <linux/vga_switcheroo.h> 58 #include <linux/apple-gmux.h> 58 59 #include <linux/firmware.h> 59 60 #include <sound/hda_codec.h> … … 136 137 #endif 137 138 static bool dmic_detect = 1; 139 #ifndef TARGET_OS2 140 static bool ctl_dev_id = IS_ENABLED(CONFIG_SND_HDA_CTL_DEV_ID) ? 1 : 0; 141 #else 142 static bool ctl_dev_id = 0; 143 #endif 138 144 139 145 module_param_array(index, int, NULL, 0444); … … 174 180 "(0=off, 1=on) (default=1); " 175 181 "deprecated, use snd-intel-dspcfg.dsp_driver option instead"); 182 module_param(ctl_dev_id, bool, 0444); 183 MODULE_PARM_DESC(ctl_dev_id, "Use control device identifier (based on codec address)."); 176 184 177 185 #ifdef CONFIG_PM … … 1497 1505 */ 1498 1506 if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) && 1499 atpx_present())1507 (atpx_present() || apple_gmux_detect(NULL, NULL))) 1500 1508 return p; 1501 1509 pci_dev_put(p); … … 2329 2337 chip->beep_mode = beep_mode[dev]; 2330 2338 #endif 2339 2340 chip->ctl_dev_id = ctl_dev_id; 2331 2341 2332 2342 /* create codec instances */ -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_ca0132.c
r756 r757 2461 2461 { 2462 2462 int status = 0; 2463 unsigned int size = sizeof( dma_chan);2463 unsigned int size = sizeof(*dma_chan); 2464 2464 2465 2465 codec_dbg(codec, " dspio_alloc_dma_chan() -- begin\n"); -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_conexant.c
r741 r757 1188 1188 HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto), 1189 1189 HDA_CODEC_ENTRY(0x14f120d0, "CX11970", patch_conexant_auto), 1190 HDA_CODEC_ENTRY(0x14f120d1, "SN6180", patch_conexant_auto), 1190 1191 HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto), 1191 1192 HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto), -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_hdmi.c
r756 r757 180 180 181 181 bool dyn_pin_out; 182 bool static_pcm_mapping; 182 183 /* hdmi interrupt trigger control flag for Nvidia codec */ 183 184 bool hdmi_intr_trig_ctrl; … … 1542 1543 pcm_jack = pin_idx_to_pcm_jack(codec, per_pin); 1543 1544 1544 if (eld->eld_valid) { 1545 hdmi_attach_hda_pcm(spec, per_pin); 1546 hdmi_pcm_setup_pin(spec, per_pin); 1547 } else { 1548 hdmi_pcm_reset_pin(spec, per_pin); 1549 hdmi_detach_hda_pcm(spec, per_pin); 1550 } 1545 if (!spec->static_pcm_mapping) { 1546 if (eld->eld_valid) { 1547 hdmi_attach_hda_pcm(spec, per_pin); 1548 hdmi_pcm_setup_pin(spec, per_pin); 1549 } else { 1550 hdmi_pcm_reset_pin(spec, per_pin); 1551 hdmi_detach_hda_pcm(spec, per_pin); 1552 } 1553 } 1554 1551 1555 /* if pcm_idx == -1, it means this is in monitor connection event 1552 1556 * we can get the correct pcm_idx now. … … 1755 1759 switch (spec->silent_stream_type) { 1756 1760 case SILENT_STREAM_KAE: 1761 silent_stream_enable_i915(codec, per_pin); 1757 1762 silent_stream_set_kae(codec, per_pin, true); 1758 1763 break; … … 1992 1997 SND_PCI_QUIRK(0x103c, 0x870f, "HP", 1), 1993 1998 SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1), 1999 SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1), 2000 SND_PCI_QUIRK(0x103c, 0x8715, "HP", 1), 1994 2001 SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1), 1995 2002 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1), … … 2296 2303 int idx, pcm_num; 2297 2304 2298 /* limit the PCM devices to the codec converters */2299 pcm_num = spec->num_cvts;2305 /* limit the PCM devices to the codec converters or available PINs */ 2306 pcm_num = min(spec->num_cvts, spec->num_pins); 2300 2307 codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num); 2301 2308 … … 2393 2400 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); 2394 2401 struct hdmi_eld *pin_eld = &per_pin->sink_eld; 2402 2403 if (spec->static_pcm_mapping) { 2404 hdmi_attach_hda_pcm(spec, per_pin); 2405 hdmi_pcm_setup_pin(spec, per_pin); 2406 } 2395 2407 2396 2408 pin_eld->eld_valid = false; … … 2899 2911 int format) 2900 2912 { 2913 struct hdmi_spec *spec = codec->spec; 2914 int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id); 2915 struct hdmi_spec_per_pin *per_pin; 2916 int res; 2917 2918 if (pin_idx < 0) 2919 per_pin = NULL; 2920 else 2921 per_pin = get_pin(spec, pin_idx); 2922 2901 2923 haswell_verify_D0(codec, cvt_nid, pin_nid); 2902 return hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id, 2903 stream_tag, format); 2924 2925 if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) { 2926 silent_stream_set_kae(codec, per_pin, false); 2927 /* wait for pending transfers in codec to clear */ 2928 usleep_range(100, 200); 2929 } 2930 2931 res = hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id, 2932 stream_tag, format); 2933 2934 if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) { 2935 usleep_range(100, 200); 2936 silent_stream_set_kae(codec, per_pin, true); 2937 } 2938 2939 return res; 2904 2940 } 2905 2941 … … 2920 2956 } 2921 2957 } 2958 2959 #ifdef CONFIG_PM 2960 static int i915_adlp_hdmi_suspend(struct hda_codec *codec) 2961 { 2962 struct hdmi_spec *spec = codec->spec; 2963 bool silent_streams = false; 2964 int pin_idx, res; 2965 2966 res = generic_hdmi_suspend(codec); 2967 2968 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { 2969 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); 2970 2971 if (per_pin->silent_stream) { 2972 silent_streams = true; 2973 break; 2974 } 2975 } 2976 2977 if (silent_streams && spec->silent_stream_type == SILENT_STREAM_KAE) { 2978 /* 2979 * stream-id should remain programmed when codec goes 2980 * to runtime suspend 2981 */ 2982 codec->no_stream_clean_at_suspend = 1; 2983 2984 /* 2985 * the system might go to S3, in which case keep-alive 2986 * must be reprogrammed upon resume 2987 */ 2988 codec->forced_resume = 1; 2989 2990 codec_dbg(codec, "HDMI: KAE active at suspend\n"); 2991 } else { 2992 codec->no_stream_clean_at_suspend = 0; 2993 codec->forced_resume = 0; 2994 } 2995 2996 return res; 2997 } 2998 2999 static int i915_adlp_hdmi_resume(struct hda_codec *codec) 3000 { 3001 struct hdmi_spec *spec = codec->spec; 3002 int pin_idx, res; 3003 3004 res = generic_hdmi_resume(codec); 3005 3006 /* KAE not programmed at suspend, nothing to do here */ 3007 if (!codec->no_stream_clean_at_suspend) 3008 return res; 3009 3010 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { 3011 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); 3012 3013 /* 3014 * If system was in suspend with monitor connected, 3015 * the codec setting may have been lost. Re-enable 3016 * keep-alive. 3017 */ 3018 if (per_pin->silent_stream) { 3019 unsigned int param; 3020 3021 param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0, 3022 AC_VERB_GET_CONV, 0); 3023 if (!param) { 3024 codec_dbg(codec, "HDMI: KAE: restore stream id\n"); 3025 silent_stream_enable_i915(codec, per_pin); 3026 } 3027 3028 param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0, 3029 AC_VERB_GET_DIGI_CONVERT_1, 0); 3030 if (!(param & (AC_DIG3_KAE << 16))) { 3031 codec_dbg(codec, "HDMI: KAE: restore DIG3_KAE\n"); 3032 silent_stream_set_kae(codec, per_pin, true); 3033 } 3034 } 3035 } 3036 3037 return res; 3038 } 3039 #endif 2922 3040 2923 3041 /* precondition and allocation for Intel codecs */ … … 3051 3169 spec = codec->spec; 3052 3170 3053 if (spec->silent_stream_type) 3171 if (spec->silent_stream_type) { 3054 3172 spec->silent_stream_type = SILENT_STREAM_KAE; 3173 3174 #ifdef CONFIG_PM 3175 codec->patch_ops.resume = i915_adlp_hdmi_resume; 3176 codec->patch_ops.suspend = i915_adlp_hdmi_suspend; 3177 #endif 3178 } 3055 3179 } 3056 3180 … … 4325 4449 4326 4450 spec = codec->spec; 4451 4452 spec->static_pcm_mapping = true; 4327 4453 4328 4454 spec->ops.pin_get_eld = atihdmi_pin_get_eld; -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_realtek.c
r756 r757 844 844 break; 845 845 case 7: 846 alc_setup_gpio(codec, 0x0 3);846 alc_setup_gpio(codec, 0x04); 847 847 break; 848 848 case 5: … … 4214 4214 bool hp_pin_sense; 4215 4215 4216 if (!hp_pin)4217 hp_pin = 0x21;4218 4219 msleep(30);4220 4221 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);4222 4223 if (hp_pin_sense)4224 msleep(2);4225 4226 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */4227 4216 if (spec->ultra_low_power) { 4228 4217 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); … … 4233 4222 msleep(30); 4234 4223 } 4224 4225 if (!hp_pin) 4226 hp_pin = 0x21; 4227 4228 msleep(30); 4229 4230 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 4231 4232 if (hp_pin_sense) 4233 msleep(2); 4234 4235 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 4235 4236 4236 4237 snd_hda_codec_write(codec, hp_pin, 0, … … 4363 4364 bool hp1_pin_sense, hp2_pin_sense; 4364 4365 4366 if (spec->ultra_low_power) { 4367 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); 4368 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 4369 alc_update_coef_idx(codec, 0x33, 1<<11, 0); 4370 msleep(30); 4371 } 4372 4365 4373 if (spec->codec_variant != ALC269_TYPE_ALC287 && 4366 4374 spec->codec_variant != ALC269_TYPE_ALC245) … … 4389 4397 4390 4398 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 4391 if (spec->ultra_low_power) {4392 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);4393 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);4394 alc_update_coef_idx(codec, 0x33, 1<<11, 0);4395 msleep(30);4396 }4397 4399 4398 4400 if (hp1_pin_sense || spec->ultra_low_power) … … 5330 5332 } 5331 5333 5334 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec, 5335 const struct hda_fixup *fix, int action) 5336 { 5337 struct alc_spec *spec = codec->spec; 5338 5339 if (action == HDA_FIXUP_ACT_PRE_PROBE) 5340 spec->micmute_led_polarity = 1; 5341 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 5342 } 5343 5332 5344 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, 5333 5345 const struct hda_fixup *fix, int action) … … 5351 5363 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 5352 5364 alc285_fixup_hp_coef_micmute_led(codec, fix, action); 5365 } 5366 5367 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec, 5368 const struct hda_fixup *fix, int action) 5369 { 5370 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 5371 alc285_fixup_hp_gpio_micmute_led(codec, fix, action); 5353 5372 } 5354 5373 … … 7595 7614 }; 7596 7615 struct alc_spec *spec = codec->spec; 7616 7617 switch (action) { 7618 case HDA_FIXUP_ACT_PRE_PROBE: 7619 snd_hda_apply_pincfgs(codec, pincfgs); 7620 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7621 spec->gen.preferred_dacs = preferred_pairs; 7622 break; 7623 } 7624 } 7625 7626 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec, 7627 const struct hda_fixup *fix, int action) 7628 { 7629 static const struct hda_pintbl pincfgs[] = { 7630 { 0x14, 0x90170151 }, 7631 { 0x17, 0x90170150 }, 7632 {0} 7633 }; 7634 static const hda_nid_t conn[] = { 0x02, 0x03 }; 7635 static const hda_nid_t preferred_pairs[] = { 7636 0x14, 0x02, 7637 0x17, 0x03, 7638 0x21, 0x02, 7639 0 7640 }; 7641 struct alc_spec *spec = codec->spec; 7642 7643 alc_fixup_no_shutup(codec, fix, action); 7597 7644 7598 7645 switch (action) { … … 7780 7827 ALC285_FIXUP_HP_GPIO_LED, 7781 7828 ALC285_FIXUP_HP_MUTE_LED, 7829 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED, 7782 7830 ALC236_FIXUP_HP_GPIO_LED, 7783 7831 ALC236_FIXUP_HP_MUTE_LED, … … 7848 7896 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 7849 7897 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, 7898 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS, 7899 ALC236_FIXUP_DELL_DUAL_CODECS, 7850 7900 }; 7851 7901 … … 9482 9532 .type = HDA_FIXUP_FUNC, 9483 9533 .v.func = alc285_fixup_hp_mute_led, 9534 }, 9535 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = { 9536 .type = HDA_FIXUP_FUNC, 9537 .v.func = alc285_fixup_hp_spectre_x360_mute_led, 9484 9538 }, 9485 9539 [ALC236_FIXUP_HP_GPIO_LED] = { … … 10121 10175 .chained = true, 10122 10176 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 10177 }, 10178 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = { 10179 .type = HDA_FIXUP_FUNC, 10180 .v.func = alc295_fixup_dell_inspiron_top_speakers, 10181 .chained = true, 10182 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 10183 }, 10184 [ALC236_FIXUP_DELL_DUAL_CODECS] = { 10185 .type = HDA_FIXUP_PINS, 10186 .v.func = alc1220_fixup_gb_dual_codecs, 10187 .chained = true, 10188 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 10123 10189 }, 10124 10190 }; … … 10163 10229 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10164 10230 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 10231 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10165 10232 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 10166 10233 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), … … 10222 10289 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK), 10223 10290 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK), 10291 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10292 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10293 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10294 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 10295 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 10296 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10297 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 10298 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10299 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 10224 10300 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10225 10301 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), … … 10304 10380 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10305 10381 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10382 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), 10306 10383 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10307 10384 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), … … 10373 10450 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10374 10451 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10452 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10375 10453 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10376 10454 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), … … 10381 10459 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10382 10460 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10461 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10462 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10463 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10464 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10465 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10466 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10467 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10468 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10469 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED), 10470 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED), 10471 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED), 10472 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED), 10473 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED), 10474 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED), 10475 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10476 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED), 10383 10477 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 10384 10478 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), … … 10426 10520 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2), 10427 10521 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 10522 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), 10428 10523 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 10429 10524 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), … … 10469 10564 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), 10470 10565 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 10566 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP), 10471 10567 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 10472 10568 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), … … 10647 10743 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 10648 10744 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 10745 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE), 10649 10746 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), 10650 10747 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), … … 12030 12127 } 12031 12128 12129 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec, 12130 const struct hda_fixup *fix, int action) 12131 { 12132 struct alc_spec *spec = codec->spec; 12133 12134 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12135 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12136 spec->gen.hp_automute_hook = alc897_hp_automute_hook; 12137 } 12138 } 12139 12032 12140 static const struct coef_fw alc668_coefs[] = { 12033 12141 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), … … 12113 12221 ALC897_FIXUP_HEADSET_MIC_PIN, 12114 12222 ALC897_FIXUP_HP_HSMIC_VERB, 12223 ALC897_FIXUP_LENOVO_HEADSET_MODE, 12224 ALC897_FIXUP_HEADSET_MIC_PIN2, 12115 12225 }; 12116 12226 … … 12726 12836 { } 12727 12837 }, 12838 }, 12839 #endif 12840 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = { 12841 .type = HDA_FIXUP_FUNC, 12842 .v.func = alc897_fixup_lenovo_headset_mode, 12843 }, 12844 #ifdef NOT_USED 12845 [ALC897_FIXUP_HEADSET_MIC_PIN2] = { 12846 .type = HDA_FIXUP_PINS, 12847 .v.pins = (const struct hda_pintbl[]) { 12848 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 12849 { } 12850 }, 12851 .chained = true, 12852 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE 12728 12853 }, 12729 12854 #endif … … 12753 12878 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12754 12879 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 12880 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12755 12881 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12756 12882 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), … … 12780 12906 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN), 12781 12907 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN), 12908 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2), 12782 12909 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 12783 12910 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), -
GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_via.c
r739 r757 828 828 nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn, 829 829 ARRAY_SIZE(conn) - 1); 830 if (nums < 0) 831 return nums; 832 830 833 for (i = 0; i < nums; i++) { 831 834 if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT) -
GPL/branches/uniaud32-exp/alsa-kernel/synth/emux/emux_nrpn.c
r697 r757 350 350 int param) 351 351 { 352 if (param >= ARRAY_SIZE(chan->control)) 353 return -EINVAL; 354 352 355 return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), 353 356 port, chan, param,
Note:
See TracChangeset
for help on using the changeset viewer.