Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4922863imu; Sun, 25 Nov 2018 12:57:25 -0800 (PST) X-Google-Smtp-Source: AJdET5eph/7IbezheNJJWooICKJBPN7MfAz2T7Td22henOnGqfk/0CeNYnIc2bDIIf/DxcjB5byy X-Received: by 2002:a62:5504:: with SMTP id j4-v6mr25010157pfb.166.1543179445726; Sun, 25 Nov 2018 12:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543179445; cv=none; d=google.com; s=arc-20160816; b=HAtUjQ0BxbbKvEePx6FehtHAJLTuyN5JlylD+WAVYxgUU/71Zk6ENreeNvzYHcgetS QECR27oX8WKjscbIEuZrdBNAkm9x+REiPNucSIhz2rEnJOR3CXe2FAIJfcOlRokGFSVw ti7cGlnbubk/UHXRHX+rZvqHzi9egvfkQQ/MdY5nZ+lLb10jSfCZ3oMIsq1q4R1EH6Sk x1HIYh3UHJUz0KrhmvX7idKfsWD1yaTZUivA2y4cPMjoUa83Z4MmTQGyGy52UcUhqSDW aEPhjynysCLRVDZtaTTJSJt/lfZXX6o8Pt1YRdfHn3Nr+2FN5OMyFZHzt0uqTKocTkb3 w0Wg== 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=5cEbEdueKdv+/HQQwmLfQ5f/+McRWJ2u5YYzyvvJ9i0=; b=q09IcllK9Xas/hNQxxfEmJOHWqLFDMi0wdUKFNKC5T9c7D8yMFTTvdVXXsgnfgPLQM 3MDOC9TR/7pe99DA1KB+dMj65YQHOIfSycQowy1xCu9gdky/lvyAKuNNgKAqo9SXduX8 RjxD8HXR6aurYrUNToUwaCooGxCf1MOz4E0BDI1bK6nDZIEWA58Ish51nBAluwmH05sz kK84iE+NNFCvWVfwJPIxGlGFRcJWIV15hWzNOHHsN3TbmwEhMypFMkIOrsTXsJOROWsr z9bHLKtJ8/bySQKR71ohLkrBw82feOl+1M5Hqvvv2EQlU7h+fNK2re3wbl56BjRrt0ju yMtQ== 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 d17si58610615pgl.484.2018.11.25.12.57.11; Sun, 25 Nov 2018 12:57:25 -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 S1726142AbeKZHsT (ORCPT + 99 others); Mon, 26 Nov 2018 02:48:19 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52453 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726021AbeKZHsS (ORCPT ); Mon, 26 Nov 2018 02:48:18 -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 1gR1Ru-00006N-V4; Sun, 25 Nov 2018 21:56:14 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gR1Rs-0001eq-MU; Sun, 25 Nov 2018 21:56:12 +0100 Date: Sun, 25 Nov 2018 21:56:12 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: =?utf-8?B?Vm9rw6HEjQ==?= Michal Cc: Lothar =?iso-8859-1?Q?Wa=DFmann?= , Thierry Reding , Mark Rutland , "devicetree@vger.kernel.org" , "linux-pwm@vger.kernel.org" , Lukasz Majewski , "linux-kernel@vger.kernel.org" , Rob Herring , "kernel@pengutronix.de" , Fabio Estevam , Linus Walleij , viresh kumar Subject: Re: [RCF PATCH,v2,2/2] pwm: imx: Configure output to GPIO in disabled state Message-ID: <20181125205612.aownvgjnpxhqyxed@pengutronix.de> References: <20181114215120.vddykljqyavm64wj@pengutronix.de> <20181115152545.GA8611@ulmo> <20181115203733.qvonika6yhn2bsnb@pengutronix.de> <20181116083430.7f1d8452@ipc1.ka-ro> <20181116082557.l2ljgu3hsu7tvdci@pengutronix.de> <91640f9b-d219-553e-043a-c6151f2f68d7@ysoft.com> <20181122162359.ufngpgxkenlmgqni@pengutronix.de> <20181122190321.ktqegs7kpvhcemvi@pengutronix.de> <9da8c6d9-d97c-200c-d8e4-2eb9f73eedc5@ysoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9da8c6d9-d97c-200c-d8e4-2eb9f73eedc5@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 Michal, On Fri, Nov 23, 2018 at 03:15:11PM +0000, Vokáč Michal wrote: > On 22.11.2018 20:03, Uwe Kleine-König wrote: > > On Thu, Nov 22, 2018 at 04:46:39PM +0000, Vokáč Michal wrote: > >> On 22.11.2018 17:23, Uwe Kleine-König wrote: > >>> So I'd expect this to really work on i.MX6 but not the earlier SoCs > >>> without a gpio specifier. > >> > >> Maybe you would expect it to work but I already tested and measured > >> that weeks ago ;) It did not work. > > > > Which pin/gpio do we talk about? Which i.MX6 variant did you test this > > on? (Assuming i.MX6D or i.MX6Q and PAD_DISP0_DATA09, did you try setting > > > > IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA09 (0x020E0194) = 0x00000005 > > IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA09 (0x020E04A8) = 0x0000b080 > > > > and then play with GPIO 4.30 direction and output value?) > > My test setup is as follows: > - SoC is i.MX6DL or i.MX6S - I have three board variants in total. > - Pin used for PWM/GPIO is PAD_GPIO9. > - The pin is not connected to any circuit. Just a test point. > - pinctrl setup in DT: > - for "pwm": > - fsl,pins = > - IOMUXC_SW_MUX_CTL_PAD_GPIO09 = 0x00000004 > - IOMUXC_SW_PAD_CTL_PAD_GPIO09 = 0x00000008 > > - for "gpio": > - fsl,pins = > - IOMUXC_SW_MUX_CTL_PAD_GPIO09 = 0x00000005 > - IOMUXC_SW_PAD_CTL_PAD_GPIO09 = 0x0000b000 FTR: I suggested 0x0000b080 here, but 0x0000b000 is just fine. > Test scenario: > > - In bootloader configure the pin as GPIO output, set it LOW (0V). > I set it LOW to start in the oposite state than I want to end up in. > - Boot Linux > - Use sysfs to configure the PWM to produce some signal. > - In the PWM driver select the "pwm" pinctrl state. > - Measure the output - expected waveform on the scope. > - Use sysfs to stop the PWM "echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable° > - In the PWM driver select the "gpio" pinctrl state. > - Then in the PWM driver: > > a) non-working variant > - Do not request the GPIO - so do not touch its pad control reg. > It is set as output from the bootloader, data register = 0. > - Measure voltage on the output > - against GND = 0V > - against VCC = 0V > - Measure resistance against VCC: Hi-Z > > The pin is in Hi-Z mode. That is fine but that does not satisfy any > logic level. > > b) working variant > - Request the GPIO, configure it as input. > - Measure voltage on the output > - against GND = VCC (3.3V) > - against VCC = 0V > - Measure resistance against VCC = 91.1kOhm > > The pull-up is active. Thanks for your detailed test. So DSE = 0 doesn't work as I (and I think Lothar) expected. @Lothar: if Michal did something different than you expected, please tell us with a few more details. > I can repeat the results on both i.MX6DL and i.MX6S on pwm1 and pwm4. > All pull-up and pull-down combinations gave me the expected results > only if the pin is configured as input. So if I repeat the test and > do not touch the pin in bootloader at all, it works as well even if > I do not request/configure the GPIO in the PWM driver. OK. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |