Merge branch 'work.regset' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux/fpc-iii.git] / drivers / media / i2c / et8ek8 / et8ek8_reg.h
blobc90e74935f127943d712fc8bf330851d80a9e8c1
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * et8ek8_reg.h
5 * Copyright (C) 2008 Nokia Corporation
7 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
8 * Tuukka Toivonen <tuukkat76@gmail.com>
9 */
11 #ifndef ET8EK8REGS_H
12 #define ET8EK8REGS_H
14 #include <linux/i2c.h>
15 #include <linux/types.h>
16 #include <linux/videodev2.h>
17 #include <linux/v4l2-subdev.h>
19 struct v4l2_mbus_framefmt;
20 struct v4l2_subdev_pad_mbus_code_enum;
22 struct et8ek8_mode {
23 /* Physical sensor resolution and current image window */
24 u16 sensor_width;
25 u16 sensor_height;
26 u16 sensor_window_origin_x;
27 u16 sensor_window_origin_y;
28 u16 sensor_window_width;
29 u16 sensor_window_height;
31 /* Image data coming from sensor (after scaling) */
32 u16 width;
33 u16 height;
34 u16 window_origin_x;
35 u16 window_origin_y;
36 u16 window_width;
37 u16 window_height;
39 u32 pixel_clock; /* in Hz */
40 u32 ext_clock; /* in Hz */
41 struct v4l2_fract timeperframe;
42 u32 max_exp; /* Maximum exposure value */
43 u32 bus_format; /* MEDIA_BUS_FMT_ */
44 u32 sensitivity; /* 16.16 fixed point */
47 #define ET8EK8_REG_8BIT 1
48 #define ET8EK8_REG_16BIT 2
49 #define ET8EK8_REG_DELAY 100
50 #define ET8EK8_REG_TERM 0xff
51 struct et8ek8_reg {
52 u16 type;
53 u16 reg; /* 16-bit offset */
54 u32 val; /* 8/16/32-bit value */
57 /* Possible struct smia_reglist types. */
58 #define ET8EK8_REGLIST_STANDBY 0
59 #define ET8EK8_REGLIST_POWERON 1
60 #define ET8EK8_REGLIST_RESUME 2
61 #define ET8EK8_REGLIST_STREAMON 3
62 #define ET8EK8_REGLIST_STREAMOFF 4
63 #define ET8EK8_REGLIST_DISABLED 5
65 #define ET8EK8_REGLIST_MODE 10
67 #define ET8EK8_REGLIST_LSC_ENABLE 100
68 #define ET8EK8_REGLIST_LSC_DISABLE 101
69 #define ET8EK8_REGLIST_ANR_ENABLE 102
70 #define ET8EK8_REGLIST_ANR_DISABLE 103
72 struct et8ek8_reglist {
73 u32 type;
74 struct et8ek8_mode mode;
75 struct et8ek8_reg regs[];
78 #define ET8EK8_MAX_LEN 32
79 struct et8ek8_meta_reglist {
80 char version[ET8EK8_MAX_LEN];
81 union {
82 struct et8ek8_reglist *ptr;
83 } reglist[];
86 extern struct et8ek8_meta_reglist meta_reglist;
88 #endif /* ET8EK8REGS */