Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp998490iob; Fri, 13 May 2022 19:06:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznfjshZSAJLah6ByJEWuIOrtW4SyIDLwoebf0II3mOD8id5FzrcwhMBseBdgXDr8CnW6FG X-Received: by 2002:a05:600c:1da5:b0:395:baf7:ca4c with SMTP id p37-20020a05600c1da500b00395baf7ca4cmr6960990wms.99.1652494004821; Fri, 13 May 2022 19:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652494004; cv=none; d=google.com; s=arc-20160816; b=Oembej5dItZBHlCAjYMuQNijlI7qO/4v2R7CYpk+wrXeFUANV1UPGoPN4kcVG7eO4r b2gWhsXjadrhtt3n7jgKmYtQ1eW5YrZWidCdGyhsxyWKIPm0O6decyIami1uzaDFw6Uk 4NeFWV7tdkigCVKEYbb3nZmGb1WaHqy36TBHWmSaiVDvyUuvX9Endzw0qy2l4QLgUs/W KLRSK43UWiF7ugKbWq8mVq+yXQRZ8zlGSpu6t8qW8eDH/Nteyvaxmt41eLlP7KPHTBfK n+dJ+Mx7A+9+RBcsYnJ9yx8TzoWZxN4pBA0NypyhH1m2ePMtmkM2LPMsfel4pFzrpcmj 71gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Wjttoh5pJ3Cm9OJ+7lfSQscXOm+8KL2ATcs8KqsT+HA=; b=Vht1K5GhRcE/NhCkeAvxA6PczuL54qj6AfMidatJSXPgtLSkYVFboNoT1z8BxISadi imj/eNSrAdLGKc4O2RDRHP6W+ktNv0XMHlEmrpQTfVfHlBhMagimxHZ/d5cy4HZb43m8 U4lvQHZnlisdyyEb7zUzPkjX7en8cQ9riI2gUcr1G9CWr2lSwZ4Oy6S3zEz5j6BuzYqz TE0BOElOt7SQnI3sug2SzMP1u5gSt43bUaVNsjPLqG/mrqT4X3VsLmuHcApcdAnKnjyS QZ1tBumcMfjjkXWwRuAqIeA8MTcM5Wdvf2uFIbX3jWrSSH1wn72a7p3YC3qfnvxgxC5T zg9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=msYuy6T0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u11-20020a5d6acb000000b0020c74e10ff6si3259067wrw.606.2022.05.13.19.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=msYuy6T0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A3ED489C37; Fri, 13 May 2022 17:27:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379521AbiEMK1k (ORCPT + 99 others); Fri, 13 May 2022 06:27:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379209AbiEMK1J (ORCPT ); Fri, 13 May 2022 06:27:09 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10D3C50451; Fri, 13 May 2022 03:27:08 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id g23so9359186edy.13; 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=pt/7YjG4HE8Xo2SJHBTfufzlasUEGwpqrnK8B/XDQ+f4J/8ZA+HezYSOxRJj5xyb5M ttc9xygCE41TAc5qo8WD5yTdMUZqqQxt4kCYWgJGpSvRi4Sr/t3KMRNvWs7qNcmoe3ML ZyX0E23y9vs84F7pWKMem8jJySzuatu8ctPnR2MaXD9NWnThV1e52wsBAEM9jeuJddn9 Fn7822SV/bzbb/ypvcHQ8k7flhpMrovgbREUHrmzv5jtAhZKjle5dyh0ZN69W6SLVtXt 6Jy9hIzRky4f4YEtM1pkYZ/ME+aSHYNmJ9Ch255/7lRJ0DNJuwZq6thRRURoM4Z8QyQF AkNA== X-Gm-Message-State: AOAM530WFBzAA+i3mI124YdjXZ2eNxVn6eUe4JWBdIHCIJKlybBj7FPC aSExWOnc/6ZnS+Rsbp1Ysnk= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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"; -- 2.20.1