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 #ifndef IA_CSS_NO_DEBUG
18 #include "ia_css_debug.h"
20 #include "sh_css_frac.h"
22 #include "ia_css_wb.host.h"
24 const struct ia_css_wb_config default_wb_config = {
34 struct sh_css_isp_wb_params *to,
35 const struct ia_css_wb_config *from,
40 uISP_REG_BIT - from->integer_bits;
42 uDIGIT_FITTING(from->gr, 16 - from->integer_bits,
45 uDIGIT_FITTING(from->r, 16 - from->integer_bits,
48 uDIGIT_FITTING(from->b, 16 - from->integer_bits,
51 uDIGIT_FITTING(from->gb, 16 - from->integer_bits,
55 #ifndef IA_CSS_NO_DEBUG
58 const struct sh_css_isp_wb_params *wb,
62 ia_css_debug_dtrace(level, "White Balance:\n");
63 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
64 "wb_gain_shift", wb->gain_shift);
65 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
66 "wb_gain_gr", wb->gain_gr);
67 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
68 "wb_gain_r", wb->gain_r);
69 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
70 "wb_gain_b", wb->gain_b);
71 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
72 "wb_gain_gb", wb->gain_gb);
76 ia_css_wb_debug_dtrace(
77 const struct ia_css_wb_config *config,
80 ia_css_debug_dtrace(level,
81 "config.integer_bits=%d, "
82 "config.gr=%d, config.r=%d, "
83 "config.b=%d, config.gb=%d\n",
85 config->gr, config->r,
86 config->b, config->gb);