diff options
Diffstat (limited to 'drivers/media/video/ov772x.c')
-rw-r--r-- | drivers/media/video/ov772x.c | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index 34c981933780..c0d911252862 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c | |||
@@ -169,11 +169,11 @@ | |||
169 | #define GAM15 0x8C /* Gamma Curve 15th segment input end point */ | 169 | #define GAM15 0x8C /* Gamma Curve 15th segment input end point */ |
170 | #define SLOP 0x8D /* Gamma curve highest segment slope */ | 170 | #define SLOP 0x8D /* Gamma curve highest segment slope */ |
171 | #define DNSTH 0x8E /* De-noise threshold */ | 171 | #define DNSTH 0x8E /* De-noise threshold */ |
172 | #define EDGE0 0x8F /* Edge enhancement control 0 */ | 172 | #define EDGE_STRNGT 0x8F /* Edge strength control when manual mode */ |
173 | #define EDGE1 0x90 /* Edge enhancement control 1 */ | 173 | #define EDGE_TRSHLD 0x90 /* Edge threshold control when manual mode */ |
174 | #define DNSOFF 0x91 /* Auto De-noise threshold control */ | 174 | #define DNSOFF 0x91 /* Auto De-noise threshold control */ |
175 | #define EDGE2 0x92 /* Edge enhancement strength low point control */ | 175 | #define EDGE_UPPER 0x92 /* Edge strength upper limit when Auto mode */ |
176 | #define EDGE3 0x93 /* Edge enhancement strength high point control */ | 176 | #define EDGE_LOWER 0x93 /* Edge strength lower limit when Auto mode */ |
177 | #define MTX1 0x94 /* Matrix coefficient 1 */ | 177 | #define MTX1 0x94 /* Matrix coefficient 1 */ |
178 | #define MTX2 0x95 /* Matrix coefficient 2 */ | 178 | #define MTX2 0x95 /* Matrix coefficient 2 */ |
179 | #define MTX3 0x96 /* Matrix coefficient 3 */ | 179 | #define MTX3 0x96 /* Matrix coefficient 3 */ |
@@ -358,6 +358,14 @@ | |||
358 | #define VOSZ_VGA 0xF0 | 358 | #define VOSZ_VGA 0xF0 |
359 | #define VOSZ_QVGA 0x78 | 359 | #define VOSZ_QVGA 0x78 |
360 | 360 | ||
361 | /* DSPAUTO (DSP Auto Function ON/OFF Control) */ | ||
362 | #define AWB_ACTRL 0x80 /* AWB auto threshold control */ | ||
363 | #define DENOISE_ACTRL 0x40 /* De-noise auto threshold control */ | ||
364 | #define EDGE_ACTRL 0x20 /* Edge enhancement auto strength control */ | ||
365 | #define UV_ACTRL 0x10 /* UV adjust auto slope control */ | ||
366 | #define SCAL0_ACTRL 0x08 /* Auto scaling factor control */ | ||
367 | #define SCAL1_2_ACTRL 0x04 /* Auto scaling factor control */ | ||
368 | |||
361 | /* | 369 | /* |
362 | * ID | 370 | * ID |
363 | */ | 371 | */ |
@@ -816,6 +824,53 @@ static int ov772x_set_params(struct ov772x_priv *priv, u32 width, u32 height, | |||
816 | ov772x_reset(priv->client); | 824 | ov772x_reset(priv->client); |
817 | 825 | ||
818 | /* | 826 | /* |
827 | * Edge Ctrl | ||
828 | */ | ||
829 | if (priv->info->edgectrl.strength & OV772X_MANUAL_EDGE_CTRL) { | ||
830 | |||
831 | /* | ||
832 | * Manual Edge Control Mode | ||
833 | * | ||
834 | * Edge auto strength bit is set by default. | ||
835 | * Remove it when manual mode. | ||
836 | */ | ||
837 | |||
838 | ret = ov772x_mask_set(priv->client, DSPAUTO, EDGE_ACTRL, 0x00); | ||
839 | if (ret < 0) | ||
840 | goto ov772x_set_fmt_error; | ||
841 | |||
842 | ret = ov772x_mask_set(priv->client, | ||
843 | EDGE_TRSHLD, EDGE_THRESHOLD_MASK, | ||
844 | priv->info->edgectrl.threshold); | ||
845 | if (ret < 0) | ||
846 | goto ov772x_set_fmt_error; | ||
847 | |||
848 | ret = ov772x_mask_set(priv->client, | ||
849 | EDGE_STRNGT, EDGE_STRENGTH_MASK, | ||
850 | priv->info->edgectrl.strength); | ||
851 | if (ret < 0) | ||
852 | goto ov772x_set_fmt_error; | ||
853 | |||
854 | } else if (priv->info->edgectrl.upper > priv->info->edgectrl.lower) { | ||
855 | /* | ||
856 | * Auto Edge Control Mode | ||
857 | * | ||
858 | * set upper and lower limit | ||
859 | */ | ||
860 | ret = ov772x_mask_set(priv->client, | ||
861 | EDGE_UPPER, EDGE_UPPER_MASK, | ||
862 | priv->info->edgectrl.upper); | ||
863 | if (ret < 0) | ||
864 | goto ov772x_set_fmt_error; | ||
865 | |||
866 | ret = ov772x_mask_set(priv->client, | ||
867 | EDGE_LOWER, EDGE_LOWER_MASK, | ||
868 | priv->info->edgectrl.lower); | ||
869 | if (ret < 0) | ||
870 | goto ov772x_set_fmt_error; | ||
871 | } | ||
872 | |||
873 | /* | ||
819 | * set size format | 874 | * set size format |
820 | */ | 875 | */ |
821 | ret = ov772x_write_array(priv->client, priv->win->regs); | 876 | ret = ov772x_write_array(priv->client, priv->win->regs); |