From patchwork Tue Jul 21 04:25:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru M Stan X-Patchwork-Id: 11674937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B01B138A for ; Tue, 21 Jul 2020 04:27:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63E982176B for ; Tue, 21 Jul 2020 04:27:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rqUDcYQe"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WvDaw8DX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63E982176B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=jt01Gw5A36WYsTTKWClQbhreDOUd5gUOWPMoahsjF/o=; b=rqUDcYQeoBLcr0YQPloa6F6ECX YHqnSf+yicZL9PRm3UeL4Pp1U/knibHoA3eTN6D8tJDcnyR4HF3kb2SG8FCwYuf6//TD20YQfQLPQ Qtvo6pP8UhShabcrW6m4SnwkANDZM8LjqmN21LUlHITxuS8maGBOnRQJKQkODGUe3lt/i3keCg/8M x6Brm9Xt7T3MJ5Z6hBq9EUaFPrzZe7RjHpbUKVu8pxk7X6UCRh4hMCLvs9m8dpfWzFkvvrSkjsWV4 hpvPri3c+jiGyvqxJQLXHdMKf4YTCTGZ4LlkTPk8gx7rEdPiO47SVulw+Rwj4zl5T5To20NpkKsm/ mtciq5/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxjs3-0007NQ-6e; Tue, 21 Jul 2020 04:27:15 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxjrz-0007M4-JB for linux-rockchip@lists.infradead.org; Tue, 21 Jul 2020 04:27:12 +0000 Received: by mail-pg1-x544.google.com with SMTP id z5so11355955pgb.6 for ; Mon, 20 Jul 2020 21:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jIb2rFOZN8gwoOlXTkxPZa6eyeZDpgkSyS7W8wCzIJg=; b=WvDaw8DXxILkRr/NoclGFf0Rt0bm/iie3CNU3ZYfRBxlZ3lZovpsXOcdh3xgFByHih aU4ABPVp2FzRKAoUX9PQtPZU5+8n8XyIuUFBWdNFPjrloSZ1wwtOW85Gx+3KkNcwxMY4 AVxsqdoadhQc1+eyMrH2gYFo6d/D2sDR6TXHQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jIb2rFOZN8gwoOlXTkxPZa6eyeZDpgkSyS7W8wCzIJg=; b=EGXXdW1RVrWSV1OxhqxSQ8SV5mUFEE3dNbvQ5BxqFLM4gAAktmAQ1Vk9Zvlnkix7jT /EPzRyxp2lVOtziVIsnh+qYFTP/VdQKCLnYRb/BEctarxGY50rUVwfYdvqFiKSj1LTJk jT9zgz9AoN4RJL6NvGvoqHH7yb6dsiDxqRVVrML5kSHCFePwOeNHB8gvYRQQlGuhuEJd cU3GRRcTq+UVEuA4AaiR62kg6FMzPdUZtepmckQ/yDnW6UKKOziRy9DKTdZkH5qKEPqM CBPc03qoiVphoTr+APeGmco+skefAqiuuxloc5u9Q1WEMUgiFNJyzQP8lT9KAOUqs1pi agBQ== X-Gm-Message-State: AOAM530VNSaVtH67LonlV8y7RPrYaC21dsu+uwh+WkaAmjws1yDy4g3Z lHByLb0UOKSsJZFV1NFswq/gSKup+3o= X-Google-Smtp-Source: ABdhPJz9Vh2IOS/1uRlQ2nI9iXmkt0IM/J22K0/Kq13gyoo2noXO6h6x9nUFPTbwdyISrFtDedLw5w== X-Received: by 2002:a63:395:: with SMTP id 143mr21310754pgd.57.1595305627807; Mon, 20 Jul 2020 21:27:07 -0700 (PDT) Received: from alex-desktop.lan (c-73-63-253-164.hsd1.ca.comcast.net. [73.63.253.164]) by smtp.gmail.com with ESMTPSA id o8sm1207075pjf.37.2020.07.20.21.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 21:27:06 -0700 (PDT) From: Alexandru Stan To: Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Heiko Stuebner , Rob Herring Subject: [PATCH 0/3] PWM backlight interpolation adjustments Date: Mon, 20 Jul 2020 21:25:19 -0700 Message-Id: <20200721042522.2403410-1-amstan@chromium.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_002711_684960_691C7B90 X-CRM114-Status: GOOD ( 10.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, Alexandru Stan , linux-pwm@vger.kernel.org, Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Kaehlcke , Enric Balletbo i Serra , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org I was trying to adjust the brightness for a new chromebook: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2291209 Like a lot of panels, the low end needs to be cropped, and now that we have the interpolation stuff I wanted to make use of it and bake in even the curve. I found the behavior a little unintuitive and non-linear. See patch 1 for a suggested fix for this. Unfortunatelly a few veyron dts files were relying on this (perhaps weird) behavior. Those devices also want a minimum brightness. The issue is that they also want the 0% point for turning off the display. https://github.com/torvalds/linux/commit/6233269bce47bd450196a671ab28eb1ec5eb88d9#diff-e401ae20091bbfb311a062c464f4f47fL23 So the idea here is to change those dts files to only say <3 255> (patch 3), and add in a virtual 0% point at the bottom of the scale (patch 2). We have to do this conditionally because it seems some devices like to have the scale inverted: % git grep "brightness-levels\s*=\s*<\s*[1-9]"|cat arch/arm/boot/dts/tegra124-apalis-eval.dts: brightness-levels = <255 231 223 207 191 159 127 0>; Alexandru Stan (3): backlight: pwm_bl: Fix interpolation backlight: pwm_bl: Artificially add 0% during interpolation ARM: dts: rockchip: Remove 0 point in backlight arch/arm/boot/dts/rk3288-veyron-jaq.dts | 2 +- arch/arm/boot/dts/rk3288-veyron-minnie.dts | 2 +- arch/arm/boot/dts/rk3288-veyron-tiger.dts | 2 +- drivers/video/backlight/pwm_bl.c | 78 +++++++++++----------- 4 files changed, 42 insertions(+), 42 deletions(-)