Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4273483ybb; Tue, 7 Apr 2020 04:20:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLMYPemGcwxSfCl6uvSKeL6cLA4jvOh5YZub7vzDLXn/zsL+NntMCDAG5zH1uqaJWV0wfoX X-Received: by 2002:a9d:1904:: with SMTP id j4mr1120825ota.37.1586258436380; Tue, 07 Apr 2020 04:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586258436; cv=none; d=google.com; s=arc-20160816; b=cZsQClx4R05nY7LYlLfWoUrGkDnZVpY9ijxlgS/ZrHNP1+i2Qf5Nvzq40LbbjtSLwk QpUE0tjn48HYn6ILd4GQid6bbzJ2XrcRuCAeq0/wGWV7f46UaB5dlxPbWkVs8fGiIu3p Sb5Kc9muNdX9fvCqdIaZp3rXsV9/AP+WsB2gJ8EFMp8NTclLJp2OF0lIHfLgVZahtrfF G73adJpUtLmuYX8SEVwqLT2DVSF6WVsIb2mHXREAAHQJ9ulnkNGWg0zTIPWtCIRhkbTX HtjtPSkudjev1q9/ykISz9ANOwpqr4Tfi/WWCJQA6M+qsbW+CrTSttSmSjV7udLMUZ0g mmZw== 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=Lf3lk2SwVAt3pJeX1oHGyhLd2RqIcy7otyqJ2NNXR2A=; b=IkqfXBw9EyrDVszs1qdGVSQAUdTokrR2Jb/PFVpXBwcNJgmkqNbe482bTobYWvs9zp yN5l6YXRphH0yAqTkHaWP1wnC8vl4zQRQXkebLT1UYhBwWK57SsM0/iaqvbAQUg8GIWE OYcDO+RE4LhIBVC59wnvQOSxJiCDNQR5bXkcQNy8Whb5X+aI2hMJYkoF9X3b8gjv6fdu ZP1SH1UB/jTkCEHeIhzHHs3O7QhGcrZ2o+pVpQDkLH3bnbBf7tkqXIgdAqr+mJg8hHLA n9I/d9fwAtyNxfQ2I1cS0OV/MC5+HOmDZeH+GSrE/t5rmeoorcDsdiui7/ZgLVta8/Vf hWPg== 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 o5si1095956otp.191.2020.04.07.04.20.24; Tue, 07 Apr 2020 04:20:36 -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 S1728459AbgDGLSz (ORCPT + 99 others); Tue, 7 Apr 2020 07:18:55 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51181 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbgDGLSz (ORCPT ); Tue, 7 Apr 2020 07:18:55 -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 1jLmFf-0005po-L5; Tue, 07 Apr 2020 13:18:43 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jLmFe-0002q9-MB; Tue, 07 Apr 2020 13:18:42 +0200 Date: Tue, 7 Apr 2020 13:18:42 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Oleksandr Suvorov Cc: devicetree@vger.kernel.org, Paul Barker , Marcel Ziswiler , Igor Opaniuk , Philippe Schenker , Laurent Pinchart , Rob Herring , Thierry Reding , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Subject: Re: [RFC PATCH v2 2/6] dt-bindings: pwm: document the PWM no-flag Message-ID: <20200407111842.hp7mhrlsuesa74ep@pengutronix.de> References: <20200405192246.3741784-1-oleksandr.suvorov@toradex.com> <20200405192246.3741784-3-oleksandr.suvorov@toradex.com> <20200407061646.pcglaw43kfmrag6a@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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, Apr 07, 2020 at 01:51:42PM +0300, Oleksandr Suvorov wrote: > On Tue, Apr 7, 2020 at 9:17 AM Uwe Kleine-K?nig > wrote: > > > > On Sun, Apr 05, 2020 at 10:22:42PM +0300, Oleksandr Suvorov wrote: > > > Add the description of PWM_NOFLAGS flag property. > > > > > > Signed-off-by: Oleksandr Suvorov > > > > As I already wrote in reply to the v1 series I'd prefer a name for 0 > > that explicitly handles normal polarity. > > Uwe, AFAIU, there is no flag that forces normal polarity, the normal polarity > is the default state if there is no flag to invert the polarity is set. Yes, that's the status quo. > '0' value in the bit flags cell really means there are no flags set > for the PWM instance. For me the relevance of giving 0 a name is mostly for human consumption. Currently there is only a single flag encoded in the number in question. But as soon as we add another, say PWM_AUTOSTART we have the following possible settings: PWM_NOFLAGS PWM_POLARITY_INVERTED PWM_AUTOSTART PWM_POLARITY_INVERTED | PWM_AUTOSTART Then for the first two a reader doesn't see if autostart is not in use because the dt author doesn't know this feature (e.g. because autostart is too new) or if they don't want autostart at all. If however we had PWM_POLARITY_NORMAL and PWM_NO_AUTOSTART to complement PWM_POLARITY_INVERTED and PWM_AUTOSTART every flag's setting could be explicit and if there is a device tree that only has PWM_POLARITY_NORMAL it would be obvious that nobody thought enough about autostarting to explicitly mention it. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |