Merge remote-tracking branches 'asoc/fix/adsp', 'asoc/fix/amd', 'asoc/fix/atmel'...
[linux-2.6-microblaze.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / xnr / xnr_1.0 / ia_css_xnr.host.c
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15
16 #include "ia_css_types.h"
17 #include "sh_css_defs.h"
18 #include "ia_css_debug.h"
19 #include "sh_css_frac.h"
20
21 #include "ia_css_xnr.host.h"
22
23 const struct ia_css_xnr_config default_xnr_config = {
24         /* default threshold 6400 translates to 25 on ISP. */
25         6400
26 };
27
28 void
29 ia_css_xnr_table_vamem_encode(
30         struct sh_css_isp_xnr_vamem_params *to,
31         const struct ia_css_xnr_table *from,
32         unsigned size)
33 {
34         (void)size;
35         memcpy (&to->xnr,  &from->data, sizeof(to->xnr));
36 }
37
38 void
39 ia_css_xnr_encode(
40         struct sh_css_isp_xnr_params *to,
41         const struct ia_css_xnr_config *from,
42         unsigned size)
43 {
44         (void)size;
45
46         to->threshold =
47                 (uint16_t)uDIGIT_FITTING(from->threshold, 16, SH_CSS_ISP_YUV_BITS);
48 }
49
50 void
51 ia_css_xnr_table_debug_dtrace(
52         const struct ia_css_xnr_table *config,
53         unsigned level)
54 {
55         (void)config;
56         (void)level;
57 }
58
59 void
60 ia_css_xnr_debug_dtrace(
61         const struct ia_css_xnr_config *config,
62         unsigned level)
63 {
64         ia_css_debug_dtrace(level,
65                 "config.threshold=%d\n", config->threshold);
66 }