RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / staging / dream / qdsp5 / adsp_vfe_patch_event.c
bloba56392b3521c3b7fb246afd853dd27948ad4c22b
1 /* arch/arm/mach-msm/qdsp5/adsp_vfe_patch_event.c
3 * Verification code for aDSP VFE packets from userspace.
5 * Copyright (c) 2008 QUALCOMM Incorporated
6 * Copyright (C) 2008 Google, Inc.
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
19 #include <mach/qdsp5/qdsp5vfemsg.h>
20 #include "adsp.h"
22 static int patch_op_event(struct msm_adsp_module *module,
23 struct adsp_event *event)
25 vfe_msg_op1 *op = (vfe_msg_op1 *)event->data.msg16;
26 if (adsp_pmem_paddr_fixup(module, (void **)&op->op1_buf_y_addr) ||
27 adsp_pmem_paddr_fixup(module, (void **)&op->op1_buf_cbcr_addr))
28 return -1;
29 return 0;
32 static int patch_af_wb_event(struct msm_adsp_module *module,
33 struct adsp_event *event)
35 vfe_msg_stats_wb_exp *af = (vfe_msg_stats_wb_exp *)event->data.msg16;
36 return adsp_pmem_paddr_fixup(module, (void **)&af->wb_exp_stats_op_buf);
39 int adsp_vfe_patch_event(struct msm_adsp_module *module,
40 struct adsp_event *event)
42 switch(event->msg_id) {
43 case VFE_MSG_OP1:
44 case VFE_MSG_OP2:
45 return patch_op_event(module, event);
46 case VFE_MSG_STATS_AF:
47 case VFE_MSG_STATS_WB_EXP:
48 return patch_af_wb_event(module, event);
49 default:
50 break;
53 return 0;