From patchwork Wed Jun 15 11:50:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12882242 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 A2164C43334 for ; Wed, 15 Jun 2022 11:59:38 +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=pYk+wptUywbz9zfg4Br6GPIcSXM1ZcGAzb+YWzIskls=; b=E5JpDk+fa5CHHZ Q4WSwV/Lc/RFkA4amWkPdYVksjmaqI0gavXzS43jSpMd9841cd9g0jFlxDkVNTkznIuKJlTTWyxG+ qOgLGMFtZcLNAchVGanSjgI0+6sqLflRb8Iak5SJjlvaZFJfIXzFEPUXSVNaKJDBG0oRPp/3Q3xnd ncDedgD//i4b3k5w3P76RXiK5TEEv5dBdG0b2cI60tP1NPtgBHQWoi6LG1x9Xcs2lFFy8zswShzqw YsNk6NFHdcPSZZ2WTmxQVMuajd1Zw3Ghfypzgml3BRmQLlMetj20ALayrrJZ4aZJ628GWyh6dlIOq qa1zPhT5fbozCafGxgsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1RfB-00EKME-12; Wed, 15 Jun 2022 11:58:21 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1RY9-00EGsn-Dr for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 11:51:07 +0000 Received: by mail-ej1-x635.google.com with SMTP id bg6so22833360ejb.0 for ; Wed, 15 Jun 2022 04:51:04 -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=zSTuZ2t7hCCrfuAfUAIkWHaObpQDE2fE3zF2HruldLs=; b=ln5FWn0385Z1emtIsEMSvzyPVQj600V8Xddp7sktlEE2o0X5IHEEJe+zZcziBxAeaI L079l5X5V8ABLgSAXShBMGIzRZTiZuo00hC+3agDHrNUITGdlo9DCBHbiLswo4IbNTTo W5pYechsn0C/VJHhuN1tsacXFrakv968FofRMYMl5lCkTHroC7wUi44O16uwCWLLmaTn 8++7kO4iu2SIgSwXgFhY8SrbLKho9wIEVsAnW+hUZ8UqPYOTfZDbW6tbIN0Afn5zatrL ioD5wWGvfonA3lLir+iFYUffgxw0LnsctVE634zARgMy4K+YjY4iWUQ3CV+OcIdy6A8j vsBQ== 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=zSTuZ2t7hCCrfuAfUAIkWHaObpQDE2fE3zF2HruldLs=; b=ptTG4JWzws78qbWB3gjLM5/0hm2fK5BSONoZihmm5CVW0ZahsSHeWlPPzWX3iK/rDy IbR3FQYsMsEADucyKSHRx+xRsCa8edDQEW14OpC4DCgtUItpABW1PMC7k897jJ01YmMW F8M54vAc+yaCsCVUw0dfwZKsKW66kF687K4IHXccnKPfroofuxu3wARIp4UTn2y7S2fv HVqw776qXvucoMwGQljiZ2HaGh6EFHS9FKFSbQakchg+m9GE9FextcwGmnvPmV+MSHda hfrODFUvnDZqYaUACTJ/88vosahR0kJsZH2eI6b+ueyn4468ThubTSfBoHSJHnRjO5kc r3Sw== X-Gm-Message-State: AOAM530AWaq6Or1weNxSwr0D7t7Sx0QB1YV1XkB3oYY9XRLXcPJ8jyab u3eIMdOuj7zXVxQOvCuMl+Y= X-Google-Smtp-Source: ABdhPJw7wppeArZ3rP5GRFzy41nguU3d/FX10LZVO5qLp4RlXIHWhjbGmzhHxVTVml/slX4PPyi8nA== X-Received: by 2002:a17:907:3e82:b0:6ff:1e04:a365 with SMTP id hs2-20020a1709073e8200b006ff1e04a365mr8581673ejc.617.1655293863270; Wed, 15 Jun 2022 04:51:03 -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 t6-20020a17090616c600b00715a02874acsm4561158ejd.35.2022.06.15.04.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 04:51:02 -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 v2 16/18] ARM: dts: imx6q-apalis: backlight pwm: Simplify inverted backlight Date: Wed, 15 Jun 2022 13:50:04 +0200 Message-Id: <20220615115006.45672-17-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220615115006.45672-1-max.oss.09@gmail.com> References: <20220615115006.45672-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-20220615_045105_519225_4064B285 X-CRM114-Status: GOOD ( 15.52 ) 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 --- (no changes since v1) 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 4ff46ffd2300..c134e71f2a09 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"; }; @@ -776,7 +777,6 @@ }; &pwm4 { - #pwm-cells = <2>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm4>; status = "disabled";