aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/crystalhd/crystalhd_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/crystalhd/crystalhd_cmds.c')
-rw-r--r--drivers/staging/crystalhd/crystalhd_cmds.c160
1 files changed, 82 insertions, 78 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c
index 1a7ca8ba7f8..1429608544d 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.c
+++ b/drivers/staging/crystalhd/crystalhd_cmds.c
@@ -69,8 +69,8 @@ static void bc_cproc_mark_pwr_state(struct crystalhd_cmd *ctx)
69 } 69 }
70} 70}
71 71
72static BC_STATUS bc_cproc_notify_mode(struct crystalhd_cmd *ctx, 72static enum BC_STATUS bc_cproc_notify_mode(struct crystalhd_cmd *ctx,
73 crystalhd_ioctl_data *idata) 73 struct crystalhd_ioctl_data *idata)
74{ 74{
75 int rc = 0, i = 0; 75 int rc = 0, i = 0;
76 76
@@ -111,8 +111,8 @@ static BC_STATUS bc_cproc_notify_mode(struct crystalhd_cmd *ctx,
111 return crystalhd_hw_setup_dma_rings(&ctx->hw_ctx); 111 return crystalhd_hw_setup_dma_rings(&ctx->hw_ctx);
112} 112}
113 113
114static BC_STATUS bc_cproc_get_version(struct crystalhd_cmd *ctx, 114static enum BC_STATUS bc_cproc_get_version(struct crystalhd_cmd *ctx,
115 crystalhd_ioctl_data *idata) 115 struct crystalhd_ioctl_data *idata)
116{ 116{
117 117
118 if (!ctx || !idata) { 118 if (!ctx || !idata) {
@@ -126,7 +126,8 @@ static BC_STATUS bc_cproc_get_version(struct crystalhd_cmd *ctx,
126} 126}
127 127
128 128
129static BC_STATUS bc_cproc_get_hwtype(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) 129static enum BC_STATUS bc_cproc_get_hwtype(struct crystalhd_cmd *ctx,
130 struct crystalhd_ioctl_data *idata)
130{ 131{
131 if (!ctx || !idata) { 132 if (!ctx || !idata) {
132 BCMLOG_ERR("Invalid Arg!!\n"); 133 BCMLOG_ERR("Invalid Arg!!\n");
@@ -143,8 +144,8 @@ static BC_STATUS bc_cproc_get_hwtype(struct crystalhd_cmd *ctx, crystalhd_ioctl_
143 return BC_STS_SUCCESS; 144 return BC_STS_SUCCESS;
144} 145}
145 146
146static BC_STATUS bc_cproc_reg_rd(struct crystalhd_cmd *ctx, 147static enum BC_STATUS bc_cproc_reg_rd(struct crystalhd_cmd *ctx,
147 crystalhd_ioctl_data *idata) 148 struct crystalhd_ioctl_data *idata)
148{ 149{
149 if (!ctx || !idata) 150 if (!ctx || !idata)
150 return BC_STS_INV_ARG; 151 return BC_STS_INV_ARG;
@@ -153,8 +154,8 @@ static BC_STATUS bc_cproc_reg_rd(struct crystalhd_cmd *ctx,
153 return BC_STS_SUCCESS; 154 return BC_STS_SUCCESS;
154} 155}
155 156
156static BC_STATUS bc_cproc_reg_wr(struct crystalhd_cmd *ctx, 157static enum BC_STATUS bc_cproc_reg_wr(struct crystalhd_cmd *ctx,
157 crystalhd_ioctl_data *idata) 158 struct crystalhd_ioctl_data *idata)
158{ 159{
159 if (!ctx || !idata) 160 if (!ctx || !idata)
160 return BC_STS_INV_ARG; 161 return BC_STS_INV_ARG;
@@ -165,8 +166,8 @@ static BC_STATUS bc_cproc_reg_wr(struct crystalhd_cmd *ctx,
165 return BC_STS_SUCCESS; 166 return BC_STS_SUCCESS;
166} 167}
167 168
168static BC_STATUS bc_cproc_link_reg_rd(struct crystalhd_cmd *ctx, 169static enum BC_STATUS bc_cproc_link_reg_rd(struct crystalhd_cmd *ctx,
169 crystalhd_ioctl_data *idata) 170 struct crystalhd_ioctl_data *idata)
170{ 171{
171 if (!ctx || !idata) 172 if (!ctx || !idata)
172 return BC_STS_INV_ARG; 173 return BC_STS_INV_ARG;
@@ -176,8 +177,8 @@ static BC_STATUS bc_cproc_link_reg_rd(struct crystalhd_cmd *ctx,
176 return BC_STS_SUCCESS; 177 return BC_STS_SUCCESS;
177} 178}
178 179
179static BC_STATUS bc_cproc_link_reg_wr(struct crystalhd_cmd *ctx, 180static enum BC_STATUS bc_cproc_link_reg_wr(struct crystalhd_cmd *ctx,
180 crystalhd_ioctl_data *idata) 181 struct crystalhd_ioctl_data *idata)
181{ 182{
182 if (!ctx || !idata) 183 if (!ctx || !idata)
183 return BC_STS_INV_ARG; 184 return BC_STS_INV_ARG;
@@ -188,10 +189,10 @@ static BC_STATUS bc_cproc_link_reg_wr(struct crystalhd_cmd *ctx,
188 return BC_STS_SUCCESS; 189 return BC_STS_SUCCESS;
189} 190}
190 191
191static BC_STATUS bc_cproc_mem_rd(struct crystalhd_cmd *ctx, 192static enum BC_STATUS bc_cproc_mem_rd(struct crystalhd_cmd *ctx,
192 crystalhd_ioctl_data *idata) 193 struct crystalhd_ioctl_data *idata)
193{ 194{
194 BC_STATUS sts = BC_STS_SUCCESS; 195 enum BC_STATUS sts = BC_STS_SUCCESS;
195 196
196 if (!ctx || !idata || !idata->add_cdata) 197 if (!ctx || !idata || !idata->add_cdata)
197 return BC_STS_INV_ARG; 198 return BC_STS_INV_ARG;
@@ -207,10 +208,10 @@ static BC_STATUS bc_cproc_mem_rd(struct crystalhd_cmd *ctx,
207 208
208} 209}
209 210
210static BC_STATUS bc_cproc_mem_wr(struct crystalhd_cmd *ctx, 211static enum BC_STATUS bc_cproc_mem_wr(struct crystalhd_cmd *ctx,
211 crystalhd_ioctl_data *idata) 212 struct crystalhd_ioctl_data *idata)
212{ 213{
213 BC_STATUS sts = BC_STS_SUCCESS; 214 enum BC_STATUS sts = BC_STS_SUCCESS;
214 215
215 if (!ctx || !idata || !idata->add_cdata) 216 if (!ctx || !idata || !idata->add_cdata)
216 return BC_STS_INV_ARG; 217 return BC_STS_INV_ARG;
@@ -226,11 +227,11 @@ static BC_STATUS bc_cproc_mem_wr(struct crystalhd_cmd *ctx,
226 return sts; 227 return sts;
227} 228}
228 229
229static BC_STATUS bc_cproc_cfg_rd(struct crystalhd_cmd *ctx, 230static enum BC_STATUS bc_cproc_cfg_rd(struct crystalhd_cmd *ctx,
230 crystalhd_ioctl_data *idata) 231 struct crystalhd_ioctl_data *idata)
231{ 232{
232 uint32_t ix, cnt, off, len; 233 uint32_t ix, cnt, off, len;
233 BC_STATUS sts = BC_STS_SUCCESS; 234 enum BC_STATUS sts = BC_STS_SUCCESS;
234 uint32_t *temp; 235 uint32_t *temp;
235 236
236 if (!ctx || !idata) 237 if (!ctx || !idata)
@@ -258,11 +259,11 @@ static BC_STATUS bc_cproc_cfg_rd(struct crystalhd_cmd *ctx,
258 return sts; 259 return sts;
259} 260}
260 261
261static BC_STATUS bc_cproc_cfg_wr(struct crystalhd_cmd *ctx, 262static enum BC_STATUS bc_cproc_cfg_wr(struct crystalhd_cmd *ctx,
262 crystalhd_ioctl_data *idata) 263 struct crystalhd_ioctl_data *idata)
263{ 264{
264 uint32_t ix, cnt, off, len; 265 uint32_t ix, cnt, off, len;
265 BC_STATUS sts = BC_STS_SUCCESS; 266 enum BC_STATUS sts = BC_STS_SUCCESS;
266 uint32_t *temp; 267 uint32_t *temp;
267 268
268 if (!ctx || !idata) 269 if (!ctx || !idata)
@@ -290,10 +291,10 @@ static BC_STATUS bc_cproc_cfg_wr(struct crystalhd_cmd *ctx,
290 return sts; 291 return sts;
291} 292}
292 293
293static BC_STATUS bc_cproc_download_fw(struct crystalhd_cmd *ctx, 294static enum BC_STATUS bc_cproc_download_fw(struct crystalhd_cmd *ctx,
294 crystalhd_ioctl_data *idata) 295 struct crystalhd_ioctl_data *idata)
295{ 296{
296 BC_STATUS sts = BC_STS_SUCCESS; 297 enum BC_STATUS sts = BC_STS_SUCCESS;
297 298
298 if (!ctx || !idata || !idata->add_cdata || !idata->add_cdata_sz) { 299 if (!ctx || !idata || !idata->add_cdata || !idata->add_cdata_sz) {
299 BCMLOG_ERR("Invalid Arg!!\n"); 300 BCMLOG_ERR("Invalid Arg!!\n");
@@ -329,9 +330,10 @@ static BC_STATUS bc_cproc_download_fw(struct crystalhd_cmd *ctx,
329 * Abort pending input transfers and issue decoder flush command. 330 * Abort pending input transfers and issue decoder flush command.
330 * 331 *
331 */ 332 */
332static BC_STATUS bc_cproc_do_fw_cmd(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) 333static enum BC_STATUS bc_cproc_do_fw_cmd(struct crystalhd_cmd *ctx,
334 struct crystalhd_ioctl_data *idata)
333{ 335{
334 BC_STATUS sts; 336 enum BC_STATUS sts;
335 uint32_t *cmd; 337 uint32_t *cmd;
336 338
337 if (!(ctx->state & BC_LINK_INIT)) { 339 if (!(ctx->state & BC_LINK_INIT)) {
@@ -371,8 +373,8 @@ static BC_STATUS bc_cproc_do_fw_cmd(struct crystalhd_cmd *ctx, crystalhd_ioctl_d
371 return sts; 373 return sts;
372} 374}
373 375
374static void bc_proc_in_completion(crystalhd_dio_req *dio_hnd, 376static void bc_proc_in_completion(struct crystalhd_dio_req *dio_hnd,
375 wait_queue_head_t *event, BC_STATUS sts) 377 wait_queue_head_t *event, enum BC_STATUS sts)
376{ 378{
377 if (!dio_hnd || !event) { 379 if (!dio_hnd || !event) {
378 BCMLOG_ERR("Invalid Arg!!\n"); 380 BCMLOG_ERR("Invalid Arg!!\n");
@@ -386,7 +388,7 @@ static void bc_proc_in_completion(crystalhd_dio_req *dio_hnd,
386 crystalhd_set_event(event); 388 crystalhd_set_event(event);
387} 389}
388 390
389static BC_STATUS bc_cproc_codein_sleep(struct crystalhd_cmd *ctx) 391static enum BC_STATUS bc_cproc_codein_sleep(struct crystalhd_cmd *ctx)
390{ 392{
391 wait_queue_head_t sleep_ev; 393 wait_queue_head_t sleep_ev;
392 int rc = 0; 394 int rc = 0;
@@ -406,12 +408,12 @@ static BC_STATUS bc_cproc_codein_sleep(struct crystalhd_cmd *ctx)
406 return BC_STS_SUCCESS; 408 return BC_STS_SUCCESS;
407} 409}
408 410
409static BC_STATUS bc_cproc_hw_txdma(struct crystalhd_cmd *ctx, 411static enum BC_STATUS bc_cproc_hw_txdma(struct crystalhd_cmd *ctx,
410 crystalhd_ioctl_data *idata, 412 struct crystalhd_ioctl_data *idata,
411 crystalhd_dio_req *dio) 413 struct crystalhd_dio_req *dio)
412{ 414{
413 uint32_t tx_listid = 0; 415 uint32_t tx_listid = 0;
414 BC_STATUS sts = BC_STS_SUCCESS; 416 enum BC_STATUS sts = BC_STS_SUCCESS;
415 wait_queue_head_t event; 417 wait_queue_head_t event;
416 int rc = 0; 418 int rc = 0;
417 419
@@ -471,7 +473,7 @@ static BC_STATUS bc_cproc_hw_txdma(struct crystalhd_cmd *ctx,
471} 473}
472 474
473/* Helper function to check on user buffers */ 475/* Helper function to check on user buffers */
474static BC_STATUS bc_cproc_check_inbuffs(bool pin, void *ubuff, uint32_t ub_sz, 476static enum BC_STATUS bc_cproc_check_inbuffs(bool pin, void *ubuff, uint32_t ub_sz,
475 uint32_t uv_off, bool en_422) 477 uint32_t uv_off, bool en_422)
476{ 478{
477 if (!ubuff || !ub_sz) { 479 if (!ubuff || !ub_sz) {
@@ -502,12 +504,13 @@ static BC_STATUS bc_cproc_check_inbuffs(bool pin, void *ubuff, uint32_t ub_sz,
502 return BC_STS_SUCCESS; 504 return BC_STS_SUCCESS;
503} 505}
504 506
505static BC_STATUS bc_cproc_proc_input(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) 507static enum BC_STATUS bc_cproc_proc_input(struct crystalhd_cmd *ctx,
508 struct crystalhd_ioctl_data *idata)
506{ 509{
507 void *ubuff; 510 void *ubuff;
508 uint32_t ub_sz; 511 uint32_t ub_sz;
509 crystalhd_dio_req *dio_hnd = NULL; 512 struct crystalhd_dio_req *dio_hnd = NULL;
510 BC_STATUS sts = BC_STS_SUCCESS; 513 enum BC_STATUS sts = BC_STS_SUCCESS;
511 514
512 if (!ctx || !idata) { 515 if (!ctx || !idata) {
513 BCMLOG_ERR("Invalid Arg!!\n"); 516 BCMLOG_ERR("Invalid Arg!!\n");
@@ -537,14 +540,14 @@ static BC_STATUS bc_cproc_proc_input(struct crystalhd_cmd *ctx, crystalhd_ioctl_
537 return sts; 540 return sts;
538} 541}
539 542
540static BC_STATUS bc_cproc_add_cap_buff(struct crystalhd_cmd *ctx, 543static enum BC_STATUS bc_cproc_add_cap_buff(struct crystalhd_cmd *ctx,
541 crystalhd_ioctl_data *idata) 544 struct crystalhd_ioctl_data *idata)
542{ 545{
543 void *ubuff; 546 void *ubuff;
544 uint32_t ub_sz, uv_off; 547 uint32_t ub_sz, uv_off;
545 bool en_422; 548 bool en_422;
546 crystalhd_dio_req *dio_hnd = NULL; 549 struct crystalhd_dio_req *dio_hnd = NULL;
547 BC_STATUS sts = BC_STS_SUCCESS; 550 enum BC_STATUS sts = BC_STS_SUCCESS;
548 551
549 if (!ctx || !idata) { 552 if (!ctx || !idata) {
550 BCMLOG_ERR("Invalid Arg!!\n"); 553 BCMLOG_ERR("Invalid Arg!!\n");
@@ -579,10 +582,10 @@ static BC_STATUS bc_cproc_add_cap_buff(struct crystalhd_cmd *ctx,
579 return BC_STS_SUCCESS; 582 return BC_STS_SUCCESS;
580} 583}
581 584
582static BC_STATUS bc_cproc_fmt_change(struct crystalhd_cmd *ctx, 585static enum BC_STATUS bc_cproc_fmt_change(struct crystalhd_cmd *ctx,
583 crystalhd_dio_req *dio) 586 struct crystalhd_dio_req *dio)
584{ 587{
585 BC_STATUS sts = BC_STS_SUCCESS; 588 enum BC_STATUS sts = BC_STS_SUCCESS;
586 589
587 sts = crystalhd_hw_add_cap_buffer(&ctx->hw_ctx, dio, 0); 590 sts = crystalhd_hw_add_cap_buffer(&ctx->hw_ctx, dio, 0);
588 if (sts != BC_STS_SUCCESS) 591 if (sts != BC_STS_SUCCESS)
@@ -595,12 +598,12 @@ static BC_STATUS bc_cproc_fmt_change(struct crystalhd_cmd *ctx,
595 return sts; 598 return sts;
596} 599}
597 600
598static BC_STATUS bc_cproc_fetch_frame(struct crystalhd_cmd *ctx, 601static enum BC_STATUS bc_cproc_fetch_frame(struct crystalhd_cmd *ctx,
599 crystalhd_ioctl_data *idata) 602 struct crystalhd_ioctl_data *idata)
600{ 603{
601 crystalhd_dio_req *dio = NULL; 604 struct crystalhd_dio_req *dio = NULL;
602 BC_STATUS sts = BC_STS_SUCCESS; 605 enum BC_STATUS sts = BC_STS_SUCCESS;
603 BC_DEC_OUT_BUFF *frame; 606 struct BC_DEC_OUT_BUFF *frame;
604 607
605 if (!ctx || !idata) { 608 if (!ctx || !idata) {
606 BCMLOG_ERR("Invalid Arg!!\n"); 609 BCMLOG_ERR("Invalid Arg!!\n");
@@ -636,8 +639,8 @@ static BC_STATUS bc_cproc_fetch_frame(struct crystalhd_cmd *ctx,
636 return BC_STS_SUCCESS; 639 return BC_STS_SUCCESS;
637} 640}
638 641
639static BC_STATUS bc_cproc_start_capture(struct crystalhd_cmd *ctx, 642static enum BC_STATUS bc_cproc_start_capture(struct crystalhd_cmd *ctx,
640 crystalhd_ioctl_data *idata) 643 struct crystalhd_ioctl_data *idata)
641{ 644{
642 ctx->state |= BC_LINK_CAP_EN; 645 ctx->state |= BC_LINK_CAP_EN;
643 if (ctx->state == BC_LINK_READY) 646 if (ctx->state == BC_LINK_READY)
@@ -646,12 +649,12 @@ static BC_STATUS bc_cproc_start_capture(struct crystalhd_cmd *ctx,
646 return BC_STS_SUCCESS; 649 return BC_STS_SUCCESS;
647} 650}
648 651
649static BC_STATUS bc_cproc_flush_cap_buffs(struct crystalhd_cmd *ctx, 652static enum BC_STATUS bc_cproc_flush_cap_buffs(struct crystalhd_cmd *ctx,
650 crystalhd_ioctl_data *idata) 653 struct crystalhd_ioctl_data *idata)
651{ 654{
652 crystalhd_dio_req *dio = NULL; 655 struct crystalhd_dio_req *dio = NULL;
653 BC_STATUS sts = BC_STS_SUCCESS; 656 enum BC_STATUS sts = BC_STS_SUCCESS;
654 BC_DEC_OUT_BUFF *frame; 657 struct BC_DEC_OUT_BUFF *frame;
655 uint32_t count; 658 uint32_t count;
656 659
657 if (!ctx || !idata) { 660 if (!ctx || !idata) {
@@ -681,10 +684,10 @@ static BC_STATUS bc_cproc_flush_cap_buffs(struct crystalhd_cmd *ctx,
681 return crystalhd_hw_stop_capture(&ctx->hw_ctx); 684 return crystalhd_hw_stop_capture(&ctx->hw_ctx);
682} 685}
683 686
684static BC_STATUS bc_cproc_get_stats(struct crystalhd_cmd *ctx, 687static enum BC_STATUS bc_cproc_get_stats(struct crystalhd_cmd *ctx,
685 crystalhd_ioctl_data *idata) 688 struct crystalhd_ioctl_data *idata)
686{ 689{
687 BC_DTS_STATS *stats; 690 struct BC_DTS_STATS *stats;
688 struct crystalhd_hw_stats hw_stats; 691 struct crystalhd_hw_stats hw_stats;
689 692
690 if (!ctx || !idata) { 693 if (!ctx || !idata) {
@@ -713,20 +716,20 @@ static BC_STATUS bc_cproc_get_stats(struct crystalhd_cmd *ctx,
713 return BC_STS_SUCCESS; 716 return BC_STS_SUCCESS;
714} 717}
715 718
716static BC_STATUS bc_cproc_reset_stats(struct crystalhd_cmd *ctx, 719static enum BC_STATUS bc_cproc_reset_stats(struct crystalhd_cmd *ctx,
717 crystalhd_ioctl_data *idata) 720 struct crystalhd_ioctl_data *idata)
718{ 721{
719 crystalhd_hw_stats(&ctx->hw_ctx, NULL); 722 crystalhd_hw_stats(&ctx->hw_ctx, NULL);
720 723
721 return BC_STS_SUCCESS; 724 return BC_STS_SUCCESS;
722} 725}
723 726
724static BC_STATUS bc_cproc_chg_clk(struct crystalhd_cmd *ctx, 727static enum BC_STATUS bc_cproc_chg_clk(struct crystalhd_cmd *ctx,
725 crystalhd_ioctl_data *idata) 728 struct crystalhd_ioctl_data *idata)
726{ 729{
727 BC_CLOCK *clock; 730 struct BC_CLOCK *clock;
728 uint32_t oldClk; 731 uint32_t oldClk;
729 BC_STATUS sts = BC_STS_SUCCESS; 732 enum BC_STATUS sts = BC_STS_SUCCESS;
730 733
731 if (!ctx || !idata) { 734 if (!ctx || !idata) {
732 BCMLOG_ERR("Invalid Arg!!\n"); 735 BCMLOG_ERR("Invalid Arg!!\n");
@@ -749,7 +752,7 @@ static BC_STATUS bc_cproc_chg_clk(struct crystalhd_cmd *ctx,
749} 752}
750 753
751/*=============== Cmd Proc Table.. ======================================*/ 754/*=============== Cmd Proc Table.. ======================================*/
752static const crystalhd_cmd_tbl_t g_crystalhd_cproc_tbl[] = { 755static const struct crystalhd_cmd_tbl g_crystalhd_cproc_tbl[] = {
753 { BCM_IOC_GET_VERSION, bc_cproc_get_version, 0}, 756 { BCM_IOC_GET_VERSION, bc_cproc_get_version, 0},
754 { BCM_IOC_GET_HWTYPE, bc_cproc_get_hwtype, 0}, 757 { BCM_IOC_GET_HWTYPE, bc_cproc_get_hwtype, 0},
755 { BCM_IOC_REG_RD, bc_cproc_reg_rd, 0}, 758 { BCM_IOC_REG_RD, bc_cproc_reg_rd, 0},
@@ -796,9 +799,10 @@ static const crystalhd_cmd_tbl_t g_crystalhd_cproc_tbl[] = {
796 * we pass on the power mangement notification to our plug-in by completing 799 * we pass on the power mangement notification to our plug-in by completing
797 * all outstanding requests with BC_STS_IO_USER_ABORT return code. 800 * all outstanding requests with BC_STS_IO_USER_ABORT return code.
798 */ 801 */
799BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) 802enum BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx,
803 struct crystalhd_ioctl_data *idata)
800{ 804{
801 BC_STATUS sts = BC_STS_SUCCESS; 805 enum BC_STATUS sts = BC_STS_SUCCESS;
802 806
803 if (!ctx || !idata) { 807 if (!ctx || !idata) {
804 BCMLOG_ERR("Invalid Parameters\n"); 808 BCMLOG_ERR("Invalid Parameters\n");
@@ -854,7 +858,7 @@ BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *ida
854 * start a new playback session from the pre-suspend clip position. 858 * start a new playback session from the pre-suspend clip position.
855 * 859 *
856 */ 860 */
857BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx) 861enum BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx)
858{ 862{
859 BCMLOG(BCMLOG_DBG, "crystalhd_resume Success %x\n", ctx->state); 863 BCMLOG(BCMLOG_DBG, "crystalhd_resume Success %x\n", ctx->state);
860 864
@@ -875,7 +879,7 @@ BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx)
875 * application specific resources. HW layer initialization 879 * application specific resources. HW layer initialization
876 * is done for the first open request. 880 * is done for the first open request.
877 */ 881 */
878BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, 882enum BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx,
879 struct crystalhd_user **user_ctx) 883 struct crystalhd_user **user_ctx)
880{ 884{
881 struct crystalhd_user *uc; 885 struct crystalhd_user *uc;
@@ -913,7 +917,7 @@ BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx,
913 * Closer aplication handle and release app specific 917 * Closer aplication handle and release app specific
914 * resources. 918 * resources.
915 */ 919 */
916BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc) 920enum BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc)
917{ 921{
918 uint32_t mode = uc->mode; 922 uint32_t mode = uc->mode;
919 923
@@ -948,7 +952,7 @@ BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user
948 * 952 *
949 * Called at the time of driver load. 953 * Called at the time of driver load.
950 */ 954 */
951BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, 955enum BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx,
952 struct crystalhd_adp *adp) 956 struct crystalhd_adp *adp)
953{ 957{
954 int i = 0; 958 int i = 0;
@@ -983,7 +987,7 @@ BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx,
983 * 987 *
984 * Called at the time of driver un-load. 988 * Called at the time of driver un-load.
985 */ 989 */
986BC_STATUS __devexit crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx) 990enum BC_STATUS __devexit crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx)
987{ 991{
988 BCMLOG(BCMLOG_DBG, "Deleting Command context..\n"); 992 BCMLOG(BCMLOG_DBG, "Deleting Command context..\n");
989 993
@@ -1021,7 +1025,7 @@ crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cm
1021 return NULL; 1025 return NULL;
1022 } 1026 }
1023 1027
1024 tbl_sz = sizeof(g_crystalhd_cproc_tbl) / sizeof(crystalhd_cmd_tbl_t); 1028 tbl_sz = sizeof(g_crystalhd_cproc_tbl) / sizeof(struct crystalhd_cmd_tbl);
1025 for (i = 0; i < tbl_sz; i++) { 1029 for (i = 0; i < tbl_sz; i++) {
1026 if (g_crystalhd_cproc_tbl[i].cmd_id == cmd) { 1030 if (g_crystalhd_cproc_tbl[i].cmd_id == cmd) {
1027 if ((uc->mode == DTS_MONITOR_MODE) && 1031 if ((uc->mode == DTS_MONITOR_MODE) &&