From patchwork Wed Apr 17 12:43:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 2453631 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EC9F13FD8C for ; Wed, 17 Apr 2013 12:44:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758123Ab3DQMoB (ORCPT ); Wed, 17 Apr 2013 08:44:01 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:33431 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758076Ab3DQMoB (ORCPT ); Wed, 17 Apr 2013 08:44:01 -0400 Received: from relmlir4.idc.renesas.com ([10.200.68.154]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0MLE00D4AGPB8B60@relmlor3.idc.renesas.com> for linux-media@vger.kernel.org; Wed, 17 Apr 2013 21:43:59 +0900 (JST) Received: from relmlac2.idc.renesas.com ([10.200.69.22]) by relmlir4.idc.renesas.com ( SJSMS) with ESMTP id <0MLE00J0KGPBRCB0@relmlir4.idc.renesas.com> for linux-media@vger.kernel.org; Wed, 17 Apr 2013 21:43:59 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 81591280A4; Wed, 17 Apr 2013 21:43:59 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 7D36F280A0; Wed, 17 Apr 2013 21:43:59 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id XAM24699; Wed, 17 Apr 2013 21:43:59 +0900 X-IronPort-AV: E=Sophos; i="4.87,492,1363100400"; d="scan'208"; a="124397511" Received: from unknown (HELO relay41.aps.necel.com) ([10.29.19.9]) by relmlii1.idc.renesas.com with ESMTP; Wed, 17 Apr 2013 21:43:59 +0900 Received: from julia (du2com5.eu.necel.com [172.29.24.35] (may be forged)) by relay41.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id r3HChw7s029887; Wed, 17 Apr 2013 21:43:59 +0900 (JST) Received: by julia (Postfix, from userid 2) id DB4664EB16; Wed, 17 Apr 2013 14:44:08 +0200 (CEST) Received: from du0smtp.eu.necel.com (unknown [172.29.24.86]) by julia (Postfix) with ESMTP id CE56D4EB10; Wed, 17 Apr 2013 14:44:08 +0200 (CEST) Received: from duacsls.ad.ree.renesas.com ([172.29.43.47]) by du0smtp.eu.necel.com (Lotus Domino Release 8.5.3 HF466) with ESMTP id 2013041714435732-100631 ; Wed, 17 Apr 2013 14:43:57 +0200 From: Phil Edworthy To: linux-media@vger.kernel.org, Guennadi Liakhovetski Cc: Mauro Carvalho Chehab , Phil Edworthy Subject: [PATCH] soc_camera: Add V4L2_MBUS_FMT_YUYV10_2X10 format X-Mailer: git-send-email 1.7.5.4 X-TNEFEvaluated: 1 Message-id: <1366202619-4511-1-git-send-email-phil.edworthy@renesas.com> Date: Wed, 17 Apr 2013 13:43:39 +0100 X-MIMETrack: Itemize by SMTP Server on DU0SMTP/EE/NECEE(Release 8.5.3 HF466|March 09, 2012) at 17.04.2013 14:43:57, Serialize by Router on DU0SMTP/EE/NECEE(Release 8.5.3 HF466|March 09, 2012) at 17.04.2013 14:43:58, Serialize complete at 17.04.2013 14:43:58 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The V4L2_MBUS_FMT_YUYV10_2X10 format has already been added to mediabus, so this patch just adds SoC camera support. Signed-off-by: Phil Edworthy --- drivers/media/platform/soc_camera/soc_mediabus.c | 15 +++++++++++++++ include/media/soc_mediabus.h | 3 +++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c index 7569e77..be47d41 100644 --- a/drivers/media/platform/soc_camera/soc_mediabus.c +++ b/drivers/media/platform/soc_camera/soc_mediabus.c @@ -57,6 +57,15 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { + .code = V4L2_MBUS_FMT_YUYV10_2X10, + .fmt = { + .fourcc = V4L2_PIX_FMT_YUYV, + .name = "YUYV", + .bits_per_sample = 10, + .packing = SOC_MBUS_PACKING_2X10_PADHI, + .order = SOC_MBUS_ORDER_LE, + }, +}, { .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB555, @@ -403,6 +412,10 @@ int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, *numerator = 2; *denominator = 1; return 0; + case SOC_MBUS_PACKING_2X10_PADHI: + *numerator = 3; + *denominator = 1; + return 0; case SOC_MBUS_PACKING_1_5X8: *numerator = 3; *denominator = 2; @@ -428,6 +441,8 @@ s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf) case SOC_MBUS_PACKING_2X8_PADLO: case SOC_MBUS_PACKING_EXTEND16: return width * 2; + case SOC_MBUS_PACKING_2X10_PADHI: + return width * 3; case SOC_MBUS_PACKING_1_5X8: return width * 3 / 2; case SOC_MBUS_PACKING_VARIABLE: diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index d33f6d0..b131a47 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h @@ -21,6 +21,8 @@ * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the * possibly incomplete byte high bits are padding * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding + * @SOC_MBUS_PACKING_2X10_PADHI:20 bits transferred in 2 10-bit samples. The + * high bits are padding * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended * to 16 bits * @SOC_MBUS_PACKING_VARIABLE: compressed formats with variable packing @@ -33,6 +35,7 @@ enum soc_mbus_packing { SOC_MBUS_PACKING_NONE, SOC_MBUS_PACKING_2X8_PADHI, SOC_MBUS_PACKING_2X8_PADLO, + SOC_MBUS_PACKING_2X10_PADHI, SOC_MBUS_PACKING_EXTEND16, SOC_MBUS_PACKING_VARIABLE, SOC_MBUS_PACKING_1_5X8,