2 * Copyright (C) 2012 Paul Kocialkowski <contact@paulk.fr>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef YAMAHA_MC1N2_AUDIO_H
19 #define YAMAHA_MC1N2_AUDIO_H
21 #include <system/audio.h>
25 enum yamaha_mc1n2_audio_direction {
26 YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,
27 YAMAHA_MC1N2_AUDIO_DIRECTION_INPUT,
28 YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM,
29 YAMAHA_MC1N2_AUDIO_DIRECTION_MAX
32 struct yamaha_mc1n2_audio_params_init {
33 MCDRV_AE_INFO ae_info;
34 MCDRV_PATH_INFO path_info;
35 MCDRV_DAC_INFO dac_info;
36 MCDRV_ADC_INFO adc_info;
37 MCDRV_SP_INFO sp_info;
38 MCDRV_PDM_INFO pdm_info;
39 MCDRV_DNG_INFO dng_info;
40 MCDRV_SYSEQ_INFO syseq_info;
43 struct yamaha_mc1n2_audio_params_route {
44 audio_devices_t device;
45 enum yamaha_mc1n2_audio_direction direction;
47 MCDRV_AE_INFO ae_info;
48 MCDRV_PATH_INFO path_info;
49 MCDRV_DAC_INFO dac_info;
52 struct yamaha_mc1n2_audio_params {
53 struct yamaha_mc1n2_audio_params_init *init;
54 struct yamaha_mc1n2_audio_params_route *routes;
58 struct yamaha_mc1n2_audio_device_ops {
61 struct yamaha_mc1n2_audio_params params;
64 struct yamaha_mc1n2_audio_pdata {
66 struct yamaha_mc1n2_audio_device_ops *ops;
68 audio_devices_t output_device;
69 audio_devices_t input_device;
80 extern struct yamaha_mc1n2_audio_pdata galaxys2_pdata;
87 int yamaha_mc1n2_audio_ioctl(struct yamaha_mc1n2_audio_pdata *pdata,
88 int command, struct mc1n2_ctrl_args *hw_ctrl);
89 int yamaha_mc1n2_audio_ioctl_set_ctrl(struct yamaha_mc1n2_audio_pdata *pdata,
90 unsigned long command, void *data, unsigned long update_info);
91 int yamaha_mc1n2_audio_ioctl_notify(struct yamaha_mc1n2_audio_pdata *pdata,
92 unsigned long command);
95 int yamaha_mc1n2_audio_init(struct yamaha_mc1n2_audio_pdata *pdata);
96 int yamaha_mc1n2_audio_output_start(struct yamaha_mc1n2_audio_pdata *pdata);
97 int yamaha_mc1n2_audio_output_stop(struct yamaha_mc1n2_audio_pdata *pdata);
98 int yamaha_mc1n2_audio_input_start(struct yamaha_mc1n2_audio_pdata *pdata);
99 int yamaha_mc1n2_audio_input_stop(struct yamaha_mc1n2_audio_pdata *pdata);
100 int yamaha_mc1n2_audio_modem_start(struct yamaha_mc1n2_audio_pdata *pdata);
101 int yamaha_mc1n2_audio_modem_stop(struct yamaha_mc1n2_audio_pdata *pdata);
103 // Values configuration
104 int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
105 audio_devices_t device);
106 char *yamaha_mc1n2_audio_get_hw_node(struct yamaha_mc1n2_audio_pdata *pdata);
109 int yamaha_mc1n2_audio_start(struct yamaha_mc1n2_audio_pdata **pdata_p,
111 int yamaha_mc1n2_audio_stop(struct yamaha_mc1n2_audio_pdata *pdata);