blob: 1ad2b6dad561e96ec3c73243ff1fc44319fab48c [file] [log] [blame]
Kyle Swenson8d8f6542021-03-15 11:02:55 -06001/*
2 * Copyright (c) 2013 Texas Instruments Inc.
3 *
4 * David Griego, <dagriego@biglakesoftware.com>
5 * Dale Farnsworth, <dale@farnsworth.org>
6 * Archit Taneja, <archit@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
11 */
12#ifndef TI_CSC_H
13#define TI_CSC_H
14
15/* VPE color space converter regs */
16#define CSC_CSC00 0x00
17#define CSC_A0_MASK 0x1fff
18#define CSC_A0_SHIFT 0
19#define CSC_B0_MASK 0x1fff
20#define CSC_B0_SHIFT 16
21
22#define CSC_CSC01 0x04
23#define CSC_C0_MASK 0x1fff
24#define CSC_C0_SHIFT 0
25#define CSC_A1_MASK 0x1fff
26#define CSC_A1_SHIFT 16
27
28#define CSC_CSC02 0x08
29#define CSC_B1_MASK 0x1fff
30#define CSC_B1_SHIFT 0
31#define CSC_C1_MASK 0x1fff
32#define CSC_C1_SHIFT 16
33
34#define CSC_CSC03 0x0c
35#define CSC_A2_MASK 0x1fff
36#define CSC_A2_SHIFT 0
37#define CSC_B2_MASK 0x1fff
38#define CSC_B2_SHIFT 16
39
40#define CSC_CSC04 0x10
41#define CSC_C2_MASK 0x1fff
42#define CSC_C2_SHIFT 0
43#define CSC_D0_MASK 0x0fff
44#define CSC_D0_SHIFT 16
45
46#define CSC_CSC05 0x14
47#define CSC_D1_MASK 0x0fff
48#define CSC_D1_SHIFT 0
49#define CSC_D2_MASK 0x0fff
50#define CSC_D2_SHIFT 16
51
52#define CSC_BYPASS (1 << 28)
53
54struct csc_data {
55 void __iomem *base;
56 struct resource *res;
57
58 struct platform_device *pdev;
59};
60
61void csc_dump_regs(struct csc_data *csc);
62void csc_set_coeff_bypass(struct csc_data *csc, u32 *csc_reg5);
63void csc_set_coeff(struct csc_data *csc, u32 *csc_reg0,
64 enum v4l2_colorspace src_colorspace,
65 enum v4l2_colorspace dst_colorspace);
66struct csc_data *csc_create(struct platform_device *pdev);
67
68#endif