From patchwork Sun Jul 16 14:53:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 9843427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DF8AD602BD for ; Sun, 16 Jul 2017 14:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3C9928409 for ; Sun, 16 Jul 2017 14:53:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8A85284FC; Sun, 16 Jul 2017 14:53:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8688B28409 for ; Sun, 16 Jul 2017 14:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbdGPOxU (ORCPT ); Sun, 16 Jul 2017 10:53:20 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35318 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbdGPOxQ (ORCPT ); Sun, 16 Jul 2017 10:53:16 -0400 Received: by mail-wm0-f65.google.com with SMTP id u23so18845146wma.2 for ; Sun, 16 Jul 2017 07:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=efvgVUcyrr5c9jzQtf5snyUknQ8mukBamUGlkZWJrQ4=; b=DXSzQsM/kyT7xYW+sDDs8ir6xUBcQJeYskpHPIJoatGa11TFOplEEXazKM+7NelIZf VtDaXCQc4Z7TVsHIRL/iO5ct/JT/4VZYulyCHfm1hDM0DF43Dxwuq8udKr9/zsXHVbUY X1sZdEc8GvBmCWOUZxooO/+dkw4VMR/CktcnO3Qjyc6mCCVm81V6Sv9hDt9SMOVXkVyJ O5UW1DWZstlsa67PUrvyCqVp+VuIMn/bW9j2JM6mS+wqLEqp3QWkJilUjNz+w8v2WlyD kGFx8XxqAq7JqLOSLzLiBhdTa4sxWEUAXPGDe3Bmm2C0PM5eptqXvAU7O4Kgv9jz4b40 rSOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=efvgVUcyrr5c9jzQtf5snyUknQ8mukBamUGlkZWJrQ4=; b=Hv95H30iSileRm2C1L5m84R3cZW52rGE+or/nWPX6AZGSTzhxjocz6G2MeDJ0XnFac GW3eXV0WHg+/2UnMFJ9jPBoekHDN9KQCOevQmx+s8AqdBW/dqqjeuFeD4ZcvLldH/chq ePcFzM8aSYBmrcZrtjuWio+9IoPQ9anFeXRPzpFWS4s7FKWIoTdyawjaUPAV66WAJmTa 1l0yAGFEWs3XmOEI++JsRgPkUftA42oRoumICR6bIaJQ3s9m/NpjFROopqbEET5hleUJ 8AMKshO+/t2xPuDfJX/9wdlTsKFOiezrQlKRACxVcmhOuqrSVzo7Ghzt0Pr8XB3y9qs2 uerA== X-Gm-Message-State: AIVw1134nGprN0hgz4kNZ4XxbWvsFvkdrpxswz9473D4hbMkhjtEzCBD uETM3m/jy77CKWLU X-Received: by 10.80.145.174 with SMTP id g43mr14483960eda.179.1500216794828; Sun, 16 Jul 2017 07:53:14 -0700 (PDT) Received: from ped.lan (ip1f12fb64.dynamic.kabel-deutschland.de. [31.18.251.100]) by smtp.googlemail.com with ESMTPSA id c11sm7865922eda.0.2017.07.16.07.53.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Jul 2017 07:53:14 -0700 (PDT) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Philipp Zabel Subject: [PATCH v2 3/3] [media] uvcvideo: skip non-extension unit controls on Oculus Rift Sensors Date: Sun, 16 Jul 2017 16:53:05 +0200 Message-Id: <20170716145305.19934-3-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170716145305.19934-1-philipp.zabel@gmail.com> References: <20170716145305.19934-1-philipp.zabel@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Oculus Rift Sensors (DK2 and CV1) allow to configure their sensor chips directly via I2C commands using extension unit controls. The processing and camera unit controls do not function at all. Signed-off-by: Philipp Zabel --- drivers/media/usb/uvc/uvc_ctrl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 1d60321a6777..738edb81bc0a 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -2213,6 +2213,10 @@ int uvc_ctrl_init_device(struct uvc_device *dev) { struct uvc_entity *entity; unsigned int i; + const struct usb_device_id xu_only[] = { + { USB_DEVICE(0x2833, 0x0201) }, + { USB_DEVICE(0x2833, 0x0211) }, + }; /* Walk the entities list and instantiate controls */ list_for_each_entry(entity, &dev->entities, list) { @@ -2220,6 +2224,16 @@ int uvc_ctrl_init_device(struct uvc_device *dev) unsigned int bControlSize = 0, ncontrols; __u8 *bmControls = NULL; + /* Oculus Sensors only handle extension unit controls */ + if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT) { + for (i = 0; i < ARRAY_SIZE(xu_only); i++) { + if (usb_match_one_id(dev->intf, &xu_only[i])) + break; + } + if (i != ARRAY_SIZE(xu_only)) + continue; + } + if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) { bmControls = entity->extension.bmControls; bControlSize = entity->extension.bControlSize;