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 struct yamaha_mc1n2_audio_params_init {
26 MCDRV_AE_INFO ae_info;
27 MCDRV_PATH_INFO path_info;
28 MCDRV_DAC_INFO dac_info;
29 MCDRV_ADC_INFO adc_info;
30 MCDRV_SP_INFO sp_info;
31 MCDRV_PDM_INFO pdm_info;
32 MCDRV_DNG_INFO dng_info;
33 MCDRV_SYSEQ_INFO syseq_info;
36 struct yamaha_mc1n2_audio_params_route {
37 audio_devices_t device;
40 MCDRV_AE_INFO ae_info;
41 MCDRV_PATH_INFO path_info;
42 MCDRV_DAC_INFO dac_info;
45 struct yamaha_mc1n2_audio_params {
46 struct yamaha_mc1n2_audio_params_init *init;
47 struct yamaha_mc1n2_audio_params_route *routes;
51 struct yamaha_mc1n2_audio_device_ops {
53 struct yamaha_mc1n2_audio_params params;
56 struct yamaha_mc1n2_audio_pdata {
58 struct yamaha_mc1n2_audio_device_ops *ops;
60 audio_devices_t output_device;
61 audio_devices_t input_device;
72 extern struct yamaha_mc1n2_audio_pdata galaxys2_pdata;
79 int yamaha_mc1n2_audio_ioctl(struct yamaha_mc1n2_audio_pdata *pdata,
80 int command, struct mc1n2_ctrl_args *hw_ctrl);
81 int yamaha_mc1n2_audio_ioctl_set_ctrl(struct yamaha_mc1n2_audio_pdata *pdata,
82 unsigned long command, void *data, unsigned long update_info);
83 int yamaha_mc1n2_audio_ioctl_notify(struct yamaha_mc1n2_audio_pdata *pdata,
84 unsigned long command);
87 int yamaha_mc1n2_audio_init(struct yamaha_mc1n2_audio_pdata *pdata);
88 int yamaha_mc1n2_audio_output_start(struct yamaha_mc1n2_audio_pdata *pdata);
89 int yamaha_mc1n2_audio_output_stop(struct yamaha_mc1n2_audio_pdata *pdata);
90 int yamaha_mc1n2_audio_input_start(struct yamaha_mc1n2_audio_pdata *pdata);
91 int yamaha_mc1n2_audio_input_stop(struct yamaha_mc1n2_audio_pdata *pdata);
93 // Values configuration
94 int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
95 audio_devices_t device, audio_mode_t mode);
96 char *yamaha_mc1n2_audio_get_hw_node(struct yamaha_mc1n2_audio_pdata *pdata);
99 int yamaha_mc1n2_audio_start(struct yamaha_mc1n2_audio_pdata **pdata_p,
101 int yamaha_mc1n2_audio_stop(struct yamaha_mc1n2_audio_pdata *pdata);