From patchwork Mon May 16 11:58:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12850691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4028CC433F5 for ; Mon, 16 May 2022 12:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZtugL2wXh57Zr8HO8Y0YU0O2oUPoylMeGhxvBc72Ras=; b=ojjmvN9ODY4SnQ 0NdV4ivks+YMI8mhe8DpuYgAqTaJ2hmwqeIvrs8B9oHrEUdswGRv9+RBBuse+V7OruM9Ib6LRMJL6 wHLTzp89HzCr8FvHsM3d3O6MXISYfbdvtLTpGd64Nc+AnVvXtjwpgpET3lQQJfaURns/NkCErqblI HHiAIlQ2+aPEIh29B1IwJEaXpfj//wHfon2DpMc0XeRxFMg/jbaNSJIaPGZuMJ4TzBuq+KzEjzU5K fhec5VtFr1pUJtqRkje79DCrJB8oB0X467P6ovfSd0GkENU39aRzVDe/BMWoIwy9GgqFLvr576BmJ sI4o4Siy9wiAEK+uUZbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqZS7-007Rv3-Al; Mon, 16 May 2022 12:03:55 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqZO3-007PhL-0y for linux-arm-kernel@lists.infradead.org; Mon, 16 May 2022 11:59:44 +0000 Received: by mail-ej1-x636.google.com with SMTP id l18so28141691ejc.7 for ; Mon, 16 May 2022 04:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HQ+/zAYDYzlIVwhBZOjr+9YmcuxLFRWGYnq8noCNm6Q=; b=Ul2ALb+PwrpKLFgrqQ2ddPMSS6EGneglWSb29zDFP9QO3F6HpYV3GsIJX/TX4FeKaS sh3REtOmRVVysBbyRKetx2mvKsIXfVdAj7wliiqyzPCYjKNE+kI5wQAluPX5QlHNqEkY m5teKtGq2++zpS5nHhe9BuoCXPbXOEyeraV/OdrT3su3IgHf5qG/TzhXiWOrmKpyuisG hFX9vCQx2Ic27oP2qY96k4SKtI92Mp3CHaF1nmJ9u1/Ml+wRe0Dwp1qFj6CA4ET+gbG1 U/UjXG3quk5naFPEEDv/8bTVNrnEgc7ra7Q4y7iMoRfHsScr+UCuszL82TontIj8x74f 8DqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HQ+/zAYDYzlIVwhBZOjr+9YmcuxLFRWGYnq8noCNm6Q=; b=qM2zvd3aN/bmPykEpcCHRmD48GlDAI+kmewSlvUH5kH6poY3ZihAZO0b8e4mAnCcWd egpPHVIg0IucJ5NgSHs439wEv1viMdiVIFKCxqdIB2kRZ34RBl8qw6kHwz/BijdI5RUn UaruHL2wc4XJU8OmSFlB3n+28f3GYxHvQFCY3oa9lpgB/FYNZKJXNf2KjvWH1tSobNFO Hck3dpI8ve9oP+7huMxvU9P44/bFSEtD6gCl418jZSsdYiSLhw3CwTBOLwE2gvP4NNTF uOR5Xk34WHu7or8eV3yDCe1SQ2Qria8FRW99G8sgu7ZEQih2BiWP80gAtE6NOraCJDbL wuvw== X-Gm-Message-State: AOAM531VEM65TkCPVA9TYGhUpWBI6XV4q6ozvhSoijwY7migawj1vVaw PD8inQgzwbMosuWSXkN3uUDDDwmDkyA= X-Google-Smtp-Source: ABdhPJzGegeYVw0NU99xQNbBARJB4zkYwREXhG0v+IXsvWmsBLwKH/JJ1PRgnOJT6uwK5uUAGF+YGQ== X-Received: by 2002:a17:906:7952:b0:6fe:1e0b:6343 with SMTP id l18-20020a170906795200b006fe1e0b6343mr9096414ejo.337.1652702380993; Mon, 16 May 2022 04:59:40 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id s18-20020a170906779200b006f3ef214dacsm3711008ejm.18.2022.05.16.04.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 04:59:40 -0700 (PDT) From: Max Krummenacher To: max.krummenacher@toradex.com Cc: Fabio Estevam , Krzysztof Kozlowski , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 15/17] ARM: dts: imx6q-apalis: backlight pwm: Simplify inverted backlight Date: Mon, 16 May 2022 13:58:43 +0200 Message-Id: <20220516115846.58328-16-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220516115846.58328-1-max.oss.09@gmail.com> References: <20220516115846.58328-1-max.oss.09@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220516_045943_145985_9F148A2E X-CRM114-Status: GOOD ( 15.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Max Krummenacher Set #pwm-cells to the default 3 to gain access to the parameter which allows inverting the PWM signal. This is useful to specify a backlight which has its highest brightness at 0. With the change to use the PWM with inverted polarity the PWM signal is inverted to how it was before this patch. This changes the meaning of the values in the brightness-levels property. I.e. the duty-cycle changes from x/255 to (255-x)/255. Keeping the brightness-levels will then have a big brightness jump from 0 to 127 duty cycle, the other 6 steps will then be barely noticeable. Change the brightness-levels to provide the same brightness-levels as before. Signed-off-by: Max Krummenacher --- arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi index 57642aefe349..49669caac8b7 100644 --- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi +++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi @@ -6,6 +6,7 @@ */ #include +#include / { model = "Toradex Apalis iMX6Q/D Module"; @@ -19,13 +20,13 @@ backlight: backlight { compatible = "pwm-backlight"; + brightness-levels = <0 4 8 16 32 64 128 255>; + default-brightness-level = <6>; + enable-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpio_bl_on>; - brightness-levels = <0 127 191 223 239 247 251 255>; - default-brightness-level = <1>; - enable-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>; power-supply = <®_module_3v3>; - pwms = <&pwm4 0 5000000>; + pwms = <&pwm4 0 5000000 PWM_POLARITY_INVERTED>; status = "disabled"; }; @@ -761,7 +762,6 @@ }; &pwm4 { - #pwm-cells = <2>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm4>; status = "disabled";