From patchwork Mon Jan 20 08:11:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edgar Thier X-Patchwork-Id: 3511011 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 A9D069F1C3 for ; Mon, 20 Jan 2014 08:11:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB3892013D for ; Mon, 20 Jan 2014 08:11:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FBCB20122 for ; Mon, 20 Jan 2014 08:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752385AbaATILa (ORCPT ); Mon, 20 Jan 2014 03:11:30 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:47658 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbaATIL3 (ORCPT ); Mon, 20 Jan 2014 03:11:29 -0500 Received: by mail-wi0-f175.google.com with SMTP id hr1so2859033wib.8 for ; Mon, 20 Jan 2014 00:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=xaXA4Mk6/aaZmecCB1ODZmX1fG5d/rAJjt7rT0ZL/10=; b=KjslB/KrNRPyq4pZSF8mCMHcGf11xVfsz2dWMw+jndAk4L3Kz5a0/U2MFiAOXHeMhh A2XFw0CRVRo/NWNIl4cxC5jb7qth8vWxooLdKu7fpgqAS51f+jVsIPBotJci9515vkDk zqwE2DnouTtv9S0YT/ryYphwvE3t3Ym+khplxEA0I8tejaDF5/tD6j01vTp6y0DeSBmn l7PwkVvzT5VU33jAI1wTxPdc6JyygRIsedDGNIa8fWai1A3xXh7nJKwRCAXjXwkAD0MC c5VM/HGsMiGXudr/TcS/F5/+C12/ZjV7q9VmA/lwKqxfa9fbmFongbr0Tktp754n5hYg zNvA== MIME-Version: 1.0 X-Received: by 10.194.201.65 with SMTP id jy1mr12812597wjc.43.1390205488403; Mon, 20 Jan 2014 00:11:28 -0800 (PST) Received: by 10.194.109.227 with HTTP; Mon, 20 Jan 2014 00:11:28 -0800 (PST) Date: Mon, 20 Jan 2014 09:11:28 +0100 X-Google-Sender-Auth: 4bhpmJ2sC-cn1FOBvRymVv4TmjM Message-ID: Subject: [PATCH] Added bayer 8-bit patterns to uvcvideo From: Edgar Thier To: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Add bayer 8-bit GUIDs to uvcvideo and associate them with the corresponding V4L2 pixel formats. Signed-off-by: Edgar Thier Acked-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_driver.c | 22 +++++++++++++++++++++- drivers/media/usb/uvc/uvcvideo.h | 12 ++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index c3bb250..84da426 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -108,11 +108,31 @@ static struct uvc_format_desc uvc_fmts[] = { .fcc = V4L2_PIX_FMT_Y16, }, { - .name = "RGB Bayer", + .name = "RGB Bayer (bggr)", .guid = UVC_GUID_FORMAT_BY8, .fcc = V4L2_PIX_FMT_SBGGR8, }, { + .name = "RGB Bayer (bggr)", + .guid = UVC_GUID_FORMAT_BY8_BA81, + .fcc = V4L2_PIX_FMT_SBGGR8, + }, + { + .name = "RGB Bayer (grbg)", + .guid = UVC_GUID_FORMAT_BY8_GRBG, + .fcc = V4L2_PIX_FMT_SGRBG8, + }, + { + .name = "RGB Bayer (gbrg)", + .guid = UVC_GUID_FORMAT_BY8_GBRG, + .fcc = V4L2_PIX_FMT_SGBRG8, + }, + { + .name = "RGB Bayer (rggb)", + .guid = UVC_GUID_FORMAT_BY8_RGGB, + .fcc = V4L2_PIX_FMT_SRGGB8, + }, + { .name = "RGB565", .guid = UVC_GUID_FORMAT_RGBP, .fcc = V4L2_PIX_FMT_RGB565, diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 9e35982..57357d9 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -94,6 +94,18 @@ #define UVC_GUID_FORMAT_BY8 \ { 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_BY8_BA81 \ + { 'B', 'A', '8', '1', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_BY8_GRBG \ + { 'G', 'R', 'B', 'G', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_BY8_GBRG \ + { 'G', 'B', 'R', 'G', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_BY8_RGGB \ + { 'R', 'G', 'G', 'B', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} #define UVC_GUID_FORMAT_RGBP \ { 'R', 'G', 'B', 'P', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}