From patchwork Thu Nov 3 15:57:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 14966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp621228wru; Thu, 3 Nov 2022 09:05:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6e8CHnqyNFbDNwoLu0yKDSX5NozCylsavDdL9ZEDfjg68wdho0CZ4fXRFmTWHs0PZfhKWr X-Received: by 2002:a63:a13:0:b0:440:a593:b79f with SMTP id 19-20020a630a13000000b00440a593b79fmr26283731pgk.557.1667491559497; Thu, 03 Nov 2022 09:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667491559; cv=none; d=google.com; s=arc-20160816; b=ZrP3Y6TW1oxi7cbsNbXXLjcQisWV0xhQH2bIm3um2vXPDrUX5h2G1vzUMkcdymqeUh akGG5OPv0Rj+jS5f1pw0Q6E1MOVdW5aS9siSqfm0OwANtyFgw5fDuqn+uZyaDsy15Pp/ 2/enalxzwE4KJVdfv7mEbcEzskBrupe19MXtPyl9qPyzO7LiA1VcmHUSqGBh+NO6dZkf FQ+bxjpAWvrnFR6mdpptphJnT3pEc9LAGWYC6f1aJnh3+5tNIzlQ/Hodz674hsMFtfV3 zwRHW5aF9s+Z1fLrOAhSWNKrkTuItZkk1TxNt1h9V8b9jBffo98XmELQQNZ6jCtmw+Ba /Hrg== 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=P4KjjYgTtpbKBqU4fB8B4s25eLipX0/Tsg/fPCZui/E=; b=kw5XL+ozIGMU9GVXznz24KO547IRAvH3tHA5xcNFaLVlOg0bN0FEunknKA5UxCsBau ow9asZEhoH4Uh/GzY4v2u2Obt4rXizaJEj9TxStg8HKlUpVYWT8pZb0EKe+nNiDMf+29 mBcIDeEaQboDW17Pk9/TZQmDmhuGeVcMp5CMRn8nXkbBZ1FqrpXh5rFCj6JBd3Uqx1fO jtwzUQsLJm9OzolrlzGgRidx4o+Eh6xH1hlm9DrnXO7VfHfn8f5ZiRBEqxQ8x5xLgVeY vv0dVR1JT2Y9XCmlfABnmAL10ZrnAfrBdK4EXp59+xCAA4B3a5k2e4ePasvczzZRSudJ rqqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hGP4mpN4; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n1-20020a170903404100b00179eb71c71csi1026081pla.198.2022.11.03.09.05.35; Thu, 03 Nov 2022 09:05:59 -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=@redhat.com header.s=mimecast20190719 header.b=hGP4mpN4; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231659AbiKCQBD (ORCPT + 99 others); Thu, 3 Nov 2022 12:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbiKCQBB (ORCPT ); Thu, 3 Nov 2022 12:01:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8D717AA7 for ; Thu, 3 Nov 2022 08:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667491114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P4KjjYgTtpbKBqU4fB8B4s25eLipX0/Tsg/fPCZui/E=; b=hGP4mpN4WcwSfaPeExK2DVCkCxpXTA5D8meM7fDOAI5KaacB193EuzqH+glzXNcHaWbtly ti/FimFJ5SI3KfW1mA95tDzFGApnJbiQWMBos5Fa9LioykZmACxohUrNtQ7ODcxNw6bViI AuuWkrKM+Lcl7AdekpdCxRIOwbR1kis= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-277-ACO4-53cPxKUyQFM1hnFUw-1; Thu, 03 Nov 2022 11:58:23 -0400 X-MC-Unique: ACO4-53cPxKUyQFM1hnFUw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E344101A5BB; Thu, 3 Nov 2022 15:58:22 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.192.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFC234A9254; Thu, 3 Nov 2022 15:58:20 +0000 (UTC) From: Benjamin Tissoires To: Greg KH , Jiri Kosina , Jonathan Corbet , Shuah Khan Cc: Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Benjamin Tissoires Subject: [PATCH hid v12 02/15] HID: Kconfig: split HID support and hid-core compilation Date: Thu, 3 Nov 2022 16:57:43 +0100 Message-Id: <20221103155756.687789-3-benjamin.tissoires@redhat.com> In-Reply-To: <20221103155756.687789-1-benjamin.tissoires@redhat.com> References: <20221103155756.687789-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748491629425668086?= X-GMAIL-MSGID: =?utf-8?q?1748491629425668086?= Currently, we step into drivers/hid/ based on the value of CONFIG_HID. However, that value is a tristate, meaning that it can be a module. As per the documentation, if we jump into the subdirectory by following an obj-m, we can not compile anything inside that subdirectory in vmlinux. It is considered as a bug. To make things more friendly to HID-BPF, split HID (the HID core parameter) from HID_SUPPORT (do we want any kind of HID support in the system?), and make this new config a boolean. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Benjamin Tissoires --- changes in v12: - ensure HID gets selected by transport drivers - ensure HID leaf drivers are not selected without HID no changes in v11 no changes in v10 no changes in v9 no changes in v8 new in v7 --- drivers/Makefile | 2 +- drivers/hid/Kconfig | 16 +++++++++++----- drivers/hid/amd-sfh-hid/Kconfig | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/Makefile b/drivers/Makefile index bdf1c66141c9..cf5d8b86da8f 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -137,7 +137,7 @@ obj-$(CONFIG_CRYPTO) += crypto/ obj-$(CONFIG_SUPERH) += sh/ obj-y += clocksource/ obj-$(CONFIG_DCA) += dca/ -obj-$(CONFIG_HID) += hid/ +obj-$(CONFIG_HID_SUPPORT) += hid/ obj-$(CONFIG_PPC_PS3) += ps3/ obj-$(CONFIG_OF) += of/ obj-$(CONFIG_SSB) += ssb/ diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 185a077d59cd..72bbf9899993 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -2,12 +2,18 @@ # # HID driver configuration # -menu "HID support" - depends on INPUT +menuconfig HID_SUPPORT + bool "HID bus support" + default y + depends on INPUT + help + This option adds core support for human interface device (HID). + You will also need drivers from the following menu to make use of it. + +if HID_SUPPORT config HID - tristate "HID bus support" - depends on INPUT + tristate "HID bus core support" default y help A human interface device (HID) is a type of computer device that @@ -1290,4 +1296,4 @@ source "drivers/hid/amd-sfh-hid/Kconfig" source "drivers/hid/surface-hid/Kconfig" -endmenu +endif # HID_SUPPORT diff --git a/drivers/hid/amd-sfh-hid/Kconfig b/drivers/hid/amd-sfh-hid/Kconfig index db069a83e9a2..56e473fc3c93 100644 --- a/drivers/hid/amd-sfh-hid/Kconfig +++ b/drivers/hid/amd-sfh-hid/Kconfig @@ -2,10 +2,10 @@ menu "AMD SFH HID Support" depends on X86_64 || COMPILE_TEST depends on PCI - depends on HID config AMD_SFH_HID tristate "AMD Sensor Fusion Hub" + select HID help If you say yes to this option, support will be included for the AMD Sensor Fusion Hub.