[media] em28xx: introduce #defines for the image quality default settings
authorFrank Schaefer <fschaefer.oss@googlemail.com>
Fri, 15 Feb 2013 17:38:31 +0000 (14:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 4 Mar 2013 17:50:31 +0000 (14:50 -0300)
The image quality default values will be used in at least two different places
and by using #defines we make sure that they are always consistent.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/em28xx/em28xx-core.c
drivers/media/usb/em28xx/em28xx-reg.h

index 26d249971a016e03b7c209880c53dd9a46476e14..b2dcb3d1342d9cb9d11276b51e8a3a729d1724c6 100644 (file)
@@ -607,12 +607,12 @@ EXPORT_SYMBOL_GPL(em28xx_audio_setup);
 
 int em28xx_colorlevels_set_default(struct em28xx *dev)
 {
-       em28xx_write_reg(dev, EM28XX_R20_YGAIN, 0x10);  /* contrast */
-       em28xx_write_reg(dev, EM28XX_R21_YOFFSET, 0x00);        /* brightness */
-       em28xx_write_reg(dev, EM28XX_R22_UVGAIN, 0x10); /* saturation */
-       em28xx_write_reg(dev, EM28XX_R23_UOFFSET, 0x00);
-       em28xx_write_reg(dev, EM28XX_R24_VOFFSET, 0x00);
-       em28xx_write_reg(dev, EM28XX_R25_SHARPNESS, 0x00);
+       em28xx_write_reg(dev, EM28XX_R20_YGAIN, CONTRAST_DEFAULT);
+       em28xx_write_reg(dev, EM28XX_R21_YOFFSET, BRIGHTNESS_DEFAULT);
+       em28xx_write_reg(dev, EM28XX_R22_UVGAIN, SATURATION_DEFAULT);
+       em28xx_write_reg(dev, EM28XX_R23_UOFFSET, BLUE_BALANCE_DEFAULT);
+       em28xx_write_reg(dev, EM28XX_R24_VOFFSET, RED_BALANCE_DEFAULT);
+       em28xx_write_reg(dev, EM28XX_R25_SHARPNESS, SHARPNESS_DEFAULT);
 
        em28xx_write_reg(dev, EM28XX_R14_GAMMA, 0x20);
        em28xx_write_reg(dev, EM28XX_R15_RGAIN, 0x20);
index 0a3cb04fbeae79757bd5ea9958f4e8c3abc3a7e8..8fd3c7f802017d3d44625eb9104bb362b2d73d89 100644 (file)
 #define EM28XX_R1E_CWIDTH      0x1e
 #define EM28XX_R1F_CHEIGHT     0x1f
 
-#define EM28XX_R20_YGAIN       0x20
-#define EM28XX_R21_YOFFSET     0x21
-#define EM28XX_R22_UVGAIN      0x22
-#define EM28XX_R23_UOFFSET     0x23
-#define EM28XX_R24_VOFFSET     0x24
-#define EM28XX_R25_SHARPNESS   0x25
+#define EM28XX_R20_YGAIN       0x20 /* contrast [0:4]   */
+#define   CONTRAST_DEFAULT     0x10
+
+#define EM28XX_R21_YOFFSET     0x21 /* brightness       */     /* signed */
+#define   BRIGHTNESS_DEFAULT   0x00
+
+#define EM28XX_R22_UVGAIN      0x22 /* saturation [0:4] */
+#define   SATURATION_DEFAULT   0x10
+
+#define EM28XX_R23_UOFFSET     0x23 /* blue balance     */     /* signed */
+#define   BLUE_BALANCE_DEFAULT 0x00
+
+#define EM28XX_R24_VOFFSET     0x24 /* red balance      */     /* signed */
+#define   RED_BALANCE_DEFAULT  0x00
+
+#define EM28XX_R25_SHARPNESS   0x25 /* sharpness [0:4]  */
+#define   SHARPNESS_DEFAULT    0x00
 
 #define EM28XX_R26_COMPR       0x26
 #define EM28XX_R27_OUTFMT      0x27