aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-07-06 08:12:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-11 14:58:58 -0400
commitac9dad93164c603e5efc4e57727e929799861a9f (patch)
tree5050ed1dad9dfd48649d7305d1857286a940aa41 /drivers/media/video
parent7bec7ef8604d0cd4da2e297279d94546fe2efa2e (diff)
[media] omap3isp: preview: Merge gamma correction and gamma bypass
Enabling gamma bypass disables gamma correction and vice versa. Merge the two parameters. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/omap3isp/isppreview.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c
index 9a8628417b50..72d261835ad2 100644
--- a/drivers/media/video/omap3isp/isppreview.c
+++ b/drivers/media/video/omap3isp/isppreview.c
@@ -481,25 +481,6 @@ static void preview_enable_dcor(struct isp_prev_device *prev, bool enable)
481} 481}
482 482
483/* 483/*
484 * preview_enable_gammabypass - Enable/disable Gamma Bypass
485 *
486 * When gamma bypass is enabled, the output of the gamma correction is the 8 MSB
487 * of the 10-bit input .
488 */
489static void
490preview_enable_gammabypass(struct isp_prev_device *prev, bool enable)
491{
492 struct isp_device *isp = to_isp_device(prev);
493
494 if (enable)
495 isp_reg_set(isp, OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
496 ISPPRV_PCR_GAMMA_BYPASS);
497 else
498 isp_reg_clr(isp, OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
499 ISPPRV_PCR_GAMMA_BYPASS);
500}
501
502/*
503 * preview_enable_drkframe_capture - Enable/disable Dark Frame Capture 484 * preview_enable_drkframe_capture - Enable/disable Dark Frame Capture
504 */ 485 */
505static void 486static void
@@ -597,6 +578,25 @@ preview_config_gammacorrn(struct isp_prev_device *prev,
597} 578}
598 579
599/* 580/*
581 * preview_enable_gammacorrn - Enable/disable Gamma Correction
582 *
583 * When gamma correction is disabled, the module is bypassed and its output is
584 * the 8 MSB of the 10-bit input .
585 */
586static void
587preview_enable_gammacorrn(struct isp_prev_device *prev, bool enable)
588{
589 struct isp_device *isp = to_isp_device(prev);
590
591 if (enable)
592 isp_reg_clr(isp, OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
593 ISPPRV_PCR_GAMMA_BYPASS);
594 else
595 isp_reg_set(isp, OMAP3_ISP_IOMEM_PREV, ISPPRV_PCR,
596 ISPPRV_PCR_GAMMA_BYPASS);
597}
598
599/*
600 * preview_config_contrast - Configure the Contrast 600 * preview_config_contrast - Configure the Contrast
601 * 601 *
602 * Value should be programmed before enabling the module. 602 * Value should be programmed before enabling the module.
@@ -815,9 +815,9 @@ static const struct preview_update update_attrs[] = {
815 offsetof(struct prev_params, dcor), 815 offsetof(struct prev_params, dcor),
816 FIELD_SIZEOF(struct prev_params, dcor), 816 FIELD_SIZEOF(struct prev_params, dcor),
817 offsetof(struct omap3isp_prev_update_config, dcor), 817 offsetof(struct omap3isp_prev_update_config, dcor),
818 }, /* OMAP3ISP_PREV_GAMMABYPASS */ { 818 }, /* Previously OMAP3ISP_PREV_GAMMABYPASS, not used anymore */ {
819 NULL,
819 NULL, 820 NULL,
820 preview_enable_gammabypass,
821 }, /* OMAP3ISP_PREV_DRK_FRM_CAPTURE */ { 821 }, /* OMAP3ISP_PREV_DRK_FRM_CAPTURE */ {
822 NULL, 822 NULL,
823 preview_enable_drkframe_capture, 823 preview_enable_drkframe_capture,
@@ -835,7 +835,7 @@ static const struct preview_update update_attrs[] = {
835 offsetof(struct omap3isp_prev_update_config, nf), 835 offsetof(struct omap3isp_prev_update_config, nf),
836 }, /* OMAP3ISP_PREV_GAMMA */ { 836 }, /* OMAP3ISP_PREV_GAMMA */ {
837 preview_config_gammacorrn, 837 preview_config_gammacorrn,
838 NULL, 838 preview_enable_gammacorrn,
839 offsetof(struct prev_params, gamma), 839 offsetof(struct prev_params, gamma),
840 FIELD_SIZEOF(struct prev_params, gamma), 840 FIELD_SIZEOF(struct prev_params, gamma),
841 offsetof(struct omap3isp_prev_update_config, gamma), 841 offsetof(struct omap3isp_prev_update_config, gamma),