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: 2933861 Return-Path: X-Original-To: patchwork-linux-sh@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 7D5349F289 for ; Tue, 24 Sep 2013 13:38:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 608BD2044C for ; Tue, 24 Sep 2013 13:38:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 356E42030E for ; Tue, 24 Sep 2013 13:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510Ab3IXNir (ORCPT ); Tue, 24 Sep 2013 09:38:47 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:60576 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752933Ab3IXNio (ORCPT ); Tue, 24 Sep 2013 09:38:44 -0400 Received: by mail-lb0-f176.google.com with SMTP id y6so3789311lbh.21 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=PSdMnsaOnxFInrphvHBN03oCRESJaOSpKT7BEFedgmCsccrhUPVu5DNPdUEV4CcHOh FGSkw385NFDeSDT04h+M5BtiUG7JAjnvZ0tvZnLLggnSxhXGRHFDZEa/2aTg8RVi98Oj f4ucp3FcFR5SNKyqglKJj+Fy9HKlreX9rlzB7NPeO71Zep7H+6IlVXlIaqyfP8xnNBkI kYHEhiw1X0zYpVLZg8AKSlCS4SKXML5rcwwUKM5Yd8/W/c+1zwsb520Cc4v45LpLI+tl rpDLzsUxhRo6QVqgP+eqW+lIQfCWY9QGYDDq0JAilau8uOk4Q4QRp2Sf3e2XQorefCDG bqtg== X-Gm-Message-State: ALoCoQngq89WgECCdzLIcRciSBeG9ErtuxwIAtrR+cACX8FJB6tjTS6492rLukmUNI+Ekd9V8tvL 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-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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=ham 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;