]>
Commit | Line | Data |
---|---|---|
caff4cae IM |
1 | /* arch/arm/mach-msm/qdsp5/adsp_vfe_patch_event.c |
2 | * | |
3 | * Verification code for aDSP VFE packets from userspace. | |
4 | * | |
5 | * Copyright (c) 2008 QUALCOMM Incorporated | |
6 | * Copyright (C) 2008 Google, Inc. | |
7 | * | |
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. | |
11 | * | |
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. | |
16 | * | |
17 | */ | |
18 | ||
19 | #include <mach/qdsp5/qdsp5vfemsg.h> | |
20 | #include "adsp.h" | |
21 | ||
22 | static int patch_op_event(struct msm_adsp_module *module, | |
23 | struct adsp_event *event) | |
24 | { | |
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; | |
30 | } | |
31 | ||
32 | static int patch_af_wb_event(struct msm_adsp_module *module, | |
33 | struct adsp_event *event) | |
34 | { | |
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); | |
37 | } | |
38 | ||
39 | int adsp_vfe_patch_event(struct msm_adsp_module *module, | |
40 | struct adsp_event *event) | |
41 | { | |
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; | |
51 | } | |
52 | ||
53 | return 0; | |
54 | } |