2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
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.
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
15 #include "ia_css_types.h"
16 #include "sh_css_defs.h"
17 #include "sh_css_frac.h"
18 #ifndef IA_CSS_NO_DEBUG
19 #include "ia_css_debug.h"
22 #include "ia_css_ob2.host.h"
24 const struct ia_css_ob2_config default_ob2_config
= {
33 struct sh_css_isp_ob2_params
*to
,
34 const struct ia_css_ob2_config
*from
,
39 /* Blacklevels types are u0_16 */
40 to
->blacklevel_gr
= uDIGIT_FITTING(from
->level_gr
, 16, SH_CSS_BAYER_BITS
);
41 to
->blacklevel_r
= uDIGIT_FITTING(from
->level_r
, 16, SH_CSS_BAYER_BITS
);
42 to
->blacklevel_b
= uDIGIT_FITTING(from
->level_b
, 16, SH_CSS_BAYER_BITS
);
43 to
->blacklevel_gb
= uDIGIT_FITTING(from
->level_gb
, 16, SH_CSS_BAYER_BITS
);
46 #ifndef IA_CSS_NO_DEBUG
49 const struct sh_css_isp_ob2_params
*ob2
,
55 ia_css_debug_dtrace(level
, "Optical Black 2:\n");
56 ia_css_debug_dtrace(level
, "\t%-32s = %d\n",
57 "ob2_blacklevel_gr", ob2
->blacklevel_gr
);
58 ia_css_debug_dtrace(level
, "\t%-32s = %d\n",
59 "ob2_blacklevel_r", ob2
->blacklevel_r
);
60 ia_css_debug_dtrace(level
, "\t%-32s = %d\n",
61 "ob2_blacklevel_b", ob2
->blacklevel_b
);
62 ia_css_debug_dtrace(level
, "\t%-32s = %d\n",
63 "ob2_blacklevel_gb", ob2
->blacklevel_gb
);
69 ia_css_ob2_debug_dtrace(
70 const struct ia_css_ob2_config
*config
,
73 ia_css_debug_dtrace(level
,
74 "config.level_gr=%d, config.level_r=%d, "
75 "config.level_b=%d, config.level_gb=%d, ",
76 config
->level_gr
, config
->level_r
,
77 config
->level_b
, config
->level_gb
);