Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / drivers / media / platform / omap3isp / isph3a.h
blob5144f7689dda78c2835ae552c7a8d368c99e4a91
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * isph3a.h
5 * TI OMAP3 ISP - H3A AF module
7 * Copyright (C) 2010 Nokia Corporation
8 * Copyright (C) 2009 Texas Instruments, Inc.
10 * Contacts: David Cohen <dacohen@gmail.com>
11 * Laurent Pinchart <laurent.pinchart@ideasonboard.com>
12 * Sakari Ailus <sakari.ailus@iki.fi>
15 #ifndef OMAP3_ISP_H3A_H
16 #define OMAP3_ISP_H3A_H
18 #include <linux/omap3isp.h>
21 * ----------
22 * -H3A AEWB-
23 * ----------
26 #define AEWB_PACKET_SIZE 16
27 #define AEWB_SATURATION_LIMIT 0x3ff
29 /* Flags for changed registers */
30 #define PCR_CHNG (1 << 0)
31 #define AEWWIN1_CHNG (1 << 1)
32 #define AEWINSTART_CHNG (1 << 2)
33 #define AEWINBLK_CHNG (1 << 3)
34 #define AEWSUBWIN_CHNG (1 << 4)
35 #define PRV_WBDGAIN_CHNG (1 << 5)
36 #define PRV_WBGAIN_CHNG (1 << 6)
38 /* ISPH3A REGISTERS bits */
39 #define ISPH3A_PCR_AF_EN (1 << 0)
40 #define ISPH3A_PCR_AF_ALAW_EN (1 << 1)
41 #define ISPH3A_PCR_AF_MED_EN (1 << 2)
42 #define ISPH3A_PCR_AF_BUSY (1 << 15)
43 #define ISPH3A_PCR_AEW_EN (1 << 16)
44 #define ISPH3A_PCR_AEW_ALAW_EN (1 << 17)
45 #define ISPH3A_PCR_AEW_BUSY (1 << 18)
46 #define ISPH3A_PCR_AEW_MASK (ISPH3A_PCR_AEW_ALAW_EN | \
47 ISPH3A_PCR_AEW_AVE2LMT_MASK)
50 * --------
51 * -H3A AF-
52 * --------
55 /* Peripheral Revision */
56 #define AFPID 0x0
58 #define AFCOEF_OFFSET 0x00000004 /* COEF base address */
60 /* PCR fields */
61 #define AF_BUSYAF (1 << 15)
62 #define AF_FVMODE (1 << 14)
63 #define AF_RGBPOS (0x7 << 11)
64 #define AF_MED_TH (0xFF << 3)
65 #define AF_MED_EN (1 << 2)
66 #define AF_ALAW_EN (1 << 1)
67 #define AF_EN (1 << 0)
68 #define AF_PCR_MASK (AF_FVMODE | AF_RGBPOS | AF_MED_TH | \
69 AF_MED_EN | AF_ALAW_EN)
71 /* AFPAX1 fields */
72 #define AF_PAXW (0x7F << 16)
73 #define AF_PAXH 0x7F
75 /* AFPAX2 fields */
76 #define AF_AFINCV (0xF << 13)
77 #define AF_PAXVC (0x7F << 6)
78 #define AF_PAXHC 0x3F
80 /* AFPAXSTART fields */
81 #define AF_PAXSH (0xFFF<<16)
82 #define AF_PAXSV 0xFFF
84 /* COEFFICIENT MASK */
85 #define AF_COEF_MASK0 0xFFF
86 #define AF_COEF_MASK1 (0xFFF<<16)
88 /* BIT SHIFTS */
89 #define AF_RGBPOS_SHIFT 11
90 #define AF_MED_TH_SHIFT 3
91 #define AF_PAXW_SHIFT 16
92 #define AF_LINE_INCR_SHIFT 13
93 #define AF_VT_COUNT_SHIFT 6
94 #define AF_HZ_START_SHIFT 16
95 #define AF_COEF_SHIFT 16
97 /* Init and cleanup functions */
98 int omap3isp_h3a_aewb_init(struct isp_device *isp);
99 int omap3isp_h3a_af_init(struct isp_device *isp);
101 void omap3isp_h3a_aewb_cleanup(struct isp_device *isp);
102 void omap3isp_h3a_af_cleanup(struct isp_device *isp);
104 #endif /* OMAP3_ISP_H3A_H */