~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to drivers/isdn/mISDN/dsp_pipeline.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2012-06-21 09:16:38 UTC
  • Revision ID: package-import@ubuntu.com-20120621091638-gubhv4nox8xez1ct
Tags: 3.5.0-1.1
[ Andy Whitcroft]

* Rebuild lowlatency against Ubuntu-3.5.0-1.1
* All new configuration system to allow configuration deltas to be
  exposed via debian.lowlatency/config-delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        *buf = 0;
64
64
        for (i = 0; i < elem->num_args; i++)
65
65
                p += sprintf(p, "Name:        %s\n%s%s%sDescription: %s\n\n",
66
 
                          elem->args[i].name,
67
 
                          elem->args[i].def ? "Default:     " : "",
68
 
                          elem->args[i].def ? elem->args[i].def : "",
69
 
                          elem->args[i].def ? "\n" : "",
70
 
                          elem->args[i].desc);
 
66
                             elem->args[i].name,
 
67
                             elem->args[i].def ? "Default:     " : "",
 
68
                             elem->args[i].def ? elem->args[i].def : "",
 
69
                             elem->args[i].def ? "\n" : "",
 
70
                             elem->args[i].desc);
71
71
 
72
72
        return p - buf;
73
73
}
106
106
        ret = device_register(&entry->dev);
107
107
        if (ret) {
108
108
                printk(KERN_ERR "%s: failed to register %s\n",
109
 
                        __func__, elem->name);
 
109
                       __func__, elem->name);
110
110
                goto err1;
111
111
        }
112
112
        list_add_tail(&entry->list, &dsp_elements);
113
113
 
114
114
        for (i = 0; i < ARRAY_SIZE(element_attributes); ++i) {
115
115
                ret = device_create_file(&entry->dev,
116
 
                                &element_attributes[i]);
 
116
                                         &element_attributes[i]);
117
117
                if (ret) {
118
118
                        printk(KERN_ERR "%s: failed to create device file\n",
119
 
                                __func__);
 
119
                               __func__);
120
120
                        goto err2;
121
121
                }
122
122
        }
148
148
                        device_unregister(&entry->dev);
149
149
#ifdef PIPELINE_DEBUG
150
150
                        printk(KERN_DEBUG "%s: %s unregistered\n",
151
 
                                __func__, elem->name);
 
151
                               __func__, elem->name);
152
152
#endif
153
153
                        return;
154
154
                }
182
182
        list_for_each_entry_safe(entry, n, &dsp_elements, list) {
183
183
                list_del(&entry->list);
184
184
                printk(KERN_WARNING "%s: element was still registered: %s\n",
185
 
                        __func__, entry->elem->name);
 
185
                       __func__, entry->elem->name);
186
186
                kfree(entry);
187
187
        }
188
188
 
213
213
                list_del(&entry->list);
214
214
                if (entry->elem == dsp_hwec)
215
215
                        dsp_hwec_disable(container_of(pipeline, struct dsp,
216
 
                                pipeline));
 
216
                                                      pipeline));
217
217
                else
218
218
                        entry->elem->free(entry->p);
219
219
                kfree(entry);
271
271
                                elem = entry->elem;
272
272
 
273
273
                                pipeline_entry = kmalloc(sizeof(struct
274
 
                                        dsp_pipeline_entry), GFP_ATOMIC);
 
274
                                                                dsp_pipeline_entry), GFP_ATOMIC);
275
275
                                if (!pipeline_entry) {
276
276
                                        printk(KERN_ERR "%s: failed to add "
277
 
                                            "entry to pipeline: %s (out of "
278
 
                                            "memory)\n", __func__, elem->name);
 
277
                                               "entry to pipeline: %s (out of "
 
278
                                               "memory)\n", __func__, elem->name);
279
279
                                        incomplete = 1;
280
280
                                        goto _out;
281
281
                                }
285
285
                                        /* This is a hack to make the hwec
286
286
                                           available as a pipeline module */
287
287
                                        dsp_hwec_enable(container_of(pipeline,
288
 
                                                struct dsp, pipeline), args);
 
288
                                                                     struct dsp, pipeline), args);
289
289
                                        list_add_tail(&pipeline_entry->list,
290
 
                                                &pipeline->list);
 
290
                                                      &pipeline->list);
291
291
                                } else {
292
292
                                        pipeline_entry->p = elem->new(args);
293
293
                                        if (pipeline_entry->p) {
294
294
                                                list_add_tail(&pipeline_entry->
295
 
                                                        list, &pipeline->list);
 
295
                                                              list, &pipeline->list);
296
296
#ifdef PIPELINE_DEBUG
297
297
                                                printk(KERN_DEBUG "%s: created "
298
 
                                                    "instance of %s%s%s\n",
299
 
                                                    __func__, name, args ?
300
 
                                                    " with args " : "", args ?
301
 
                                                    args : "");
 
298
                                                       "instance of %s%s%s\n",
 
299
                                                       __func__, name, args ?
 
300
                                                       " with args " : "", args ?
 
301
                                                       args : "");
302
302
#endif
303
303
                                        } else {
304
304
                                                printk(KERN_ERR "%s: failed "
305
 
                                                  "to add entry to pipeline: "
306
 
                                                  "%s (new() returned NULL)\n",
307
 
                                                  __func__, elem->name);
 
305
                                                       "to add entry to pipeline: "
 
306
                                                       "%s (new() returned NULL)\n",
 
307
                                                       __func__, elem->name);
308
308
                                                kfree(pipeline_entry);
309
309
                                                incomplete = 1;
310
310
                                        }
317
317
                        found = 0;
318
318
                else {
319
319
                        printk(KERN_ERR "%s: element not found, skipping: "
320
 
                                "%s\n", __func__, name);
 
320
                               "%s\n", __func__, name);
321
321
                        incomplete = 1;
322
322
                }
323
323
        }
330
330
 
331
331
#ifdef PIPELINE_DEBUG
332
332
        printk(KERN_DEBUG "%s: dsp pipeline built%s: %s\n",
333
 
                __func__, incomplete ? " incomplete" : "", cfg);
 
333
               __func__, incomplete ? " incomplete" : "", cfg);
334
334
#endif
335
335
        kfree(dup);
336
336
        return 0;
349
349
}
350
350
 
351
351
void dsp_pipeline_process_rx(struct dsp_pipeline *pipeline, u8 *data, int len,
352
 
        unsigned int txlen)
 
352
                             unsigned int txlen)
353
353
{
354
354
        struct dsp_pipeline_entry *entry;
355
355
 
360
360
                if (entry->elem->process_rx)
361
361
                        entry->elem->process_rx(entry->p, data, len, txlen);
362
362
}
363
 
 
364