From patchwork Fri May 13 10:26:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12848639 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 2219DC433EF for ; Fri, 13 May 2022 10:28:33 +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=UJNz2ZaZcO8EMpc+uVP3/6dIOmtA870TzRchiJG/Ex0=; b=ekw/u4Hnp7F3gj 0kNTUym84BakBfBdvRzNUyLmvU/jKH7NafZRLjSdFkVTLM3VgW2EVQQJL0EpWv8eCanyAVuy5Xw/6 B+nkSG8AEwK9hVzr3S/dOAfjN4f3xV6MeAiJap+afWEQDKNM00tNltaYU9aA2jkslGwoqrciAGXQG mgoRvTFNAbKsXU62Z+X53+XIZt+NldF9CeG/8YjLN+jwcWTWR/DH6mZdSXTH/WlgggNDED1qHpJsP Zs12UFtKsa5Qe6WUQdg/UQNHoNH2VkY2WCalwlEitVG+4jnijcu+jD9cIa1OxEuXXhMiPXnTrkh8R gLBM1sWxdSrOEDCugPgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1npSWH-00FXi0-1K; Fri, 13 May 2022 10:27:37 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1npSVp-00FXTl-1U for linux-arm-kernel@lists.infradead.org; Fri, 13 May 2022 10:27:10 +0000 Received: by mail-ed1-x533.google.com with SMTP id d6so9438034ede.8 for ; Fri, 13 May 2022 03:27:07 -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=Wjttoh5pJ3Cm9OJ+7lfSQscXOm+8KL2ATcs8KqsT+HA=; b=msYuy6T0lARvYyJaJSawEOZr3dDydhikevW3BwFGVTX5wJ7cpXtdPNtbiRqTbtsGLu 0c6iVa3rEbA0+7p4SulwQ4w7vdifgtpidzsJKqqpc11+zB6GbDtJoxT/1WmQQM0W7uID g17a7NjqvSqJaMxJqN81YsBoiLAOpPibkWMt8EXsjxy5vEDRtxn39Te5jBONTlfaUor5 F8V8IgwwmbvX7rwkOfeyGr0hYUsriTB/7UhB8XxKxlZYbkgbmDjTwD7fGaEviEimyNSa 6RGreK8pnkvJ/hIBS52EuXPIiJjOlkFXuuQ6Cb+DzRpM5vUghLRUSn62bV/cAHz/SPDn NQhg== 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=Wjttoh5pJ3Cm9OJ+7lfSQscXOm+8KL2ATcs8KqsT+HA=; b=HEKchE3ebho9gPob+herHH3oyDs6VIBykrITYXlNY6qCFnXCyKcCywHVHll5EgVb2K loREQu3kDAaAis9bTFZkWh/sxd0W6n0qH2i23hAbElT8l8jgLJB7jSH4bBYHkSJptUML L/cSZs2RPv7EW4/nVUlflDo43B3KOrTwgBlYcTz7o7Lo7N3BKJ6/hP3U/WgUkCr8/Fp/ rkKRNI4CsXSKpf3gTrR8qns17u28KSkU1/5vAUR7DX83KgkTLgxUbaP12QecBvf1+o4t Z2TFfGWNMLH2v03irRKBuE2QlEr31TCWHO60lRmssC0wbDbGBDNl1wPRf9hJfh4l42sG DpoQ== X-Gm-Message-State: AOAM532d8qkiZ0SvirZlYqdpeduQLVYgTZPxyJLUCiS8g2Ok/+y4Qzec Pl9Dy5aSgzjZAvIjdulpcuM= X-Google-Smtp-Source: ABdhPJzfZZQ0iwoUhAxi7llnxPNl7jZQUVkZxsiuUFC6Gmb/knxfHIKdKy0GUvUJ6TNiDR9mDxE3ag== X-Received: by 2002:a05:6402:42c4:b0:426:a7a8:348f with SMTP id i4-20020a05640242c400b00426a7a8348fmr39951718edc.341.1652437626688; Fri, 13 May 2022 03:27:06 -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 3-20020a170906100300b006f3ef214e40sm609677ejm.166.2022.05.13.03.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 03:27:06 -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 v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight Date: Fri, 13 May 2022 12:26:14 +0200 Message-Id: <20220513102616.48040-4-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220513102616.48040-1-max.oss.09@gmail.com> References: <20220513102616.48040-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-20220513_032709_177385_5CC5154C X-CRM114-Status: GOOD ( 16.00 ) 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 Reviewed-by: Fabio Estevam --- Changes in v3: - Add the reason why brightness-levels needs a change to commit comment as proposed by Fabio Estevam Changes in v2: - Split to two patches as proposed by Fabio Estevam arch/arm/boot/dts/imx6qdl-colibri.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi index f0908b530f86..d91fae92c90a 100644 --- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi +++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi @@ -6,6 +6,7 @@ */ #include +#include / { model = "Toradex Colibri iMX6DL/S Module"; @@ -13,13 +14,13 @@ backlight: backlight { compatible = "pwm-backlight"; - brightness-levels = <0 127 191 223 239 247 251 255>; - default-brightness-level = <1>; + brightness-levels = <0 4 8 16 32 64 128 255>; + default-brightness-level = <6>; enable-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* Colibri BL_ON */ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpio_bl_on>; power-supply = <®_module_3v3>; - pwms = <&pwm3 0 5000000>; + pwms = <&pwm3 0 5000000 PWM_POLARITY_INVERTED>; status = "disabled"; }; @@ -620,7 +621,6 @@ /* Colibri PWM */ &pwm3 { - #pwm-cells = <2>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm3>; status = "disabled";