| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2012 Samsung Electronics Co., Ltd. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 6 | | - * published by the Free Software Foundation. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| 9 | 6 | #ifndef FIMC_LITE_REG_H_ |
|---|
| 10 | 7 | #define FIMC_LITE_REG_H_ |
|---|
| 8 | + |
|---|
| 9 | +#include <linux/bitops.h> |
|---|
| 11 | 10 | |
|---|
| 12 | 11 | #include "fimc-lite.h" |
|---|
| 13 | 12 | |
|---|
| .. | .. |
|---|
| 30 | 29 | /* User defined formats. x = 0...15 */ |
|---|
| 31 | 30 | #define FLITE_REG_CIGCTRL_USER(x) ((0x30 + x - 1) << 24) |
|---|
| 32 | 31 | #define FLITE_REG_CIGCTRL_FMT_MASK (0x3f << 24) |
|---|
| 33 | | -#define FLITE_REG_CIGCTRL_SHADOWMASK_DISABLE (1 << 21) |
|---|
| 34 | | -#define FLITE_REG_CIGCTRL_ODMA_DISABLE (1 << 20) |
|---|
| 35 | | -#define FLITE_REG_CIGCTRL_SWRST_REQ (1 << 19) |
|---|
| 36 | | -#define FLITE_REG_CIGCTRL_SWRST_RDY (1 << 18) |
|---|
| 37 | | -#define FLITE_REG_CIGCTRL_SWRST (1 << 17) |
|---|
| 38 | | -#define FLITE_REG_CIGCTRL_TEST_PATTERN_COLORBAR (1 << 15) |
|---|
| 39 | | -#define FLITE_REG_CIGCTRL_INVPOLPCLK (1 << 14) |
|---|
| 40 | | -#define FLITE_REG_CIGCTRL_INVPOLVSYNC (1 << 13) |
|---|
| 41 | | -#define FLITE_REG_CIGCTRL_INVPOLHREF (1 << 12) |
|---|
| 32 | +#define FLITE_REG_CIGCTRL_SHADOWMASK_DISABLE BIT(21) |
|---|
| 33 | +#define FLITE_REG_CIGCTRL_ODMA_DISABLE BIT(20) |
|---|
| 34 | +#define FLITE_REG_CIGCTRL_SWRST_REQ BIT(19) |
|---|
| 35 | +#define FLITE_REG_CIGCTRL_SWRST_RDY BIT(18) |
|---|
| 36 | +#define FLITE_REG_CIGCTRL_SWRST BIT(17) |
|---|
| 37 | +#define FLITE_REG_CIGCTRL_TEST_PATTERN_COLORBAR BIT(15) |
|---|
| 38 | +#define FLITE_REG_CIGCTRL_INVPOLPCLK BIT(14) |
|---|
| 39 | +#define FLITE_REG_CIGCTRL_INVPOLVSYNC BIT(13) |
|---|
| 40 | +#define FLITE_REG_CIGCTRL_INVPOLHREF BIT(12) |
|---|
| 42 | 41 | /* Interrupts mask bits (1 disables an interrupt) */ |
|---|
| 43 | | -#define FLITE_REG_CIGCTRL_IRQ_LASTEN (1 << 8) |
|---|
| 44 | | -#define FLITE_REG_CIGCTRL_IRQ_ENDEN (1 << 7) |
|---|
| 45 | | -#define FLITE_REG_CIGCTRL_IRQ_STARTEN (1 << 6) |
|---|
| 46 | | -#define FLITE_REG_CIGCTRL_IRQ_OVFEN (1 << 5) |
|---|
| 42 | +#define FLITE_REG_CIGCTRL_IRQ_LASTEN BIT(8) |
|---|
| 43 | +#define FLITE_REG_CIGCTRL_IRQ_ENDEN BIT(7) |
|---|
| 44 | +#define FLITE_REG_CIGCTRL_IRQ_STARTEN BIT(6) |
|---|
| 45 | +#define FLITE_REG_CIGCTRL_IRQ_OVFEN BIT(5) |
|---|
| 47 | 46 | #define FLITE_REG_CIGCTRL_IRQ_DISABLE_MASK (0xf << 5) |
|---|
| 48 | | -#define FLITE_REG_CIGCTRL_SELCAM_MIPI (1 << 3) |
|---|
| 47 | +#define FLITE_REG_CIGCTRL_SELCAM_MIPI BIT(3) |
|---|
| 49 | 48 | |
|---|
| 50 | 49 | /* Image Capture Enable */ |
|---|
| 51 | 50 | #define FLITE_REG_CIIMGCPT 0x08 |
|---|
| 52 | | -#define FLITE_REG_CIIMGCPT_IMGCPTEN (1 << 31) |
|---|
| 53 | | -#define FLITE_REG_CIIMGCPT_CPT_FREN (1 << 25) |
|---|
| 51 | +#define FLITE_REG_CIIMGCPT_IMGCPTEN BIT(31) |
|---|
| 52 | +#define FLITE_REG_CIIMGCPT_CPT_FREN BIT(25) |
|---|
| 54 | 53 | #define FLITE_REG_CIIMGCPT_CPT_MOD_FRCNT (1 << 18) |
|---|
| 55 | 54 | #define FLITE_REG_CIIMGCPT_CPT_MOD_FREN (0 << 18) |
|---|
| 56 | 55 | |
|---|
| .. | .. |
|---|
| 59 | 58 | |
|---|
| 60 | 59 | /* Camera Window Offset */ |
|---|
| 61 | 60 | #define FLITE_REG_CIWDOFST 0x10 |
|---|
| 62 | | -#define FLITE_REG_CIWDOFST_WINOFSEN (1 << 31) |
|---|
| 63 | | -#define FLITE_REG_CIWDOFST_CLROVIY (1 << 31) |
|---|
| 64 | | -#define FLITE_REG_CIWDOFST_CLROVFICB (1 << 15) |
|---|
| 65 | | -#define FLITE_REG_CIWDOFST_CLROVFICR (1 << 14) |
|---|
| 61 | +#define FLITE_REG_CIWDOFST_WINOFSEN BIT(31) |
|---|
| 62 | +#define FLITE_REG_CIWDOFST_CLROVIY BIT(31) |
|---|
| 63 | +#define FLITE_REG_CIWDOFST_CLROVFICB BIT(15) |
|---|
| 64 | +#define FLITE_REG_CIWDOFST_CLROVFICR BIT(14) |
|---|
| 66 | 65 | #define FLITE_REG_CIWDOFST_OFST_MASK ((0x1fff << 16) | 0x1fff) |
|---|
| 67 | 66 | |
|---|
| 68 | 67 | /* Camera Window Offset2 */ |
|---|
| .. | .. |
|---|
| 70 | 69 | |
|---|
| 71 | 70 | /* Camera Output DMA Format */ |
|---|
| 72 | 71 | #define FLITE_REG_CIODMAFMT 0x18 |
|---|
| 73 | | -#define FLITE_REG_CIODMAFMT_RAW_CON (1 << 15) |
|---|
| 74 | | -#define FLITE_REG_CIODMAFMT_PACK12 (1 << 14) |
|---|
| 72 | +#define FLITE_REG_CIODMAFMT_RAW_CON BIT(15) |
|---|
| 73 | +#define FLITE_REG_CIODMAFMT_PACK12 BIT(14) |
|---|
| 75 | 74 | #define FLITE_REG_CIODMAFMT_YCBYCR (0 << 4) |
|---|
| 76 | 75 | #define FLITE_REG_CIODMAFMT_YCRYCB (1 << 4) |
|---|
| 77 | 76 | #define FLITE_REG_CIODMAFMT_CBYCRY (2 << 4) |
|---|
| .. | .. |
|---|
| 91 | 90 | |
|---|
| 92 | 91 | /* Camera Status */ |
|---|
| 93 | 92 | #define FLITE_REG_CISTATUS 0x40 |
|---|
| 94 | | -#define FLITE_REG_CISTATUS_MIPI_VVALID (1 << 22) |
|---|
| 95 | | -#define FLITE_REG_CISTATUS_MIPI_HVALID (1 << 21) |
|---|
| 96 | | -#define FLITE_REG_CISTATUS_MIPI_DVALID (1 << 20) |
|---|
| 97 | | -#define FLITE_REG_CISTATUS_ITU_VSYNC (1 << 14) |
|---|
| 98 | | -#define FLITE_REG_CISTATUS_ITU_HREFF (1 << 13) |
|---|
| 99 | | -#define FLITE_REG_CISTATUS_OVFIY (1 << 10) |
|---|
| 100 | | -#define FLITE_REG_CISTATUS_OVFICB (1 << 9) |
|---|
| 101 | | -#define FLITE_REG_CISTATUS_OVFICR (1 << 8) |
|---|
| 102 | | -#define FLITE_REG_CISTATUS_IRQ_SRC_OVERFLOW (1 << 7) |
|---|
| 103 | | -#define FLITE_REG_CISTATUS_IRQ_SRC_LASTCAPEND (1 << 6) |
|---|
| 104 | | -#define FLITE_REG_CISTATUS_IRQ_SRC_FRMSTART (1 << 5) |
|---|
| 105 | | -#define FLITE_REG_CISTATUS_IRQ_SRC_FRMEND (1 << 4) |
|---|
| 106 | | -#define FLITE_REG_CISTATUS_IRQ_CAM (1 << 0) |
|---|
| 93 | +#define FLITE_REG_CISTATUS_MIPI_VVALID BIT(22) |
|---|
| 94 | +#define FLITE_REG_CISTATUS_MIPI_HVALID BIT(21) |
|---|
| 95 | +#define FLITE_REG_CISTATUS_MIPI_DVALID BIT(20) |
|---|
| 96 | +#define FLITE_REG_CISTATUS_ITU_VSYNC BIT(14) |
|---|
| 97 | +#define FLITE_REG_CISTATUS_ITU_HREFF BIT(13) |
|---|
| 98 | +#define FLITE_REG_CISTATUS_OVFIY BIT(10) |
|---|
| 99 | +#define FLITE_REG_CISTATUS_OVFICB BIT(9) |
|---|
| 100 | +#define FLITE_REG_CISTATUS_OVFICR BIT(8) |
|---|
| 101 | +#define FLITE_REG_CISTATUS_IRQ_SRC_OVERFLOW BIT(7) |
|---|
| 102 | +#define FLITE_REG_CISTATUS_IRQ_SRC_LASTCAPEND BIT(6) |
|---|
| 103 | +#define FLITE_REG_CISTATUS_IRQ_SRC_FRMSTART BIT(5) |
|---|
| 104 | +#define FLITE_REG_CISTATUS_IRQ_SRC_FRMEND BIT(4) |
|---|
| 105 | +#define FLITE_REG_CISTATUS_IRQ_CAM BIT(0) |
|---|
| 107 | 106 | #define FLITE_REG_CISTATUS_IRQ_MASK (0xf << 4) |
|---|
| 108 | 107 | |
|---|
| 109 | 108 | /* Camera Status2 */ |
|---|
| 110 | 109 | #define FLITE_REG_CISTATUS2 0x44 |
|---|
| 111 | | -#define FLITE_REG_CISTATUS2_LASTCAPEND (1 << 1) |
|---|
| 112 | | -#define FLITE_REG_CISTATUS2_FRMEND (1 << 0) |
|---|
| 110 | +#define FLITE_REG_CISTATUS2_LASTCAPEND BIT(1) |
|---|
| 111 | +#define FLITE_REG_CISTATUS2_FRMEND BIT(0) |
|---|
| 113 | 112 | |
|---|
| 114 | 113 | /* Qos Threshold */ |
|---|
| 115 | 114 | #define FLITE_REG_CITHOLD 0xf0 |
|---|
| 116 | | -#define FLITE_REG_CITHOLD_W_QOS_EN (1 << 30) |
|---|
| 115 | +#define FLITE_REG_CITHOLD_W_QOS_EN BIT(30) |
|---|
| 117 | 116 | |
|---|
| 118 | 117 | /* Camera General Purpose */ |
|---|
| 119 | 118 | #define FLITE_REG_CIGENERAL 0xfc |
|---|
| 120 | 119 | /* b0: 1 - camera B, 0 - camera A */ |
|---|
| 121 | | -#define FLITE_REG_CIGENERAL_CAM_B (1 << 0) |
|---|
| 120 | +#define FLITE_REG_CIGENERAL_CAM_B BIT(0) |
|---|
| 122 | 121 | |
|---|
| 123 | 122 | #define FLITE_REG_CIFCNTSEQ 0x100 |
|---|
| 124 | 123 | #define FLITE_REG_CIOSAN(x) (0x200 + (4 * (x))) |
|---|