Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp418904ybh; Wed, 18 Mar 2020 02:22:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvLOY7D85mAoJ6J7ycEdDFGO1XmPi7Y3ZPOc0ZpGBcqc6gL+CyE2VXm0DQ5jIcZ1Fs2Eny9 X-Received: by 2002:aca:aac1:: with SMTP id t184mr2432329oie.14.1584523345730; Wed, 18 Mar 2020 02:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584523345; cv=none; d=google.com; s=arc-20160816; b=V+K4rd9wkTqdtlN0OynXJu+zk/5dYhyWiIYiyhNFLM+csfJ1mqPrlq6D7/dZvCEu0q 0Rn3T4jBf4bB7OLO+jXJ6ztnIK4wFk5HV6GMQhQjzfHs7u3+PdEnd29jerDuz6aFpjSF J7dQfV99NlYCCZJvaGW6CUDfQJQKJgnWop1RdjfDNp4LHUD895+zi2DOo+o89/eXZvPc wKmiMqi+7aSruLBDOrCyansum22uLbeHro/us+1OagCv3+dzC5/jAXQNUaIcL+vk/4ID ZqjQzaZYQuCCtGpG/Wc6HNUcQXiY0AEjHR4FnjApa+RIfQ0+jANKqZo2RRBLysoeU1Fh NG+g== 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=CzTZspoxMpyugF1DBP06c747jOpXbTL1DAFbmpXaYWY=; b=ktCKsjspR1LhiJSSR3gmiQ+nWCcBpweIz6mc482LvyeaJrEZDl2P529qNNGETsxskp NkHUc0EyzIxfL366E8eGS06ScyeVvF1hp+UfdDs5K1W0egqgbR8zgB0pYT/G2mnjOX8Z KFkvXul1k4Hq3BlHF6MSG3UeFTSbWC5GtXE5bYTfusMDYNL5MkgmndVs7fc+gUX5ZGAy hzGM+gIYaoWI9qXUDcXkkwY3HSasabT0NDz9Wsa+AuJgxXlh5Al7dJ9ZhY0/OrfFDDVl yilpYdFlh9ry8OGah/NT/rehJ8dqcI3agmBNVyaUBFUUYaKQwoNGsoyrqqRnVbV+WzqH +bXA== 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 x10si2877341oie.211.2020.03.18.02.22.13; Wed, 18 Mar 2020 02:22:25 -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 S1727420AbgCRJU4 (ORCPT + 99 others); Wed, 18 Mar 2020 05:20:56 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:59419 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbgCRJU4 (ORCPT ); Wed, 18 Mar 2020 05:20:56 -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 1jEUsa-0006vf-Bx; Wed, 18 Mar 2020 10:20:48 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jEUsZ-0006yY-8Y; Wed, 18 Mar 2020 10:20:47 +0100 Date: Wed, 18 Mar 2020 10:20:47 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Laurent Pinchart Cc: Oleksandr Suvorov , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, Paul Barker , Marcel Ziswiler , Igor Opaniuk , Philippe Schenker , Rob Herring , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 3/7] dt-bindings: pwm: add normal PWM polarity flag Message-ID: <20200318092047.25gjkx43jwfyywsl@pengutronix.de> References: <20200317123231.2843297-1-oleksandr.suvorov@toradex.com> <20200317123231.2843297-4-oleksandr.suvorov@toradex.com> <20200317225656.GK2527@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200317225656.GK2527@pendragon.ideasonboard.com> 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 Hello Laurent, On Wed, Mar 18, 2020 at 12:56:56AM +0200, Laurent Pinchart wrote: > On Tue, Mar 17, 2020 at 02:32:27PM +0200, Oleksandr Suvorov wrote: > > PWM can have a normal polarity and a reverted one. The reverted polarity > > value is defined. > > I would squash this patch with 2/7, apart from that it looks fine. > However, I also agree with Thierry that the PWM cell that contains this > value is a bitmask, so once we get more flags it may get a bit awkward. For me the usefulness of PWM_POLARITY_NORMAL increases with more bits used. That's because if there are 5 things that can be set there and the patch author mentions only the two that are non-zero, I as a reviewer don't know if the author actually know and thought about the other three. If however they spell out PWM_POLARITY_NORMAL it's quite sure they want normal polarity. > Will we have one macro for each flag that will evaluate to 0 to report > that the flag isn't set ? Yes. Given the above mentioned advantage this is cheap enough in my eyes. > Or should we define a single PWM_FLAG_NONE (or > similarly named) macro ? I like one macro for each bit field better for the above mentioned reason. > In retrospect, maybe PWM_POLARITY_INVERTED > should have been named PWM_FLAG_POLARITY_INVERTED. Seems to be subjective. I don't see much added semantic that justifies the longer name. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |