-
Notifications
You must be signed in to change notification settings - Fork 11
/
below315.patch
242 lines (214 loc) · 8.33 KB
/
below315.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
diff --git a/madifx.c b/madifx.c
index d2a4101..a2e629e 100644
--- a/madifx.c
+++ b/madifx.c
@@ -444,7 +444,7 @@ struct hdspm {
};
-static const struct pci_device_id snd_madifx_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(snd_madifx_ids) = {
{
.vendor = PCI_VENDOR_ID_XILINX,
.device = 0x3fc7,
@@ -731,8 +731,7 @@ static int madifx_get_external_rate(struct hdspm *hdspm)
current_clock -= 3;
break;
default:
- dev_err(hdspm->card->dev,
- "MADIFX: Unknown clock source\n");
+ snd_printk(KERN_ERR "MADIFX: Unknown clock source\n");
return 0;
}
@@ -762,7 +761,7 @@ static int madifx_set_rate(struct hdspm *hdspm, int rate, int called_internally)
just make a warning an remember setting
for future master mode switching */
- dev_warn(hdspm->card->dev,
+ snd_printk(KERN_WARNING
"MADIFX: Warning: device is not running as a clock master.\n");
not_set = 1;
} else {
@@ -771,7 +770,7 @@ static int madifx_set_rate(struct hdspm *hdspm, int rate, int called_internally)
if (rate != external_freq) {
- dev_warn(hdspm->card->dev,
+ snd_printk(KERN_WARNING
"MADIFX: Warning: Requested rate %d doesn't match external rate %d\n",
rate, external_freq);
not_set = 1;
@@ -839,8 +838,8 @@ static int madifx_set_rate(struct hdspm *hdspm, int rate, int called_internally)
if (current_speed != target_speed
&& (hdspm->capture_pid >= 0 || hdspm->playback_pid >= 0)) {
- dev_err
- (hdspm->card->dev, "MADIFX: "
+ snd_printk
+ (KERN_ERR "MADIFX: "
"cannot change from %s speed to %s speed mode "
"(capture PID = %d, playback PID = %d)\n",
madifx_speed_names[current_speed],
@@ -1184,8 +1183,7 @@ static int snd_madifx_create_midi(struct snd_card *card,
break;
default:
- dev_err(hdspm->card->dev,
- "MADIFX: Unknown MIDI port %i\n", id);
+ snd_printk(KERN_ERR "MADIFX: Unknown MIDI port %i\n", id);
return -EINVAL;
}
@@ -1336,8 +1334,7 @@ static int madifx_external_freq_index(struct hdspm *hdspm, enum madifx_syncsourc
freq0_bit = MADIFX_sync_in_freq0;
break;
default:
- dev_err(hdspm->card->dev,
- "MADIFX: Unknown external port ID %i\n", port);
+ snd_printk(KERN_ERR "MADIFX: Unknown external port ID %i\n", port);
return 0;
}
@@ -2077,7 +2074,7 @@ static struct snd_kcontrol_new snd_madifx_playback_mixer = HDSPM_PLAYBACK_MIXER;
static int madifx_update_simple_mixer_controls(struct hdspm *hdspm)
{
int i;
- dev_warn(hdspm->card->dev, "MADIFX: updating broken mixer\n");
+ snd_printk(KERN_WARNING "MADIFX: updating broken mixer\n");
for (i = hdspm->ds_out_channels; i < hdspm->ss_out_channels; ++i) {
if (hdspm->system_sample_rate > 48000) {
@@ -2610,7 +2607,7 @@ static int snd_madifx_hw_params(struct snd_pcm_substream *substream,
spin_lock_irq(&hdspm->lock);
err = madifx_set_rate(hdspm, params_rate(params), 0);
if (err < 0) {
- dev_info(hdspm->card->dev, "err on madifx_set_rate: %d\n", err);
+ snd_printk(KERN_INFO "err on madifx_set_rate: %d\n", err);
spin_unlock_irq(&hdspm->lock);
_snd_pcm_hw_param_setempty(params,
SNDRV_PCM_HW_PARAM_RATE);
@@ -2621,8 +2618,7 @@ static int snd_madifx_hw_params(struct snd_pcm_substream *substream,
err = madifx_set_interrupt_interval(hdspm,
params_period_size(params));
if (err < 0) {
- dev_info(hdspm->card->dev,
- "err on madifx_set_interrupt_interval: %d\n", err);
+ snd_printk(KERN_INFO "err on madifx_set_interrupt_interval: %d\n", err);
_snd_pcm_hw_param_setempty(params,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE);
return err;
@@ -2644,8 +2640,7 @@ static int snd_madifx_hw_params(struct snd_pcm_substream *substream,
err = snd_pcm_lib_malloc_pages(substream, wanted);
if (err < 0) {
- dev_info(hdspm->card->dev,
- "err on snd_pcm_lib_malloc_pages: %d\n", err);
+ snd_printk(KERN_INFO "err on snd_pcm_lib_malloc_pages: %d\n", err);
return err;
}
}
@@ -2726,14 +2721,12 @@ static int snd_madifx_hw_params(struct snd_pcm_substream *substream,
/* Switch to native float format if requested */
if (SNDRV_PCM_FORMAT_FLOAT_LE == params_format(params)) {
if (!(hdspm->control_register & MADIFX_float_format))
- dev_info(hdspm->card->dev,
- "hdspm: Switching to native 32bit LE float format.\n");
+ snd_printk(KERN_INFO "hdspm: Switching to native 32bit LE float format.\n");
hdspm->control_register |= MADIFX_float_format;
} else if (SNDRV_PCM_FORMAT_S32_LE == params_format(params)) {
if (hdspm->control_register & MADIFX_float_format)
- dev_info(hdspm->card->dev,
- "hdspm: Switching to native 32bit LE integer format.\n");
+ snd_printk(KERN_INFO "hdspm: Switching to native 32bit LE integer format.\n");
hdspm->control_register &= ~MADIFX_float_format;
}
@@ -2778,7 +2771,7 @@ static int snd_madifx_channel_info(struct snd_pcm_substream *substream,
int last_madi_channel = 193;
if (snd_BUG_ON(info->channel >= hdspm->max_channels_out)) {
- dev_info(hdspm->card->dev,
+ snd_printk(KERN_INFO
"snd_madifx_channel_info: output channel out of range (%d)\n",
info->channel);
return -EINVAL;
@@ -2834,7 +2827,7 @@ static int snd_madifx_channel_info(struct snd_pcm_substream *substream,
64 : 256;
} else {
if (snd_BUG_ON(info->channel >= hdspm->max_channels_in)) {
- dev_info(hdspm->card->dev,
+ snd_printk(KERN_INFO
"snd_madifx_channel_info: input channel out of range (%d)\n",
info->channel);
return -EINVAL;
@@ -3566,8 +3559,8 @@ static int snd_madifx_preallocate_memory(struct hdspm *hdspm)
MADIFX_MAX_PAGE_TABLE_SIZE, GFP_KERNEL);
if (!hdspm->dmaPageTable) {
- dev_err(hdspm->card->dev,
- "MADIFX: unable to kmalloc dmaPageTable memory\n");
+ snd_printk(KERN_ERR
+ "MADIFX: unable to kmalloc dmaPageTable memory\n");
return -ENOMEM;
}
@@ -3590,8 +3583,8 @@ static int snd_madifx_preallocate_memory(struct hdspm *hdspm)
snd_dma_pci_data(hdspm->pci),
MADIFX_LEVEL_BUFFER_SIZE, &hdspm->dmaLevelBuffer);
if (err < 0) {
- dev_err(hdspm->card->dev,
- "MADIFX: Unable to allocate DMA level buffer\n");
+ snd_printk(KERN_ERR
+ "MADIFX: Unable to allocate DMA level buffer\n");
return -ENOMEM;
}
@@ -3710,8 +3703,7 @@ static int snd_madifx_create_alsa_devices(struct snd_card *card,
err = snd_card_register(card);
if (err < 0) {
- dev_err(hdspm->card->dev,
- "MADIFX: error registering card\n");
+ snd_printk(KERN_ERR "MADIFX: error registering card\n");
return err;
}
@@ -3745,9 +3737,9 @@ static int snd_madifx_create(struct snd_card *card,
hdspm->midiPorts = 4;
break;
default:
- dev_err(hdspm->card->dev,
- "MADIFX: unknown firmware revision %x\n",
- hdspm->firmware_rev);
+ snd_printk(KERN_ERR
+ "MADIFX: unknown firmware revision %x\n",
+ hdspm->firmware_rev);
return -ENODEV;
}
@@ -3769,8 +3761,8 @@ static int snd_madifx_create(struct snd_card *card,
hdspm->iobase = ioremap_nocache(hdspm->port, io_extent);
if (!hdspm->iobase) {
- dev_err(hdspm->card->dev,
- "MADIFX: unable to remap region 0x%lx-0x%lx\n",
+ snd_printk(KERN_ERR
+ "MADIFX: unable to remap region 0x%lx-0x%lx\n",
hdspm->port, hdspm->port + io_extent - 1);
return -EBUSY;
}
@@ -3780,8 +3772,7 @@ static int snd_madifx_create(struct snd_card *card,
if (request_irq(pci->irq, snd_madifx_interrupt,
IRQF_SHARED, KBUILD_MODNAME, hdspm)) {
- dev_err(hdspm->card->dev,
- "MADIFX: unable to use IRQ %d\n", pci->irq);
+ snd_printk(KERN_ERR "MADIFX: unable to use IRQ %d\n", pci->irq);
return -EBUSY;
}
@@ -3794,9 +3785,9 @@ static int snd_madifx_create(struct snd_card *card,
hdspm->newmixer = kzalloc(sizeof(struct madifx_newmixer), GFP_KERNEL);
if (!hdspm->newmixer) {
- dev_err(hdspm->card->dev,
- "MADIFX: unable to kmalloc Mixer memory of %d Bytes\n",
- (int)sizeof(struct madifx_newmixer));
+ snd_printk(KERN_ERR
+ "MADIFX: unable to kmalloc Mixer memory of %d Bytes\n",
+ (int)sizeof(struct madifx_newmixer));
return -ENOMEM;
}
@@ -3938,7 +3929,7 @@ static int snd_madifx_probe(struct pci_dev *pci,
return -ENOENT;
}
- err = snd_card_new(&pci->dev, index[dev], id[dev],
+ err = snd_card_create(index[dev], id[dev],
THIS_MODULE, sizeof(struct hdspm), &card);
if (err < 0)
return err;
@@ -3948,6 +3939,8 @@ static int snd_madifx_probe(struct pci_dev *pci,
hdspm->dev = dev;
hdspm->pci = pci;
+ snd_card_set_dev(card, &pci->dev);
+
err = snd_madifx_create(card, hdspm);
if (err < 0) {
snd_card_free(card);