Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp512120ybd; Wed, 26 Jun 2019 01:59:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrBVaxKty6//RjGgG+7Z6Pjo3t/saP/ImdWH36GOIIHpzAVkDtv1+j3JT0MimLOC3BFIQE X-Received: by 2002:a17:902:7295:: with SMTP id d21mr3831669pll.299.1561539554517; Wed, 26 Jun 2019 01:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561539554; cv=none; d=google.com; s=arc-20160816; b=A95drkV3Ezq5Vk5uaOW4DScD+MeO5dxO6zgkQwXQY5hweOy8fgJMwZXklQPo3mWkCj HV2U6xHs70+CM8S5xDyhOsjxWFNozvw/U+cTbPg05JVzXRJ7KltYBxJCRAZFadegxbQ5 ayT6m3FRQ37/+CWGeefbnKc38eCWTLVrKjiEBgR9Fi93WSC2we4A8/mDX+DH0QVRUXA6 NRxa/wAUdURNAZ4JB8SrivqWTjonSEdxMugnCbVRysUis+WlYxWcZDdDc+94hUJXenvR P+qyTWjq7k1kzdpKDLQIdN/HgaR505cOPH0EfVhr4xIPXXmreP/UBVUz6ytx5ELX0vxg lM2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=0XCSKALcbfqgIgpiB/hhkHLiFnMiBNjhr6i+M0CQ33Y=; b=LLNdlae4Pl1zVSWdOUy4CwDLMinxKPFUeMFcGJHnG33wzPQXkacueZU9yGJWJZ78qC R/cVUJjS2CrgkAJXZksGVdm5szZmjtALVWgG5cqiOF6/dWJQB97aVMgKai+bpJI7cnP7 fDd4aeuRv+Uu4RlHW90RQR976k9XeG7QY+iXUqFUzQ4UFCqkBRF9VYMh1QzoQwKB5s9f eVBC7cb3BUnw8dObJmrVCtlTBwxbbFWcMLZxJt6gxyjlT9+2A9Z1Qw1bCgDfOxBg4M+o tb0dCYYFZVg/jwvIRy86/GR4fG6LSER4x9myTZWYIeGAtr+xq29TvotUSbIpeOp++jaI u0VQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si2782068plq.92.2019.06.26.01.58.57; Wed, 26 Jun 2019 01:59:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbfFZI6i (ORCPT + 99 others); Wed, 26 Jun 2019 04:58:38 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52955 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFZI6i (ORCPT ); Wed, 26 Jun 2019 04:58:38 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hg3l8-0006dR-FY; Wed, 26 Jun 2019 10:58:30 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hg3l5-0008VO-Se; Wed, 26 Jun 2019 10:58:27 +0200 Date: Wed, 26 Jun 2019 10:58:27 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Thierry Reding Cc: Daniel Thompson , Paul Cercueil , Lee Jones , Jingoo Han , Linus Walleij , Bartlomiej Zolnierkiewicz , od@zcrc.me, linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] backlight: pwm_bl: Set pin to sleep state when powered down Message-ID: <20190626085827.fija4kfzb5uhwosi@pengutronix.de> References: <20190522163428.7078-1-paul@crapouillou.net> <5b0f8bb3-e7b0-52c1-1f2f-9709992b76fc@linaro.org> <20190621135608.GB11839@ulmo> <20190624112844.fmwbfpdxjkst3u7r@holly.lan> <20190625093839.GB1516@ulmo> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190625093839.GB1516@ulmo> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 11:38:39AM +0200, Thierry Reding wrote: > On Mon, Jun 24, 2019 at 12:28:44PM +0100, Daniel Thompson wrote: > > [...] although given pwm-backlight is essentially a wrapper driver > > round a PWM I wondered why the pinctrl was on the backlight node > > (rather than the PWM node). > > I agree with this. We're defining the pin control state for the PWM pin, > so in my opinion it should be the PWM driver that controls it. > > One reason why I think this is important is if we ever end up with a > device that requires pins from two different controllers to be > configured at runtime, then how would we model that? Since pin control > states cannot be aggregated, so you'd have to have multiple "default" > states, each for the pins that they control. I thought you can do: pinctrl-names = "default"; pinctrl-0 = <&pinctrl_in_first_pincontroller>, <&pinctrl_in_another_controller>; if two (or more) controllers are involved. > On the other hand if we associate the pin control states with each of > the resources that need those states, then when those resources are > controlled, they will automatically know how to deal with the states. > The top-level device (i.e. backlight) doesn't need to concern itself > with those details. So the options are: a) put "active" and "inactive" pinctrls into the pwm-node, and nothing related to the involved PWM pins in the consumer b) put the PWM pin config in the consumer's "default" pinctrl (and maybe leave it out int "init" if you want smooth taking over). (Or maybe use "enabled" and "disabled" in a) to match the pwm_states .enabled?) The advantages I see in b) over a) are: - "default" and "init" are a known pinctrl concept that most people should have understood. - You have all pinctrl config for the backlight in a single place. - none of the involved driver must explicitly handle pinctrl stuff You presume that b) being commonly done is a sign of "our device trees and kernel subsystems still maturing". But maybe it's only that the capabilities provided by pinctrl subsystem without extra effort is good enough? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |