Received: by 10.223.176.46 with SMTP id f43csp113962wra; Fri, 19 Jan 2018 14:41:18 -0800 (PST) X-Google-Smtp-Source: AH8x224sAIV39LmbV5Ma/yZwI4NzR6LJTU4OMbqiZ5ZOGXvfn8sLyfl+Q+FOoVX/X2M2qWy7bl5c X-Received: by 10.99.178.19 with SMTP id x19mr18721pge.31.1516401678655; Fri, 19 Jan 2018 14:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516401678; cv=none; d=google.com; s=arc-20160816; b=QNlHOQXuZuQRcwMLxLFqWUTLyoZPxnQdHBZ0CTyK0gfCJHeGkk4/sv0zWBL2V77nTU Fba4KTVJVOQQRTJVCCCVxxq6k7tNK+UMHK0JV4Vo+/mS+LK5o7p1GJhTAe1H4nK1nKZ+ WC7c9wetTzFG6wn1UTMHUKzovguSvEF326MFSsYdouhCTEwHdKhWlmuMBtV//dj8uQra yJXr3dnm3jZp8MZyeA76yHSzXU6RK5qBN3vtQNSxQfgqHZj9/tBFkmAThCyPW9+1JZlK 3Tr4AkjLJVWB/l5VM+Pb90FMrNFmiOuTSBlPka0VUJOn6SN2HSWvq8ev1l313l/HbCa8 lATQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=DLG6pVKhnvwoEu7FYGUGDwthCy89NluTQKP3y/Ico/Y=; b=otTmF4qI0Pr0hUeS1VM+GdR1m0siHCpizWKpqaGspTf9bOibdxsFAirtXvilhlVrd3 aOmiMiDGQxip0TCiRBeFz7UXEJwkOgWuHRFLudIIVF0kbiZjg8qfldOYALkGu4QUoyTF M64f2Hg3LYflAPacfVXhMJ0nN01eMTsy2gRKhbBPon93JBBH79oP7PpcmSPBqVjc66hi Dl9ixqmmVZ6ZNo0ge1G6dqjZmQNFjysKR3SAozqbtsQ06vfQEWxMahYeV07ihftCKs+W I8I4xoy0dARvkZNMHqOvjCNNLEUnqcCkyHRjAgTmPocOBMBmG4R9ybsEKOG99MKfTI6V vXiw== 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 z61-v6si1159756plb.155.2018.01.19.14.41.00; Fri, 19 Jan 2018 14:41:18 -0800 (PST) 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 S1756662AbeASWjQ (ORCPT + 99 others); Fri, 19 Jan 2018 17:39:16 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:37775 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756560AbeASWjK (ORCPT ); Fri, 19 Jan 2018 17:39:10 -0500 Received: by mail-oi0-f67.google.com with SMTP id e144so2179758oib.4; Fri, 19 Jan 2018 14:39:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DLG6pVKhnvwoEu7FYGUGDwthCy89NluTQKP3y/Ico/Y=; b=WFpyutelqxg7WgavuZD/zhjoUhTqtielPR4O4G6e+506gKPhd4QeVT4SSITTQzhIS9 Qmu1n2mAAfykaJ/+ny9JtYVG9MicMZttnFOdqwI5L56B2YYDxrHYloI9TzUcrtleJUbO IjGh1B5bOSlSTcT12miprgVxB7K+ODeKyTItHU0nxJR00ovxj8Zo6061HKovOxlBg2DO ap+F4AhL2ojPosUCEFbd1qbyhm2DSQPAGBOQUuyucAtbw9e4NtKhGU0K+XAY221dmBAa vNduPKNbcxyhdT1PE3Jiff5MNfd1nLbUC4Q23rxLddf9FcBZGuv6A1aXPL8IEMgFi8Nx kZKQ== X-Gm-Message-State: AKwxytc9NCTxtps1jE+BLPrOG50HngOUZvqMP4xxg2wH00edP1NknYfC HAGmhqF11df/m61z3BFtLQ== X-Received: by 10.202.179.2 with SMTP id c2mr9727oif.111.1516401549527; Fri, 19 Jan 2018 14:39:09 -0800 (PST) Received: from localhost (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.gmail.com with ESMTPSA id z17sm5195952otj.32.2018.01.19.14.39.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jan 2018 14:39:08 -0800 (PST) Date: Fri, 19 Jan 2018 16:39:08 -0600 From: Rob Herring To: Claudiu Beznea Cc: thierry.reding@gmail.com, mark.rutland@arm.com, linux@armlinux.org.uk, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, corbet@lwn.net, nicolas.ferre@microchip.com, alexandre.belloni@free-electrons.com, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 11/16] pwm: add documentation for PWM modes Message-ID: <20180119223908.b3dxdx53nzuhakzw@rob-hp-laptop> References: <1515766983-15151-1-git-send-email-claudiu.beznea@microchip.com> <1515766983-15151-12-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515766983-15151-12-git-send-email-claudiu.beznea@microchip.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 12, 2018 at 04:22:58PM +0200, Claudiu Beznea wrote: > Add documentation for PWM normal and complementary modes. This and the previous patch can be combined. > > Signed-off-by: Claudiu Beznea > --- > Documentation/devicetree/bindings/pwm/pwm.txt | 17 ++++++++++++++-- > Documentation/pwm.txt | 29 +++++++++++++++++++++++++-- > 2 files changed, 42 insertions(+), 4 deletions(-) > > diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt > index 8556263b8502..fdff25bad1db 100644 > --- a/Documentation/devicetree/bindings/pwm/pwm.txt > +++ b/Documentation/devicetree/bindings/pwm/pwm.txt > @@ -43,8 +43,8 @@ because the name "backlight" would be used as fallback anyway. > pwm-specifier typically encodes the chip-relative PWM number and the PWM > period in nanoseconds. > > -Optionally, the pwm-specifier can encode a number of flags (defined in > -) in a third cell: > +Optionally, the pwm-specifier can encode: > +1. a number of flags (defined in ) in a third cell: Based on the prior patches, "third cell" is probably to restrictive here and it should just say "in a flags cell". > - PWM_POLARITY_INVERTED: invert the PWM signal polarity > > Example with optional PWM specifier for inverse polarity > @@ -54,6 +54,19 @@ Example with optional PWM specifier for inverse polarity > pwm-names = "backlight"; > }; > > +2. PWM working modes (defined in ) in the 4th cell: > +- PWM_MODE_NORMAL: for all PWM controllers > +- PWM_MODE_COMPLEMENTARY: for PWM controllers with more than one output per > +PWM channel > + > +Example with PWM modes: > + > + bl: blacklight { > + pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED > + PWM_DTMODE_NORMAL | PWM_DTMODE_COMPLEMENTARY>; > + pwm-names = "backlight"; > + }; > + > 2) PWM controller nodes > ----------------------- > > diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt > index 8fbf0aa3ba2d..58c9bd55f021 100644 > --- a/Documentation/pwm.txt > +++ b/Documentation/pwm.txt > @@ -61,8 +61,8 @@ In addition to the PWM state, the PWM API also exposes PWM arguments, which > are the reference PWM config one should use on this PWM. > PWM arguments are usually platform-specific and allows the PWM user to only > care about dutycycle relatively to the full period (like, duty = 50% of the > -period). struct pwm_args contains 2 fields (period and polarity) and should > -be used to set the initial PWM config (usually done in the probe function > +period). struct pwm_args contains 3 fields (period, polarity and mode) and > +should be used to set the initial PWM config (usually done in the probe function > of the PWM user). PWM arguments are retrieved with pwm_get_args(). > > Using PWMs with the sysfs interface > @@ -83,6 +83,9 @@ will find: > unexport > Unexports a PWM channel from sysfs (write-only). > > + mode > + PWM chip supported modes. > + > The PWM channels are numbered using a per-chip index from 0 to npwm-1. > > When a PWM channel is exported a pwmX directory will be created in the > @@ -110,6 +113,28 @@ channel that was exported. The following properties will then be available: > - 0 - disabled > - 1 - enabled > > + mode > + Set PWM channel working mode (normal and complementary). PWM chip with > + complementary mode could also work in normal mode by using only one physical > + output. > + > + Normal mode - for PWM chips with one output per PWM channel; output > + waveforms looks like this: > + __ __ __ __ > + PWM __| |__| |__| |__| |__ > + <--T--> > + > + Complementary mode - for PWM chips with more than one output per PWM > + channel; output waveforms for a PWM controller with 2 outputs per PWM > + channel looks line this: > + __ __ __ __ > + PWMH1 __| |__| |__| |__| |__ > + __ __ __ __ __ > + PWML1 |__| |__| |__| |__| > + <--T--> > + > + Where T is the signal period. > + > Implementing a PWM driver > ------------------------- > > -- > 2.7.4 >