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_routine_init {
26 MCDRV_DAC_INFO dac_info;
27 MCDRV_ADC_INFO adc_info;
28 MCDRV_SP_INFO sp_info;
29 MCDRV_PDM_INFO pdm_info;
30 MCDRV_DNG_INFO dng_info;
31 MCDRV_SYSEQ_INFO syseq_info;
34 struct yamaha_mc1n2_audio_routine_postopen {
35 MCDRV_AE_INFO ae_info;
38 struct yamaha_mc1n2_audio_routine_route {
39 audio_devices_t device;
42 MCDRV_AE_INFO ae_info;
43 MCDRV_PATH_INFO path_info;
44 MCDRV_DAC_INFO dac_info;
47 struct yamaha_mc1n2_audio_routines {
48 struct yamaha_mc1n2_audio_routine_init *init;
49 struct yamaha_mc1n2_audio_routine_postopen *postopen;
50 struct yamaha_mc1n2_audio_routine_route *route_init;
51 struct yamaha_mc1n2_audio_routine_route *route_start;
52 struct yamaha_mc1n2_audio_routine_route *route_stop;
54 int route_start_count;
57 struct yamaha_mc1n2_audio_device_ops {
59 struct yamaha_mc1n2_audio_routines routines;
62 struct yamaha_mc1n2_audio_pdata {
64 struct yamaha_mc1n2_audio_device_ops *ops;
66 audio_devices_t device_current;
67 audio_mode_t mode_current;
75 extern struct yamaha_mc1n2_audio_pdata galaxys2_pdata;
82 int yamaha_mc1n2_audio_ioctl(struct yamaha_mc1n2_audio_pdata *pdata,
83 int command, struct mc1n2_ctrl_args *hw_ctrl);
84 int yamaha_mc1n2_audio_ioctl_set_ctrl(struct yamaha_mc1n2_audio_pdata *pdata,
85 unsigned long command, void *data, unsigned long update_info);
86 int yamaha_mc1n2_audio_ioctl_notify(struct yamaha_mc1n2_audio_pdata *pdata,
87 unsigned long command);
90 int yamaha_mc1n2_audio_routine_init(struct yamaha_mc1n2_audio_pdata *pdata);
91 int yamaha_mc1n2_audio_routine_postopen(struct yamaha_mc1n2_audio_pdata *pdata);
92 int yamaha_mc1n2_audio_routine_route_init(struct yamaha_mc1n2_audio_pdata *pdata);
93 int yamaha_mc1n2_audio_routine_route_start(struct yamaha_mc1n2_audio_pdata *pdata);
94 int yamaha_mc1n2_audio_routine_route_stop(struct yamaha_mc1n2_audio_pdata *pdata);
96 // Values configuration
97 int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
98 audio_devices_t device, audio_mode_t mode);
99 char *yamaha_mc1n2_audio_get_hw_node(struct yamaha_mc1n2_audio_pdata *pdata);
102 int yamaha_mc1n2_audio_start(struct yamaha_mc1n2_audio_pdata **pdata_p,
104 int yamaha_mc1n2_audio_stop(struct yamaha_mc1n2_audio_pdata *pdata);