Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1797781rwl; Wed, 12 Apr 2023 19:28:13 -0700 (PDT) X-Google-Smtp-Source: AKy350Y3PGXZjttIochH88OzK5Q1mEmk/oKoqBCgep3/cEWMHMIBrPpvhEvOX8WeQbsLTW/YsVBd X-Received: by 2002:a05:6402:2027:b0:4fe:e851:af4a with SMTP id ay7-20020a056402202700b004fee851af4amr726764edb.39.1681352893550; Wed, 12 Apr 2023 19:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681352893; cv=none; d=google.com; s=arc-20160816; b=y//JB2nEKwNNxACHdTbqKaV/2xmpioaTi77hwYI7VE1DX4GyE6zjvX205Q5IeQqfwF Kx/LNdZSl2BUSCn8ZLr8AKbBYXO7wyCecm14qygdA7q6xibhvyl9LNv28Cr+KIp0PjVO x2ZSGm+bbePrBleuSAdM0GmC0fcRQVlzVmeBFqbvlwnDo5X7wqCVkWRBUR0VrjSgyksJ YeX16TBa3hnoNN/t2mig2AiuQVxG3qaM/liTyRfOo4Q7lu3OM+ntQizZFPZgdXARzrIP NxXUf5p041SA6q3300pKUin1o+KO6zaOhYOuTI4rMSDkEO1TXKqVXG03Fr5jPTc6FmOU /BNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=f3FTM3P0d0Yu5XkpwXvscwyTC9to58Zm82Hu9n7W5lA=; b=xjKQQ6gWq6gNiCVi+pGDN559LgQgqUlYxfFojxB0oQXAEBw+ABHLYb+SM/p+hVrtRK UL9wFcKaulsvjxnUaLpPDWaJnkEfBCHUiu+Dc06SFCJlfEaLal0qUYIgISK3mIVhZMAn N6Hvdl9l8tEweQ2QTxfZcHGKdfNPeqKrkI1R79uCeftCxf4x7dCOjLwQd0DB9pTg0e9F JK0CQJwogRKFZWErVrSEl8aXVw2ajJa9hOIEKwOKS9dHbtasUNzc985K1Neth+8df9Fn 0xx7dvpbdFhNz5F3LR0yo2FFcYCid43gR1zTBltQ7mGeMFAoKc+SUkZNEKbdnZBxVbXK ANYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="Nk6f9Pe/"; 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 m20-20020aa7c2d4000000b00504b120d3b9si598006edp.235.2023.04.12.19.27.49; Wed, 12 Apr 2023 19:28:13 -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=20221208 header.b="Nk6f9Pe/"; 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 S229830AbjDMB63 (ORCPT + 99 others); Wed, 12 Apr 2023 21:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjDMB62 (ORCPT ); Wed, 12 Apr 2023 21:58:28 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B4272688; Wed, 12 Apr 2023 18:58:27 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id la3so13299186plb.11; Wed, 12 Apr 2023 18:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681351106; x=1683943106; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=f3FTM3P0d0Yu5XkpwXvscwyTC9to58Zm82Hu9n7W5lA=; b=Nk6f9Pe/mKe1sUmRoEDXBv3+WBVPk4QiJmvSEpW13PD898AB4RFv6CZD+dydHcB5pM pwPWnq5590ybVEuMMwMIxhmODHzbxOXEF8vu4DEy9TSj+rW6Ok8lRhbeiXzkw8MTSHhZ e1WPeyeDEELmtnM5EcpyPAqkjuOFe+BbCX+jO3WcJqPuSuUBE/64MO7OIVCva4yncij+ M8z7DGVI06S+w5FhTeSakc96krHNJVhBdPrO79vt2r2vymL5yUCU9fHRcmXa7nDx4ykW ArA40m5hEMchG1LljJAWYJg/cfb3qH37Ks1o0dFyMHhFd3gv27W2nm9ZcaNRZOEBD8iR N5TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681351106; x=1683943106; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f3FTM3P0d0Yu5XkpwXvscwyTC9to58Zm82Hu9n7W5lA=; b=faHHCjVVULR9BNDUkGV6+5joWDkcaj1txcbZUUOKRbWJisowzcrxsWUmMvTfR6PnYs eWOaYU8UOqjt8XMzlS1RZKgxjFLJCYaDMciVCWeu+Lw/N3hhOWlYywHsuRKD13FUeYID YsLQqRd0lxQkirBjbXXc0WDZBTysObXcx+5PtvxdtGFz2PLs/UfKB82AMNjo/hltKA8S +FPS642bimjZdeLr41kx5AHJ6p2sZDhRdttesHPsGQV6F8I9AZM4NU4so8xRI/nnpSoL JL80Q4rF/32VcucYVl9w73ZFqGfmPT0XLdXwk83d90OuxXDR3hzPgUFELtpn8xrvITUg LFfw== X-Gm-Message-State: AAQBX9fkD+tDJSxQptQzGyGde+t78tWvigH+QgW0fxFo1ZrX/1e8dd9i vuQA8NPfByFcfbZ5ClRlAOg= X-Received: by 2002:a17:902:d0d2:b0:1a5:2b9b:67f7 with SMTP id n18-20020a170902d0d200b001a52b9b67f7mr310775pln.46.1681351106540; Wed, 12 Apr 2023 18:58:26 -0700 (PDT) Received: from Gentoo (n220246252240.netvigator.com. [220.246.252.240]) by smtp.gmail.com with ESMTPSA id t20-20020a1709028c9400b001a63deeb5e2sm231190plo.92.2023.04.12.18.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 18:58:25 -0700 (PDT) Date: Thu, 13 Apr 2023 09:58:19 +0800 From: Jianhua Lu To: Konrad Dybcio Cc: Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Marijn Suijten , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] drm/panel: nt36523: Add DCS backlight support Message-ID: References: <20230412-topic-lenovopanel-v1-0-00b25df46824@linaro.org> <20230412-topic-lenovopanel-v1-3-00b25df46824@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230412-topic-lenovopanel-v1-3-00b25df46824@linaro.org> X-Spam-Status: No, score=-1.8 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 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 On Wed, Apr 12, 2023 at 09:46:00PM +0200, Konrad Dybcio wrote: > This chip supports controlling the backlight via DCS commands, on at > least some panels. Add support for doing so. > > Note this may only concern the NT36523*W* variant. Nobody knows, really, > there's no docs. > > Signed-off-by: Konrad Dybcio > --- > drivers/gpu/drm/panel/panel-novatek-nt36523.c | 67 +++++++++++++++++++++++++-- > 1 file changed, 64 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36523.c b/drivers/gpu/drm/panel/panel-novatek-nt36523.c > index d30dbbfb67b1..3c81ec014eef 100644 > --- a/drivers/gpu/drm/panel/panel-novatek-nt36523.c > +++ b/drivers/gpu/drm/panel/panel-novatek-nt36523.c > @@ -5,6 +5,7 @@ > * Copyright (c) 2022, 2023 Jianhua Lu > */ > > + [..] > +static struct backlight_device *nt36523_create_backlight(struct mipi_dsi_device *dsi) > +{ > + struct device *dev = &dsi->dev; > + const struct backlight_properties props = { > + .type = BACKLIGHT_RAW, > + .brightness = 512, > + .max_brightness = 4095, Please set the missing scale property of backlight. Daniel said: "Unknown is never correct for new drivers." See https://lore.kernel.org/lkml/Y6SIWoVFX%2FOlNO0n@aspen.lan/ Otherwise, Reviewed-by: Jianhua Lu > + }; > + > + return devm_backlight_device_register(dev, dev_name(dev), dev, dsi, > + &nt36523_bl_ops, &props); > +} > + > static int nt36523_probe(struct mipi_dsi_device *dsi) > { > struct device *dev = &dsi->dev; > @@ -730,9 +784,16 @@ static int nt36523_probe(struct mipi_dsi_device *dsi) > mipi_dsi_set_drvdata(dsi, pinfo); > drm_panel_init(&pinfo->panel, dev, &nt36523_panel_funcs, DRM_MODE_CONNECTOR_DSI); > > - ret = drm_panel_of_backlight(&pinfo->panel); > - if (ret) > - return dev_err_probe(dev, ret, "failed to get backlight\n"); > + if (pinfo->desc->has_dcs_backlight) { > + pinfo->panel.backlight = nt36523_create_backlight(dsi); > + if (IS_ERR(pinfo->panel.backlight)) > + return dev_err_probe(dev, PTR_ERR(pinfo->panel.backlight), > + "Failed to create backlight\n"); > + } else { > + ret = drm_panel_of_backlight(&pinfo->panel); > + if (ret) > + return dev_err_probe(dev, ret, "Failed to get backlight\n"); > + } > > drm_panel_add(&pinfo->panel); > > > -- > 2.40.0 >