Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp600366iog; Wed, 15 Jun 2022 08:28:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRtp0gsU3yiQqwC8vG4m9JXULEcXEccTBCjrqVNJkaHd4NSYKg9gHM1gGMnu8EmGVu/11r X-Received: by 2002:a17:906:7b82:b0:6f3:ee8d:b959 with SMTP id s2-20020a1709067b8200b006f3ee8db959mr351931ejo.458.1655306883933; Wed, 15 Jun 2022 08:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655306883; cv=none; d=google.com; s=arc-20160816; b=xSGZtkbMvkyREDtvh6AtQsj1NSNunP5TeOhZNSfm7pSU0as8L7BKmQ8L+LBinooFWB r2pycOaeobxvUDk62w6Ai1YtT2UvwbM9OMmeyyjLtSJXnYN+t5NCmJtivKK31bbaghob njNRlLwSQ9J0ACdEogPD7FTV9nPufJZc28MFvDqMvtxAkLtBGtSNDm2hUMBgHbxcvxD+ qUmnB8/Qis9dC+KLqfoHcQrcCsqB8c9cidg5CYcBDbgjxXkiOG/BCV8n+qXJK3K39F1g UfvdUao54w8dhDj06fDeIlqvSHirXn1VUxF7MfOQ2zQ2/ZzwmBIc3v+ea/mPDFlBSZ3L QJlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ba/er2SVgt15hBIKXCuOmTfszYwx0bh+mH6faV5HgMs=; b=yDoIpMv+PL9npNepXGS+4+cpriyRenY36vz1frTHG0b2tsvZPDWAZCKh64GoXLDn0t aGQvsFuigPLu80+vZ4wp132ewObJXFvYEK33/+E3Uv3qadhuCy4+QDJZ91s00SgMK2wB e+tVuLf5fd4/k1bgn0rbwgxhipnGps8d9N05TWHUOVgaoijVd2oYpQIvXscYPTa53iX4 qX6O9aiPS3q4uzVHAHC+1Z6Rap74Sd52IeuXworWxVlIjJX9aslvX3dwXrRRg4iBNEhV S2kHPSFigyESMenC5EBIA98O2kxO3q1BDliDzdJE5kMluQeU98SMQ/406Rhwb4LSJlks vIMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JQp8uyCT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd29-20020a170907629d00b0070ec2ee783esi15868541ejc.841.2022.06.15.08.27.38; Wed, 15 Jun 2022 08:28:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JQp8uyCT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344198AbiFOPNR (ORCPT + 99 others); Wed, 15 Jun 2022 11:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241871AbiFOPNG (ORCPT ); Wed, 15 Jun 2022 11:13:06 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEE6F1054B for ; Wed, 15 Jun 2022 08:13:05 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id x5so16658052edi.2 for ; Wed, 15 Jun 2022 08:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ba/er2SVgt15hBIKXCuOmTfszYwx0bh+mH6faV5HgMs=; b=JQp8uyCTM//DUgQt4nw52g0tqFaEinTgubLJ4S2k9TJ38p0QFNd9Dn5y64TjVrLpCv RzxXG/VvC8CrHUAb93Y4UyrlzUw/Qqcs3F0IhGL016/+9hGwHlXSI4NSn/0G9UqpLxRh NzwN218m+NNMxYKRdJV+PRCksrpXoV7O5m60g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ba/er2SVgt15hBIKXCuOmTfszYwx0bh+mH6faV5HgMs=; b=OQjpW7sgwCjVH9w/R+c4n3RsUVUZD5Oqmlfc/82s9KOCW0rYByEuJ/hkNJdkougFP4 VbhoJ8h9wZeRARzZ9KFgTLVaTZSA8f0L+1i27QmCGa1BJNPI4p4/V5fj0Lvm9PkTSvkR iWTr7jURwKd+ygFwEITqFLcGe2RZxFpDmxmymAbBnbZ13uDc7zQ7Rg/PRtjZtil7OFDg fHYRPapyewkbWk8J01fzmXNrasQzeNZLdWie/b9IuBoGQj48rKH48uveaMI2KdqMyw6V NlNIlJKpqwpm7J0UksGNqf0TVwtPz+AKrzaMPcoOfogdXNQN1h8/WedAUvgS7Hu3jnPk t9eg== X-Gm-Message-State: AJIora9052WwX0i9tV/OmKD6UUUOiR03miTUuqr0xxZfKVo3vvs0wbx7 lyQk655CiFPAJJzhD46BDCObCg== X-Received: by 2002:a05:6402:2752:b0:433:3a08:27b1 with SMTP id z18-20020a056402275200b004333a0827b1mr220066edd.235.1655305984296; Wed, 15 Jun 2022 08:13:04 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id b25-20020aa7cd19000000b0042bd2012196sm9610264edw.85.2022.06.15.08.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 08:13:03 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, senozhatsky@chromium.org, yunkec@google.com Cc: Ricardo Ribalda Subject: [PATCH v6 3/8] media: uvcvideo: Support minimum for V4L2_CTRL_TYPE_MENU Date: Wed, 15 Jun 2022 17:12:54 +0200 Message-Id: <20220615151259.77825-4-ribalda@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220615151259.77825-1-ribalda@chromium.org> References: <20220615151259.77825-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently all mappings of type V4L2_CTRL_TYPE_MENU, have a minimum of 0, but there are some controls (limited powerline), that start with a value different than 0. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 092decfdaa62..0d89d239e881 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -1144,7 +1144,7 @@ static int __uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, switch (mapping->v4l2_type) { case V4L2_CTRL_TYPE_MENU: - v4l2_ctrl->minimum = 0; + v4l2_ctrl->minimum = mapping->menu_min; v4l2_ctrl->maximum = mapping->menu_count - 1; v4l2_ctrl->step = 1; diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index fff5c5c99a3d..6ceb7f7b964d 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -254,6 +254,7 @@ struct uvc_control_mapping { u32 data_type; const struct uvc_menu_info *menu_info; + u32 menu_min; u32 menu_count; u32 master_id; -- 2.36.1.476.g0c4daa206d-goog