Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1815797imm; Thu, 23 Aug 2018 09:11:18 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwVhNA8eeG2NJ+AWUfC35zwRYPicb0tyGoCuetQ/kUujXnQ44ujcN87BrW1AHZhotovfvuZ X-Received: by 2002:a17:902:2e83:: with SMTP id r3-v6mr59209199plb.80.1535040678799; Thu, 23 Aug 2018 09:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535040678; cv=none; d=google.com; s=arc-20160816; b=k1Bm4xoPCG3Io3+jnxObNGR+OhRnsmPMaTls2dOks4AuCxZ4N7CRFxkwlOeWvOvOCW MKdIdAxcJMwZNLnDIi28AQDLNhDgX331IEFwFDy4CeuqYMx/r/YP5sorxHJipX6y7p5s gQlbxHcv/Rn4OpEErCel1cl8K4gEOHWMSy0wE68gKNGZIgjYRWX/UewOV3IEnA89rAI2 2W4lKM7MlUCuPiXIi4RFm4t6/5PjmDuFLnibS/z+7bEKn8FOUw/1Uo//pThBa78cJeiG jDHKtlrePd4T9z+fpSq20mXR8HHmkfSpQUWQCpOJ2tLBO5zpYY4ybWlZ5NMKyRIQfZpO jK2w== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=80L5gidsZPQwp6pEl77N8lT130oVOvMnSLjxHbf62zo=; b=XiMi9beMIWQiUEVk6AzDKMKFgaS/kTJKS4cOiAzev8cRfKCcF1ZqMWY665929gXdoi JeRnY4r+lL84itKptgjJDREuGLRP/l5fS3bV60ghWkMMnEmbn7Z8QFzofeu9xFZv3J90 XHeM8bhw6+TMr0hQ38pIUKnVsxlaofmeCeJnppuaHMTRkdZt/BGoeuk1HkMlxwgkDhI4 VAvMUvZbzrnDAeY2JgEQhJqTEes7OwM6pE7NyOShmj9DhbTxnQ7mtwP2b9zUSRAij9Kv gAMfJDGsIRmb95j6FDl+guRJ8t2L7dRx8bM7mmFivDWMBr6N9Wn0qaSnnBww867e443c vIGw== 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 69-v6si4493642plc.388.2018.08.23.09.11.02; Thu, 23 Aug 2018 09:11:18 -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 S1731395AbeHWOrh convert rfc822-to-8bit (ORCPT + 99 others); Thu, 23 Aug 2018 10:47:37 -0400 Received: from smtprelay06.ispgateway.de ([80.67.31.101]:33384 "EHLO smtprelay06.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727620AbeHWOrg (ORCPT ); Thu, 23 Aug 2018 10:47:36 -0400 Received: from [89.1.81.74] (helo=ipc1.ka-ro) by smtprelay06.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fsnd4-0001Di-0p; Thu, 23 Aug 2018 13:18:18 +0200 Date: Thu, 23 Aug 2018 13:18:16 +0200 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Michal =?UTF-8?B?Vm9rw6HEjQ==?= 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 Subject: Re: [RFC PATCH 1/2] dt-bindings: pwm: imx: Allow switching PWM output between PWM and GPIO Message-ID: <20180823131816.741c09cc@ipc1.ka-ro> In-Reply-To: <5b13d21c-f83f-49b0-eedd-9a4995dbd469@ysoft.com> References: <1534862333-27950-1-git-send-email-michal.vokac@ysoft.com> <1534862333-27950-2-git-send-email-michal.vokac@ysoft.com> <20180822081436.13d8f55b@ipc1.ka-ro> <175003bc-eae7-1b30-ebfe-b56ffc58705e@ysoft.com> <20180822131758.162d5351@ipc1.ka-ro> <18b4a847-bc59-4450-331a-0b17f27c97a8@ysoft.com> <20180822161036.4d69bdc1@ipc1.ka-ro> <5b13d21c-f83f-49b0-eedd-9a4995dbd469@ysoft.com> Organization: Ka-Ro electronics GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Df-Sender: bHdAa2Fyby1lbGVjdHJvbmljcy5kZQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Vokáč wrote: > On 22.8.2018 16:10, Lothar Waßmann wrote: > > My use case is attaching different displays to the same baseboard, > > where some displays have the brightness control pin inverted with > > respect to the others. It's easy to change the compatible string for > > the simple-panel driver and the PWM polarity setting for the > > pwm-backlight driver from U-Boot according to the display model, but > > it's not so easy, to edit the pinctrl settings from pull-up to > > pull-down or vice versa. > > OK, I got it. Though that is something different than having two clients, > right? > > You do not actually need to change the pinctrl pull-up/down configuration > in bootloader. You define the two pinctrl groups as I suggested in the > example. Or more precisely, you add a new pinctrl group where the PWM > output pad is configured as a GPIO with pull-up. You add this group to > all your common device trees. This does no harm as the group is not used > yet. > > In bootloader you detect the type of the panel. Normal PWM polarity? OK, > do nothing and boot. Inverted PWM polarity? Set the pinctrl-names property > to "default", "pwm". Set the pinctrl-0 property to point to the GPIO group > and set pinctrl-1 property to point to the old PWM group. > > E.g. something like: > > => fdt set /soc/aips-bus@2000000/pwm@2080000 pinctrl-names default pwm > => fdt get value gpio-phandle /soc/aips-bus@2000000/iomuxc@20e0000/pwm1grp-gpio phandle > => fdt get value pwm-phandle /soc/aips-bus@2000000/iomuxc@20e0000/pwm1grp-pwm phandle > => fdt set /soc/aips-bus@2000000/pwm@2080000 pinctrl-0 ${gpio-phandle} > => fdt set /soc/aips-bus@2000000/pwm@2080000 pinctrl-1 ${pwm-phandle} > > Will this work for you? > This would probably work, but it's quite ugly. I'd still prefer to set the pin output state to the desired level rather than relying on the chip internal pullup/pulldown facility. Lothar Waßmann -- ___________________________________________________________ Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Geschäftsführer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996 www.karo-electronics.de | info@karo-electronics.de ___________________________________________________________