diff options
Diffstat (limited to 'sound')
28 files changed, 597 insertions, 455 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index f038f5afafe2..f0b0e14497a5 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -288,6 +288,10 @@ static bool snd_ctl_remove_numid_conflict(struct snd_card *card, | |||
288 | { | 288 | { |
289 | struct snd_kcontrol *kctl; | 289 | struct snd_kcontrol *kctl; |
290 | 290 | ||
291 | /* Make sure that the ids assigned to the control do not wrap around */ | ||
292 | if (card->last_numid >= UINT_MAX - count) | ||
293 | card->last_numid = 0; | ||
294 | |||
291 | list_for_each_entry(kctl, &card->controls, list) { | 295 | list_for_each_entry(kctl, &card->controls, list) { |
292 | if (kctl->id.numid < card->last_numid + 1 + count && | 296 | if (kctl->id.numid < card->last_numid + 1 + count && |
293 | kctl->id.numid + kctl->count > card->last_numid + 1) { | 297 | kctl->id.numid + kctl->count > card->last_numid + 1) { |
@@ -330,6 +334,7 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) | |||
330 | { | 334 | { |
331 | struct snd_ctl_elem_id id; | 335 | struct snd_ctl_elem_id id; |
332 | unsigned int idx; | 336 | unsigned int idx; |
337 | unsigned int count; | ||
333 | int err = -EINVAL; | 338 | int err = -EINVAL; |
334 | 339 | ||
335 | if (! kcontrol) | 340 | if (! kcontrol) |
@@ -337,6 +342,9 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) | |||
337 | if (snd_BUG_ON(!card || !kcontrol->info)) | 342 | if (snd_BUG_ON(!card || !kcontrol->info)) |
338 | goto error; | 343 | goto error; |
339 | id = kcontrol->id; | 344 | id = kcontrol->id; |
345 | if (id.index > UINT_MAX - kcontrol->count) | ||
346 | goto error; | ||
347 | |||
340 | down_write(&card->controls_rwsem); | 348 | down_write(&card->controls_rwsem); |
341 | if (snd_ctl_find_id(card, &id)) { | 349 | if (snd_ctl_find_id(card, &id)) { |
342 | up_write(&card->controls_rwsem); | 350 | up_write(&card->controls_rwsem); |
@@ -358,8 +366,9 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) | |||
358 | card->controls_count += kcontrol->count; | 366 | card->controls_count += kcontrol->count; |
359 | kcontrol->id.numid = card->last_numid + 1; | 367 | kcontrol->id.numid = card->last_numid + 1; |
360 | card->last_numid += kcontrol->count; | 368 | card->last_numid += kcontrol->count; |
369 | count = kcontrol->count; | ||
361 | up_write(&card->controls_rwsem); | 370 | up_write(&card->controls_rwsem); |
362 | for (idx = 0; idx < kcontrol->count; idx++, id.index++, id.numid++) | 371 | for (idx = 0; idx < count; idx++, id.index++, id.numid++) |
363 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); | 372 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); |
364 | return 0; | 373 | return 0; |
365 | 374 | ||
@@ -388,6 +397,7 @@ int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, | |||
388 | bool add_on_replace) | 397 | bool add_on_replace) |
389 | { | 398 | { |
390 | struct snd_ctl_elem_id id; | 399 | struct snd_ctl_elem_id id; |
400 | unsigned int count; | ||
391 | unsigned int idx; | 401 | unsigned int idx; |
392 | struct snd_kcontrol *old; | 402 | struct snd_kcontrol *old; |
393 | int ret; | 403 | int ret; |
@@ -423,8 +433,9 @@ add: | |||
423 | card->controls_count += kcontrol->count; | 433 | card->controls_count += kcontrol->count; |
424 | kcontrol->id.numid = card->last_numid + 1; | 434 | kcontrol->id.numid = card->last_numid + 1; |
425 | card->last_numid += kcontrol->count; | 435 | card->last_numid += kcontrol->count; |
436 | count = kcontrol->count; | ||
426 | up_write(&card->controls_rwsem); | 437 | up_write(&card->controls_rwsem); |
427 | for (idx = 0; idx < kcontrol->count; idx++, id.index++, id.numid++) | 438 | for (idx = 0; idx < count; idx++, id.index++, id.numid++) |
428 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); | 439 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); |
429 | return 0; | 440 | return 0; |
430 | 441 | ||
@@ -897,9 +908,9 @@ static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, | |||
897 | result = kctl->put(kctl, control); | 908 | result = kctl->put(kctl, control); |
898 | } | 909 | } |
899 | if (result > 0) { | 910 | if (result > 0) { |
911 | struct snd_ctl_elem_id id = control->id; | ||
900 | up_read(&card->controls_rwsem); | 912 | up_read(&card->controls_rwsem); |
901 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, | 913 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &id); |
902 | &control->id); | ||
903 | return 0; | 914 | return 0; |
904 | } | 915 | } |
905 | } | 916 | } |
@@ -991,6 +1002,7 @@ static int snd_ctl_elem_unlock(struct snd_ctl_file *file, | |||
991 | 1002 | ||
992 | struct user_element { | 1003 | struct user_element { |
993 | struct snd_ctl_elem_info info; | 1004 | struct snd_ctl_elem_info info; |
1005 | struct snd_card *card; | ||
994 | void *elem_data; /* element data */ | 1006 | void *elem_data; /* element data */ |
995 | unsigned long elem_data_size; /* size of element data in bytes */ | 1007 | unsigned long elem_data_size; /* size of element data in bytes */ |
996 | void *tlv_data; /* TLV data */ | 1008 | void *tlv_data; /* TLV data */ |
@@ -1034,7 +1046,9 @@ static int snd_ctl_elem_user_get(struct snd_kcontrol *kcontrol, | |||
1034 | { | 1046 | { |
1035 | struct user_element *ue = kcontrol->private_data; | 1047 | struct user_element *ue = kcontrol->private_data; |
1036 | 1048 | ||
1049 | mutex_lock(&ue->card->user_ctl_lock); | ||
1037 | memcpy(&ucontrol->value, ue->elem_data, ue->elem_data_size); | 1050 | memcpy(&ucontrol->value, ue->elem_data, ue->elem_data_size); |
1051 | mutex_unlock(&ue->card->user_ctl_lock); | ||
1038 | return 0; | 1052 | return 0; |
1039 | } | 1053 | } |
1040 | 1054 | ||
@@ -1043,10 +1057,12 @@ static int snd_ctl_elem_user_put(struct snd_kcontrol *kcontrol, | |||
1043 | { | 1057 | { |
1044 | int change; | 1058 | int change; |
1045 | struct user_element *ue = kcontrol->private_data; | 1059 | struct user_element *ue = kcontrol->private_data; |
1046 | 1060 | ||
1061 | mutex_lock(&ue->card->user_ctl_lock); | ||
1047 | change = memcmp(&ucontrol->value, ue->elem_data, ue->elem_data_size) != 0; | 1062 | change = memcmp(&ucontrol->value, ue->elem_data, ue->elem_data_size) != 0; |
1048 | if (change) | 1063 | if (change) |
1049 | memcpy(ue->elem_data, &ucontrol->value, ue->elem_data_size); | 1064 | memcpy(ue->elem_data, &ucontrol->value, ue->elem_data_size); |
1065 | mutex_unlock(&ue->card->user_ctl_lock); | ||
1050 | return change; | 1066 | return change; |
1051 | } | 1067 | } |
1052 | 1068 | ||
@@ -1066,19 +1082,32 @@ static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol, | |||
1066 | new_data = memdup_user(tlv, size); | 1082 | new_data = memdup_user(tlv, size); |
1067 | if (IS_ERR(new_data)) | 1083 | if (IS_ERR(new_data)) |
1068 | return PTR_ERR(new_data); | 1084 | return PTR_ERR(new_data); |
1085 | mutex_lock(&ue->card->user_ctl_lock); | ||
1069 | change = ue->tlv_data_size != size; | 1086 | change = ue->tlv_data_size != size; |
1070 | if (!change) | 1087 | if (!change) |
1071 | change = memcmp(ue->tlv_data, new_data, size); | 1088 | change = memcmp(ue->tlv_data, new_data, size); |
1072 | kfree(ue->tlv_data); | 1089 | kfree(ue->tlv_data); |
1073 | ue->tlv_data = new_data; | 1090 | ue->tlv_data = new_data; |
1074 | ue->tlv_data_size = size; | 1091 | ue->tlv_data_size = size; |
1092 | mutex_unlock(&ue->card->user_ctl_lock); | ||
1075 | } else { | 1093 | } else { |
1076 | if (! ue->tlv_data_size || ! ue->tlv_data) | 1094 | int ret = 0; |
1077 | return -ENXIO; | 1095 | |
1078 | if (size < ue->tlv_data_size) | 1096 | mutex_lock(&ue->card->user_ctl_lock); |
1079 | return -ENOSPC; | 1097 | if (!ue->tlv_data_size || !ue->tlv_data) { |
1098 | ret = -ENXIO; | ||
1099 | goto err_unlock; | ||
1100 | } | ||
1101 | if (size < ue->tlv_data_size) { | ||
1102 | ret = -ENOSPC; | ||
1103 | goto err_unlock; | ||
1104 | } | ||
1080 | if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size)) | 1105 | if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size)) |
1081 | return -EFAULT; | 1106 | ret = -EFAULT; |
1107 | err_unlock: | ||
1108 | mutex_unlock(&ue->card->user_ctl_lock); | ||
1109 | if (ret) | ||
1110 | return ret; | ||
1082 | } | 1111 | } |
1083 | return change; | 1112 | return change; |
1084 | } | 1113 | } |
@@ -1136,8 +1165,6 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, | |||
1136 | struct user_element *ue; | 1165 | struct user_element *ue; |
1137 | int idx, err; | 1166 | int idx, err; |
1138 | 1167 | ||
1139 | if (!replace && card->user_ctl_count >= MAX_USER_CONTROLS) | ||
1140 | return -ENOMEM; | ||
1141 | if (info->count < 1) | 1168 | if (info->count < 1) |
1142 | return -EINVAL; | 1169 | return -EINVAL; |
1143 | access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : | 1170 | access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : |
@@ -1146,21 +1173,16 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, | |||
1146 | SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)); | 1173 | SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)); |
1147 | info->id.numid = 0; | 1174 | info->id.numid = 0; |
1148 | memset(&kctl, 0, sizeof(kctl)); | 1175 | memset(&kctl, 0, sizeof(kctl)); |
1149 | down_write(&card->controls_rwsem); | 1176 | |
1150 | _kctl = snd_ctl_find_id(card, &info->id); | 1177 | if (replace) { |
1151 | err = 0; | 1178 | err = snd_ctl_remove_user_ctl(file, &info->id); |
1152 | if (_kctl) { | 1179 | if (err) |
1153 | if (replace) | 1180 | return err; |
1154 | err = snd_ctl_remove(card, _kctl); | ||
1155 | else | ||
1156 | err = -EBUSY; | ||
1157 | } else { | ||
1158 | if (replace) | ||
1159 | err = -ENOENT; | ||
1160 | } | 1181 | } |
1161 | up_write(&card->controls_rwsem); | 1182 | |
1162 | if (err < 0) | 1183 | if (card->user_ctl_count >= MAX_USER_CONTROLS) |
1163 | return err; | 1184 | return -ENOMEM; |
1185 | |||
1164 | memcpy(&kctl.id, &info->id, sizeof(info->id)); | 1186 | memcpy(&kctl.id, &info->id, sizeof(info->id)); |
1165 | kctl.count = info->owner ? info->owner : 1; | 1187 | kctl.count = info->owner ? info->owner : 1; |
1166 | access |= SNDRV_CTL_ELEM_ACCESS_USER; | 1188 | access |= SNDRV_CTL_ELEM_ACCESS_USER; |
@@ -1210,6 +1232,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, | |||
1210 | ue = kzalloc(sizeof(struct user_element) + private_size, GFP_KERNEL); | 1232 | ue = kzalloc(sizeof(struct user_element) + private_size, GFP_KERNEL); |
1211 | if (ue == NULL) | 1233 | if (ue == NULL) |
1212 | return -ENOMEM; | 1234 | return -ENOMEM; |
1235 | ue->card = card; | ||
1213 | ue->info = *info; | 1236 | ue->info = *info; |
1214 | ue->info.access = 0; | 1237 | ue->info.access = 0; |
1215 | ue->elem_data = (char *)ue + sizeof(*ue); | 1238 | ue->elem_data = (char *)ue + sizeof(*ue); |
@@ -1321,8 +1344,9 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file, | |||
1321 | } | 1344 | } |
1322 | err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); | 1345 | err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); |
1323 | if (err > 0) { | 1346 | if (err > 0) { |
1347 | struct snd_ctl_elem_id id = kctl->id; | ||
1324 | up_read(&card->controls_rwsem); | 1348 | up_read(&card->controls_rwsem); |
1325 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &kctl->id); | 1349 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &id); |
1326 | return 0; | 1350 | return 0; |
1327 | } | 1351 | } |
1328 | } else { | 1352 | } else { |
diff --git a/sound/core/init.c b/sound/core/init.c index 5ee83845c5de..7bdfd19e24a8 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
@@ -232,6 +232,7 @@ int snd_card_new(struct device *parent, int idx, const char *xid, | |||
232 | INIT_LIST_HEAD(&card->devices); | 232 | INIT_LIST_HEAD(&card->devices); |
233 | init_rwsem(&card->controls_rwsem); | 233 | init_rwsem(&card->controls_rwsem); |
234 | rwlock_init(&card->ctl_files_rwlock); | 234 | rwlock_init(&card->ctl_files_rwlock); |
235 | mutex_init(&card->user_ctl_lock); | ||
235 | INIT_LIST_HEAD(&card->controls); | 236 | INIT_LIST_HEAD(&card->controls); |
236 | INIT_LIST_HEAD(&card->ctl_files); | 237 | INIT_LIST_HEAD(&card->ctl_files); |
237 | spin_lock_init(&card->files_lock); | 238 | spin_lock_init(&card->files_lock); |
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index b684c6e4f301..dabe41975a9d 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c | |||
@@ -898,6 +898,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec, | |||
898 | if (!strcmp(codec->modelname, models->name)) { | 898 | if (!strcmp(codec->modelname, models->name)) { |
899 | codec->fixup_id = models->id; | 899 | codec->fixup_id = models->id; |
900 | codec->fixup_name = models->name; | 900 | codec->fixup_name = models->name; |
901 | codec->fixup_list = fixlist; | ||
901 | codec->fixup_forced = 1; | 902 | codec->fixup_forced = 1; |
902 | return; | 903 | return; |
903 | } | 904 | } |
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 480bbddbd801..6df04d91c93c 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c | |||
@@ -193,7 +193,8 @@ azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream) | |||
193 | dsp_unlock(azx_dev); | 193 | dsp_unlock(azx_dev); |
194 | return azx_dev; | 194 | return azx_dev; |
195 | } | 195 | } |
196 | if (!res) | 196 | if (!res || |
197 | (chip->driver_caps & AZX_DCAPS_REVERSE_ASSIGN)) | ||
197 | res = azx_dev; | 198 | res = azx_dev; |
198 | } | 199 | } |
199 | dsp_unlock(azx_dev); | 200 | dsp_unlock(azx_dev); |
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c index 9d07e4edacdb..8b4940ba33d6 100644 --- a/sound/pci/hda/hda_i915.c +++ b/sound/pci/hda/hda_i915.c | |||
@@ -20,24 +20,71 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <sound/core.h> | 21 | #include <sound/core.h> |
22 | #include <drm/i915_powerwell.h> | 22 | #include <drm/i915_powerwell.h> |
23 | #include "hda_priv.h" | ||
23 | #include "hda_i915.h" | 24 | #include "hda_i915.h" |
24 | 25 | ||
25 | static void (*get_power)(void); | 26 | /* Intel HSW/BDW display HDA controller Extended Mode registers. |
26 | static void (*put_power)(void); | 27 | * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display |
28 | * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N | ||
29 | * The values will be lost when the display power well is disabled. | ||
30 | */ | ||
31 | #define ICH6_REG_EM4 0x100c | ||
32 | #define ICH6_REG_EM5 0x1010 | ||
33 | |||
34 | static int (*get_power)(void); | ||
35 | static int (*put_power)(void); | ||
36 | static int (*get_cdclk)(void); | ||
27 | 37 | ||
28 | void hda_display_power(bool enable) | 38 | int hda_display_power(bool enable) |
29 | { | 39 | { |
30 | if (!get_power || !put_power) | 40 | if (!get_power || !put_power) |
31 | return; | 41 | return -ENODEV; |
32 | 42 | ||
33 | pr_debug("HDA display power %s \n", | 43 | pr_debug("HDA display power %s \n", |
34 | enable ? "Enable" : "Disable"); | 44 | enable ? "Enable" : "Disable"); |
35 | if (enable) | 45 | if (enable) |
36 | get_power(); | 46 | return get_power(); |
37 | else | 47 | else |
38 | put_power(); | 48 | return put_power(); |
49 | } | ||
50 | |||
51 | void haswell_set_bclk(struct azx *chip) | ||
52 | { | ||
53 | int cdclk_freq; | ||
54 | unsigned int bclk_m, bclk_n; | ||
55 | |||
56 | if (!get_cdclk) | ||
57 | return; | ||
58 | |||
59 | cdclk_freq = get_cdclk(); | ||
60 | switch (cdclk_freq) { | ||
61 | case 337500: | ||
62 | bclk_m = 16; | ||
63 | bclk_n = 225; | ||
64 | break; | ||
65 | |||
66 | case 450000: | ||
67 | default: /* default CDCLK 450MHz */ | ||
68 | bclk_m = 4; | ||
69 | bclk_n = 75; | ||
70 | break; | ||
71 | |||
72 | case 540000: | ||
73 | bclk_m = 4; | ||
74 | bclk_n = 90; | ||
75 | break; | ||
76 | |||
77 | case 675000: | ||
78 | bclk_m = 8; | ||
79 | bclk_n = 225; | ||
80 | break; | ||
81 | } | ||
82 | |||
83 | azx_writew(chip, EM4, bclk_m); | ||
84 | azx_writew(chip, EM5, bclk_n); | ||
39 | } | 85 | } |
40 | 86 | ||
87 | |||
41 | int hda_i915_init(void) | 88 | int hda_i915_init(void) |
42 | { | 89 | { |
43 | int err = 0; | 90 | int err = 0; |
@@ -55,6 +102,10 @@ int hda_i915_init(void) | |||
55 | return -ENODEV; | 102 | return -ENODEV; |
56 | } | 103 | } |
57 | 104 | ||
105 | get_cdclk = symbol_request(i915_get_cdclk_freq); | ||
106 | if (!get_cdclk) /* may have abnormal BCLK and audio playback rate */ | ||
107 | pr_warn("hda-i915: get_cdclk symbol get fail\n"); | ||
108 | |||
58 | pr_debug("HDA driver get symbol successfully from i915 module\n"); | 109 | pr_debug("HDA driver get symbol successfully from i915 module\n"); |
59 | 110 | ||
60 | return err; | 111 | return err; |
@@ -70,6 +121,10 @@ int hda_i915_exit(void) | |||
70 | symbol_put(i915_release_power_well); | 121 | symbol_put(i915_release_power_well); |
71 | put_power = NULL; | 122 | put_power = NULL; |
72 | } | 123 | } |
124 | if (get_cdclk) { | ||
125 | symbol_put(i915_get_cdclk_freq); | ||
126 | get_cdclk = NULL; | ||
127 | } | ||
73 | 128 | ||
74 | return 0; | 129 | return 0; |
75 | } | 130 | } |
diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h index 5a63da2c53e5..e6072c627583 100644 --- a/sound/pci/hda/hda_i915.h +++ b/sound/pci/hda/hda_i915.h | |||
@@ -17,11 +17,13 @@ | |||
17 | #define __SOUND_HDA_I915_H | 17 | #define __SOUND_HDA_I915_H |
18 | 18 | ||
19 | #ifdef CONFIG_SND_HDA_I915 | 19 | #ifdef CONFIG_SND_HDA_I915 |
20 | void hda_display_power(bool enable); | 20 | int hda_display_power(bool enable); |
21 | void haswell_set_bclk(struct azx *chip); | ||
21 | int hda_i915_init(void); | 22 | int hda_i915_init(void); |
22 | int hda_i915_exit(void); | 23 | int hda_i915_exit(void); |
23 | #else | 24 | #else |
24 | static inline void hda_display_power(bool enable) {} | 25 | static inline int hda_display_power(bool enable) { return 0; } |
26 | static inline void haswell_set_bclk(struct azx *chip) { return; } | ||
25 | static inline int hda_i915_init(void) | 27 | static inline int hda_i915_init(void) |
26 | { | 28 | { |
27 | return -ENODEV; | 29 | return -ENODEV; |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bb65a124e006..83cd19017cf3 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -62,9 +62,9 @@ | |||
62 | #include <linux/vga_switcheroo.h> | 62 | #include <linux/vga_switcheroo.h> |
63 | #include <linux/firmware.h> | 63 | #include <linux/firmware.h> |
64 | #include "hda_codec.h" | 64 | #include "hda_codec.h" |
65 | #include "hda_i915.h" | ||
66 | #include "hda_controller.h" | 65 | #include "hda_controller.h" |
67 | #include "hda_priv.h" | 66 | #include "hda_priv.h" |
67 | #include "hda_i915.h" | ||
68 | 68 | ||
69 | 69 | ||
70 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 70 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
@@ -227,7 +227,7 @@ enum { | |||
227 | /* quirks for Intel PCH */ | 227 | /* quirks for Intel PCH */ |
228 | #define AZX_DCAPS_INTEL_PCH_NOPM \ | 228 | #define AZX_DCAPS_INTEL_PCH_NOPM \ |
229 | (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \ | 229 | (AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_BUFSIZE | \ |
230 | AZX_DCAPS_COUNT_LPIB_DELAY) | 230 | AZX_DCAPS_COUNT_LPIB_DELAY | AZX_DCAPS_REVERSE_ASSIGN) |
231 | 231 | ||
232 | #define AZX_DCAPS_INTEL_PCH \ | 232 | #define AZX_DCAPS_INTEL_PCH \ |
233 | (AZX_DCAPS_INTEL_PCH_NOPM | AZX_DCAPS_PM_RUNTIME) | 233 | (AZX_DCAPS_INTEL_PCH_NOPM | AZX_DCAPS_PM_RUNTIME) |
@@ -288,6 +288,11 @@ static char *driver_short_names[] = { | |||
288 | [AZX_DRIVER_GENERIC] = "HD-Audio Generic", | 288 | [AZX_DRIVER_GENERIC] = "HD-Audio Generic", |
289 | }; | 289 | }; |
290 | 290 | ||
291 | struct hda_intel { | ||
292 | struct azx chip; | ||
293 | }; | ||
294 | |||
295 | |||
291 | #ifdef CONFIG_X86 | 296 | #ifdef CONFIG_X86 |
292 | static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) | 297 | static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) |
293 | { | 298 | { |
@@ -591,7 +596,7 @@ static int azx_suspend(struct device *dev) | |||
591 | struct azx *chip = card->private_data; | 596 | struct azx *chip = card->private_data; |
592 | struct azx_pcm *p; | 597 | struct azx_pcm *p; |
593 | 598 | ||
594 | if (chip->disabled) | 599 | if (chip->disabled || chip->init_failed) |
595 | return 0; | 600 | return 0; |
596 | 601 | ||
597 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 602 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -606,6 +611,7 @@ static int azx_suspend(struct device *dev) | |||
606 | free_irq(chip->irq, chip); | 611 | free_irq(chip->irq, chip); |
607 | chip->irq = -1; | 612 | chip->irq = -1; |
608 | } | 613 | } |
614 | |||
609 | if (chip->msi) | 615 | if (chip->msi) |
610 | pci_disable_msi(chip->pci); | 616 | pci_disable_msi(chip->pci); |
611 | pci_disable_device(pci); | 617 | pci_disable_device(pci); |
@@ -622,11 +628,13 @@ static int azx_resume(struct device *dev) | |||
622 | struct snd_card *card = dev_get_drvdata(dev); | 628 | struct snd_card *card = dev_get_drvdata(dev); |
623 | struct azx *chip = card->private_data; | 629 | struct azx *chip = card->private_data; |
624 | 630 | ||
625 | if (chip->disabled) | 631 | if (chip->disabled || chip->init_failed) |
626 | return 0; | 632 | return 0; |
627 | 633 | ||
628 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) | 634 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { |
629 | hda_display_power(true); | 635 | hda_display_power(true); |
636 | haswell_set_bclk(chip); | ||
637 | } | ||
630 | pci_set_power_state(pci, PCI_D0); | 638 | pci_set_power_state(pci, PCI_D0); |
631 | pci_restore_state(pci); | 639 | pci_restore_state(pci); |
632 | if (pci_enable_device(pci) < 0) { | 640 | if (pci_enable_device(pci) < 0) { |
@@ -657,7 +665,7 @@ static int azx_runtime_suspend(struct device *dev) | |||
657 | struct snd_card *card = dev_get_drvdata(dev); | 665 | struct snd_card *card = dev_get_drvdata(dev); |
658 | struct azx *chip = card->private_data; | 666 | struct azx *chip = card->private_data; |
659 | 667 | ||
660 | if (chip->disabled) | 668 | if (chip->disabled || chip->init_failed) |
661 | return 0; | 669 | return 0; |
662 | 670 | ||
663 | if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) | 671 | if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) |
@@ -672,6 +680,7 @@ static int azx_runtime_suspend(struct device *dev) | |||
672 | azx_clear_irq_pending(chip); | 680 | azx_clear_irq_pending(chip); |
673 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) | 681 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) |
674 | hda_display_power(false); | 682 | hda_display_power(false); |
683 | |||
675 | return 0; | 684 | return 0; |
676 | } | 685 | } |
677 | 686 | ||
@@ -683,14 +692,16 @@ static int azx_runtime_resume(struct device *dev) | |||
683 | struct hda_codec *codec; | 692 | struct hda_codec *codec; |
684 | int status; | 693 | int status; |
685 | 694 | ||
686 | if (chip->disabled) | 695 | if (chip->disabled || chip->init_failed) |
687 | return 0; | 696 | return 0; |
688 | 697 | ||
689 | if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) | 698 | if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) |
690 | return 0; | 699 | return 0; |
691 | 700 | ||
692 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) | 701 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { |
693 | hda_display_power(true); | 702 | hda_display_power(true); |
703 | haswell_set_bclk(chip); | ||
704 | } | ||
694 | 705 | ||
695 | /* Read STATESTS before controller reset */ | 706 | /* Read STATESTS before controller reset */ |
696 | status = azx_readw(chip, STATESTS); | 707 | status = azx_readw(chip, STATESTS); |
@@ -718,7 +729,7 @@ static int azx_runtime_idle(struct device *dev) | |||
718 | struct snd_card *card = dev_get_drvdata(dev); | 729 | struct snd_card *card = dev_get_drvdata(dev); |
719 | struct azx *chip = card->private_data; | 730 | struct azx *chip = card->private_data; |
720 | 731 | ||
721 | if (chip->disabled) | 732 | if (chip->disabled || chip->init_failed) |
722 | return 0; | 733 | return 0; |
723 | 734 | ||
724 | if (!power_save_controller || | 735 | if (!power_save_controller || |
@@ -883,6 +894,8 @@ static int register_vga_switcheroo(struct azx *chip) | |||
883 | static int azx_free(struct azx *chip) | 894 | static int azx_free(struct azx *chip) |
884 | { | 895 | { |
885 | struct pci_dev *pci = chip->pci; | 896 | struct pci_dev *pci = chip->pci; |
897 | struct hda_intel *hda = container_of(chip, struct hda_intel, chip); | ||
898 | |||
886 | int i; | 899 | int i; |
887 | 900 | ||
888 | if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) | 901 | if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) |
@@ -930,7 +943,7 @@ static int azx_free(struct azx *chip) | |||
930 | hda_display_power(false); | 943 | hda_display_power(false); |
931 | hda_i915_exit(); | 944 | hda_i915_exit(); |
932 | } | 945 | } |
933 | kfree(chip); | 946 | kfree(hda); |
934 | 947 | ||
935 | return 0; | 948 | return 0; |
936 | } | 949 | } |
@@ -1174,6 +1187,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, | |||
1174 | static struct snd_device_ops ops = { | 1187 | static struct snd_device_ops ops = { |
1175 | .dev_free = azx_dev_free, | 1188 | .dev_free = azx_dev_free, |
1176 | }; | 1189 | }; |
1190 | struct hda_intel *hda; | ||
1177 | struct azx *chip; | 1191 | struct azx *chip; |
1178 | int err; | 1192 | int err; |
1179 | 1193 | ||
@@ -1183,13 +1197,14 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, | |||
1183 | if (err < 0) | 1197 | if (err < 0) |
1184 | return err; | 1198 | return err; |
1185 | 1199 | ||
1186 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | 1200 | hda = kzalloc(sizeof(*hda), GFP_KERNEL); |
1187 | if (!chip) { | 1201 | if (!hda) { |
1188 | dev_err(card->dev, "Cannot allocate chip\n"); | 1202 | dev_err(card->dev, "Cannot allocate hda\n"); |
1189 | pci_disable_device(pci); | 1203 | pci_disable_device(pci); |
1190 | return -ENOMEM; | 1204 | return -ENOMEM; |
1191 | } | 1205 | } |
1192 | 1206 | ||
1207 | chip = &hda->chip; | ||
1193 | spin_lock_init(&chip->reg_lock); | 1208 | spin_lock_init(&chip->reg_lock); |
1194 | mutex_init(&chip->open_mutex); | 1209 | mutex_init(&chip->open_mutex); |
1195 | chip->card = card; | 1210 | chip->card = card; |
@@ -1375,6 +1390,10 @@ static int azx_first_init(struct azx *chip) | |||
1375 | 1390 | ||
1376 | /* initialize chip */ | 1391 | /* initialize chip */ |
1377 | azx_init_pci(chip); | 1392 | azx_init_pci(chip); |
1393 | |||
1394 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) | ||
1395 | haswell_set_bclk(chip); | ||
1396 | |||
1378 | azx_init_chip(chip, (probe_only[dev] & 2) == 0); | 1397 | azx_init_chip(chip, (probe_only[dev] & 2) == 0); |
1379 | 1398 | ||
1380 | /* codec detection */ | 1399 | /* codec detection */ |
@@ -1656,8 +1675,13 @@ static int azx_probe_continue(struct azx *chip) | |||
1656 | "Error request power-well from i915\n"); | 1675 | "Error request power-well from i915\n"); |
1657 | goto out_free; | 1676 | goto out_free; |
1658 | } | 1677 | } |
1678 | err = hda_display_power(true); | ||
1679 | if (err < 0) { | ||
1680 | dev_err(chip->card->dev, | ||
1681 | "Cannot turn on display power on i915\n"); | ||
1682 | goto out_free; | ||
1683 | } | ||
1659 | #endif | 1684 | #endif |
1660 | hda_display_power(true); | ||
1661 | } | 1685 | } |
1662 | 1686 | ||
1663 | err = azx_first_init(chip); | 1687 | err = azx_first_init(chip); |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index ebd1fa6f015c..4e2d4863daa1 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -417,6 +417,27 @@ struct snd_hda_pin_quirk { | |||
417 | int value; /* quirk value */ | 417 | int value; /* quirk value */ |
418 | }; | 418 | }; |
419 | 419 | ||
420 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
421 | |||
422 | #define SND_HDA_PIN_QUIRK(_codec, _subvendor, _name, _value, _pins...) \ | ||
423 | { .codec = _codec,\ | ||
424 | .subvendor = _subvendor,\ | ||
425 | .name = _name,\ | ||
426 | .value = _value,\ | ||
427 | .pins = (const struct hda_pintbl[]) { _pins } \ | ||
428 | } | ||
429 | #else | ||
430 | |||
431 | #define SND_HDA_PIN_QUIRK(_codec, _subvendor, _name, _value, _pins...) \ | ||
432 | { .codec = _codec,\ | ||
433 | .subvendor = _subvendor,\ | ||
434 | .value = _value,\ | ||
435 | .pins = (const struct hda_pintbl[]) { _pins } \ | ||
436 | } | ||
437 | |||
438 | #endif | ||
439 | |||
440 | |||
420 | /* fixup types */ | 441 | /* fixup types */ |
421 | enum { | 442 | enum { |
422 | HDA_FIXUP_INVALID, | 443 | HDA_FIXUP_INVALID, |
diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h index 4a7cb01fa912..e9d1a5762a55 100644 --- a/sound/pci/hda/hda_priv.h +++ b/sound/pci/hda/hda_priv.h | |||
@@ -186,6 +186,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
186 | #define AZX_DCAPS_BUFSIZE (1 << 21) /* no buffer size alignment */ | 186 | #define AZX_DCAPS_BUFSIZE (1 << 21) /* no buffer size alignment */ |
187 | #define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */ | 187 | #define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* buffer size alignment */ |
188 | #define AZX_DCAPS_4K_BDLE_BOUNDARY (1 << 23) /* BDLE in 4k boundary */ | 188 | #define AZX_DCAPS_4K_BDLE_BOUNDARY (1 << 23) /* BDLE in 4k boundary */ |
189 | #define AZX_DCAPS_REVERSE_ASSIGN (1 << 24) /* Assign devices in reverse order */ | ||
189 | #define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */ | 190 | #define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */ |
190 | #define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */ | 191 | #define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */ |
191 | #define AZX_DCAPS_I915_POWERWELL (1 << 27) /* HSW i915 powerwell support */ | 192 | #define AZX_DCAPS_I915_POWERWELL (1 << 27) /* HSW i915 powerwell support */ |
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index a366ba9293a8..358414da6418 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c | |||
@@ -236,6 +236,7 @@ disable_hda: | |||
236 | return rc; | 236 | return rc; |
237 | } | 237 | } |
238 | 238 | ||
239 | #ifdef CONFIG_PM_SLEEP | ||
239 | static void hda_tegra_disable_clocks(struct hda_tegra *data) | 240 | static void hda_tegra_disable_clocks(struct hda_tegra *data) |
240 | { | 241 | { |
241 | clk_disable_unprepare(data->hda2hdmi_clk); | 242 | clk_disable_unprepare(data->hda2hdmi_clk); |
@@ -243,7 +244,6 @@ static void hda_tegra_disable_clocks(struct hda_tegra *data) | |||
243 | clk_disable_unprepare(data->hda_clk); | 244 | clk_disable_unprepare(data->hda_clk); |
244 | } | 245 | } |
245 | 246 | ||
246 | #ifdef CONFIG_PM_SLEEP | ||
247 | /* | 247 | /* |
248 | * power management | 248 | * power management |
249 | */ | 249 | */ |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 3e4417b0ddbe..ba4ca52072ff 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -2204,7 +2204,7 @@ static int generic_hdmi_resume(struct hda_codec *codec) | |||
2204 | struct hdmi_spec *spec = codec->spec; | 2204 | struct hdmi_spec *spec = codec->spec; |
2205 | int pin_idx; | 2205 | int pin_idx; |
2206 | 2206 | ||
2207 | generic_hdmi_init(codec); | 2207 | codec->patch_ops.init(codec); |
2208 | snd_hda_codec_resume_amp(codec); | 2208 | snd_hda_codec_resume_amp(codec); |
2209 | snd_hda_codec_resume_cache(codec); | 2209 | snd_hda_codec_resume_cache(codec); |
2210 | 2210 | ||
@@ -3337,6 +3337,7 @@ static const struct hda_codec_preset snd_hda_preset_hdmi[] = { | |||
3337 | { .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_nvhdmi }, | 3337 | { .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_nvhdmi }, |
3338 | { .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_nvhdmi }, | 3338 | { .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_nvhdmi }, |
3339 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch }, | 3339 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch }, |
3340 | { .id = 0x10de0070, .name = "GPU 70 HDMI/DP", .patch = patch_nvhdmi }, | ||
3340 | { .id = 0x10de0071, .name = "GPU 71 HDMI/DP", .patch = patch_nvhdmi }, | 3341 | { .id = 0x10de0071, .name = "GPU 71 HDMI/DP", .patch = patch_nvhdmi }, |
3341 | { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch }, | 3342 | { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch }, |
3342 | { .id = 0x11069f80, .name = "VX900 HDMI/DP", .patch = patch_via_hdmi }, | 3343 | { .id = 0x11069f80, .name = "VX900 HDMI/DP", .patch = patch_via_hdmi }, |
@@ -3394,6 +3395,7 @@ MODULE_ALIAS("snd-hda-codec-id:10de0044"); | |||
3394 | MODULE_ALIAS("snd-hda-codec-id:10de0051"); | 3395 | MODULE_ALIAS("snd-hda-codec-id:10de0051"); |
3395 | MODULE_ALIAS("snd-hda-codec-id:10de0060"); | 3396 | MODULE_ALIAS("snd-hda-codec-id:10de0060"); |
3396 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); | 3397 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); |
3398 | MODULE_ALIAS("snd-hda-codec-id:10de0070"); | ||
3397 | MODULE_ALIAS("snd-hda-codec-id:10de0071"); | 3399 | MODULE_ALIAS("snd-hda-codec-id:10de0071"); |
3398 | MODULE_ALIAS("snd-hda-codec-id:10de8001"); | 3400 | MODULE_ALIAS("snd-hda-codec-id:10de8001"); |
3399 | MODULE_ALIAS("snd-hda-codec-id:11069f80"); | 3401 | MODULE_ALIAS("snd-hda-codec-id:11069f80"); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index af76995fa966..b60824e90408 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4880,6 +4880,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4880 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), | 4880 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
4881 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), | 4881 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), |
4882 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), | 4882 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
4883 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), | ||
4883 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 4884 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4884 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 4885 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4885 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 4886 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
@@ -4962,228 +4963,141 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
4962 | }; | 4963 | }; |
4963 | 4964 | ||
4964 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | 4965 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
4965 | { | 4966 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
4966 | .codec = 0x10ec0255, | 4967 | {0x12, 0x90a60140}, |
4967 | .subvendor = 0x1028, | 4968 | {0x14, 0x90170110}, |
4968 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 4969 | {0x17, 0x40000000}, |
4969 | .name = "Dell", | 4970 | {0x18, 0x411111f0}, |
4970 | #endif | 4971 | {0x19, 0x411111f0}, |
4971 | .pins = (const struct hda_pintbl[]) { | 4972 | {0x1a, 0x411111f0}, |
4972 | {0x12, 0x90a60140}, | 4973 | {0x1b, 0x411111f0}, |
4973 | {0x14, 0x90170110}, | 4974 | {0x1d, 0x40700001}, |
4974 | {0x17, 0x40000000}, | 4975 | {0x1e, 0x411111f0}, |
4975 | {0x18, 0x411111f0}, | 4976 | {0x21, 0x02211020}), |
4976 | {0x19, 0x411111f0}, | 4977 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
4977 | {0x1a, 0x411111f0}, | 4978 | {0x12, 0x90a60160}, |
4978 | {0x1b, 0x411111f0}, | 4979 | {0x14, 0x90170120}, |
4979 | {0x1d, 0x40700001}, | 4980 | {0x17, 0x40000000}, |
4980 | {0x1e, 0x411111f0}, | 4981 | {0x18, 0x411111f0}, |
4981 | {0x21, 0x02211020}, | 4982 | {0x19, 0x411111f0}, |
4982 | }, | 4983 | {0x1a, 0x411111f0}, |
4983 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 4984 | {0x1b, 0x411111f0}, |
4984 | }, | 4985 | {0x1d, 0x40700001}, |
4985 | { | 4986 | {0x1e, 0x411111f0}, |
4986 | .codec = 0x10ec0255, | 4987 | {0x21, 0x02211030}), |
4987 | .subvendor = 0x1028, | 4988 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
4988 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 4989 | {0x12, 0x90a60160}, |
4989 | .name = "Dell", | 4990 | {0x14, 0x90170120}, |
4990 | #endif | 4991 | {0x17, 0x90170140}, |
4991 | .pins = (const struct hda_pintbl[]) { | 4992 | {0x18, 0x40000000}, |
4992 | {0x12, 0x90a60160}, | 4993 | {0x19, 0x411111f0}, |
4993 | {0x14, 0x90170120}, | 4994 | {0x1a, 0x411111f0}, |
4994 | {0x17, 0x40000000}, | 4995 | {0x1b, 0x411111f0}, |
4995 | {0x18, 0x411111f0}, | 4996 | {0x1d, 0x41163b05}, |
4996 | {0x19, 0x411111f0}, | 4997 | {0x1e, 0x411111f0}, |
4997 | {0x1a, 0x411111f0}, | 4998 | {0x21, 0x0321102f}), |
4998 | {0x1b, 0x411111f0}, | 4999 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
4999 | {0x1d, 0x40700001}, | 5000 | {0x12, 0x90a60160}, |
5000 | {0x1e, 0x411111f0}, | 5001 | {0x14, 0x90170130}, |
5001 | {0x21, 0x02211030}, | 5002 | {0x17, 0x40000000}, |
5002 | }, | 5003 | {0x18, 0x411111f0}, |
5003 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 5004 | {0x19, 0x411111f0}, |
5004 | }, | 5005 | {0x1a, 0x411111f0}, |
5005 | { | 5006 | {0x1b, 0x411111f0}, |
5006 | .codec = 0x10ec0255, | 5007 | {0x1d, 0x40700001}, |
5007 | .subvendor = 0x1028, | 5008 | {0x1e, 0x411111f0}, |
5008 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5009 | {0x21, 0x02211040}), |
5009 | .name = "Dell", | 5010 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
5010 | #endif | 5011 | {0x12, 0x90a60160}, |
5011 | .pins = (const struct hda_pintbl[]) { | 5012 | {0x14, 0x90170140}, |
5012 | {0x12, 0x90a60160}, | 5013 | {0x17, 0x40000000}, |
5013 | {0x14, 0x90170120}, | 5014 | {0x18, 0x411111f0}, |
5014 | {0x17, 0x90170140}, | 5015 | {0x19, 0x411111f0}, |
5015 | {0x18, 0x40000000}, | 5016 | {0x1a, 0x411111f0}, |
5016 | {0x19, 0x411111f0}, | 5017 | {0x1b, 0x411111f0}, |
5017 | {0x1a, 0x411111f0}, | 5018 | {0x1d, 0x40700001}, |
5018 | {0x1b, 0x411111f0}, | 5019 | {0x1e, 0x411111f0}, |
5019 | {0x1d, 0x41163b05}, | 5020 | {0x21, 0x02211050}), |
5020 | {0x1e, 0x411111f0}, | 5021 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
5021 | {0x21, 0x0321102f}, | 5022 | {0x12, 0x90a60170}, |
5022 | }, | 5023 | {0x14, 0x90170120}, |
5023 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 5024 | {0x17, 0x40000000}, |
5024 | }, | 5025 | {0x18, 0x411111f0}, |
5025 | { | 5026 | {0x19, 0x411111f0}, |
5026 | .codec = 0x10ec0255, | 5027 | {0x1a, 0x411111f0}, |
5027 | .subvendor = 0x1028, | 5028 | {0x1b, 0x411111f0}, |
5028 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5029 | {0x1d, 0x40700001}, |
5029 | .name = "Dell", | 5030 | {0x1e, 0x411111f0}, |
5030 | #endif | 5031 | {0x21, 0x02211030}), |
5031 | .pins = (const struct hda_pintbl[]) { | 5032 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
5032 | {0x12, 0x90a60160}, | 5033 | {0x12, 0x90a60170}, |
5033 | {0x14, 0x90170130}, | 5034 | {0x14, 0x90170130}, |
5034 | {0x17, 0x40000000}, | 5035 | {0x17, 0x40000000}, |
5035 | {0x18, 0x411111f0}, | 5036 | {0x18, 0x411111f0}, |
5036 | {0x19, 0x411111f0}, | 5037 | {0x19, 0x411111f0}, |
5037 | {0x1a, 0x411111f0}, | 5038 | {0x1a, 0x411111f0}, |
5038 | {0x1b, 0x411111f0}, | 5039 | {0x1b, 0x411111f0}, |
5039 | {0x1d, 0x40700001}, | 5040 | {0x1d, 0x40700001}, |
5040 | {0x1e, 0x411111f0}, | 5041 | {0x1e, 0x411111f0}, |
5041 | {0x21, 0x02211040}, | 5042 | {0x21, 0x02211040}), |
5042 | }, | 5043 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
5043 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 5044 | {0x12, 0x90a60130}, |
5044 | }, | 5045 | {0x14, 0x90170110}, |
5045 | { | 5046 | {0x17, 0x40020008}, |
5046 | .codec = 0x10ec0255, | 5047 | {0x18, 0x411111f0}, |
5047 | .subvendor = 0x1028, | 5048 | {0x19, 0x411111f0}, |
5048 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5049 | {0x1a, 0x411111f0}, |
5049 | .name = "Dell", | 5050 | {0x1b, 0x411111f0}, |
5050 | #endif | 5051 | {0x1d, 0x40e00001}, |
5051 | .pins = (const struct hda_pintbl[]) { | 5052 | {0x1e, 0x411111f0}, |
5052 | {0x12, 0x90a60160}, | 5053 | {0x21, 0x0321101f}), |
5053 | {0x14, 0x90170140}, | 5054 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
5054 | {0x17, 0x40000000}, | 5055 | {0x12, 0x90a60160}, |
5055 | {0x18, 0x411111f0}, | 5056 | {0x14, 0x90170120}, |
5056 | {0x19, 0x411111f0}, | 5057 | {0x17, 0x40000000}, |
5057 | {0x1a, 0x411111f0}, | 5058 | {0x18, 0x411111f0}, |
5058 | {0x1b, 0x411111f0}, | 5059 | {0x19, 0x411111f0}, |
5059 | {0x1d, 0x40700001}, | 5060 | {0x1a, 0x411111f0}, |
5060 | {0x1e, 0x411111f0}, | 5061 | {0x1b, 0x411111f0}, |
5061 | {0x21, 0x02211050}, | 5062 | {0x1d, 0x40700001}, |
5062 | }, | 5063 | {0x1e, 0x411111f0}, |
5063 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 5064 | {0x21, 0x02211030}), |
5064 | }, | 5065 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
5065 | { | 5066 | {0x12, 0x90a60140}, |
5066 | .codec = 0x10ec0255, | 5067 | {0x13, 0x411111f0}, |
5067 | .subvendor = 0x1028, | 5068 | {0x14, 0x90170110}, |
5068 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5069 | {0x15, 0x0221401f}, |
5069 | .name = "Dell", | 5070 | {0x16, 0x411111f0}, |
5070 | #endif | 5071 | {0x18, 0x411111f0}, |
5071 | .pins = (const struct hda_pintbl[]) { | 5072 | {0x19, 0x411111f0}, |
5072 | {0x12, 0x90a60170}, | 5073 | {0x1a, 0x411111f0}, |
5073 | {0x14, 0x90170120}, | 5074 | {0x1b, 0x411111f0}, |
5074 | {0x17, 0x40000000}, | 5075 | {0x1d, 0x40700001}, |
5075 | {0x18, 0x411111f0}, | 5076 | {0x1e, 0x411111f0}), |
5076 | {0x19, 0x411111f0}, | 5077 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
5077 | {0x1a, 0x411111f0}, | 5078 | {0x12, 0x40000000}, |
5078 | {0x1b, 0x411111f0}, | 5079 | {0x13, 0x90a60140}, |
5079 | {0x1d, 0x40700001}, | 5080 | {0x14, 0x90170110}, |
5080 | {0x1e, 0x411111f0}, | 5081 | {0x15, 0x0221401f}, |
5081 | {0x21, 0x02211030}, | 5082 | {0x16, 0x21014020}, |
5082 | }, | 5083 | {0x18, 0x411111f0}, |
5083 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 5084 | {0x19, 0x21a19030}, |
5084 | }, | 5085 | {0x1a, 0x411111f0}, |
5085 | { | 5086 | {0x1b, 0x411111f0}, |
5086 | .codec = 0x10ec0255, | 5087 | {0x1d, 0x40700001}, |
5087 | .subvendor = 0x1028, | 5088 | {0x1e, 0x411111f0}), |
5088 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5089 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
5089 | .name = "Dell", | 5090 | {0x12, 0x40000000}, |
5090 | #endif | 5091 | {0x13, 0x90a60140}, |
5091 | .pins = (const struct hda_pintbl[]) { | 5092 | {0x14, 0x90170110}, |
5092 | {0x12, 0x90a60170}, | 5093 | {0x15, 0x0221401f}, |
5093 | {0x14, 0x90170130}, | 5094 | {0x16, 0x411111f0}, |
5094 | {0x17, 0x40000000}, | 5095 | {0x18, 0x411111f0}, |
5095 | {0x18, 0x411111f0}, | 5096 | {0x19, 0x411111f0}, |
5096 | {0x19, 0x411111f0}, | 5097 | {0x1a, 0x411111f0}, |
5097 | {0x1a, 0x411111f0}, | 5098 | {0x1b, 0x411111f0}, |
5098 | {0x1b, 0x411111f0}, | 5099 | {0x1d, 0x40700001}, |
5099 | {0x1d, 0x40700001}, | 5100 | {0x1e, 0x411111f0}), |
5100 | {0x1e, 0x411111f0}, | ||
5101 | {0x21, 0x02211040}, | ||
5102 | }, | ||
5103 | .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5104 | }, | ||
5105 | { | ||
5106 | .codec = 0x10ec0283, | ||
5107 | .subvendor = 0x1028, | ||
5108 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
5109 | .name = "Dell", | ||
5110 | #endif | ||
5111 | .pins = (const struct hda_pintbl[]) { | ||
5112 | {0x12, 0x90a60130}, | ||
5113 | {0x14, 0x90170110}, | ||
5114 | {0x17, 0x40020008}, | ||
5115 | {0x18, 0x411111f0}, | ||
5116 | {0x19, 0x411111f0}, | ||
5117 | {0x1a, 0x411111f0}, | ||
5118 | {0x1b, 0x411111f0}, | ||
5119 | {0x1d, 0x40e00001}, | ||
5120 | {0x1e, 0x411111f0}, | ||
5121 | {0x21, 0x0321101f}, | ||
5122 | }, | ||
5123 | .value = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5124 | }, | ||
5125 | { | ||
5126 | .codec = 0x10ec0283, | ||
5127 | .subvendor = 0x1028, | ||
5128 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
5129 | .name = "Dell", | ||
5130 | #endif | ||
5131 | .pins = (const struct hda_pintbl[]) { | ||
5132 | {0x12, 0x90a60160}, | ||
5133 | {0x14, 0x90170120}, | ||
5134 | {0x17, 0x40000000}, | ||
5135 | {0x18, 0x411111f0}, | ||
5136 | {0x19, 0x411111f0}, | ||
5137 | {0x1a, 0x411111f0}, | ||
5138 | {0x1b, 0x411111f0}, | ||
5139 | {0x1d, 0x40700001}, | ||
5140 | {0x1e, 0x411111f0}, | ||
5141 | {0x21, 0x02211030}, | ||
5142 | }, | ||
5143 | .value = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5144 | }, | ||
5145 | { | ||
5146 | .codec = 0x10ec0292, | ||
5147 | .subvendor = 0x1028, | ||
5148 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
5149 | .name = "Dell", | ||
5150 | #endif | ||
5151 | .pins = (const struct hda_pintbl[]) { | ||
5152 | {0x12, 0x90a60140}, | ||
5153 | {0x13, 0x411111f0}, | ||
5154 | {0x14, 0x90170110}, | ||
5155 | {0x15, 0x0221401f}, | ||
5156 | {0x16, 0x411111f0}, | ||
5157 | {0x18, 0x411111f0}, | ||
5158 | {0x19, 0x411111f0}, | ||
5159 | {0x1a, 0x411111f0}, | ||
5160 | {0x1b, 0x411111f0}, | ||
5161 | {0x1d, 0x40700001}, | ||
5162 | {0x1e, 0x411111f0}, | ||
5163 | }, | ||
5164 | .value = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | ||
5165 | }, | ||
5166 | { | ||
5167 | .codec = 0x10ec0293, | ||
5168 | .subvendor = 0x1028, | ||
5169 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
5170 | .name = "Dell", | ||
5171 | #endif | ||
5172 | .pins = (const struct hda_pintbl[]) { | ||
5173 | {0x12, 0x40000000}, | ||
5174 | {0x13, 0x90a60140}, | ||
5175 | {0x14, 0x90170110}, | ||
5176 | {0x15, 0x0221401f}, | ||
5177 | {0x16, 0x21014020}, | ||
5178 | {0x18, 0x411111f0}, | ||
5179 | {0x19, 0x21a19030}, | ||
5180 | {0x1a, 0x411111f0}, | ||
5181 | {0x1b, 0x411111f0}, | ||
5182 | {0x1d, 0x40700001}, | ||
5183 | {0x1e, 0x411111f0}, | ||
5184 | }, | ||
5185 | .value = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
5186 | }, | ||
5187 | {} | 5101 | {} |
5188 | }; | 5102 | }; |
5189 | 5103 | ||
@@ -6039,90 +5953,66 @@ static const struct hda_model_fixup alc662_fixup_models[] = { | |||
6039 | }; | 5953 | }; |
6040 | 5954 | ||
6041 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { | 5955 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
6042 | { | 5956 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
6043 | .codec = 0x10ec0668, | 5957 | {0x12, 0x99a30130}, |
6044 | .subvendor = 0x1028, | 5958 | {0x14, 0x90170110}, |
6045 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5959 | {0x15, 0x0321101f}, |
6046 | .name = "Dell", | 5960 | {0x16, 0x03011020}, |
6047 | #endif | 5961 | {0x18, 0x40000008}, |
6048 | .pins = (const struct hda_pintbl[]) { | 5962 | {0x19, 0x411111f0}, |
6049 | {0x12, 0x99a30130}, | 5963 | {0x1a, 0x411111f0}, |
6050 | {0x14, 0x90170110}, | 5964 | {0x1b, 0x411111f0}, |
6051 | {0x15, 0x0321101f}, | 5965 | {0x1d, 0x41000001}, |
6052 | {0x16, 0x03011020}, | 5966 | {0x1e, 0x411111f0}, |
6053 | {0x18, 0x40000008}, | 5967 | {0x1f, 0x411111f0}), |
6054 | {0x19, 0x411111f0}, | 5968 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
6055 | {0x1a, 0x411111f0}, | 5969 | {0x12, 0x99a30140}, |
6056 | {0x1b, 0x411111f0}, | 5970 | {0x14, 0x90170110}, |
6057 | {0x1d, 0x41000001}, | 5971 | {0x15, 0x0321101f}, |
6058 | {0x1e, 0x411111f0}, | 5972 | {0x16, 0x03011020}, |
6059 | {0x1f, 0x411111f0}, | 5973 | {0x18, 0x40000008}, |
6060 | }, | 5974 | {0x19, 0x411111f0}, |
6061 | .value = ALC668_FIXUP_AUTO_MUTE, | 5975 | {0x1a, 0x411111f0}, |
6062 | }, | 5976 | {0x1b, 0x411111f0}, |
6063 | { | 5977 | {0x1d, 0x41000001}, |
6064 | .codec = 0x10ec0668, | 5978 | {0x1e, 0x411111f0}, |
6065 | .subvendor = 0x1028, | 5979 | {0x1f, 0x411111f0}), |
6066 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 5980 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
6067 | .name = "Dell", | 5981 | {0x12, 0x99a30150}, |
6068 | #endif | 5982 | {0x14, 0x90170110}, |
6069 | .pins = (const struct hda_pintbl[]) { | 5983 | {0x15, 0x0321101f}, |
6070 | {0x12, 0x99a30140}, | 5984 | {0x16, 0x03011020}, |
6071 | {0x14, 0x90170110}, | 5985 | {0x18, 0x40000008}, |
6072 | {0x15, 0x0321101f}, | 5986 | {0x19, 0x411111f0}, |
6073 | {0x16, 0x03011020}, | 5987 | {0x1a, 0x411111f0}, |
6074 | {0x18, 0x40000008}, | 5988 | {0x1b, 0x411111f0}, |
6075 | {0x19, 0x411111f0}, | 5989 | {0x1d, 0x41000001}, |
6076 | {0x1a, 0x411111f0}, | 5990 | {0x1e, 0x411111f0}, |
6077 | {0x1b, 0x411111f0}, | 5991 | {0x1f, 0x411111f0}), |
6078 | {0x1d, 0x41000001}, | 5992 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
6079 | {0x1e, 0x411111f0}, | 5993 | {0x12, 0x411111f0}, |
6080 | {0x1f, 0x411111f0}, | 5994 | {0x14, 0x90170110}, |
6081 | }, | 5995 | {0x15, 0x0321101f}, |
6082 | .value = ALC668_FIXUP_AUTO_MUTE, | 5996 | {0x16, 0x03011020}, |
6083 | }, | 5997 | {0x18, 0x40000008}, |
6084 | { | 5998 | {0x19, 0x411111f0}, |
6085 | .codec = 0x10ec0668, | 5999 | {0x1a, 0x411111f0}, |
6086 | .subvendor = 0x1028, | 6000 | {0x1b, 0x411111f0}, |
6087 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 6001 | {0x1d, 0x41000001}, |
6088 | .name = "Dell", | 6002 | {0x1e, 0x411111f0}, |
6089 | #endif | 6003 | {0x1f, 0x411111f0}), |
6090 | .pins = (const struct hda_pintbl[]) { | 6004 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
6091 | {0x12, 0x99a30150}, | 6005 | {0x12, 0x90a60130}, |
6092 | {0x14, 0x90170110}, | 6006 | {0x14, 0x90170110}, |
6093 | {0x15, 0x0321101f}, | 6007 | {0x15, 0x0321101f}, |
6094 | {0x16, 0x03011020}, | 6008 | {0x16, 0x40000000}, |
6095 | {0x18, 0x40000008}, | 6009 | {0x18, 0x411111f0}, |
6096 | {0x19, 0x411111f0}, | 6010 | {0x19, 0x411111f0}, |
6097 | {0x1a, 0x411111f0}, | 6011 | {0x1a, 0x411111f0}, |
6098 | {0x1b, 0x411111f0}, | 6012 | {0x1b, 0x411111f0}, |
6099 | {0x1d, 0x41000001}, | 6013 | {0x1d, 0x40d6832d}, |
6100 | {0x1e, 0x411111f0}, | 6014 | {0x1e, 0x411111f0}, |
6101 | {0x1f, 0x411111f0}, | 6015 | {0x1f, 0x411111f0}), |
6102 | }, | ||
6103 | .value = ALC668_FIXUP_AUTO_MUTE, | ||
6104 | }, | ||
6105 | { | ||
6106 | .codec = 0x10ec0668, | ||
6107 | .subvendor = 0x1028, | ||
6108 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
6109 | .name = "Dell", | ||
6110 | #endif | ||
6111 | .pins = (const struct hda_pintbl[]) { | ||
6112 | {0x12, 0x411111f0}, | ||
6113 | {0x14, 0x90170110}, | ||
6114 | {0x15, 0x0321101f}, | ||
6115 | {0x16, 0x03011020}, | ||
6116 | {0x18, 0x40000008}, | ||
6117 | {0x19, 0x411111f0}, | ||
6118 | {0x1a, 0x411111f0}, | ||
6119 | {0x1b, 0x411111f0}, | ||
6120 | {0x1d, 0x41000001}, | ||
6121 | {0x1e, 0x411111f0}, | ||
6122 | {0x1f, 0x411111f0}, | ||
6123 | }, | ||
6124 | .value = ALC668_FIXUP_AUTO_MUTE, | ||
6125 | }, | ||
6126 | {} | 6016 | {} |
6127 | }; | 6017 | }; |
6128 | 6018 | ||
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 7f40a150899c..3744ea4e843d 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -122,6 +122,12 @@ enum { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | enum { | 124 | enum { |
125 | STAC_92HD95_HP_LED, | ||
126 | STAC_92HD95_HP_BASS, | ||
127 | STAC_92HD95_MODELS | ||
128 | }; | ||
129 | |||
130 | enum { | ||
125 | STAC_925x_REF, | 131 | STAC_925x_REF, |
126 | STAC_M1, | 132 | STAC_M1, |
127 | STAC_M1_2, | 133 | STAC_M1_2, |
@@ -4128,6 +4134,48 @@ static const struct snd_pci_quirk stac9205_fixup_tbl[] = { | |||
4128 | {} /* terminator */ | 4134 | {} /* terminator */ |
4129 | }; | 4135 | }; |
4130 | 4136 | ||
4137 | static void stac92hd95_fixup_hp_led(struct hda_codec *codec, | ||
4138 | const struct hda_fixup *fix, int action) | ||
4139 | { | ||
4140 | struct sigmatel_spec *spec = codec->spec; | ||
4141 | |||
4142 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | ||
4143 | return; | ||
4144 | |||
4145 | if (find_mute_led_cfg(codec, spec->default_polarity)) | ||
4146 | codec_dbg(codec, "mute LED gpio %d polarity %d\n", | ||
4147 | spec->gpio_led, | ||
4148 | spec->gpio_led_polarity); | ||
4149 | } | ||
4150 | |||
4151 | static const struct hda_fixup stac92hd95_fixups[] = { | ||
4152 | [STAC_92HD95_HP_LED] = { | ||
4153 | .type = HDA_FIXUP_FUNC, | ||
4154 | .v.func = stac92hd95_fixup_hp_led, | ||
4155 | }, | ||
4156 | [STAC_92HD95_HP_BASS] = { | ||
4157 | .type = HDA_FIXUP_VERBS, | ||
4158 | .v.verbs = (const struct hda_verb[]) { | ||
4159 | {0x1a, 0x795, 0x00}, /* HPF to 100Hz */ | ||
4160 | {} | ||
4161 | }, | ||
4162 | .chained = true, | ||
4163 | .chain_id = STAC_92HD95_HP_LED, | ||
4164 | }, | ||
4165 | }; | ||
4166 | |||
4167 | static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = { | ||
4168 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS), | ||
4169 | {} /* terminator */ | ||
4170 | }; | ||
4171 | |||
4172 | static const struct hda_model_fixup stac92hd95_models[] = { | ||
4173 | { .id = STAC_92HD95_HP_LED, .name = "hp-led" }, | ||
4174 | { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" }, | ||
4175 | {} | ||
4176 | }; | ||
4177 | |||
4178 | |||
4131 | static int stac_parse_auto_config(struct hda_codec *codec) | 4179 | static int stac_parse_auto_config(struct hda_codec *codec) |
4132 | { | 4180 | { |
4133 | struct sigmatel_spec *spec = codec->spec; | 4181 | struct sigmatel_spec *spec = codec->spec; |
@@ -4580,10 +4628,16 @@ static int patch_stac92hd95(struct hda_codec *codec) | |||
4580 | spec->gen.beep_nid = 0x19; /* digital beep */ | 4628 | spec->gen.beep_nid = 0x19; /* digital beep */ |
4581 | spec->pwr_nids = stac92hd95_pwr_nids; | 4629 | spec->pwr_nids = stac92hd95_pwr_nids; |
4582 | spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); | 4630 | spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); |
4583 | spec->default_polarity = -1; /* no default cfg */ | 4631 | spec->default_polarity = 0; |
4584 | 4632 | ||
4585 | codec->patch_ops = stac_patch_ops; | 4633 | codec->patch_ops = stac_patch_ops; |
4586 | 4634 | ||
4635 | snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, | ||
4636 | stac92hd95_fixups); | ||
4637 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | ||
4638 | |||
4639 | stac_setup_gpio(codec); | ||
4640 | |||
4587 | err = stac_parse_auto_config(codec); | 4641 | err = stac_parse_auto_config(codec); |
4588 | if (err < 0) { | 4642 | if (err < 0) { |
4589 | stac_free(codec); | 4643 | stac_free(codec); |
@@ -4592,6 +4646,8 @@ static int patch_stac92hd95(struct hda_codec *codec) | |||
4592 | 4646 | ||
4593 | codec->proc_widget_hook = stac92hd_proc_hook; | 4647 | codec->proc_widget_hook = stac92hd_proc_hook; |
4594 | 4648 | ||
4649 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); | ||
4650 | |||
4595 | return 0; | 4651 | return 0; |
4596 | } | 4652 | } |
4597 | 4653 | ||
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index cbfa1e18f651..0b9571c858f8 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
@@ -225,11 +225,11 @@ config SND_SOC_ADAU1373 | |||
225 | config SND_SOC_ADAU1701 | 225 | config SND_SOC_ADAU1701 |
226 | tristate "Analog Devices ADAU1701 CODEC" | 226 | tristate "Analog Devices ADAU1701 CODEC" |
227 | depends on I2C | 227 | depends on I2C |
228 | select SND_SOC_SIGMADSP | 228 | select SND_SOC_SIGMADSP_I2C |
229 | 229 | ||
230 | config SND_SOC_ADAU17X1 | 230 | config SND_SOC_ADAU17X1 |
231 | tristate | 231 | tristate |
232 | select SND_SOC_SIGMADSP | 232 | select SND_SOC_SIGMADSP_REGMAP |
233 | 233 | ||
234 | config SND_SOC_ADAU1761 | 234 | config SND_SOC_ADAU1761 |
235 | tristate | 235 | tristate |
@@ -476,6 +476,14 @@ config SND_SOC_SIGMADSP | |||
476 | tristate | 476 | tristate |
477 | select CRC32 | 477 | select CRC32 |
478 | 478 | ||
479 | config SND_SOC_SIGMADSP_I2C | ||
480 | tristate | ||
481 | select SND_SOC_SIGMADSP | ||
482 | |||
483 | config SND_SOC_SIGMADSP_REGMAP | ||
484 | tristate | ||
485 | select SND_SOC_SIGMADSP | ||
486 | |||
479 | config SND_SOC_SIRF_AUDIO_CODEC | 487 | config SND_SOC_SIRF_AUDIO_CODEC |
480 | tristate "SiRF SoC internal audio codec" | 488 | tristate "SiRF SoC internal audio codec" |
481 | select REGMAP_MMIO | 489 | select REGMAP_MMIO |
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index be3377b8d73f..1bd6e1cf6f82 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile | |||
@@ -77,6 +77,8 @@ snd-soc-sgtl5000-objs := sgtl5000.o | |||
77 | snd-soc-alc5623-objs := alc5623.o | 77 | snd-soc-alc5623-objs := alc5623.o |
78 | snd-soc-alc5632-objs := alc5632.o | 78 | snd-soc-alc5632-objs := alc5632.o |
79 | snd-soc-sigmadsp-objs := sigmadsp.o | 79 | snd-soc-sigmadsp-objs := sigmadsp.o |
80 | snd-soc-sigmadsp-i2c-objs := sigmadsp-i2c.o | ||
81 | snd-soc-sigmadsp-regmap-objs := sigmadsp-regmap.o | ||
80 | snd-soc-si476x-objs := si476x.o | 82 | snd-soc-si476x-objs := si476x.o |
81 | snd-soc-sirf-audio-codec-objs := sirf-audio-codec.o | 83 | snd-soc-sirf-audio-codec-objs := sirf-audio-codec.o |
82 | snd-soc-sn95031-objs := sn95031.o | 84 | snd-soc-sn95031-objs := sn95031.o |
@@ -240,6 +242,8 @@ obj-$(CONFIG_SND_SOC_RT5651) += snd-soc-rt5651.o | |||
240 | obj-$(CONFIG_SND_SOC_RT5677) += snd-soc-rt5677.o | 242 | obj-$(CONFIG_SND_SOC_RT5677) += snd-soc-rt5677.o |
241 | obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o | 243 | obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o |
242 | obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o | 244 | obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o |
245 | obj-$(CONFIG_SND_SOC_SIGMADSP_I2C) += snd-soc-sigmadsp-i2c.o | ||
246 | obj-$(CONFIG_SND_SOC_SIGMADSP_REGMAP) += snd-soc-sigmadsp-regmap.o | ||
243 | obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o | 247 | obj-$(CONFIG_SND_SOC_SI476X) += snd-soc-si476x.o |
244 | obj-$(CONFIG_SND_SOC_SN95031) +=snd-soc-sn95031.o | 248 | obj-$(CONFIG_SND_SOC_SN95031) +=snd-soc-sn95031.o |
245 | obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o | 249 | obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif-rx.o snd-soc-spdif-tx.o |
diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c new file mode 100644 index 000000000000..246081aae8ca --- /dev/null +++ b/sound/soc/codecs/sigmadsp-i2c.c | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Load Analog Devices SigmaStudio firmware files | ||
3 | * | ||
4 | * Copyright 2009-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/i2c.h> | ||
10 | #include <linux/export.h> | ||
11 | #include <linux/module.h> | ||
12 | |||
13 | #include "sigmadsp.h" | ||
14 | |||
15 | static int sigma_action_write_i2c(void *control_data, | ||
16 | const struct sigma_action *sa, size_t len) | ||
17 | { | ||
18 | return i2c_master_send(control_data, (const unsigned char *)&sa->addr, | ||
19 | len); | ||
20 | } | ||
21 | |||
22 | int process_sigma_firmware(struct i2c_client *client, const char *name) | ||
23 | { | ||
24 | struct sigma_firmware ssfw; | ||
25 | |||
26 | ssfw.control_data = client; | ||
27 | ssfw.write = sigma_action_write_i2c; | ||
28 | |||
29 | return _process_sigma_firmware(&client->dev, &ssfw, name); | ||
30 | } | ||
31 | EXPORT_SYMBOL(process_sigma_firmware); | ||
32 | |||
33 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | ||
34 | MODULE_DESCRIPTION("SigmaDSP I2C firmware loader"); | ||
35 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/sigmadsp-regmap.c b/sound/soc/codecs/sigmadsp-regmap.c new file mode 100644 index 000000000000..f78ed8d2cfb2 --- /dev/null +++ b/sound/soc/codecs/sigmadsp-regmap.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Load Analog Devices SigmaStudio firmware files | ||
3 | * | ||
4 | * Copyright 2009-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/regmap.h> | ||
10 | #include <linux/export.h> | ||
11 | #include <linux/module.h> | ||
12 | |||
13 | #include "sigmadsp.h" | ||
14 | |||
15 | static int sigma_action_write_regmap(void *control_data, | ||
16 | const struct sigma_action *sa, size_t len) | ||
17 | { | ||
18 | return regmap_raw_write(control_data, be16_to_cpu(sa->addr), | ||
19 | sa->payload, len - 2); | ||
20 | } | ||
21 | |||
22 | int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, | ||
23 | const char *name) | ||
24 | { | ||
25 | struct sigma_firmware ssfw; | ||
26 | |||
27 | ssfw.control_data = regmap; | ||
28 | ssfw.write = sigma_action_write_regmap; | ||
29 | |||
30 | return _process_sigma_firmware(dev, &ssfw, name); | ||
31 | } | ||
32 | EXPORT_SYMBOL(process_sigma_firmware_regmap); | ||
33 | |||
34 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | ||
35 | MODULE_DESCRIPTION("SigmaDSP regmap firmware loader"); | ||
36 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c index 4068f2491232..f2de7e049bc6 100644 --- a/sound/soc/codecs/sigmadsp.c +++ b/sound/soc/codecs/sigmadsp.c | |||
@@ -34,23 +34,6 @@ enum { | |||
34 | SIGMA_ACTION_END, | 34 | SIGMA_ACTION_END, |
35 | }; | 35 | }; |
36 | 36 | ||
37 | struct sigma_action { | ||
38 | u8 instr; | ||
39 | u8 len_hi; | ||
40 | __le16 len; | ||
41 | __be16 addr; | ||
42 | unsigned char payload[]; | ||
43 | } __packed; | ||
44 | |||
45 | struct sigma_firmware { | ||
46 | const struct firmware *fw; | ||
47 | size_t pos; | ||
48 | |||
49 | void *control_data; | ||
50 | int (*write)(void *control_data, const struct sigma_action *sa, | ||
51 | size_t len); | ||
52 | }; | ||
53 | |||
54 | static inline u32 sigma_action_len(struct sigma_action *sa) | 37 | static inline u32 sigma_action_len(struct sigma_action *sa) |
55 | { | 38 | { |
56 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); | 39 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); |
@@ -138,7 +121,7 @@ process_sigma_actions(struct sigma_firmware *ssfw) | |||
138 | return 0; | 121 | return 0; |
139 | } | 122 | } |
140 | 123 | ||
141 | static int _process_sigma_firmware(struct device *dev, | 124 | int _process_sigma_firmware(struct device *dev, |
142 | struct sigma_firmware *ssfw, const char *name) | 125 | struct sigma_firmware *ssfw, const char *name) |
143 | { | 126 | { |
144 | int ret; | 127 | int ret; |
@@ -197,50 +180,6 @@ static int _process_sigma_firmware(struct device *dev, | |||
197 | 180 | ||
198 | return ret; | 181 | return ret; |
199 | } | 182 | } |
200 | 183 | EXPORT_SYMBOL_GPL(_process_sigma_firmware); | |
201 | #if IS_ENABLED(CONFIG_I2C) | ||
202 | |||
203 | static int sigma_action_write_i2c(void *control_data, | ||
204 | const struct sigma_action *sa, size_t len) | ||
205 | { | ||
206 | return i2c_master_send(control_data, (const unsigned char *)&sa->addr, | ||
207 | len); | ||
208 | } | ||
209 | |||
210 | int process_sigma_firmware(struct i2c_client *client, const char *name) | ||
211 | { | ||
212 | struct sigma_firmware ssfw; | ||
213 | |||
214 | ssfw.control_data = client; | ||
215 | ssfw.write = sigma_action_write_i2c; | ||
216 | |||
217 | return _process_sigma_firmware(&client->dev, &ssfw, name); | ||
218 | } | ||
219 | EXPORT_SYMBOL(process_sigma_firmware); | ||
220 | |||
221 | #endif | ||
222 | |||
223 | #if IS_ENABLED(CONFIG_REGMAP) | ||
224 | |||
225 | static int sigma_action_write_regmap(void *control_data, | ||
226 | const struct sigma_action *sa, size_t len) | ||
227 | { | ||
228 | return regmap_raw_write(control_data, be16_to_cpu(sa->addr), | ||
229 | sa->payload, len - 2); | ||
230 | } | ||
231 | |||
232 | int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, | ||
233 | const char *name) | ||
234 | { | ||
235 | struct sigma_firmware ssfw; | ||
236 | |||
237 | ssfw.control_data = regmap; | ||
238 | ssfw.write = sigma_action_write_regmap; | ||
239 | |||
240 | return _process_sigma_firmware(dev, &ssfw, name); | ||
241 | } | ||
242 | EXPORT_SYMBOL(process_sigma_firmware_regmap); | ||
243 | |||
244 | #endif | ||
245 | 184 | ||
246 | MODULE_LICENSE("GPL"); | 185 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/codecs/sigmadsp.h b/sound/soc/codecs/sigmadsp.h index e439cbd7af7d..c47cd23e9827 100644 --- a/sound/soc/codecs/sigmadsp.h +++ b/sound/soc/codecs/sigmadsp.h | |||
@@ -12,6 +12,26 @@ | |||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/regmap.h> | 13 | #include <linux/regmap.h> |
14 | 14 | ||
15 | struct sigma_action { | ||
16 | u8 instr; | ||
17 | u8 len_hi; | ||
18 | __le16 len; | ||
19 | __be16 addr; | ||
20 | unsigned char payload[]; | ||
21 | } __packed; | ||
22 | |||
23 | struct sigma_firmware { | ||
24 | const struct firmware *fw; | ||
25 | size_t pos; | ||
26 | |||
27 | void *control_data; | ||
28 | int (*write)(void *control_data, const struct sigma_action *sa, | ||
29 | size_t len); | ||
30 | }; | ||
31 | |||
32 | int _process_sigma_firmware(struct device *dev, | ||
33 | struct sigma_firmware *ssfw, const char *name); | ||
34 | |||
15 | struct i2c_client; | 35 | struct i2c_client; |
16 | 36 | ||
17 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | 37 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); |
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 6bb0ea59284f..a609aafc994d 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c | |||
@@ -923,8 +923,8 @@ static int fsl_soc_dma_probe(struct platform_device *pdev) | |||
923 | dma->dai.pcm_free = fsl_dma_free_dma_buffers; | 923 | dma->dai.pcm_free = fsl_dma_free_dma_buffers; |
924 | 924 | ||
925 | /* Store the SSI-specific information that we need */ | 925 | /* Store the SSI-specific information that we need */ |
926 | dma->ssi_stx_phys = res.start + offsetof(struct ccsr_ssi, stx0); | 926 | dma->ssi_stx_phys = res.start + CCSR_SSI_STX0; |
927 | dma->ssi_srx_phys = res.start + offsetof(struct ccsr_ssi, srx0); | 927 | dma->ssi_srx_phys = res.start + CCSR_SSI_SRX0; |
928 | 928 | ||
929 | iprop = of_get_property(ssi_np, "fsl,fifo-depth", NULL); | 929 | iprop = of_get_property(ssi_np, "fsl,fifo-depth", NULL); |
930 | if (iprop) | 930 | if (iprop) |
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index b912d45a2a4c..d7a60614dd21 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c | |||
@@ -762,7 +762,7 @@ static int fsl_spdif_vbit_get(struct snd_kcontrol *kcontrol, | |||
762 | struct regmap *regmap = spdif_priv->regmap; | 762 | struct regmap *regmap = spdif_priv->regmap; |
763 | u32 val; | 763 | u32 val; |
764 | 764 | ||
765 | val = regmap_read(regmap, REG_SPDIF_SIS, &val); | 765 | regmap_read(regmap, REG_SPDIF_SIS, &val); |
766 | ucontrol->value.integer.value[0] = (val & INT_VAL_NOGOOD) != 0; | 766 | ucontrol->value.integer.value[0] = (val & INT_VAL_NOGOOD) != 0; |
767 | regmap_write(regmap, REG_SPDIF_SIC, INT_VAL_NOGOOD); | 767 | regmap_write(regmap, REG_SPDIF_SIC, INT_VAL_NOGOOD); |
768 | 768 | ||
@@ -1076,7 +1076,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, | |||
1076 | goto out; | 1076 | goto out; |
1077 | } else if (arate / rate[index] == 1) { | 1077 | } else if (arate / rate[index] == 1) { |
1078 | /* A little bigger than expect */ | 1078 | /* A little bigger than expect */ |
1079 | sub = (arate - rate[index]) * 100000; | 1079 | sub = (u64)(arate - rate[index]) * 100000; |
1080 | do_div(sub, rate[index]); | 1080 | do_div(sub, rate[index]); |
1081 | if (sub >= savesub) | 1081 | if (sub >= savesub) |
1082 | continue; | 1082 | continue; |
@@ -1086,7 +1086,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, | |||
1086 | spdif_priv->txrate[index] = arate; | 1086 | spdif_priv->txrate[index] = arate; |
1087 | } else if (rate[index] / arate == 1) { | 1087 | } else if (rate[index] / arate == 1) { |
1088 | /* A little smaller than expect */ | 1088 | /* A little smaller than expect */ |
1089 | sub = (rate[index] - arate) * 100000; | 1089 | sub = (u64)(rate[index] - arate) * 100000; |
1090 | do_div(sub, rate[index]); | 1090 | do_div(sub, rate[index]); |
1091 | if (sub >= savesub) | 1091 | if (sub >= savesub) |
1092 | continue; | 1092 | continue; |
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c index 0849b7b83f0a..0db94f492e97 100644 --- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c | |||
@@ -59,7 +59,6 @@ int imx_pcm_dma_init(struct platform_device *pdev) | |||
59 | { | 59 | { |
60 | return devm_snd_dmaengine_pcm_register(&pdev->dev, | 60 | return devm_snd_dmaengine_pcm_register(&pdev->dev, |
61 | &imx_dmaengine_pcm_config, | 61 | &imx_dmaengine_pcm_config, |
62 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | | ||
63 | SND_DMAENGINE_PCM_FLAG_COMPAT); | 62 | SND_DMAENGINE_PCM_FLAG_COMPAT); |
64 | } | 63 | } |
65 | EXPORT_SYMBOL_GPL(imx_pcm_dma_init); | 64 | EXPORT_SYMBOL_GPL(imx_pcm_dma_init); |
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 6acb225ec6fd..2434b6d61675 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig | |||
@@ -11,6 +11,7 @@ config SND_PXA2XX_SOC | |||
11 | config SND_MMP_SOC | 11 | config SND_MMP_SOC |
12 | bool "Soc Audio for Marvell MMP chips" | 12 | bool "Soc Audio for Marvell MMP chips" |
13 | depends on ARCH_MMP | 13 | depends on ARCH_MMP |
14 | select MMP_SRAM | ||
14 | select SND_SOC_GENERIC_DMAENGINE_PCM | 15 | select SND_SOC_GENERIC_DMAENGINE_PCM |
15 | select SND_ARM | 16 | select SND_ARM |
16 | help | 17 | help |
@@ -40,7 +41,7 @@ config SND_MMP_SOC_SSPA | |||
40 | 41 | ||
41 | config SND_PXA2XX_SOC_CORGI | 42 | config SND_PXA2XX_SOC_CORGI |
42 | tristate "SoC Audio support for Sharp Zaurus SL-C7x0" | 43 | tristate "SoC Audio support for Sharp Zaurus SL-C7x0" |
43 | depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx | 44 | depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx && I2C |
44 | select SND_PXA2XX_SOC_I2S | 45 | select SND_PXA2XX_SOC_I2S |
45 | select SND_SOC_WM8731 | 46 | select SND_SOC_WM8731 |
46 | help | 47 | help |
@@ -49,7 +50,7 @@ config SND_PXA2XX_SOC_CORGI | |||
49 | 50 | ||
50 | config SND_PXA2XX_SOC_SPITZ | 51 | config SND_PXA2XX_SOC_SPITZ |
51 | tristate "SoC Audio support for Sharp Zaurus SL-Cxx00" | 52 | tristate "SoC Audio support for Sharp Zaurus SL-Cxx00" |
52 | depends on SND_PXA2XX_SOC && PXA_SHARP_Cxx00 | 53 | depends on SND_PXA2XX_SOC && PXA_SHARP_Cxx00 && I2C |
53 | select SND_PXA2XX_SOC_I2S | 54 | select SND_PXA2XX_SOC_I2S |
54 | select SND_SOC_WM8750 | 55 | select SND_SOC_WM8750 |
55 | help | 56 | help |
@@ -58,7 +59,7 @@ config SND_PXA2XX_SOC_SPITZ | |||
58 | 59 | ||
59 | config SND_PXA2XX_SOC_Z2 | 60 | config SND_PXA2XX_SOC_Z2 |
60 | tristate "SoC Audio support for Zipit Z2" | 61 | tristate "SoC Audio support for Zipit Z2" |
61 | depends on SND_PXA2XX_SOC && MACH_ZIPIT2 | 62 | depends on SND_PXA2XX_SOC && MACH_ZIPIT2 && I2C |
62 | select SND_PXA2XX_SOC_I2S | 63 | select SND_PXA2XX_SOC_I2S |
63 | select SND_SOC_WM8750 | 64 | select SND_SOC_WM8750 |
64 | help | 65 | help |
@@ -66,7 +67,7 @@ config SND_PXA2XX_SOC_Z2 | |||
66 | 67 | ||
67 | config SND_PXA2XX_SOC_POODLE | 68 | config SND_PXA2XX_SOC_POODLE |
68 | tristate "SoC Audio support for Poodle" | 69 | tristate "SoC Audio support for Poodle" |
69 | depends on SND_PXA2XX_SOC && MACH_POODLE | 70 | depends on SND_PXA2XX_SOC && MACH_POODLE && I2C |
70 | select SND_PXA2XX_SOC_I2S | 71 | select SND_PXA2XX_SOC_I2S |
71 | select SND_SOC_WM8731 | 72 | select SND_SOC_WM8731 |
72 | help | 73 | help |
@@ -181,7 +182,7 @@ config SND_PXA2XX_SOC_HX4700 | |||
181 | 182 | ||
182 | config SND_PXA2XX_SOC_MAGICIAN | 183 | config SND_PXA2XX_SOC_MAGICIAN |
183 | tristate "SoC Audio support for HTC Magician" | 184 | tristate "SoC Audio support for HTC Magician" |
184 | depends on SND_PXA2XX_SOC && MACH_MAGICIAN | 185 | depends on SND_PXA2XX_SOC && MACH_MAGICIAN && I2C |
185 | select SND_PXA2XX_SOC_I2S | 186 | select SND_PXA2XX_SOC_I2S |
186 | select SND_PXA_SOC_SSP | 187 | select SND_PXA_SOC_SSP |
187 | select SND_SOC_UDA1380 | 188 | select SND_SOC_UDA1380 |
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 91880156e1ae..4e86265f625c 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -315,7 +315,7 @@ static void rsnd_dma_of_name(struct rsnd_dma *dma, | |||
315 | dst_mod = mod[index]; | 315 | dst_mod = mod[index]; |
316 | } else { | 316 | } else { |
317 | src_mod = mod[index]; | 317 | src_mod = mod[index]; |
318 | dst_mod = mod[index + 1]; | 318 | dst_mod = mod[index - 1]; |
319 | } | 319 | } |
320 | 320 | ||
321 | index = 0; | 321 | index = 0; |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index a74b9bf23d9f..cdc837ed144d 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2755,7 +2755,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2755 | unsigned int mask = (1 << fls(max)) - 1; | 2755 | unsigned int mask = (1 << fls(max)) - 1; |
2756 | unsigned int invert = mc->invert; | 2756 | unsigned int invert = mc->invert; |
2757 | unsigned int val; | 2757 | unsigned int val; |
2758 | int connect, change; | 2758 | int connect, change, reg_change = 0; |
2759 | struct snd_soc_dapm_update update; | 2759 | struct snd_soc_dapm_update update; |
2760 | int ret = 0; | 2760 | int ret = 0; |
2761 | 2761 | ||
@@ -2773,20 +2773,23 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2773 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | 2773 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); |
2774 | 2774 | ||
2775 | change = dapm_kcontrol_set_value(kcontrol, val); | 2775 | change = dapm_kcontrol_set_value(kcontrol, val); |
2776 | if (change) { | ||
2777 | if (reg != SND_SOC_NOPM) { | ||
2778 | mask = mask << shift; | ||
2779 | val = val << shift; | ||
2780 | |||
2781 | if (snd_soc_test_bits(codec, reg, mask, val)) { | ||
2782 | update.kcontrol = kcontrol; | ||
2783 | update.reg = reg; | ||
2784 | update.mask = mask; | ||
2785 | update.val = val; | ||
2786 | card->update = &update; | ||
2787 | } | ||
2788 | 2776 | ||
2777 | if (reg != SND_SOC_NOPM) { | ||
2778 | mask = mask << shift; | ||
2779 | val = val << shift; | ||
2780 | |||
2781 | reg_change = snd_soc_test_bits(codec, reg, mask, val); | ||
2782 | } | ||
2783 | |||
2784 | if (change || reg_change) { | ||
2785 | if (reg_change) { | ||
2786 | update.kcontrol = kcontrol; | ||
2787 | update.reg = reg; | ||
2788 | update.mask = mask; | ||
2789 | update.val = val; | ||
2790 | card->update = &update; | ||
2789 | } | 2791 | } |
2792 | change |= reg_change; | ||
2790 | 2793 | ||
2791 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); | 2794 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); |
2792 | 2795 | ||
diff --git a/sound/usb/card.c b/sound/usb/card.c index c3b5b7dca1c3..a09e5f3519e3 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -307,6 +307,11 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
307 | 307 | ||
308 | static int snd_usb_audio_free(struct snd_usb_audio *chip) | 308 | static int snd_usb_audio_free(struct snd_usb_audio *chip) |
309 | { | 309 | { |
310 | struct list_head *p, *n; | ||
311 | |||
312 | list_for_each_safe(p, n, &chip->ep_list) | ||
313 | snd_usb_endpoint_free(p); | ||
314 | |||
310 | mutex_destroy(&chip->mutex); | 315 | mutex_destroy(&chip->mutex); |
311 | kfree(chip); | 316 | kfree(chip); |
312 | return 0; | 317 | return 0; |
@@ -585,7 +590,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, | |||
585 | struct snd_usb_audio *chip) | 590 | struct snd_usb_audio *chip) |
586 | { | 591 | { |
587 | struct snd_card *card; | 592 | struct snd_card *card; |
588 | struct list_head *p, *n; | 593 | struct list_head *p; |
589 | 594 | ||
590 | if (chip == (void *)-1L) | 595 | if (chip == (void *)-1L) |
591 | return; | 596 | return; |
@@ -598,14 +603,16 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, | |||
598 | mutex_lock(®ister_mutex); | 603 | mutex_lock(®ister_mutex); |
599 | chip->num_interfaces--; | 604 | chip->num_interfaces--; |
600 | if (chip->num_interfaces <= 0) { | 605 | if (chip->num_interfaces <= 0) { |
606 | struct snd_usb_endpoint *ep; | ||
607 | |||
601 | snd_card_disconnect(card); | 608 | snd_card_disconnect(card); |
602 | /* release the pcm resources */ | 609 | /* release the pcm resources */ |
603 | list_for_each(p, &chip->pcm_list) { | 610 | list_for_each(p, &chip->pcm_list) { |
604 | snd_usb_stream_disconnect(p); | 611 | snd_usb_stream_disconnect(p); |
605 | } | 612 | } |
606 | /* release the endpoint resources */ | 613 | /* release the endpoint resources */ |
607 | list_for_each_safe(p, n, &chip->ep_list) { | 614 | list_for_each_entry(ep, &chip->ep_list, list) { |
608 | snd_usb_endpoint_free(p); | 615 | snd_usb_endpoint_release(ep); |
609 | } | 616 | } |
610 | /* release the midi resources */ | 617 | /* release the midi resources */ |
611 | list_for_each(p, &chip->midi_list) { | 618 | list_for_each(p, &chip->midi_list) { |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 289f582c9130..114e3e7ff511 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -987,19 +987,30 @@ void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep) | |||
987 | } | 987 | } |
988 | 988 | ||
989 | /** | 989 | /** |
990 | * snd_usb_endpoint_release: Tear down an snd_usb_endpoint | ||
991 | * | ||
992 | * @ep: the endpoint to release | ||
993 | * | ||
994 | * This function does not care for the endpoint's use count but will tear | ||
995 | * down all the streaming URBs immediately. | ||
996 | */ | ||
997 | void snd_usb_endpoint_release(struct snd_usb_endpoint *ep) | ||
998 | { | ||
999 | release_urbs(ep, 1); | ||
1000 | } | ||
1001 | |||
1002 | /** | ||
990 | * snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint | 1003 | * snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint |
991 | * | 1004 | * |
992 | * @ep: the list header of the endpoint to free | 1005 | * @ep: the list header of the endpoint to free |
993 | * | 1006 | * |
994 | * This function does not care for the endpoint's use count but will tear | 1007 | * This free all resources of the given ep. |
995 | * down all the streaming URBs immediately and free all resources. | ||
996 | */ | 1008 | */ |
997 | void snd_usb_endpoint_free(struct list_head *head) | 1009 | void snd_usb_endpoint_free(struct list_head *head) |
998 | { | 1010 | { |
999 | struct snd_usb_endpoint *ep; | 1011 | struct snd_usb_endpoint *ep; |
1000 | 1012 | ||
1001 | ep = list_entry(head, struct snd_usb_endpoint, list); | 1013 | ep = list_entry(head, struct snd_usb_endpoint, list); |
1002 | release_urbs(ep, 1); | ||
1003 | kfree(ep); | 1014 | kfree(ep); |
1004 | } | 1015 | } |
1005 | 1016 | ||
diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h index 1c7e8ee48abc..e61ee5c356a3 100644 --- a/sound/usb/endpoint.h +++ b/sound/usb/endpoint.h | |||
@@ -23,6 +23,7 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep); | |||
23 | void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep); | 23 | void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep); |
24 | int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep); | 24 | int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep); |
25 | void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep); | 25 | void snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep); |
26 | void snd_usb_endpoint_release(struct snd_usb_endpoint *ep); | ||
26 | void snd_usb_endpoint_free(struct list_head *head); | 27 | void snd_usb_endpoint_free(struct list_head *head); |
27 | 28 | ||
28 | int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep); | 29 | int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep); |