aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/meilhaus/me4600_ao.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/meilhaus/me4600_ao.c')
-rw-r--r--drivers/staging/meilhaus/me4600_ao.c148
1 files changed, 74 insertions, 74 deletions
diff --git a/drivers/staging/meilhaus/me4600_ao.c b/drivers/staging/meilhaus/me4600_ao.c
index fe7ad3a4de9..eb472692a7c 100644
--- a/drivers/staging/meilhaus/me4600_ao.c
+++ b/drivers/staging/meilhaus/me4600_ao.c
@@ -38,8 +38,8 @@
38 38
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <linux/spinlock.h> 40#include <linux/spinlock.h>
41#include <asm/io.h> 41#include <linux/io.h>
42#include <asm/uaccess.h> 42#include <linux/uaccess.h>
43#include <linux/types.h> 43#include <linux/types.h>
44#include <linux/version.h> 44#include <linux/version.h>
45#include <linux/interrupt.h> 45#include <linux/interrupt.h>
@@ -58,31 +58,31 @@
58/* Defines 58/* Defines
59 */ 59 */
60 60
61static int me4600_ao_query_range_by_min_max(me_subdevice_t * subdevice, 61static int me4600_ao_query_range_by_min_max(me_subdevice_t *subdevice,
62 int unit, 62 int unit,
63 int *min, 63 int *min,
64 int *max, int *maxdata, int *range); 64 int *max, int *maxdata, int *range);
65 65
66static int me4600_ao_query_number_ranges(me_subdevice_t * subdevice, 66static int me4600_ao_query_number_ranges(me_subdevice_t *subdevice,
67 int unit, int *count); 67 int unit, int *count);
68 68
69static int me4600_ao_query_range_info(me_subdevice_t * subdevice, 69static int me4600_ao_query_range_info(me_subdevice_t *subdevice,
70 int range, 70 int range,
71 int *unit, 71 int *unit,
72 int *min, int *max, int *maxdata); 72 int *min, int *max, int *maxdata);
73 73
74static int me4600_ao_query_timer(me_subdevice_t * subdevice, 74static int me4600_ao_query_timer(me_subdevice_t *subdevice,
75 int timer, 75 int timer,
76 int *base_frequency, 76 int *base_frequency,
77 long long *min_ticks, long long *max_ticks); 77 long long *min_ticks, long long *max_ticks);
78 78
79static int me4600_ao_query_number_channels(me_subdevice_t * subdevice, 79static int me4600_ao_query_number_channels(me_subdevice_t *subdevice,
80 int *number); 80 int *number);
81 81
82static int me4600_ao_query_subdevice_type(me_subdevice_t * subdevice, 82static int me4600_ao_query_subdevice_type(me_subdevice_t *subdevice,
83 int *type, int *subtype); 83 int *type, int *subtype);
84 84
85static int me4600_ao_query_subdevice_caps(me_subdevice_t * subdevice, 85static int me4600_ao_query_subdevice_caps(me_subdevice_t *subdevice,
86 int *caps); 86 int *caps);
87 87
88static int me4600_ao_query_subdevice_caps_args(struct me_subdevice *subdevice, 88static int me4600_ao_query_subdevice_caps_args(struct me_subdevice *subdevice,
@@ -105,12 +105,12 @@ static void me4600_ao_destructor(struct me_subdevice *subdevice);
105 105
106/** Reset subdevice. Stop all actions. Reset registry. Disable FIFO. Set output to 0V and status to 'none'. 106/** Reset subdevice. Stop all actions. Reset registry. Disable FIFO. Set output to 0V and status to 'none'.
107*/ 107*/
108static int me4600_ao_io_reset_subdevice(me_subdevice_t * subdevice, 108static int me4600_ao_io_reset_subdevice(me_subdevice_t *subdevice,
109 struct file *filep, int flags); 109 struct file *filep, int flags);
110 110
111/** Set output as single 111/** Set output as single
112*/ 112*/
113static int me4600_ao_io_single_config(me_subdevice_t * subdevice, 113static int me4600_ao_io_single_config(me_subdevice_t *subdevice,
114 struct file *filep, 114 struct file *filep,
115 int channel, 115 int channel,
116 int single_config, 116 int single_config,
@@ -120,55 +120,55 @@ static int me4600_ao_io_single_config(me_subdevice_t * subdevice,
120 120
121/** Pass to user actual value of output. 121/** Pass to user actual value of output.
122*/ 122*/
123static int me4600_ao_io_single_read(me_subdevice_t * subdevice, 123static int me4600_ao_io_single_read(me_subdevice_t *subdevice,
124 struct file *filep, 124 struct file *filep,
125 int channel, 125 int channel,
126 int *value, int time_out, int flags); 126 int *value, int time_out, int flags);
127 127
128/** Write to output requed value. 128/** Write to output requed value.
129*/ 129*/
130static int me4600_ao_io_single_write(me_subdevice_t * subdevice, 130static int me4600_ao_io_single_write(me_subdevice_t *subdevice,
131 struct file *filep, 131 struct file *filep,
132 int channel, 132 int channel,
133 int value, int time_out, int flags); 133 int value, int time_out, int flags);
134 134
135/** Set output as streamed device. 135/** Set output as streamed device.
136*/ 136*/
137static int me4600_ao_io_stream_config(me_subdevice_t * subdevice, 137static int me4600_ao_io_stream_config(me_subdevice_t *subdevice,
138 struct file *filep, 138 struct file *filep,
139 meIOStreamConfig_t * config_list, 139 meIOStreamConfig_t *config_list,
140 int count, 140 int count,
141 meIOStreamTrigger_t * trigger, 141 meIOStreamTrigger_t *trigger,
142 int fifo_irq_threshold, int flags); 142 int fifo_irq_threshold, int flags);
143 143
144/** Wait for / Check empty space in buffer. 144/** Wait for / Check empty space in buffer.
145*/ 145*/
146static int me4600_ao_io_stream_new_values(me_subdevice_t * subdevice, 146static int me4600_ao_io_stream_new_values(me_subdevice_t *subdevice,
147 struct file *filep, 147 struct file *filep,
148 int time_out, int *count, int flags); 148 int time_out, int *count, int flags);
149 149
150/** Start streaming. 150/** Start streaming.
151*/ 151*/
152static int me4600_ao_io_stream_start(me_subdevice_t * subdevice, 152static int me4600_ao_io_stream_start(me_subdevice_t *subdevice,
153 struct file *filep, 153 struct file *filep,
154 int start_mode, int time_out, int flags); 154 int start_mode, int time_out, int flags);
155 155
156/** Check actual state. / Wait for end. 156/** Check actual state. / Wait for end.
157*/ 157*/
158static int me4600_ao_io_stream_status(me_subdevice_t * subdevice, 158static int me4600_ao_io_stream_status(me_subdevice_t *subdevice,
159 struct file *filep, 159 struct file *filep,
160 int wait, 160 int wait,
161 int *status, int *values, int flags); 161 int *status, int *values, int flags);
162 162
163/** Stop streaming. 163/** Stop streaming.
164*/ 164*/
165static int me4600_ao_io_stream_stop(me_subdevice_t * subdevice, 165static int me4600_ao_io_stream_stop(me_subdevice_t *subdevice,
166 struct file *filep, 166 struct file *filep,
167 int stop_mode, int flags); 167 int stop_mode, int flags);
168 168
169/** Write datas to buffor. 169/** Write datas to buffor.
170*/ 170*/
171static int me4600_ao_io_stream_write(me_subdevice_t * subdevice, 171static int me4600_ao_io_stream_write(me_subdevice_t *subdevice,
172 struct file *filep, 172 struct file *filep,
173 int write_mode, 173 int write_mode,
174 int *values, int *count, int flags); 174 int *values, int *count, int flags);
@@ -178,27 +178,27 @@ static int me4600_ao_io_stream_write(me_subdevice_t * subdevice,
178static irqreturn_t me4600_ao_isr(int irq, void *dev_id); 178static irqreturn_t me4600_ao_isr(int irq, void *dev_id);
179/** Copy data from circular buffer to fifo (fast) in wraparound mode. 179/** Copy data from circular buffer to fifo (fast) in wraparound mode.
180*/ 180*/
181int inline ao_write_data_wraparound(me4600_ao_subdevice_t * instance, int count, 181inline int ao_write_data_wraparound(me4600_ao_subdevice_t *instance, int count,
182 int start_pos); 182 int start_pos);
183 183
184/** Copy data from circular buffer to fifo (fast). 184/** Copy data from circular buffer to fifo (fast).
185*/ 185*/
186int inline ao_write_data(me4600_ao_subdevice_t * instance, int count, 186inline int ao_write_data(me4600_ao_subdevice_t *instance, int count,
187 int start_pos); 187 int start_pos);
188 188
189/** Copy data from circular buffer to fifo (slow). 189/** Copy data from circular buffer to fifo (slow).
190*/ 190*/
191int inline ao_write_data_pooling(me4600_ao_subdevice_t * instance, int count, 191inline int ao_write_data_pooling(me4600_ao_subdevice_t *instance, int count,
192 int start_pos); 192 int start_pos);
193 193
194/** Copy data from user space to circular buffer. 194/** Copy data from user space to circular buffer.
195*/ 195*/
196int inline ao_get_data_from_user(me4600_ao_subdevice_t * instance, int count, 196inline int ao_get_data_from_user(me4600_ao_subdevice_t *instance, int count,
197 int *user_values); 197 int *user_values);
198 198
199/** Stop presentation. Preserve FIFOs. 199/** Stop presentation. Preserve FIFOs.
200*/ 200*/
201int inline ao_stop_immediately(me4600_ao_subdevice_t * instance); 201inline int ao_stop_immediately(me4600_ao_subdevice_t *instance);
202 202
203/** Task for asynchronical state verifying. 203/** Task for asynchronical state verifying.
204*/ 204*/
@@ -206,7 +206,7 @@ static void me4600_ao_work_control_task(struct work_struct *work);
206/* Functions 206/* Functions
207 */ 207 */
208 208
209static int me4600_ao_io_reset_subdevice(me_subdevice_t * subdevice, 209static int me4600_ao_io_reset_subdevice(me_subdevice_t *subdevice,
210 struct file *filep, int flags) 210 struct file *filep, int flags)
211{ 211{
212 me4600_ao_subdevice_t *instance; 212 me4600_ao_subdevice_t *instance;
@@ -280,7 +280,7 @@ static int me4600_ao_io_reset_subdevice(me_subdevice_t * subdevice,
280 return err; 280 return err;
281} 281}
282 282
283static int me4600_ao_io_single_config(me_subdevice_t * subdevice, 283static int me4600_ao_io_single_config(me_subdevice_t *subdevice,
284 struct file *filep, 284 struct file *filep,
285 int channel, 285 int channel,
286 int single_config, 286 int single_config,
@@ -453,7 +453,7 @@ static int me4600_ao_io_single_config(me_subdevice_t * subdevice,
453 return err; 453 return err;
454} 454}
455 455
456static int me4600_ao_io_single_read(me_subdevice_t * subdevice, 456static int me4600_ao_io_single_read(me_subdevice_t *subdevice,
457 struct file *filep, 457 struct file *filep,
458 int channel, 458 int channel,
459 int *value, int time_out, int flags) 459 int *value, int time_out, int flags)
@@ -537,7 +537,7 @@ static int me4600_ao_io_single_read(me_subdevice_t * subdevice,
537 return err; 537 return err;
538} 538}
539 539
540static int me4600_ao_io_single_write(me_subdevice_t * subdevice, 540static int me4600_ao_io_single_write(me_subdevice_t *subdevice,
541 struct file *filep, 541 struct file *filep,
542 int channel, 542 int channel,
543 int value, int time_out, int flags) 543 int value, int time_out, int flags)
@@ -979,11 +979,11 @@ static int me4600_ao_io_single_write(me_subdevice_t * subdevice,
979 return err; 979 return err;
980} 980}
981 981
982static int me4600_ao_io_stream_config(me_subdevice_t * subdevice, 982static int me4600_ao_io_stream_config(me_subdevice_t *subdevice,
983 struct file *filep, 983 struct file *filep,
984 meIOStreamConfig_t * config_list, 984 meIOStreamConfig_t *config_list,
985 int count, 985 int count,
986 meIOStreamTrigger_t * trigger, 986 meIOStreamTrigger_t *trigger,
987 int fifo_irq_threshold, int flags) 987 int fifo_irq_threshold, int flags)
988{ 988{
989 me4600_ao_subdevice_t *instance; 989 me4600_ao_subdevice_t *instance;
@@ -1317,7 +1317,7 @@ static int me4600_ao_io_stream_config(me_subdevice_t * subdevice,
1317 return err; 1317 return err;
1318} 1318}
1319 1319
1320static int me4600_ao_io_stream_new_values(me_subdevice_t * subdevice, 1320static int me4600_ao_io_stream_new_values(me_subdevice_t *subdevice,
1321 struct file *filep, 1321 struct file *filep,
1322 int time_out, int *count, int flags) 1322 int time_out, int *count, int flags)
1323{ 1323{
@@ -1398,7 +1398,7 @@ static int me4600_ao_io_stream_new_values(me_subdevice_t * subdevice,
1398 return err; 1398 return err;
1399} 1399}
1400 1400
1401static int me4600_ao_io_stream_start(me_subdevice_t * subdevice, 1401static int me4600_ao_io_stream_start(me_subdevice_t *subdevice,
1402 struct file *filep, 1402 struct file *filep,
1403 int start_mode, int time_out, int flags) 1403 int start_mode, int time_out, int flags)
1404{ 1404{
@@ -1835,7 +1835,7 @@ static int me4600_ao_io_stream_start(me_subdevice_t * subdevice,
1835 return err; 1835 return err;
1836} 1836}
1837 1837
1838static int me4600_ao_io_stream_status(me_subdevice_t * subdevice, 1838static int me4600_ao_io_stream_status(me_subdevice_t *subdevice,
1839 struct file *filep, 1839 struct file *filep,
1840 int wait, 1840 int wait,
1841 int *status, int *values, int flags) 1841 int *status, int *values, int flags)
@@ -1933,7 +1933,7 @@ static int me4600_ao_io_stream_status(me_subdevice_t * subdevice,
1933 return err; 1933 return err;
1934} 1934}
1935 1935
1936static int me4600_ao_io_stream_stop(me_subdevice_t * subdevice, 1936static int me4600_ao_io_stream_stop(me_subdevice_t *subdevice,
1937 struct file *filep, 1937 struct file *filep,
1938 int stop_mode, int flags) 1938 int stop_mode, int flags)
1939{ // Stop work and empty buffer and FIFO 1939{ // Stop work and empty buffer and FIFO
@@ -2038,7 +2038,7 @@ static int me4600_ao_io_stream_stop(me_subdevice_t * subdevice,
2038 return err; 2038 return err;
2039} 2039}
2040 2040
2041static int me4600_ao_io_stream_write(me_subdevice_t * subdevice, 2041static int me4600_ao_io_stream_write(me_subdevice_t *subdevice,
2042 struct file *filep, 2042 struct file *filep,
2043 int write_mode, 2043 int write_mode,
2044 int *values, int *count, int flags) 2044 int *values, int *count, int flags)
@@ -2484,8 +2484,8 @@ static void me4600_ao_destructor(struct me_subdevice *subdevice)
2484} 2484}
2485 2485
2486me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base, 2486me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base,
2487 spinlock_t * preload_reg_lock, 2487 spinlock_t *preload_reg_lock,
2488 uint32_t * preload_flags, 2488 uint32_t *preload_flags,
2489 int ao_idx, 2489 int ao_idx,
2490 int fifo, 2490 int fifo,
2491 int irq, 2491 int irq,
@@ -2690,7 +2690,7 @@ me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base,
2690* 2690*
2691* @param instance The subdevice instance (pointer). 2691* @param instance The subdevice instance (pointer).
2692*/ 2692*/
2693int inline ao_stop_immediately(me4600_ao_subdevice_t * instance) 2693inline int ao_stop_immediately(me4600_ao_subdevice_t *instance)
2694{ 2694{
2695 unsigned long cpu_flags; 2695 unsigned long cpu_flags;
2696 uint32_t ctrl; 2696 uint32_t ctrl;
@@ -2743,7 +2743,7 @@ int inline ao_stop_immediately(me4600_ao_subdevice_t * instance)
2743* @return On error/success: 0. No datas were copied => no data in buffer. 2743* @return On error/success: 0. No datas were copied => no data in buffer.
2744* @return On error: -ME_ERRNO_FIFO_BUFFER_OVERFLOW. 2744* @return On error: -ME_ERRNO_FIFO_BUFFER_OVERFLOW.
2745*/ 2745*/
2746int inline ao_write_data_wraparound(me4600_ao_subdevice_t * instance, int count, 2746inline int ao_write_data_wraparound(me4600_ao_subdevice_t *instance, int count,
2747 int start_pos) 2747 int start_pos)
2748{ /// @note This is time critical function! 2748{ /// @note This is time critical function!
2749 uint32_t status; 2749 uint32_t status;
@@ -2808,7 +2808,7 @@ int inline ao_write_data_wraparound(me4600_ao_subdevice_t * instance, int count,
2808* @return On error/success: 0. No datas were copied => no data in buffer. 2808* @return On error/success: 0. No datas were copied => no data in buffer.
2809* @return On error: -ME_ERRNO_FIFO_BUFFER_OVERFLOW. 2809* @return On error: -ME_ERRNO_FIFO_BUFFER_OVERFLOW.
2810*/ 2810*/
2811int inline ao_write_data(me4600_ao_subdevice_t * instance, int count, 2811inline int ao_write_data(me4600_ao_subdevice_t *instance, int count,
2812 int start_pos) 2812 int start_pos)
2813{ /// @note This is time critical function! 2813{ /// @note This is time critical function!
2814 uint32_t status; 2814 uint32_t status;
@@ -2878,7 +2878,7 @@ int inline ao_write_data(me4600_ao_subdevice_t * instance, int count,
2878* @return On error/success: 0. FIFO was full at begining. 2878* @return On error/success: 0. FIFO was full at begining.
2879* @return On error: -ME_ERRNO_RING_BUFFER_UNDEFFLOW. 2879* @return On error: -ME_ERRNO_RING_BUFFER_UNDEFFLOW.
2880*/ 2880*/
2881int inline ao_write_data_pooling(me4600_ao_subdevice_t * instance, int count, 2881inline int ao_write_data_pooling(me4600_ao_subdevice_t *instance, int count,
2882 int start_pos) 2882 int start_pos)
2883{ /// @note This is slow function! 2883{ /// @note This is slow function!
2884 uint32_t status; 2884 uint32_t status;
@@ -2936,7 +2936,7 @@ int inline ao_write_data_pooling(me4600_ao_subdevice_t * instance, int count,
2936* @return On success: Number of copied values. 2936* @return On success: Number of copied values.
2937* @return On error: -ME_ERRNO_INTERNAL. 2937* @return On error: -ME_ERRNO_INTERNAL.
2938*/ 2938*/
2939int inline ao_get_data_from_user(me4600_ao_subdevice_t * instance, int count, 2939inline int ao_get_data_from_user(me4600_ao_subdevice_t *instance, int count,
2940 int *user_values) 2940 int *user_values)
2941{ 2941{
2942 int i, err; 2942 int i, err;
@@ -3294,7 +3294,7 @@ static void me4600_ao_work_control_task(struct work_struct *work)
3294#else 3294#else
3295/// @note SPECIAL BUILD FOR BOSCH 3295/// @note SPECIAL BUILD FOR BOSCH
3296/// @author Guenter Gebhardt 3296/// @author Guenter Gebhardt
3297static int me4600_ao_io_reset_subdevice(me_subdevice_t * subdevice, 3297static int me4600_ao_io_reset_subdevice(me_subdevice_t *subdevice,
3298 struct file *filep, int flags) 3298 struct file *filep, int flags)
3299{ 3299{
3300 me4600_ao_subdevice_t *instance; 3300 me4600_ao_subdevice_t *instance;
@@ -3336,7 +3336,7 @@ static int me4600_ao_io_reset_subdevice(me_subdevice_t * subdevice,
3336 return err; 3336 return err;
3337} 3337}
3338 3338
3339static int me4600_ao_io_single_config(me_subdevice_t * subdevice, 3339static int me4600_ao_io_single_config(me_subdevice_t *subdevice,
3340 struct file *filep, 3340 struct file *filep,
3341 int channel, 3341 int channel,
3342 int single_config, 3342 int single_config,
@@ -3607,7 +3607,7 @@ static int me4600_ao_io_single_config(me_subdevice_t * subdevice,
3607 goto ERROR; 3607 goto ERROR;
3608 } 3608 }
3609 3609
3610 ERROR: 3610ERROR:
3611 3611
3612 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags); 3612 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags);
3613 3613
@@ -3616,7 +3616,7 @@ static int me4600_ao_io_single_config(me_subdevice_t * subdevice,
3616 return err; 3616 return err;
3617} 3617}
3618 3618
3619static int me4600_ao_io_single_read(me_subdevice_t * subdevice, 3619static int me4600_ao_io_single_read(me_subdevice_t *subdevice,
3620 struct file *filep, 3620 struct file *filep,
3621 int channel, 3621 int channel,
3622 int *value, int time_out, int flags) 3622 int *value, int time_out, int flags)
@@ -3653,7 +3653,7 @@ static int me4600_ao_io_single_read(me_subdevice_t * subdevice,
3653 return err; 3653 return err;
3654} 3654}
3655 3655
3656static int me4600_ao_io_single_write(me_subdevice_t * subdevice, 3656static int me4600_ao_io_single_write(me_subdevice_t *subdevice,
3657 struct file *filep, 3657 struct file *filep,
3658 int channel, 3658 int channel,
3659 int value, int time_out, int flags) 3659 int value, int time_out, int flags)
@@ -3801,18 +3801,18 @@ static int me4600_ao_io_single_write(me_subdevice_t * subdevice,
3801 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags); 3801 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags);
3802 } 3802 }
3803 3803
3804 ERROR: 3804ERROR:
3805 3805
3806 ME_SUBDEVICE_EXIT; 3806 ME_SUBDEVICE_EXIT;
3807 3807
3808 return err; 3808 return err;
3809} 3809}
3810 3810
3811static int me4600_ao_io_stream_config(me_subdevice_t * subdevice, 3811static int me4600_ao_io_stream_config(me_subdevice_t *subdevice,
3812 struct file *filep, 3812 struct file *filep,
3813 meIOStreamConfig_t * config_list, 3813 meIOStreamConfig_t *config_list,
3814 int count, 3814 int count,
3815 meIOStreamTrigger_t * trigger, 3815 meIOStreamTrigger_t *trigger,
3816 int fifo_irq_threshold, int flags) 3816 int fifo_irq_threshold, int flags)
3817{ 3817{
3818 me4600_ao_subdevice_t *instance; 3818 me4600_ao_subdevice_t *instance;
@@ -4121,7 +4121,7 @@ static int me4600_ao_io_stream_config(me_subdevice_t * subdevice,
4121 PDEBUG("Ctrl word = 0x%lX.\n", ctrl); 4121 PDEBUG("Ctrl word = 0x%lX.\n", ctrl);
4122 outl(ctrl, instance->ctrl_reg); // Write the control word 4122 outl(ctrl, instance->ctrl_reg); // Write the control word
4123 4123
4124 ERROR: 4124ERROR:
4125 4125
4126 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags); 4126 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags);
4127 4127
@@ -4130,7 +4130,7 @@ static int me4600_ao_io_stream_config(me_subdevice_t * subdevice,
4130 return err; 4130 return err;
4131} 4131}
4132 4132
4133static int me4600_ao_io_stream_new_values(me_subdevice_t * subdevice, 4133static int me4600_ao_io_stream_new_values(me_subdevice_t *subdevice,
4134 struct file *filep, 4134 struct file *filep,
4135 int time_out, int *count, int flags) 4135 int time_out, int *count, int flags)
4136{ 4136{
@@ -4209,7 +4209,7 @@ static int me4600_ao_io_stream_new_values(me_subdevice_t * subdevice,
4209 return err; 4209 return err;
4210} 4210}
4211 4211
4212static void stop_immediately(me4600_ao_subdevice_t * instance) 4212static void stop_immediately(me4600_ao_subdevice_t *instance)
4213{ 4213{
4214 unsigned long cpu_flags; 4214 unsigned long cpu_flags;
4215 uint32_t tmp; 4215 uint32_t tmp;
@@ -4224,7 +4224,7 @@ static void stop_immediately(me4600_ao_subdevice_t * instance)
4224 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags); 4224 spin_unlock_irqrestore(&instance->subdevice_lock, cpu_flags);
4225} 4225}
4226 4226
4227static int me4600_ao_io_stream_start(me_subdevice_t * subdevice, 4227static int me4600_ao_io_stream_start(me_subdevice_t *subdevice,
4228 struct file *filep, 4228 struct file *filep,
4229 int start_mode, int time_out, int flags) 4229 int start_mode, int time_out, int flags)
4230{ 4230{
@@ -4749,14 +4749,14 @@ static int me4600_ao_io_stream_start(me_subdevice_t * subdevice,
4749 goto ERROR; 4749 goto ERROR;
4750 } 4750 }
4751 4751
4752 ERROR: 4752ERROR:
4753 4753
4754 ME_SUBDEVICE_EXIT; 4754 ME_SUBDEVICE_EXIT;
4755 4755
4756 return err; 4756 return err;
4757} 4757}
4758 4758
4759static int me4600_ao_io_stream_status(me_subdevice_t * subdevice, 4759static int me4600_ao_io_stream_status(me_subdevice_t *subdevice,
4760 struct file *filep, 4760 struct file *filep,
4761 int wait, 4761 int wait,
4762 int *status, int *values, int flags) 4762 int *status, int *values, int flags)
@@ -4813,14 +4813,14 @@ static int me4600_ao_io_stream_status(me_subdevice_t * subdevice,
4813 goto ERROR; 4813 goto ERROR;
4814 } 4814 }
4815 4815
4816 ERROR: 4816ERROR:
4817 4817
4818 ME_SUBDEVICE_EXIT; 4818 ME_SUBDEVICE_EXIT;
4819 4819
4820 return err; 4820 return err;
4821} 4821}
4822 4822
4823static int me4600_ao_io_stream_stop(me_subdevice_t * subdevice, 4823static int me4600_ao_io_stream_stop(me_subdevice_t *subdevice,
4824 struct file *filep, 4824 struct file *filep,
4825 int stop_mode, int flags) 4825 int stop_mode, int flags)
4826{ 4826{
@@ -4862,14 +4862,14 @@ static int me4600_ao_io_stream_stop(me_subdevice_t * subdevice,
4862 goto ERROR; 4862 goto ERROR;
4863 } 4863 }
4864 4864
4865 ERROR: 4865ERROR:
4866 4866
4867 ME_SUBDEVICE_EXIT; 4867 ME_SUBDEVICE_EXIT;
4868 4868
4869 return err; 4869 return err;
4870} 4870}
4871 4871
4872static int me4600_ao_io_stream_write(me_subdevice_t * subdevice, 4872static int me4600_ao_io_stream_write(me_subdevice_t *subdevice,
4873 struct file *filep, 4873 struct file *filep,
4874 int write_mode, 4874 int write_mode,
4875 int *values, int *count, int flags) 4875 int *values, int *count, int flags)
@@ -5403,7 +5403,7 @@ static int me4600_ao_io_stream_write(me_subdevice_t * subdevice,
5403 goto ERROR; 5403 goto ERROR;
5404 } 5404 }
5405 5405
5406 ERROR: 5406ERROR:
5407 5407
5408 ME_SUBDEVICE_EXIT; 5408 ME_SUBDEVICE_EXIT;
5409 5409
@@ -5627,8 +5627,8 @@ static void me4600_ao_destructor(struct me_subdevice *subdevice)
5627} 5627}
5628 5628
5629me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base, 5629me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base,
5630 spinlock_t * preload_reg_lock, 5630 spinlock_t *preload_reg_lock,
5631 uint32_t * preload_flags, 5631 uint32_t *preload_flags,
5632 int ao_idx, int fifo, int irq) 5632 int ao_idx, int fifo, int irq)
5633{ 5633{
5634 me4600_ao_subdevice_t *subdevice; 5634 me4600_ao_subdevice_t *subdevice;
@@ -5790,7 +5790,7 @@ me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base,
5790/* Common functions 5790/* Common functions
5791*/ 5791*/
5792 5792
5793static int me4600_ao_query_range_by_min_max(me_subdevice_t * subdevice, 5793static int me4600_ao_query_range_by_min_max(me_subdevice_t *subdevice,
5794 int unit, 5794 int unit,
5795 int *min, 5795 int *min,
5796 int *max, int *maxdata, int *range) 5796 int *max, int *maxdata, int *range)
@@ -5825,7 +5825,7 @@ static int me4600_ao_query_range_by_min_max(me_subdevice_t * subdevice,
5825 return ME_ERRNO_SUCCESS; 5825 return ME_ERRNO_SUCCESS;
5826} 5826}
5827 5827
5828static int me4600_ao_query_number_ranges(me_subdevice_t * subdevice, 5828static int me4600_ao_query_number_ranges(me_subdevice_t *subdevice,
5829 int unit, int *count) 5829 int unit, int *count)
5830{ 5830{
5831 me4600_ao_subdevice_t *instance; 5831 me4600_ao_subdevice_t *instance;
@@ -5843,7 +5843,7 @@ static int me4600_ao_query_number_ranges(me_subdevice_t * subdevice,
5843 return ME_ERRNO_SUCCESS; 5843 return ME_ERRNO_SUCCESS;
5844} 5844}
5845 5845
5846static int me4600_ao_query_range_info(me_subdevice_t * subdevice, 5846static int me4600_ao_query_range_info(me_subdevice_t *subdevice,
5847 int range, 5847 int range,
5848 int *unit, 5848 int *unit,
5849 int *min, int *max, int *maxdata) 5849 int *min, int *max, int *maxdata)
@@ -5867,7 +5867,7 @@ static int me4600_ao_query_range_info(me_subdevice_t * subdevice,
5867 return ME_ERRNO_SUCCESS; 5867 return ME_ERRNO_SUCCESS;
5868} 5868}
5869 5869
5870static int me4600_ao_query_timer(me_subdevice_t * subdevice, 5870static int me4600_ao_query_timer(me_subdevice_t *subdevice,
5871 int timer, 5871 int timer,
5872 int *base_frequency, 5872 int *base_frequency,
5873 long long *min_ticks, long long *max_ticks) 5873 long long *min_ticks, long long *max_ticks)
@@ -5901,7 +5901,7 @@ static int me4600_ao_query_timer(me_subdevice_t * subdevice,
5901 return ME_ERRNO_SUCCESS; 5901 return ME_ERRNO_SUCCESS;
5902} 5902}
5903 5903
5904static int me4600_ao_query_number_channels(me_subdevice_t * subdevice, 5904static int me4600_ao_query_number_channels(me_subdevice_t *subdevice,
5905 int *number) 5905 int *number)
5906{ 5906{
5907 me4600_ao_subdevice_t *instance; 5907 me4600_ao_subdevice_t *instance;
@@ -5914,7 +5914,7 @@ static int me4600_ao_query_number_channels(me_subdevice_t * subdevice,
5914 return ME_ERRNO_SUCCESS; 5914 return ME_ERRNO_SUCCESS;
5915} 5915}
5916 5916
5917static int me4600_ao_query_subdevice_type(me_subdevice_t * subdevice, 5917static int me4600_ao_query_subdevice_type(me_subdevice_t *subdevice,
5918 int *type, int *subtype) 5918 int *type, int *subtype)
5919{ 5919{
5920 me4600_ao_subdevice_t *instance; 5920 me4600_ao_subdevice_t *instance;
@@ -5929,7 +5929,7 @@ static int me4600_ao_query_subdevice_type(me_subdevice_t * subdevice,
5929 return ME_ERRNO_SUCCESS; 5929 return ME_ERRNO_SUCCESS;
5930} 5930}
5931 5931
5932static int me4600_ao_query_subdevice_caps(me_subdevice_t * subdevice, int *caps) 5932static int me4600_ao_query_subdevice_caps(me_subdevice_t *subdevice, int *caps)
5933{ 5933{
5934 me4600_ao_subdevice_t *instance; 5934 me4600_ao_subdevice_t *instance;
5935 instance = (me4600_ao_subdevice_t *) subdevice; 5935 instance = (me4600_ao_subdevice_t *) subdevice;