ov772x: Add extra setting method
Commit Message
This patch add support extra register settings for platform.
For instance, platform comes to be able to use the
special setting like lens.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
---
Thank you Magnus for your nice comment.
drivers/media/video/ov772x.c | 15 ++++++++-------
include/media/ov772x.h | 7 +++++++
2 files changed, 15 insertions(+), 7 deletions(-)
@@ -368,11 +368,6 @@
/*
* struct
*/
-struct regval_list {
- unsigned char reg_num;
- unsigned char value;
-};
-
struct ov772x_color_format {
char *name;
__u32 fourcc;
@@ -400,8 +395,6 @@ struct ov772x_priv {
unsigned int flag_hflip:1;
};
-#define ENDMARKER { 0xff, 0xff }
-
/*
* register setting for window size
*/
@@ -815,6 +808,14 @@ static int ov772x_set_params(struct ov772x_priv *priv, u32 width, u32 height,
*/
ov772x_reset(priv->client);
+ /* set extra setting */
+ if (priv->info->extra) {
+ ret = ov772x_write_array(priv->client,
+ priv->info->extra);
+ if (ret < 0)
+ goto ov772x_set_fmt_error;
+ }
+
/*
* set size format
*/
@@ -13,6 +13,12 @@
#include <media/soc_camera.h>
+#define ENDMARKER { 0xff, 0xff }
+struct regval_list {
+ unsigned char reg_num;
+ unsigned char value;
+};
+
/* for flags */
#define OV772X_FLAG_VFLIP 0x00000001 /* Vertical flip image */
#define OV772X_FLAG_HFLIP 0x00000002 /* Horizontal flip image */
@@ -21,6 +27,7 @@ struct ov772x_camera_info {
unsigned long buswidth;
unsigned long flags;
struct soc_camera_link link;
+ const struct regval_list *extra;
};
#endif /* __OV772X_H__ */