Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3122892iob; Mon, 16 May 2022 13:41:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFjio277CNdqALuXoGZerKDlQNfOLCYhhWFV9BsWy3kwO4PrIpiIuSkCv5MXFklJdThR1r X-Received: by 2002:a17:907:948d:b0:6fa:7f00:ed57 with SMTP id dm13-20020a170907948d00b006fa7f00ed57mr16489553ejc.761.1652733663683; Mon, 16 May 2022 13:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652733663; cv=none; d=google.com; s=arc-20160816; b=WwM/Q4afGjRjqb1tts47nNomvspcjIEmNuFX3BTTu30+mtf3Y4cyWqgEkPfnUY0s/7 ep5rsKs0gKTMWRscMGBhMyfW1wbVIXt1KpMS3dC/pnDJr2Oap1GP91wfMbGjJhI6+fyK GSnJ+QLnAP8JEM7LlsL+d8D0gJrwOkZDLdWcMR46Myz5XaSQ2iFNfub1qQxI9EiRo66M Wf54jNz2XFW8llMlKX3Ch14vvco3t+a9xrYLv0Bdq1+E1MLkRoCQeomnYmEJUCGJgmwL xyb1i4gQnGrFjbAYET77jQGogQmzLCsa7EQmE+621Y0CupMjy7zBCQiCWKUwW+fhL9E1 YmNA== 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=HQ+/zAYDYzlIVwhBZOjr+9YmcuxLFRWGYnq8noCNm6Q=; b=EacPrkyZo1c3ynM0jymMYFCuVC/sXO22V0VTDNQzKvJ7+sxVkZ40w4cejUMJfq6opM WyYvNx3z4B416cuwJ+bO4CWkSMLsKi4U+/orFGXw4yLucn5PNCQVsGpvugPDT1mHLFJ4 sHuBDFAJ1rN37+n7Bgob2dEk0Iobve+Y860+X5ibPAZre5pFm+KPhUaPO/rBFzStIgOu +aQnZyezOjXowMWkICvTPnRdnn6fv1DzQlGD8UXqAE6ok9L+H2snb3dvWqQ45c/26uic uA5TRtWDq63JUX5VzvdqnghSEwfnvm9AMM3sKKOIiUkOGuynZRJqQkyBxyIq1fSgmcJ8 pl9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ul2ALb+P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y25-20020a170906471900b006f39b023480si349092ejq.415.2022.05.16.13.40.37; Mon, 16 May 2022 13:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ul2ALb+P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243629AbiEPMBA (ORCPT + 99 others); Mon, 16 May 2022 08:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243440AbiEPMAO (ORCPT ); Mon, 16 May 2022 08:00:14 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C3971705D; Mon, 16 May 2022 04:59:42 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id ks9so28180673ejb.2; 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=nRy/oh3VdY4yePJ3OpH7vR+wckGKmztLOtClQuBZ0fZwLnfgWjK2Sz+olBOC6HO85F SxcERnn2QOXQFIxvMlSGCsoTKI1kXmGqJfLHxeyYJwa9WySX2E/yWCNtJw3hlqBmia8d iSLfSTPIWrU/yAU5kb/+zWK+PLcbsxx2cOgwdot4fujRMdcLC/k0d1SJBxMrBq5nl7MB 7rzILK52w3MnaturHJzY9fJM9+HoVnx5kW/0SMmj4a+3jMidgouX1g3ShF8zV6a/vVQu orPuGeYVeQwlCAx4H/dcPaAVCAh1BiqboktI5ha9D6GzExv0Lx6mTVVf/rTxtxNIrEn7 5ZUA== X-Gm-Message-State: AOAM532SLWUb86jTr31ovcUlPJb91mpknJCJq9O3DvyP+lvm+SFFktqU FstkclZgQbsyWvoQcv62J/A= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 --- 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"; -- 2.20.1