Received: by 10.192.165.148 with SMTP id m20csp4308511imm; Tue, 8 May 2018 06:31:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpZ15dfgF9e1VplZAaJUNBPetRhgaELRL/EvR0r3epTrzBjV6qVDl0zBLnz0tkk29EP8G/Z X-Received: by 2002:a17:902:bc88:: with SMTP id bb8-v6mr30828685plb.175.1525786270282; Tue, 08 May 2018 06:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525786270; cv=none; d=google.com; s=arc-20160816; b=HfHVFeeSmCnE84GL82YXxx1vKiIEsJpYpbkWJIA9MhXNajR15T22xg50fXiNikCQmX zXmcPiJpWwR2EueB6GV2aTxCRm+gCnUtbkJyQYkWKyQYuOmaRISImaMU9GYIpBZyPfcR XGEv66LeI7UfCrr0XrXkCNVOvFaQ/aEK32syMV+DIDb3FWPAH9Ave61GLgGA+Thf0cDp 35vWbx+7+EpIanEW8/DQqc+Y7sidiLKrrP/Kz9AbE6ZBGvimoGzdZEGaVb5nM1mi54a4 TmxMrBREBtA3IWw4ngNJTUBMsL8AZOY8nz/9v+NeO+PwjPtq4mP1eg0Tub863fOMNn2Z HOdw== 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 :arc-authentication-results; bh=cSISD+kN+RagMbwzDL2AtBwWFyflxTL2OIB/xaCQnHQ=; b=hN78QcaBWqABMt5WxCw4vHabkZr2njIOiiufAKg4Cvpmui6DP504u6RmhKFpMZRg4/ Bc4qyMhtUssMzw7fnhuSy5oCNYdOay625T0ZQSZiN163eI+3iWQAK9xonuYt0XjOQEpr zdRfFvCKr6FqgXD3bnFDer3bjCbHNnYeNEEJ+XfyJ+bInRVC42sfmJOvVOQTcU42Ev+u vJUZHfSe2Y5yN93HxEus4aBycvgX300l6gRy5KSe6t/Qoq12QHZR4y+6RKNJnWXH3/jG Ru1LUb5s2VYIcgH0DCM81XKN5UxOIhdFaofD3CwaTxH9Yqi3jXAxaEwFblpLg46XN8yD 0JTQ== 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 f9-v6si10611257pgp.195.2018.05.08.06.30.55; Tue, 08 May 2018 06:31:10 -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 S932304AbeEHN3E convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 May 2018 09:29:04 -0400 Received: from mail.bootlin.com ([62.4.15.54]:53844 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753368AbeEHN3C (ORCPT ); Tue, 8 May 2018 09:29:02 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 8E907207CC; Tue, 8 May 2018 15:29:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LFbn-TOU-1-203-147.w86-201.abo.wanadoo.fr [86.201.50.147]) by mail.bootlin.com (Postfix) with ESMTPSA id 5C3D3200FB; Tue, 8 May 2018 15:28:50 +0200 (CEST) Date: Tue, 8 May 2018 15:28:51 +0200 From: Maxime Ripard To: Paul Kocialkowski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Rob Herring , Mark Rutland , Chen-Yu Tsai , Thierry Reding , devicetree@vger.kernel.org Subject: Re: [PATCH v3 3/3] ARM: dts: sun7i: Add support for the Ainol AW1 tablet Message-ID: <20180508132851.cvthykob5mw6v6yy@flea> References: <20180506214901.23429-1-contact@paulk.fr> <20180506214901.23429-3-contact@paulk.fr> <20180507071931.tebv45yxrojxxkeb@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 07, 2018 at 10:15:46PM +0200, Paul Kocialkowski wrote: > > > + backlight: backlight { > > > + compatible = "pwm-backlight"; > > > + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; > > > + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; > > > > The increase in perceived brightness should be linear. Usually, for > > PWMs backed backlight, an exponential list is a much better > > approximation. > > Thanks for the hint, it never occurred to me that pwm duty cycle was not > linear with brightness, but that makes sense. I'll give that a try (on > 255 values instead of 10 to keep some level of precision in low > brightness). The way to go here is probably use a base-255 logarithm > such as: duty cycle = range * log(i+1)/log(255) with i the linear > brightness value (0 to 255) and range the amplitude of our values (that > gets divided by the maximum brightness, so it's really up to hardware > precision at this point). I'll go with a range of 255 as well. Without going into something so complicated, usually a list with power of two ending at 255 is a good approximation :) > > > +&mmc0 { > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&mmc0_pins_a>; > > > + vmmc-supply = <®_vcc3v3>; > > > > You have the regulators described in your DT, you'd better use them > > instead of the one coming from sunxi-common-regulators.dtsi. > > Well, according to the reference A20 design, the mmc pins and the card > are powered by the 3.3V power rail, that comes from a regular step-down > regulator sourcing from IPSOUT, so I don't see what regulator I should > better use. Do you have a suggestion? That works for me then. > > > +&pio { > > > + panel_power_pin: panel_power_pin@0 { > > > + pins = "PH8"; > > > + function = "gpio_out"; > > > + }; > > > +}; > > > > You don't need that pinctrl node. > > I'll get rid of it then. You mentioned that regulator-simple uses the > old GPIO API, so I assumed it meant that a pinctrl node is still needed. > For reference, it uses of_get_named_gpio (not the devm-managed fashion). This is only relevant for the polarity of the pins, not the pinctrl part. Maxime -- Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com