2 * Copyright (C) 2012 Spreadtrum Communications Inc.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #include <linux/uaccess.h>
15 #include <linux/sprd_mm.h>
16 #include <video/sprd_isp.h>
19 static int32_t isp_k_prefilter_block(struct isp_io_param *param)
22 struct isp_dev_prefilter_info_v1 prefilter_info;
24 memset(&prefilter_info, 0x00, sizeof(prefilter_info));
26 ret = copy_from_user((void *)&prefilter_info, param->property_param, sizeof(prefilter_info));
28 printk("isp_k_prefilter_block: copy_from_user error, ret = 0x%x\n", (uint32_t)ret);
32 if (prefilter_info.writeback) {
33 REG_OWR(ISP_PREF_PARAM, BIT_1);
35 REG_MWR(ISP_PREF_PARAM, BIT_1, 0);
38 REG_WR(ISP_PREF_THRD, prefilter_info.thrd & 0xFF);
40 if (prefilter_info.bypass) {
41 REG_OWR(ISP_PREF_PARAM, BIT_0);
43 REG_MWR(ISP_PREF_PARAM, BIT_0, 0);
49 int32_t isp_k_cfg_prefilter(struct isp_io_param *param)
54 printk("isp_k_cfg_prefilter: param is null error.\n");
58 if (NULL == param->property_param) {
59 printk("isp_k_cfg_prefilter: property_param is null error.\n");
63 switch(param->property) {
64 case ISP_PRO_PREF_BLOCK:
65 ret = isp_k_prefilter_block(param);
68 printk("isp_k_cfg_prefilter: fail cmd id:%d, not supported.\n", param->property);