]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/blame - drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_tpg.h
Merge remote-tracking branches 'asoc/topic/da7218', 'asoc/topic/dai-drv', 'asoc/topic...
[mirror_ubuntu-disco-kernel.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / ia_css_tpg.h
CommitLineData
a49d2536
AC
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#ifndef __IA_CSS_TPG_H
16#define __IA_CSS_TPG_H
17
d929fb4e 18/* @file
a49d2536
AC
19 * This file contains support for the test pattern generator (TPG)
20 */
21
d929fb4e 22/* Enumerate the TPG IDs.
a49d2536
AC
23 */
24enum ia_css_tpg_id {
25 IA_CSS_TPG_ID0,
26 IA_CSS_TPG_ID1,
27 IA_CSS_TPG_ID2
28};
29
30/**
31 * Maximum number of TPG IDs.
32 *
33 * Make sure the value of this define gets changed to reflect the correct
34 * number of ia_css_tpg_id enum if you add/delete an item in the enum.
35 */
36#define N_CSS_TPG_IDS (IA_CSS_TPG_ID2+1)
37
d929fb4e 38/* Enumerate the TPG modes.
a49d2536
AC
39 */
40enum ia_css_tpg_mode {
41 IA_CSS_TPG_MODE_RAMP,
42 IA_CSS_TPG_MODE_CHECKERBOARD,
43 IA_CSS_TPG_MODE_FRAME_BASED_COLOR,
44 IA_CSS_TPG_MODE_MONO
45};
46
d929fb4e 47/* @brief Configure the test pattern generator.
a49d2536
AC
48 *
49 * Configure the Test Pattern Generator, the way these values are used to
50 * generate the pattern can be seen in the HRT extension for the test pattern
51 * generator:
52 * devices/test_pat_gen/hrt/include/test_pat_gen.h: hrt_calc_tpg_data().
53 *
54 * This interface is deprecated, it is not portable -> move to input system API
55 *
56@code
57unsigned int test_pattern_value(unsigned int x, unsigned int y)
58{
59 unsigned int x_val, y_val;
60 if (x_delta > 0) (x_val = (x << x_delta) & x_mask;
61 else (x_val = (x >> -x_delta) & x_mask;
62 if (y_delta > 0) (y_val = (y << y_delta) & y_mask;
63 else (y_val = (y >> -y_delta) & x_mask;
64 return (x_val + y_val) & xy_mask;
65}
66@endcode
67 */
68struct ia_css_tpg_config {
69 enum ia_css_tpg_id id;
70 enum ia_css_tpg_mode mode;
71 unsigned int x_mask;
72 int x_delta;
73 unsigned int y_mask;
74 int y_delta;
75 unsigned int xy_mask;
76};
77
78#endif /* __IA_CSS_TPG_H */