blob: cde300b0778a9265e86bb2ba0b0e7b5d26abf1ce [file] [log] [blame]
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +01001/*
2 * Copyright (c) 2016, Intel Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the Intel Corporation nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
29 */
30
31#include <stdint.h>
32#include <stddef.h>
Pierre-Louis Bossart81708a52018-04-04 18:46:50 -050033#include <sof/lock.h>
34#include <sof/list.h>
35#include <sof/stream.h>
36#include <sof/audio/component.h>
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010037
Liam Girdwood425aa5e2017-06-06 20:34:10 +010038/* tracing */
39#define trace_switch(__e) trace_event(TRACE_CLASS_SWITCH, __e)
40#define trace_switch_error(__e) trace_error(TRACE_CLASS_SWITCH, __e)
41#define tracev_switch(__e) tracev_event(TRACE_CLASS_SWITCH, __e)
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010042
Liam Girdwood425aa5e2017-06-06 20:34:10 +010043static struct comp_dev *switch_new(struct sof_ipc_comp *comp)
44{
45 trace_switch("new");
46
47 return NULL;
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010048}
49
50static void switch_free(struct comp_dev *dev)
51{
52
53}
54
Pierre-Louis Bossartf9458092017-11-09 15:24:07 -060055/* set component audio stream parameters */
Liam Girdwood2cfaebe2017-08-21 17:13:52 +010056static int switch_params(struct comp_dev *dev)
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010057{
58
59 return 0;
60}
61
62/* used to pass standard and bespoke commands (with data) to component */
63static int switch_cmd(struct comp_dev *dev, int cmd, void *data)
64{
65 /* switch will use buffer "connected" status */
66 return 0;
67}
68
69/* copy and process stream data from source to sink buffers */
70static int switch_copy(struct comp_dev *dev)
71{
72
73 return 0;
74}
75
76static int switch_reset(struct comp_dev *dev)
77{
78 return 0;
79}
80
81static int switch_prepare(struct comp_dev *dev)
82{
83 return 0;
84}
85
86struct comp_driver comp_switch = {
Liam Girdwood425aa5e2017-06-06 20:34:10 +010087 .type = SOF_COMP_SWITCH,
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010088 .ops = {
89 .new = switch_new,
90 .free = switch_free,
91 .params = switch_params,
92 .cmd = switch_cmd,
93 .copy = switch_copy,
94 .prepare = switch_prepare,
95 .reset = switch_reset,
96 },
97};
98
99void sys_comp_switch_init(void)
100{
101 comp_register(&comp_switch);
102}