Received: by 10.223.176.46 with SMTP id f43csp2652332wra; Mon, 22 Jan 2018 00:56:53 -0800 (PST) X-Google-Smtp-Source: AH8x227Wn5PjRhUblmCab6hBQTVmy+ZkHtqzysjEA91UPSF7L9xia6xdPuGjB1iCRpCoK/DV2U2d X-Received: by 10.98.213.130 with SMTP id d124mr7843043pfg.112.1516611413526; Mon, 22 Jan 2018 00:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516611413; cv=none; d=google.com; s=arc-20160816; b=Czb3UH9sHF7S5eeSVEUDE0okStq7iFFVPIkLzcL1NRPwWvjdZEC2G4x3dniXj2VOQl CWPa5djkJTOTemmwt4Tk2wt8vWTJm0xKivUHD9VQel7XTomtflOlCn3kqR+JII61sGxq rZDHkJ2ddgJw8spGeNwvgCX+cB3y2dIbU1hYhyUbS1EFLce1rcVavsaE6hTf8ZkQduUc /UTdpcHavqlM/IvIbcnawgq0bEZcIfH66DIXNNDgnxu0HUbKZZqFuQLxkl4AAg6yQXg3 VnmcqksWnbIUTuzFAVUlkViwSXoXkZUzMfhHiHJ3WK027d2qBOH/EN6D47Is+Kbyf0hU syog== 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:from:references:cc:to:subject:arc-authentication-results; bh=3Sqj1PCpSlOE0nXFJBYOhftk2f3vh+B2Yq2wkYBN+Qc=; b=Ai1nNDz+og7N8KPFYD6w7y7DT6SPg60LKS3YRaSzSEDrzkMp+AGV+HpFuA+oYszBur hnX5vNfbencgry7NJ/ItxPsIAMSu60VnQQ/Q3BXJvewax/MNeAIH/3PNAuunu6lvdGO+ /Bx1/xsJUQwc/FibEk3256lUOeecON02RX4Rw2WVuBbho7CuIorD/O6pDbp3MUBdPcrm NFxrw7qcOnnTNs5taWbThyojeKxXCsX56UDrybIuRWq81cOsQ3UU/7Rs3deG0SgKEKf6 lCtvWTpLIl9QAla0M+2YJkU0uBS87akxC8jP5JCGZXz/H92l3uIQ5pz6IzhJoPNHcora 99Rw== 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 l90si6609550pfb.248.2018.01.22.00.56.39; Mon, 22 Jan 2018 00:56:53 -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 S1752082AbeAVIzx (ORCPT + 99 others); Mon, 22 Jan 2018 03:55:53 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:22374 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbeAVIzt (ORCPT ); Mon, 22 Jan 2018 03:55:49 -0500 X-IronPort-AV: E=Sophos;i="5.46,395,1511852400"; d="scan'208";a="10431125" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jan 2018 01:55:48 -0700 Received: from [10.145.6.87] (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Mon, 22 Jan 2018 01:55:47 -0700 Subject: Re: [PATCH v2 11/16] pwm: add documentation for PWM modes To: Rob Herring CC: , , , , , , , , , , , , , , , References: <1515766983-15151-1-git-send-email-claudiu.beznea@microchip.com> <1515766983-15151-12-git-send-email-claudiu.beznea@microchip.com> <20180119223908.b3dxdx53nzuhakzw@rob-hp-laptop> From: Claudiu Beznea Message-ID: <158fe004-1202-c27e-1b4b-f87f9d198cf3@microchip.com> Date: Mon, 22 Jan 2018 10:55:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180119223908.b3dxdx53nzuhakzw@rob-hp-laptop> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.01.2018 00:39, Rob Herring wrote: > 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. OK > >> >> 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". OK Thank you, Claudiu Beznea > >> - 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 >> >