Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp604125imu; Thu, 13 Dec 2018 00:58:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/XkYc6A7Gg1hsAJzALI3FO7SCsdEqJjEqRu7N4/EBGqssz6hVbMimjbs/2J2rjLaeTA9KyE X-Received: by 2002:a63:40c6:: with SMTP id n189mr20744142pga.355.1544691529773; Thu, 13 Dec 2018 00:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544691529; cv=none; d=google.com; s=arc-20160816; b=S+WlpDJlJMGScsD7u89Acmn3XGVRG/GxEVWcs4XvXFf0Ok9ySyTpxVVCng2OsyeHFi Gv7L/fI6eHikJeYrw+MzmboOrzzYLlUGZENk0zG/mJrI/Qf1DMD5ObUs0jPJAawpfPlh AvHRQOJn9ACTZNz4psdmyh8Q7/qc2RPQ2+L49xPEt5pIkoe78qQj+zo0Jc+TfUE3qM9r Cn0U79cmQBkvz6oztwVMlJwErFqWXWen/w3iJGfXM+BAtEiFZtn3PWhO19g+NfJKnvkI 5iLy1wVAe89hnScqawb8kAW7aZ7IHTp8cTXa5+GcTSAMkg/HtNhpBJuMyEN07aFgWpuj U06Q== 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=0jptdBxbTYlsiS8TMKIAELp+cHAVEAqG7KauR5IXJp8=; b=iVNeVKIutek2F3J89ofgNAE94zOUYcES0sm0iIKEqRatrYCs7T5wyC3v9XG+ozmeUp zZ/iXb30qqfEFJu63L65PrstCiIFJsRtXQTpamfz0QfhsPjx6Xw3UEriKBHbfWRik74+ XLvhTr1qyWHGYYeQy2laSjA8ICzr/1zWnM1UC08+Vpg2KbQrW7hvwet6/eyDBO5Bn5jK rcRzKQTnIobXRWj5xhzfpPbD3vTYz1TfeNLzAU18MtJI5IHE1Oa+k4XRSrZSabaO+Piy +2f2iBMEs4b/N/Y3PgJogPMFexsL8zMzo2vUjDEtFfuqaHdJY4JLROqRYSAJldY9S8q3 dwpg== 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 q8si1154665pli.284.2018.12.13.00.58.35; Thu, 13 Dec 2018 00:58:49 -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 S1727480AbeLMI4N (ORCPT + 99 others); Thu, 13 Dec 2018 03:56:13 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:44181 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727075AbeLMI4M (ORCPT ); Thu, 13 Dec 2018 03:56:12 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gXMmt-0002Zj-9Y; Thu, 13 Dec 2018 09:56:07 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gXMmr-0003k6-DH; Thu, 13 Dec 2018 09:56:05 +0100 Date: Thu, 13 Dec 2018 09:56:05 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: =?utf-8?B?Vm9rw6HEjQ==?= Michal Cc: Thierry Reding , Rob Herring , Mark Rutland , "devicetree@vger.kernel.org" , "linux-pwm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Lukasz Majewski , Fabio Estevam , Lothar =?iso-8859-1?Q?Wa=DFmann?= , Linus Walleij Subject: Re: [RFC PATCH v4 2/2] pwm: imx: Configure output to GPIO in disabled state Message-ID: <20181213085605.j2e76y67srg5qfbc@pengutronix.de> References: <1544616263-82642-1-git-send-email-michal.vokac@ysoft.com> <1544616263-82642-3-git-send-email-michal.vokac@ysoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1544616263-82642-3-git-send-email-michal.vokac@ysoft.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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, On Wed, Dec 12, 2018 at 12:04:51PM +0000, Vokáč Michal wrote: > Normally the PWM output is held LOW when PWM is disabled. This can cause > problems when inverted PWM signal polarity is needed. With this behavior > the connected circuit is fed by 100% duty cycle instead of being shut-off. > > Allow users to define a "pwm" and a "gpio" pinctrl states. The pwm pinctrl > state is selected when PWM is enabled and the gpio pinctrl state is > selected when PWM is disabled. In the gpio state the new pwm-gpios GPIO is > configured as input and the internal pull-up resistor is used to pull the > output level high. > > If all the pinctrl states and the pwm-gpios GPIO are not correctly > specified in DT the PWM work as usual. > > As an example, with this patch a PWM controlled backlight with inversed > signal polarity can be used in full brightness range. Without this patch > the backlight can not be turned off as brightness = 0 disables the PWM > and that in turn set PWM output LOW, that is full brightness. > > Inverted output of the PWM with "default" and with "pwm"+"gpio" pinctrl: > > +--------------+------------+---------------+----------- +-------------+ > | After reset | Bootloader | PWM probe | PWM | PWM | > | 100k pull-up | | | enable 30% | disable | > +--------------+------------+---------------+------------+-------------+ > | pinctrl | none | default | default | default | > | out H __________________ __ __ | > | out L \_________________/ \_/ \_/\____________ | > | ^ ^ ^ | > +--------------+------------+---------------+------------+-------------+ > | pinctrl | none | gpio | pwm | gpio | > | out H __________________________________ __ __ _____________ | > | out L \_/ \_/ \_/ | > | ^ ^ ^ | > +----------------------------------------------------------------------+ Just for the record: My last concern against this patch set (that I sent for v3) and v4 of the series criss-crossed. So the problem with the peaks that could happen is still unaddressed. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |