Commit 73254c30 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] mt9m032: Define MT9M032_READ_MODE1 bits

Replace hardcoded values with #define's.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a54b80b1
...@@ -90,6 +90,24 @@ ...@@ -90,6 +90,24 @@
#define MT9M032_PLL_CONFIG1_PREDIV_MASK 0x3f #define MT9M032_PLL_CONFIG1_PREDIV_MASK 0x3f
#define MT9M032_PLL_CONFIG1_MUL_SHIFT 8 #define MT9M032_PLL_CONFIG1_MUL_SHIFT 8
#define MT9M032_READ_MODE1 0x1e #define MT9M032_READ_MODE1 0x1e
#define MT9M032_READ_MODE1_OUTPUT_BAD_FRAMES (1 << 13)
#define MT9M032_READ_MODE1_MAINTAIN_FRAME_RATE (1 << 12)
#define MT9M032_READ_MODE1_XOR_LINE_VALID (1 << 11)
#define MT9M032_READ_MODE1_CONT_LINE_VALID (1 << 10)
#define MT9M032_READ_MODE1_INVERT_TRIGGER (1 << 9)
#define MT9M032_READ_MODE1_SNAPSHOT (1 << 8)
#define MT9M032_READ_MODE1_GLOBAL_RESET (1 << 7)
#define MT9M032_READ_MODE1_BULB_EXPOSURE (1 << 6)
#define MT9M032_READ_MODE1_INVERT_STROBE (1 << 5)
#define MT9M032_READ_MODE1_STROBE_ENABLE (1 << 4)
#define MT9M032_READ_MODE1_STROBE_START_TRIG1 (0 << 2)
#define MT9M032_READ_MODE1_STROBE_START_EXP (1 << 2)
#define MT9M032_READ_MODE1_STROBE_START_SHUTTER (2 << 2)
#define MT9M032_READ_MODE1_STROBE_START_TRIG2 (3 << 2)
#define MT9M032_READ_MODE1_STROBE_END_TRIG1 (0 << 0)
#define MT9M032_READ_MODE1_STROBE_END_EXP (1 << 0)
#define MT9M032_READ_MODE1_STROBE_END_SHUTTER (2 << 0)
#define MT9M032_READ_MODE1_STROBE_END_TRIG2 (3 << 0)
#define MT9M032_READ_MODE2 0x20 #define MT9M032_READ_MODE2 0x20
#define MT9M032_READ_MODE2_VFLIP_SHIFT 15 #define MT9M032_READ_MODE2_VFLIP_SHIFT 15
#define MT9M032_READ_MODE2_HFLIP_SHIFT 14 #define MT9M032_READ_MODE2_HFLIP_SHIFT 14
...@@ -282,7 +300,9 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor) ...@@ -282,7 +300,9 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor)
MT9P031_PLL_CONTROL_PWRON | MT9P031_PLL_CONTROL_PWRON |
MT9P031_PLL_CONTROL_USEPLL); MT9P031_PLL_CONTROL_USEPLL);
if (!ret) /* more reserved, Continuous, Master Mode */ if (!ret) /* more reserved, Continuous, Master Mode */
ret = mt9m032_write(client, MT9M032_READ_MODE1, 0x8006); ret = mt9m032_write(client, MT9M032_READ_MODE1, 0x8000 |
MT9M032_READ_MODE1_STROBE_START_EXP |
MT9M032_READ_MODE1_STROBE_END_SHUTTER);
if (!ret) { if (!ret) {
reg_val = (pll.p1 == 6 ? MT9M032_FORMATTER1_PLL_P1_6 : 0) reg_val = (pll.p1 == 6 ? MT9M032_FORMATTER1_PLL_P1_6 : 0)
| MT9M032_FORMATTER1_PARALLEL | 0x001e; /* 14-bit */ | MT9M032_FORMATTER1_PARALLEL | 0x001e; /* 14-bit */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment