Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5415706pxu; Thu, 22 Oct 2020 01:26:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjRt2YT+67aV5xNUFA1pnjuIP5Br41yuuyB43i6oJwzeFkfcOqS0wrzkcs3Oeqk1swNKZs X-Received: by 2002:aa7:d28c:: with SMTP id w12mr1250935edq.282.1603355184039; Thu, 22 Oct 2020 01:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603355184; cv=none; d=google.com; s=arc-20160816; b=CW1xomTpG16lCset5F6C4aAy/T/Iu9lU/Iy5i/UHvZFJt6WiMr/OHgKEcqqUEQQLEx YfpvFSGccI3kTvrgapgA7SwcP3FNFQ5zEwMAx2NQOIefyJQBnE01xFcDEcFDOnX4uUHv UX1MW/iWl46u4Zi61qYLA0Zknm8HCYQT+uHkh7OKAAS0J+alNYhERXm6x6JDuVZhd5jB XsV2iIyp/TC5YE0wTH2w8Foi5b2NTkM7rpJa5lHRNgwOmBlpjNT5Vwg7hJ5BVeEd4ksA Vra3IyMV95dWvfY9ZaiIz+mWN84Ti8/t4oyNGjwqxs5Xk6oK5uBr7vrvyN+zNZ4S5KoC RSjA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=br1VG/AftR5rvhAmwlJkFmu6wT77im0wqYMY63lXCPc=; b=PARBTB907sGqjR6Ft+b/Sze6Dz/myRwT+KY5h+tq3JfJ68JaCkh7KHA2c6iYm1MfdT B2szyKNFeneC6v+kCzTM/mfH+B8blpv1RvR234L6Ag4owjrIzOP+t2oKR03+McrhkDd5 YBq5qLSd7trHMJoiYUSWdkTNTnPO1llRzok08AlHubiXKt3H2IAvLIm+dFiK6Fos7jPR yT8LFgTCjNDDsbSMnKUku4rsiG7tlt4Qwwzh+1RE6Nd1c7igovkX38ma2NnLbRoo2W9K 3mGxOCvBQwvZTjjMW7ZC+H0eJ/AXCwbhYQIbNNQA3p6Cu5SzGpqpU1k8s1UiDph1WTlE 8mYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f48hBtEY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si442955ejg.111.2020.10.22.01.26.01; Thu, 22 Oct 2020 01:26:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f48hBtEY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2444093AbgJVFFO (ORCPT + 99 others); Thu, 22 Oct 2020 01:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2443800AbgJVFFN (ORCPT ); Thu, 22 Oct 2020 01:05:13 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFECBC0613CE for ; Wed, 21 Oct 2020 22:05:13 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id d23so319674pll.7 for ; Wed, 21 Oct 2020 22:05:13 -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=br1VG/AftR5rvhAmwlJkFmu6wT77im0wqYMY63lXCPc=; b=f48hBtEYiQ9cumyN91pZln9WRYzYGIagC8IaqGZt02+O2MHl6eQhg0BtJ9+cg1Lz5h o78FtZXmTE3jBKH3YGJw6UO0d0jZFwtKCoYPkexfnY1SZ/dfXt7VslCJZM/bN6IMdzvi 1GjVCtofogBD1D5SMd8g0By60jOJ/X9Pviva4= 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=br1VG/AftR5rvhAmwlJkFmu6wT77im0wqYMY63lXCPc=; b=SyRg5C99TLhvKzV72g3XByLkqMNJkxsnSiL0H77u+JzNngJnIjef4kMhQjYoAiFzR/ 2YnTsAQ/OQDGMUiEB5j1IQb+Dna6mKLy3kDtuqMbG3T1kXfNzJ6FXIYWOEeNVF9FJybl 2m6lrs+Bt6GC3ONcOxyGTFerMCqG2P8T7+ewc5oh4WhbCKNur1BuBdd029hul05YtVLb TpO51tUkfgH68SO6YURqryvfctLQsWm1A6vVEx2tN398NhUIvDOQicRK9FmfORzmcylj b1Pc5IDbEnW97VMTKl/tX4dzTz2P6b4BG74p1vWlFzIv8FMyxdMdJTkCsdz5W0wcmI9n +QIg== X-Gm-Message-State: AOAM533WH+SYrMd5heVXtTcXNTyJi0WxJp2CWeHkdZF5i+lkMmtrm+Lg 0bF56k9q/+/VaOu0oy5uzs5ddg== X-Received: by 2002:a17:902:ab89:b029:d5:b297:2cc1 with SMTP id f9-20020a170902ab89b02900d5b2972cc1mr765458plr.7.1603343113453; Wed, 21 Oct 2020 22:05:13 -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 q16sm394954pfu.206.2020.10.21.22.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 22:05:12 -0700 (PDT) From: Alexandru Stan To: Heiko Stuebner , Rob Herring , Andy Gross , Bjorn Andersson , Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz Cc: Douglas Anderson , Matthias Kaehlcke , Enric Balletbo i Serra , Alexandru Stan , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v3 0/3] PWM backlight interpolation adjustments Date: Wed, 21 Oct 2020 22:04:42 -0700 Message-Id: <20201022050445.930403-1-amstan@chromium.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I was trying to adjust the brightness-levels for the trogdor boards: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2291209 Like on a lot of panels, trogdor's 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 that's customary to have on chromebooks. I found the current behavior of the pwm_bl driver a little unintuitive and non-linear. See patch 1 for a suggested fix for this. A few veyron dts files were relying on this (perhaps weird) behavior. Those devices also want a minimum brightness like trogdor, so changed them to use the new way. Finally, given that trogdor's dts is part of linux-next now, add the brightness-levels to it, since that's the original reason I was looking at this. Changes in v3: - Reordered patches, since both dts changes will work just fine even before the driver change. - Rewrote a bit of the commit message to describe the new policy, as Daniel suggested. - Removed redundant s64 for something that's always positive Changes in v2: - Fixed type promotion in the driver - Removed "backlight: pwm_bl: Artificially add 0% during interpolation", userspace works just fine without it because it already knows how to use bl_power for turning off the display. - Added brightness-levels to trogdor as well, now the dts is upstream. Alexandru Stan (3): ARM: dts: rockchip: veyron: Remove 0 point from brightness-levels arm64: dts: qcom: trogdor: Add brightness-levels backlight: pwm_bl: Fix interpolation 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 +- arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 9 +++ drivers/video/backlight/pwm_bl.c | 70 +++++++++----------- 5 files changed, 43 insertions(+), 42 deletions(-) -- 2.28.0