From patchwork Tue Sep 24 13:38:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentine Barshak X-Patchwork-Id: 2933871 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9E0629F289 for ; Tue, 24 Sep 2013 13:38:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A8BB2030E for ; Tue, 24 Sep 2013 13:38:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E4D320421 for ; Tue, 24 Sep 2013 13:38:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753571Ab3IXNir (ORCPT ); Tue, 24 Sep 2013 09:38:47 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:41786 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753550Ab3IXNip (ORCPT ); Tue, 24 Sep 2013 09:38:45 -0400 Received: by mail-lb0-f177.google.com with SMTP id w7so3721674lbi.8 for ; Tue, 24 Sep 2013 06:38:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZeTmjZiUZb/aVbzj5qK+Xfvlm33ozBucDw65K8Hn7xw=; b=AA7ibFIqVagn3E4vBKfbDInucD8V/9GtMcg31PxjZPMfL1hxQpkV8VZ/cJ2wh93LhX 3Km07/1LdesymoLbxGXxSWY6juakZxqXGHSJJDyP7zJmBOR8+x32lpqE0b66w9D0LX7x Dh2ITkXiPP14YtnC2rFc+n60HV7PKwob4o6kpnTGgoi7nYp2oGlTWZX6ZgmDSlk44kIz +JvJ/LMezUS5VS7KKH/4lPKNHlbGv6BEg1mZkqPDrmYvXy77lsXcJvPqFPu+xhQZ1Oor xrzTsv97yAlJ9Um8lIPt9PB5Av/Z8plti6X2W47W+k5tHzQJRYlfB/g9natiO2k4NG4X 85zg== X-Gm-Message-State: ALoCoQmcGkeB5ZIbVHRXUQyBrdVb+boe8zTwr3diTiRuy4RYF8TW9frG6eB3w9swdnUzCMDOJkBm X-Received: by 10.112.167.66 with SMTP id zm2mr719816lbb.46.1380029923534; Tue, 24 Sep 2013 06:38:43 -0700 (PDT) Received: from black.localnet ([93.100.122.208]) by mx.google.com with ESMTPSA id k6sm16685243lae.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Sep 2013 06:38:42 -0700 (PDT) From: Valentine Barshak To: linux-media@vger.kernel.org, Simon Horman , Mauro Carvalho Chehab , Guennadi Liakhovetski , Hans Verkuil , Magnus Damm Cc: Subject: [PATCH 3/3] media: rcar_vin: Add RGB888_1X24 input format support Date: Tue, 24 Sep 2013 17:38:36 +0400 Message-Id: <1380029916-10331-4-git-send-email-valentine.barshak@cogentembedded.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380029916-10331-1-git-send-email-valentine.barshak@cogentembedded.com> References: <1380029916-10331-1-git-send-email-valentine.barshak@cogentembedded.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds V4L2_MBUS_FMT_RGB888_1X24 input format support which is used by the ADV7612 chip. Signed-off-by: Valentine Barshak --- drivers/media/platform/soc_camera/rcar_vin.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index cf81e02..0f04cff 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -68,6 +68,7 @@ #define VNMC_INF_YUV8_BT656 (0 << 16) #define VNMC_INF_YUV8_BT601 (1 << 16) #define VNMC_INF_YUV16 (5 << 16) +#define VNMC_INF_RGB888 (6 << 16) #define VNMC_VUP (1 << 10) #define VNMC_IM_ODD (0 << 3) #define VNMC_IM_ODD_EVEN (1 << 3) @@ -235,7 +236,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) struct soc_camera_device *icd = priv->ici.icd; struct rcar_vin_cam *cam = icd->host_priv; u32 vnmc, dmr, interrupts; - bool progressive = false, output_is_yuv = false; + bool progressive = false, output_is_yuv = false, input_is_yuv = false; switch (priv->field) { case V4L2_FIELD_TOP: @@ -269,11 +270,17 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) case V4L2_MBUS_FMT_YUYV8_1X16: /* BT.601/BT.1358 16bit YCbCr422 */ vnmc |= VNMC_INF_YUV16; + input_is_yuv = true; break; case V4L2_MBUS_FMT_YUYV8_2X8: /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ? VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601; + input_is_yuv = true; + break; + case V4L2_MBUS_FMT_RGB888_1X24: + vnmc |= VNMC_INF_RGB888; + break; default: break; } @@ -316,7 +323,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) vnmc |= VNMC_VUP; /* If input and output use the same colorspace, use bypass mode */ - if (output_is_yuv) + if (input_is_yuv == output_is_yuv) vnmc |= VNMC_BPS; /* progressive or interlaced mode */ @@ -1002,6 +1009,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, switch (code) { case V4L2_MBUS_FMT_YUYV8_1X16: case V4L2_MBUS_FMT_YUYV8_2X8: + case V4L2_MBUS_FMT_RGB888_1X24: if (cam->extra_fmt) break;