Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2593129pxy; Mon, 3 May 2021 03:52:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWyelgcTauuYtAkFpY56IMLExvdvW99ogj95ufl9CK4pEAP58AyH2IDnVMCCjWNaiS8UUt X-Received: by 2002:a17:906:f285:: with SMTP id gu5mr16301540ejb.226.1620039170741; Mon, 03 May 2021 03:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620039170; cv=none; d=google.com; s=arc-20160816; b=PwRqY4SAiJpAb0uW1Bk33LqxwOJU0Vy+7zAgJWC16LS6h3bsw2WnQp4KLyhduUFEp1 n6njboHjyQbnjFoE8jU1xxU5WGkbDmjJBm/lh7RlEb9iXlhb6AVnZ81s3QLlP+9wnG6f sn7j7+gRDHGBbOj/YsK019ehYu44QXbAIS1+Z00t8M3YF9eas74FC9b4aC2r+eI1a+0S GiSgXRVjVqk0HR8LWR+AEEdVAX2sUMDyuWtIxoaePFYmJjxQVZx7ExJ3Rd4ZJo1z2Ftk HhCufm+iVVQ29weCIa/pWdJU2g3mc5aQwdfyS5s52OvGrAZT2ovQ9xjkppfwst5tjv/h 7RNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=NOZHphP0J77IVBBBjo8YOj6pvBpQrt+Xsfz8D8jGGIc=; b=KrCir+BCM/qBGnQK2Oo5PrnAs9fz0KyA4KtZGdY5W3KTS+TStskBm66eBE22m4tCmi 26YgbtavXemvD+1yojWumEtb3LNXwUE+K1E87pCPKpt6NmZuVIbyFFrj1AMmIC0KP4vG 1DicHg1i8d/Di04dTWswWZBShb90DLgQ6RZ78sgE+NZxuKr+bZ0Qf2qxKxfUXrSA1q1v T0euWlf7fPC+3PLa24lTdjp2PhRvA752TtErDtFTivXoS6QyzOH/zi5mXCYdNuMIkELK 1cnx9a8bgurypSQ8otlO0t09OdKSzKP3YtyYxL18CGpa21i0uanNtVOm93XnBbJ4okoV VcEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg13si12167545ejc.430.2021.05.03.03.52.27; Mon, 03 May 2021 03:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233241AbhECKRp (ORCPT + 99 others); Mon, 3 May 2021 06:17:45 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:38042 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233196AbhECKRo (ORCPT ); Mon, 3 May 2021 06:17:44 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 2D8C61C0B79; Mon, 3 May 2021 12:16:51 +0200 (CEST) Date: Mon, 3 May 2021 12:16:50 +0200 From: Pavel Machek To: Juergen Borleis Cc: linux-leds@vger.kernel.org, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , kernel@pengutronix.de Subject: Re: [PATCH] leds: trigger/tty: Use led_set_brightness() to support all use cases Message-ID: <20210503101650.GC6621@amd> References: <20210503092542.14497-1-jbe@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Sr1nOIr3CvdE5hEN" Content-Disposition: inline In-Reply-To: <20210503092542.14497-1-jbe@pengutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sr1nOIr3CvdE5hEN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon 2021-05-03 11:25:42, Juergen Borleis wrote: > Using led_set_brightness_sync() only works for LEDs which are connected > via some kind of external bus like I=B2C or SPI. But it doesn't work for > the simple use case of directly connected LEDs via GPIOs. Really? I'd need to check. > Because this function only honors the led_classdev::brightness_set_blocki= ng > callback. But the LED-GPIO driver registers the > led_classdev::brightness_set member if the GPIO can be modified directly > and thus, TTY triggers fail silently with -ENOTSUPP. >=20 > With the previously used led_set_brightness() it works for both use cases. > This function first checks for the simple case where the GPIO can be chan= ged > without additional overhead, and if it fails, does the modification via a > workqueue. Yeah, but that is not what we want. We are already running in the workqueue. We really should have a API that can be called from process context, and just simply sets the brightness. Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --Sr1nOIr3CvdE5hEN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmCPzZIACgkQMOfwapXb+vJCHQCfVFzUNHnVvgKkn6lIfeIVYX9A hs4AoIQFeJ/ueUt6I3fML1HMZCssl6ei =BadJ -----END PGP SIGNATURE----- --Sr1nOIr3CvdE5hEN--