Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10019621ybi; Wed, 24 Jul 2019 14:17:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmpR6/gcx3ur5sGYnIFMqNT4ilFmbSonR7zihUNi77B8alMXKmJCWzNxmfxWUQgZAV0bV+ X-Received: by 2002:a17:90a:7d04:: with SMTP id g4mr90164651pjl.41.1564003065464; Wed, 24 Jul 2019 14:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564003065; cv=none; d=google.com; s=arc-20160816; b=E0gWy7tHxfs+NPE9JS3lUyqV7aPxMyOX87tVpk/4wIIHc9eS5SQIT/SSDKrOoGp6Nh rNp+ka4Ehz0bw4W6Vj53bKENPfWTtYpeuslnhYSar8YAUdpx6Gu2P3RUHbhV9GYjlqNV cXPPcAqzTBf1xMr8o5dA587OtR1sVPKjBD8UcegiIL5kszMg6XGPy2ffflgYPnZrPoHo WzuUmYpP4g6BdqxzLfpLfxj/hz4TcBnbRy8VVCzSesUp9/Mf1DVWMSS/6qew4OYpwOY3 s0lzwiKnQhjO8CHopEMmtEmM/JjojgPz/W5hA0GjWPC1nPudxTdPINLBJfvR1864NI4G 5/Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=W1jFeugsJ0oirRWmWhC8GQwi5V7rmQsow/rL22Dmte8=; b=T9YpuwJcOx5k0PHvwUvutdb7OpA4he4bp6yvJJq+mhmaI6+WOBw+MAF/2SXOipD2DS OwerMWuaNzgZ8UvJZgvyeIEMqFRCfgWLfdgacN39jq3iueICKY4MHq+RomtuJawxKDj7 hpsbSVDfN3m9t9sXpILvnHJ4mCFHBiDmo5WmSYMAAUOgB6I/bMeYmc7b6A1kRTqBpIcl 285Bhwn9reLjvDSmkL/g8qQrczQcZJeDKRe3UVcCiXq5/qMIzTeH3M8CaAldFMY8cn+F jAeNgzQouApVI9dfB10YsDplCyxW8TZlNuJ18SRcaNRyuz8dXrFffpOtNpW6wsD4nq4p T26A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=usVr2ZwL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y92si13914576plb.209.2019.07.24.14.17.30; Wed, 24 Jul 2019 14:17:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=usVr2ZwL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728572AbfGXVQq (ORCPT + 99 others); Wed, 24 Jul 2019 17:16:46 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41755 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727211AbfGXVQp (ORCPT ); Wed, 24 Jul 2019 17:16:45 -0400 Received: by mail-wr1-f68.google.com with SMTP id c2so45224315wrm.8; Wed, 24 Jul 2019 14:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=W1jFeugsJ0oirRWmWhC8GQwi5V7rmQsow/rL22Dmte8=; b=usVr2ZwLIZQWZ7AIbj+TxyWWjwYj+Qp44q3aXgoV9E2Tqt/vYxz4oCR/lSjLaXfDta JOZ1NftN2dnDfnAD6PYTMvQYUD0igLbjcAGsnG7CK1TWLuw9ddtV2gpjDHq8MGUxsduG T9TTeXMSVtJ3To5rElilFQXBgSSOa0AXot8M9Ihi6R7+xomcyz0ztq3HKX/SrcKz7eW8 AvzsPtuRLrvSFmFhFihwRslqM0LIgVigxV0fCgaFG1RHbfKNbjCXMQ9UBsmu4BPo11DN eGrBU4X5KYvEJOSFct2TrbXIY2bgA1Fn/JazB7SKpUVdfMiJTdCrDbMv4WQDlYHUci8a y/1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=W1jFeugsJ0oirRWmWhC8GQwi5V7rmQsow/rL22Dmte8=; b=oNbx5ssQwLAhHLgGPUeBt+buktKHiIgZPJTCAtMboR5BYZg9D4gQ4fjBgVMj5DFxWc OOEV1pOWxg+dxF0NwfgM/hsAcc7vA3w7HsBZ43l2NfPtkS5+ThreUcMlOuhO9byNmsJ6 fZVnLDCoDaV7PBb2DTPH+0GGOAeAQD2VCGFhrNdwnKfzW0hslVldJtiHH2crEZxlfnkK a2QgZ0k+YJhaJdFV45unuH8jdwZKG4F9+DqIelg/jU3ayL0UWoC82CMGwV9jYwNx3DSf B9DEaLAKMM42qzm4me1Xc+F7lH3eCo9cCpxFdrzw46CzqVqPfHzDDHdZ/kQQMZy+Ii7u Ia/Q== X-Gm-Message-State: APjAAAVrGXU+4M3cXMEzlEVitigNGzAcKmrJDzqFDzkY9dwEQ4y6Pm4k 4rl3aP8wgPIrNfGQpsWJo2iuVIZa X-Received: by 2002:adf:ea8b:: with SMTP id s11mr88132670wrm.100.1564003002083; Wed, 24 Jul 2019 14:16:42 -0700 (PDT) Received: from [192.168.1.19] (bko238.neoplus.adsl.tpnet.pl. [83.28.182.238]) by smtp.gmail.com with ESMTPSA id y6sm58524363wmd.16.2019.07.24.14.16.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 14:16:41 -0700 (PDT) Subject: Re: [PATCH] Enable backlight when trigger is activated To: Pavel Machek Cc: Ezequiel Garcia , kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, tony@atomide.com, sre@kernel.org, nekit1000@gmail.com, mpartap@gmx.net, merlijn@wizzup.org, linux-leds@vger.kernel.org, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org References: <20190718190849.GA11409@amd> <22d7eca4ad8aa2e73933c4f83c92221ce6e0945a.camel@collabora.com> <20190722075032.GA27524@amd> <6fc6af89-1455-7665-47e7-0568ecd87c9c@gmail.com> <20190724083355.GA27716@amd> From: Jacek Anaszewski Openpgp: preference=signencrypt Autocrypt: addr=jacek.anaszewski@gmail.com; prefer-encrypt=mutual; keydata= mQINBFWjfaEBEADd66EQbd6yd8YjG0kbEDT2QIkx8C7BqMXR8AdmA1OMApbfSvEZFT1D/ECR eWFBS8XtApKQx1xAs1j5z70k3zebk2eeNs5ahxi6vM4Qh89vBM46biSKeeX5fLcv7asmGb/a FnHPAfQaKFyG/Bj9V+//ef67hpjJWR3s74C6LZCFLcbZM0z/wTH+baA5Jwcnqr4h/ygosvhP X3gkRzJLSFYekmEv+WHieeKXLrJdsUPUvPJTZtvi3ELUxHNOZwX2oRJStWpmL2QGMwPokRNQ 29GvnueQdQrIl2ylhul6TSrClMrKZqOajDFng7TLgvNfyVZE8WQwmrkTrdzBLfu3kScjE14Q Volq8OtQpTsw5570D4plVKh2ahlhrwXdneSot0STk9Dh1grEB/Jfw8dknvqkdjALUrrM45eF FM4FSMxIlNV8WxueHDss9vXRbCUxzGw37Ck9JWYo0EpcpcvwPf33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Z7QWfGtClwTbKqhQgVpkx138LH1tFYAZkbTzu3l1Qcm4ydV VykdkWccEqvxqDV4f8q0V0MW3KWfkD9/07bbGxXSnImeLt7bPuVMGK2tAUbr2+dUYmUdsETZ 1HgZ11moCVU5Ru0RwTv9oyThOsK3HQjI7NCIsDzVpolaGQPd9E7xwOVHhhDcXRqqNjLzHUSe eGGiEQ== Message-ID: Date: Wed, 24 Jul 2019 23:16:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190724083355.GA27716@amd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/19 10:33 AM, Pavel Machek wrote: > Hi! > >>>>> +++ b/drivers/leds/trigger/ledtrig-backlight.c >>>>> @@ -114,6 +114,8 @@ static int bl_trig_activate(struct led_classdev *led) >>>>> n->old_status = UNBLANK; >>>>> n->notifier.notifier_call = fb_notifier_callback; >>>>> >>>>> + led_set_brightness(led, LED_ON); >>>>> + >>>> >>>> This looks fishy. >>>> >>>> Maybe you should use a default-state = "keep" instead? (and you'll have >>>> to support it in the LED driver). >>>> >>>> That'll give you proper "don't touch the LED if it was turned on" behavior, >>>> which is what you seem to want. >>> >>> Actually no, that's not what I want. LED should go on if the display >>> is active, as soon as trigger is activated. >>> >>> Unfortunately, I have see no good way to tell if the display is >>> active (and display is usually active when trigger is activated). >> >> default-state DT property can be also set to "on" >> (see Documentation/devicetree/bindings/leds/common.txt). > > Yes, except that it does not work with all drivers :-(. In particular, > it does not work with lm3532. > > We should really move more of the device tree parsing into core, so > that there's one place to fix... Right. We could have something similar to led_get_default_pattern(). led_get_default_state() ? -- Best regards, Jacek Anaszewski