Message ID | 20240212111819.936815-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-61408-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2363329dyd; Mon, 12 Feb 2024 03:18:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXrhRNO+V5OFMHPGSz1ySeBGEY3zsCCrPthgHH74xeJ2LX0sNslGwGJqp+r6FqflwcAm2YGK4e2FXFRSSwNMF+bFX6guw== X-Google-Smtp-Source: AGHT+IG0FHTPpoIU2sT+Niw2cXzZ+QQCLDWAiG5YXHEL4LY10fxmVyHt+FTHuI2XOo5piV1q3Q5b X-Received: by 2002:a25:8405:0:b0:dc2:5041:ce18 with SMTP id u5-20020a258405000000b00dc25041ce18mr5102214ybk.23.1707736723195; Mon, 12 Feb 2024 03:18:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707736723; cv=pass; d=google.com; s=arc-20160816; b=k4xApBsLQKDYAGgbfDQ0LldHErnobwkRhwEfVUncZEywFmgrl1tMW4uRWm4DwSI9II BZfSYLtQ7VVQwR/jm5s97Ebm/E6xUOxsiRiiiFng9SUpgF89eR9Aans3flRJ2ouLgQRc klJy5yYlTbys4e6EfcPZxm76S9gO7XTvOse4SzMVTnRmJUG+qNJbLjfjUbU5BGdNrlP8 jurV2Mp13C9q4otO8sXUQzaLyQl093ZSPO8ceJCPij3GuXPfH8D5asGEIdLZ8BcwY+xV onrizVDx7mzrD5kBfSYn6LTcWlZWjXLV/z4N+oWSkuIK/39V1x2WKKBdPIFtfzApSORz guXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=fg3i5iS6DyUPk7IG+bZwdzOWeGLyzl5eDtcjw3HsDcs=; fh=y5PvVtLDqrjtqjfTTP4HiBxzagy/CrToeYOg2WIZREo=; b=CxSCvjHvU6rlffXFgccNKjJHZ4Bb/N/yrpioPgFTMd22JmkE9OngbjQ+ZVyw4oKTq8 C/8sib/drea79xoteaBnIpvm+QQFlVIu5HnE4mQvsA9Ao04YqbN1UWE4ex9ybrpA1inn PRnFW4bzcClXG1stAtG2LCJAEbsbsC3zO0fruMe7F/KXwt1W7H02lgCa2UpheTU+LCoh slnGPelV/MQFa/k9xYwvGKsGrbEBVFAogXZuIzkIIK4S7TOcu2ggyVnafC6WnRIBo6bU mjS9F+jY2CvYLBR3ooIuJbbkiXUFbqT3j/+NqTcsaCXX4XhzUm+qjMylCIIOLYglj6nO no7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m1OuXjK8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61408-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61408-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWttvS0W2ZWKn6YyGbGdfA/gWYaSCsoUUwWo0gXzvAq0jRrKVgM9EFm1/0SDYOqhmX1aednZU9hNWnP8Cw7MG0sMWt4Wg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z14-20020a05620a08ce00b00785cd725dccsi4149819qkz.488.2024.02.12.03.18.43 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:18:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61408-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m1OuXjK8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61408-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61408-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F2FFF1C215C5 for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 11:18:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 418E13984A; Mon, 12 Feb 2024 11:18:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m1OuXjK8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89E722BAE7; Mon, 12 Feb 2024 11:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707736706; cv=none; b=N41Dt154xHFD4JxPseBTjjhulTok+VEX1BoraXj5KeG5nh6h7V9fD+TrOTr3NUHJeVsx8vPu2BbkMx14UDD4T07S85Esdtk6Lc+qqfIPZhvtfpeWx3ZzJZtzfSEp0pC8lsauMfc1X6xQ2uz5iURx/3sRTQMJlizV4A6amKRG06w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707736706; c=relaxed/simple; bh=1lR4IsJGmLUexDJX/zjNYB7tgsa4JkZ3HcVTMHB2dNc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=QIAs2vceSqIax5QePmVlBWZewiSyRJLN286BXnyu068jFSeuO1vaBLyFgL+C3BqGLYfS3fULK7JNV+6wC0ZTQSf+L6bRUr8foj3oxfeB0bf+KAcGu1PBtE/4atHoEKiWZ4j9fBrcLnWiv/7e/ML/ZlZtYfmy2SjqWbjpOgSoJcc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m1OuXjK8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2547EC433F1; Mon, 12 Feb 2024 11:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707736706; bh=1lR4IsJGmLUexDJX/zjNYB7tgsa4JkZ3HcVTMHB2dNc=; h=From:To:Cc:Subject:Date:From; b=m1OuXjK8CZ+NAI6SOCsY1TaOBBI3XiORFTXfFMQ9vxA3c3yftkO8wpysTgFM97Q3q bJUqMUv9ebPvJdBSdzXnkFLHSJgYchoroVRa8XgogGgE8l064Eo3Ghdhf3jg5hwyJl 4fqFxaCSroYO4hMXj0JJr2eCkQeJH2FsKa/XxCMLTF08OZi4sDZhk5d4EIO8VIn81v 9kacs51BlOrxwHS56vkiZ6hTcegnAOltkl8drmJ0SKdBFZ0zjLBdIfO6cP9mvxB/gj zi1/nt8vcFiDJd/NTcmShtimOwOfvSTY+uyVdS4rcFPqrYrg+WxiRuF1nN9IH6umil 1JgxnCfdxJT7g== From: Arnd Bergmann <arnd@kernel.org> To: Lee Jones <lee@kernel.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>, =?utf-8?q?Duje_Mihanovi=C4=87?= <duje.mihanovic@skole.hr>, Linus Walleij <linus.walleij@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de>, Flavio Suligoi <f.suligoi@asem.it>, Hans de Goede <hdegoede@redhat.com>, Jianhua Lu <lujianhua000@gmail.com>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] backlight: ktd2801: fix LED dependency Date: Mon, 12 Feb 2024 12:18:12 +0100 Message-Id: <20240212111819.936815-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790691742405694854 X-GMAIL-MSGID: 1790691742405694854 |
Series |
backlight: ktd2801: fix LED dependency
|
|
Commit Message
Arnd Bergmann
Feb. 12, 2024, 11:18 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The new backlight driver unconditionally selects LEDS_EXPRESSWIRE, which is in a different subsystem that may be disabled here: WARNING: unmet direct dependencies detected for LEDS_EXPRESSWIRE Depends on [n]: NEW_LEDS [=n] && GPIOLIB [=y] Selected by [y]: - BACKLIGHT_KTD2801 [=y] && HAS_IOMEM [=y] && BACKLIGHT_CLASS_DEVICE [=y] Change the select to depends, to ensure the indirect dependency is met as well even when LED support is disabled. Fixes: 66c76c1cd984 ("backlight: Add Kinetic KTD2801 backlight support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/video/backlight/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Feb 12, 2024 at 12:18:12PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The new backlight driver unconditionally selects LEDS_EXPRESSWIRE, which > is in a different subsystem that may be disabled here: > > WARNING: unmet direct dependencies detected for LEDS_EXPRESSWIRE > Depends on [n]: NEW_LEDS [=n] && GPIOLIB [=y] > Selected by [y]: > - BACKLIGHT_KTD2801 [=y] && HAS_IOMEM [=y] && BACKLIGHT_CLASS_DEVICE [=y] > > Change the select to depends, to ensure the indirect dependency is > met as well even when LED support is disabled. > > Fixes: 66c76c1cd984 ("backlight: Add Kinetic KTD2801 backlight support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/video/backlight/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig > index 230bca07b09d..f83f9ef037fc 100644 > --- a/drivers/video/backlight/Kconfig > +++ b/drivers/video/backlight/Kconfig > @@ -185,7 +185,7 @@ config BACKLIGHT_KTD253 > > config BACKLIGHT_KTD2801 > tristate "Backlight Driver for Kinetic KTD2801" > - select LEDS_EXPRESSWIRE > + depends on LEDS_EXPRESSWIRE As far as I can tell this resolves the warning by making it impossible to enable BACKLIGHT_KTD2801 unless a largely unrelated driver (LEDS_KTD2692) is also enabled! A better way to resolve this problem might be to eliminate the NEW_LEDS dependency entirely: ~~~ diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 64bb2de237e95..a08816cde78ae 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -186,10 +186,6 @@ config LEDS_EL15203000 To compile this driver as a module, choose M here: the module will be called leds-el15203000. -config LEDS_EXPRESSWIRE - bool - depends on GPIOLIB - config LEDS_TURRIS_OMNIA tristate "LED support for CZ.NIC's Turris Omnia" depends on LEDS_CLASS_MULTICOLOR @@ -936,3 +932,10 @@ comment "Simple LED drivers" source "drivers/leds/simple/Kconfig" endif # NEW_LEDS + +# This is library code that is useful for LEDs but can be enable/disabled +# independently of NEW_LEDS. In fact it must be independent so it can be +# selected from other sub-systems. +config LEDS_EXPRESSWIRE + bool + depends on GPIOLIB ~~~ Alternatively we could add a "depends on NEW_LEDS" alongside the existing select or just make LEDS_EXPRESSWIRE user selectable. It also looks like we should put back the GPIOLIB dependency to both KTD2801 and KTD2692... and I'll take a mea-culpa for providing bad advice during the review cycles! Daniel.
On Monday, February 12, 2024 1:44:28 PM CET Daniel Thompson wrote: > On Mon, Feb 12, 2024 at 12:18:12PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann <arnd@arndb.de> > > > > The new backlight driver unconditionally selects LEDS_EXPRESSWIRE, which > > is in a different subsystem that may be disabled here: > > > > WARNING: unmet direct dependencies detected for LEDS_EXPRESSWIRE > > > > Depends on [n]: NEW_LEDS [=n] && GPIOLIB [=y] > > Selected by [y]: > > - BACKLIGHT_KTD2801 [=y] && HAS_IOMEM [=y] && BACKLIGHT_CLASS_DEVICE [=y] > > > > Change the select to depends, to ensure the indirect dependency is > > met as well even when LED support is disabled. > > > > Fixes: 66c76c1cd984 ("backlight: Add Kinetic KTD2801 backlight support") > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > --- > > > > drivers/video/backlight/Kconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/video/backlight/Kconfig > > b/drivers/video/backlight/Kconfig index 230bca07b09d..f83f9ef037fc 100644 > > --- a/drivers/video/backlight/Kconfig > > +++ b/drivers/video/backlight/Kconfig > > @@ -185,7 +185,7 @@ config BACKLIGHT_KTD253 > > > > config BACKLIGHT_KTD2801 > > > > tristate "Backlight Driver for Kinetic KTD2801" > > > > - select LEDS_EXPRESSWIRE > > + depends on LEDS_EXPRESSWIRE > > As far as I can tell this resolves the warning by making it impossible > to enable BACKLIGHT_KTD2801 unless a largely unrelated driver > (LEDS_KTD2692) is also enabled! > > A better way to resolve this problem might be to eliminate the NEW_LEDS > dependency entirely: I believe this would be the best thing to do here. Making LEDS_EXPRESSWIRE user selectable doesn't make much sense to me as the library is rather low- level (a quick grep turns up BTREE as an example of something similar) and IMO the GPIOLIB dependency should be handled by LEDS_EXPRESSWIRE as it's the one actually using the GPIO interface (except maybe for KTD2692 as it has some extra GPIOs not present in the other one and thus handles them itself). Regards,
On Mon, Feb 12, 2024, at 15:31, Duje Mihanović wrote: > On Monday, February 12, 2024 1:44:28 PM CET Daniel Thompson wrote: >> On Mon, Feb 12, 2024 at 12:18:12PM +0100, Arnd Bergmann wrote: > I believe this would be the best thing to do here. Making LEDS_EXPRESSWIRE > user selectable doesn't make much sense to me as the library is rather low- > level (a quick grep turns up BTREE as an example of something similar) and IMO > the GPIOLIB dependency should be handled by LEDS_EXPRESSWIRE as it's the one > actually using the GPIO interface (except maybe for KTD2692 as it has some > extra GPIOs not present in the other one and thus handles them itself). Agree, let's do it this way. Maybe the leds-expresswire.c file should not be in drivers/leds either, but it's already there and I can't think of a better place for it.so just adapting Kconfig should be enough. Please add the corresponding Makefile change as well though: --- a/drivers/Makefile +++ b/drivers/Makefile @@ -135,7 +135,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle/ obj-y += mmc/ obj-y += ufs/ obj-$(CONFIG_MEMSTICK) += memstick/ -obj-$(CONFIG_NEW_LEDS) += leds/ +obj-y += leds/ obj-$(CONFIG_INFINIBAND) += infiniband/ obj-y += firmware/ obj-$(CONFIG_CRYPTO) += crypto/ Without this, the expresswire library module won't get built unless NEW_LEDS is enabled. Arnd
On Mon, Feb 12, 2024 at 03:31:50PM +0100, Duje Mihanović wrote: > On Monday, February 12, 2024 1:44:28 PM CET Daniel Thompson wrote: > > On Mon, Feb 12, 2024 at 12:18:12PM +0100, Arnd Bergmann wrote: > > > From: Arnd Bergmann <arnd@arndb.de> > > > > > > The new backlight driver unconditionally selects LEDS_EXPRESSWIRE, which > > > is in a different subsystem that may be disabled here: > > > > > > WARNING: unmet direct dependencies detected for LEDS_EXPRESSWIRE > > > > > > Depends on [n]: NEW_LEDS [=n] && GPIOLIB [=y] > > > Selected by [y]: > > > - BACKLIGHT_KTD2801 [=y] && HAS_IOMEM [=y] && BACKLIGHT_CLASS_DEVICE > [=y] > > > > > > Change the select to depends, to ensure the indirect dependency is > > > met as well even when LED support is disabled. > > > > > > Fixes: 66c76c1cd984 ("backlight: Add Kinetic KTD2801 backlight support") > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > --- > > > > > > drivers/video/backlight/Kconfig | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/video/backlight/Kconfig > > > b/drivers/video/backlight/Kconfig index 230bca07b09d..f83f9ef037fc 100644 > > > --- a/drivers/video/backlight/Kconfig > > > +++ b/drivers/video/backlight/Kconfig > > > @@ -185,7 +185,7 @@ config BACKLIGHT_KTD253 > > > > > > config BACKLIGHT_KTD2801 > > > > > > tristate "Backlight Driver for Kinetic KTD2801" > > > > > > - select LEDS_EXPRESSWIRE > > > + depends on LEDS_EXPRESSWIRE > > > > As far as I can tell this resolves the warning by making it impossible > > to enable BACKLIGHT_KTD2801 unless a largely unrelated driver > > (LEDS_KTD2692) is also enabled! > > > > A better way to resolve this problem might be to eliminate the NEW_LEDS > > dependency entirely: > > I believe this would be the best thing to do here. Making LEDS_EXPRESSWIRE > user selectable doesn't make much sense to me as the library is rather low- > level (a quick grep turns up BTREE as an example of something similar) and IMO > the GPIOLIB dependency should be handled by LEDS_EXPRESSWIRE as it's the one > actually using the GPIO interface (except maybe for KTD2692 as it has some > extra GPIOs not present in the other one and thus handles them itself). We can keep the GPIOLIB dependency in LEDS_EXPRESSWIRE but it also needs to be included in the KTD2801 KConfig too... otherwise we'll get similar problems to the ones Arnd addressed here: https://lore.kernel.org/all/20240213165602.2230970-1-arnd@kernel.org/ Daniel.
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 230bca07b09d..f83f9ef037fc 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -185,7 +185,7 @@ config BACKLIGHT_KTD253 config BACKLIGHT_KTD2801 tristate "Backlight Driver for Kinetic KTD2801" - select LEDS_EXPRESSWIRE + depends on LEDS_EXPRESSWIRE help Say Y to enable the backlight driver for the Kinetic KTD2801 1-wire GPIO-controlled backlight found in Samsung Galaxy Core Prime VE LTE.