From patchwork Thu Jan 14 12:18:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 8031341 X-Patchwork-Delegate: geert@linux-m68k.org 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C901B9F32E for ; Thu, 14 Jan 2016 12:19:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEB0720437 for ; Thu, 14 Jan 2016 12:19:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C5DC20443 for ; Thu, 14 Jan 2016 12:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753509AbcANMTT (ORCPT ); Thu, 14 Jan 2016 07:19:19 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34176 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752943AbcANMTQ (ORCPT ); Thu, 14 Jan 2016 07:19:16 -0500 Received: by mail-pa0-f67.google.com with SMTP id yy13so28254895pab.1; Thu, 14 Jan 2016 04:19:16 -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=MqL2MTZh4eDJvqc4+bR6sXH8pmADeGYJDYbgyelAsWM=; b=V+704TE8+BG+fD4ls4Kkc5zw8GTN1KvQppbNfws4Sj8A+df4fg9RdPeFvQyf8Ay0sO uQKQOp3Z5qEKMMHLL2fDd1E4vgZn9FW9OABnD0z2Lg0+5RUa2ZdYz6QqJdEEApTrYaQM oMbL+0unh7pMGtWOxOXRNVYwgzarTnrjVdOsZLQOn41/hzTYjv6Xj5F7K7FlkN1tatxX IaQ0z+b2q55kUHnbXeeiHe/nGjx7t4FypdCz97J+i8FMRbUn9GeVE0DcFOgNEMDYYHRB V1yYKuTPoY/AZb3NMoP9oet34TUaXEr598saTFEqidxKEsgu2qBqZ84ZuvPt5NBJyRDf K78g== 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=MqL2MTZh4eDJvqc4+bR6sXH8pmADeGYJDYbgyelAsWM=; b=EtPc5JgK4tMsGtROxMOMq8hBNBVMruB4aHCJGjn9qcukqLizDpppAo4mqeA9fA99+R OaVDrABjP/o3WlvSrTQSH/2syljVeZ2KVm0OjQcltQRUlRLEHYacK/y7QYC4WujZx8+R hCdQcm4YmYerCd3FUuNCnqzN5eQlJeo75T/UQd/CVMTUJf8leur/nyrsKLYOi853pvwl EWfUsUQynd5qPCIALWLLs1JcweAzqHLWejEnY43WVrnQmMSMwVgPvn18tHnDnYGrXwgV vW1cXdnPPdx5fWmYCY+D3Rc9zJYMiHUn4KFuWZf/3X4LGc1u0VKbOkMSSg6lQLeaBfAF ZV5Q== X-Gm-Message-State: ALoCoQmOSZQ7ytWWB1f8ZCmxIddpAznDYBnvydW9WQJzsW9X7IWZnr3b/Q5ye2mTsOl5OfeIR8CHmyFkYZ3gd+fjWLlKtBUGwA== X-Received: by 10.66.63.104 with SMTP id f8mr5323004pas.41.1452773956288; Thu, 14 Jan 2016 04:19:16 -0800 (PST) Received: from macc.flets-east.jp (p3469131-ipngn19901marunouchi.tokyo.ocn.ne.jp. [153.229.6.131]) by smtp.gmail.com with ESMTPSA id 72sm9124339pfk.28.2016.01.14.04.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 04:19:15 -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 v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support Date: Thu, 14 Jan 2016 21:18:28 +0900 Message-Id: <1452773908-19260-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=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 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. v4 [Yoshihiro Kaneko] * As suggested by Sergei Shtylyov - revised an error message. 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..07c67f6 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, "Unsupported 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: