From patchwork Wed Jan 13 17:59:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 8027701 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A392BEEE5 for ; Wed, 13 Jan 2016 17:59:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23E8120527 for ; Wed, 13 Jan 2016 17:59:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15535203A1 for ; Wed, 13 Jan 2016 17:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858AbcAMR7q (ORCPT ); Wed, 13 Jan 2016 12:59:46 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36616 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755743AbcAMR7p (ORCPT ); Wed, 13 Jan 2016 12:59:45 -0500 Received: by mail-pa0-f67.google.com with SMTP id a20so22203139pag.3; Wed, 13 Jan 2016 09:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=b+2+EXHB3ETwqzME+X1QH0NCvd5r90mRqcsQDsOM72o=; b=B7GAokf5dw8tEFYHAMYjmcTFBuqi9d1Vk7QLckhKGmNiJ3FhcLN1Smg/Wln0lw+OuX y6DYeRb/dreECj2e7dvgwQLn4eN7D1xIaVGucz/iEfKQEqCsjQ84gXvPyJIvajI6p8Ii qLwIAuHEKNmEaDPT3mMRlVVmrlQMlbILWJwI5K5x9u47O0/aAFcHFW1Wad+VvrhfmUvF s8dLXGBxRPIJrax9P99/6e2aAxQCoRCq/lXTp6WasEaAmem6cLN6/ZgTs178RTQSnklj by70zijQ0DgflMXCqIWJAhO98XbCgNQ/nrhuPcCWWvcCrOCASjIgejKKmOILv+scusAs em1Q== 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; bh=b+2+EXHB3ETwqzME+X1QH0NCvd5r90mRqcsQDsOM72o=; b=NxAFDR8BEr/sFBCNx5PG1Ba/zDBucTiA2jJ5sI7TIyEE+an7toTV0WULR5C2/8fNZP HQ0YCJaObJY2o7tUspDWC+dAW88TMODfLSl6xMEfJ8j+vnULRnYbs/L3upUtNvL372M1 coy2mH71v7fWGwS09xwpZIHU55CvpObt+328qp6jKuHoxwh44XRJ4CDT5j89B/VFlFd1 n/lottLsdnn1ZDLn6cHVEl5tzgvM79k9Pb+PD4eIKiCiNJWrj0szSxWYH32PeGg6A+3q VNzS2cFqQjzY+bdKNcBhRStsaW/ALU2W7F/hY+O5sf4DEszAApp81pKphGL6WNfhitev 0fYA== X-Gm-Message-State: ALoCoQnGzDQ0W8Tt008rjiwpyhSFmr9Fs0FwwXhP7KdtW4aFE5UFR6vBeRYg7tbWDftn4y0Fmb8KyHpxyUFXQUnxhYZ5J5nCbQ== X-Received: by 10.66.180.48 with SMTP id dl16mr196987270pac.39.1452707985149; Wed, 13 Jan 2016 09:59:45 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by smtp.gmail.com with ESMTPSA id 16sm4065191pfh.48.2016.01.13.09.59.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 09:59:44 -0800 (PST) From: Yoshihiro Kaneko To: linux-media@vger.kernel.org Cc: Guennadi Liakhovetski , Simon Horman , Magnus Damm , linux-sh@vger.kernel.org Subject: [PATCH v3] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support Date: Thu, 14 Jan 2016 02:59:24 +0900 Message-Id: <1452707964-4379-1-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Koji Matsuoka This patch adds ARGB8888 capture format support for R-Car Gen3. Signed-off-by: Koji Matsuoka Signed-off-by: Yoshihiro Kaneko --- This patch is based on the for-4.6-1 branch of Guennadi's v4l-dvb tree. v3 [Yoshihiro Kaneko] * rebased to for-4.6-1 branch of Guennadi's tree. v2 [Yoshihiro Kaneko] * As suggested by Sergei Shtylyov - fix the coding style of the braces. drivers/media/platform/soc_camera/rcar_vin.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index dc75a80..466c63a 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -124,7 +124,7 @@ #define VNDMR_EXRGB (1 << 8) #define VNDMR_BPSM (1 << 4) #define VNDMR_DTMD_YCSEP (1 << 1) -#define VNDMR_DTMD_ARGB1555 (1 << 0) +#define VNDMR_DTMD_ARGB (1 << 0) /* Video n Data Mode Register 2 bits */ #define VNDMR2_VPS (1 << 30) @@ -643,7 +643,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) output_is_yuv = true; break; case V4L2_PIX_FMT_RGB555X: - dmr = VNDMR_DTMD_ARGB1555; + dmr = VNDMR_DTMD_ARGB; break; case V4L2_PIX_FMT_RGB565: dmr = 0; @@ -654,6 +654,14 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) dmr = VNDMR_EXRGB; break; } + case V4L2_PIX_FMT_ARGB32: + if (priv->chip == RCAR_GEN3) { + dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB; + } else { + dev_err(icd->parent, "Not support format\n"); + return -EINVAL; + } + break; default: dev_warn(icd->parent, "Invalid fourcc format (0x%x)\n", icd->current_fmt->host_fmt->fourcc); @@ -1304,6 +1312,14 @@ static const struct soc_mbus_pixelfmt rcar_vin_formats[] = { .order = SOC_MBUS_ORDER_LE, .layout = SOC_MBUS_LAYOUT_PACKED, }, + { + .fourcc = V4L2_PIX_FMT_ARGB32, + .name = "ARGB8888", + .bits_per_sample = 32, + .packing = SOC_MBUS_PACKING_NONE, + .order = SOC_MBUS_ORDER_LE, + .layout = SOC_MBUS_LAYOUT_PACKED, + }, }; static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, @@ -1611,6 +1627,7 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd, case V4L2_PIX_FMT_RGB32: can_scale = priv->chip != RCAR_E1; break; + case V4L2_PIX_FMT_ARGB32: case V4L2_PIX_FMT_UYVY: case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_RGB565: