Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4901496rwb; Tue, 17 Jan 2023 06:58:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXuSBQAV7lWL1RbT1br8bGMalt8ehmPeHwKwhtFfe1qN5fJhlJ2TGlsuHr7kBvgm4Y9Cp5mx X-Received: by 2002:a17:903:11c7:b0:194:58c7:ab79 with SMTP id q7-20020a17090311c700b0019458c7ab79mr3501845plh.63.1673967495442; Tue, 17 Jan 2023 06:58:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673967495; cv=none; d=google.com; s=arc-20160816; b=UXilYDlKvNjKfcCs6BBSO3UAKOP+X/E3BfxGZNyk7fZeEndXMLu8MR6FQywqurLqWj gMqwAHpIjjU8LjwP/sbURcFpLsswZKGLbHJhP2Upu8zlVPHqiLHOeWuVA6VpSM5Z9bQM XNuZiP4SQDetgIoybzRV334E0tg/OxmRAkQYmpsoxaSJgSAjOx3P0RwFAhlrgez89KkF 9gKo1tF7DETZ51VRk/JKk2ggTQi1VjJYKNw1Z0wncEm+yJbig9zG4dL11/bqsznTSHEj GSQooQzHSpMuyRd0NCUA7r4KhPkqkqI+XhKBHPp7BYx7uwS+hkNFsOfbIMeL/7OPfssx 3d1g== 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=8T4Av5sluJXt+Zl2bdIPegxIz0+hLbjYRZdYk7XDGIo=; b=kCWpU/VVSsL/N+WnWXo/SItMmIBNmufurA0LdCl76OPwxeEIR5SaXIDRwLDT/yHQa5 DPC+C6eUd3SCLigGXzC6efp0OECocyR99u4HuVYbOdtRZmx33Gr0rxJaCdeCJSdxL3vD t0NKe93lP6Lxy8LiKhx/+C4Y0xJDfxGBnRmmCdMc+43J+TZf2RBcOmFbbgI0kdyX2Aw7 ikI2z4+7Go+icS9HKxz/X02LXZGRY5jtV+4Tz+L9p2I7F0WIYv2j/2Riq5FPmXvCdMd+ M7mq0FrHOIpk2Clwm8BnBmWOSyY0pMQACP89stgbYRrk0enHiU5vjzvBR1wTASsGDmAL jWkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WLEO7Th9; 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 c19-20020a170902c1d300b001898ecbeef8si31477129plc.9.2023.01.17.06.58.09; Tue, 17 Jan 2023 06:58:15 -0800 (PST) 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=WLEO7Th9; 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 S231656AbjAQOMi (ORCPT + 48 others); Tue, 17 Jan 2023 09:12:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjAQOM2 (ORCPT ); Tue, 17 Jan 2023 09:12:28 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 287093BDAD; Tue, 17 Jan 2023 06:12:27 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id b17so26144178pld.7; Tue, 17 Jan 2023 06:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=8T4Av5sluJXt+Zl2bdIPegxIz0+hLbjYRZdYk7XDGIo=; b=WLEO7Th9M7wacwYtjCLpc3JYdhQFdVS42gtPjG6oOxsVlEO08+qAZMULbFLitKE9jS uorch4XhqoxWtGNtEzpG+Tk4wdZVyjc3sZQKY28/RfNXn+UZrWIadSbXk/OPaEYDq4ua cwi8aE2Mav7AePz5SDV7yDtYAoIMjb9bKKArOUV4wDI69HsX6P/K3+jmzxDysVT7mO9Y gWYDHC6Mr0lkL6Gp97L+26uu+pXP4mE4OP0E4+62segsd/W6Zs0oVb13IIYmOz7VgCs/ XWW3nj2pKSsMN/wZ8heiCKOESNdw/08sIW0byi+djTpqSOFNqu3WRgPMfbBH4bMvRTSY at8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=8T4Av5sluJXt+Zl2bdIPegxIz0+hLbjYRZdYk7XDGIo=; b=TpzGF/ocvQBhsuzyg0jWvgE0uvxqQqGTFJehw9lTZTaeN3xBce567eVHQmID7oHQ47 eG8XCB32PMmsA4JMHf52A7IF+ceUWXh9dF0J3MVDdDCcRhMayNjITi2DfE7bQomdgSsX NkAi+cwPxViBFrY7MdZIGIcTzjE1vi0cqUsGS7+isGsR5Ei2d7Q5KP/3Pa9gwTLzP4kd 1Pg19uyvfCNjVGuuA6gia/CTwgtKKql47Yp+AbKRParM9NJ5RcWqF/+U++9DyqhMSj71 kMhjTJIu3oBeNyEP/Tz3n0xiLHg9b5TszRDvZzVczNDNbjXdp3+qxy3F7zJ6ftQ6/sO+ slyQ== X-Gm-Message-State: AFqh2kpk7vHpDhcIcm75X3zPiGrhcf97lL8WCBPF95uJV7uNoAFmC6+p qRwlUIx8z05Wv5J5Ss1kHQM= X-Received: by 2002:a17:90b:1b4f:b0:226:d23b:8037 with SMTP id nv15-20020a17090b1b4f00b00226d23b8037mr2859651pjb.33.1673964746685; Tue, 17 Jan 2023 06:12:26 -0800 (PST) Received: from Gentoo (n220246252084.netvigator.com. [220.246.252.84]) by smtp.gmail.com with ESMTPSA id e2-20020a17090a118200b0022966311621sm4147654pja.28.2023.01.17.06.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 06:12:26 -0800 (PST) Date: Tue, 17 Jan 2023 22:12:18 +0800 From: Jianhua Lu To: Daniel Thompson Cc: Lee Jones , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Helge Deller , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH v4 1/2] backlight: ktz8866: Add support for Kinetic KTZ8866 backlight Message-ID: References: <20230117134742.23238-1-lujianhua000@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Jan 17, 2023 at 02:04:05PM +0000, Daniel Thompson wrote: > On Tue, Jan 17, 2023 at 09:47:41PM +0800, Jianhua Lu wrote: > > Add support for Kinetic KTZ8866 backlight, which is used in > > Xiaomi tablet, Mi Pad 5 series. This driver lightly based on > > downstream implementation [1]. > > [1] https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/elish-r-oss/drivers/video/backlight/ktz8866.c > > > > Signed-off-by: Jianhua Lu > > --- > > Changes in v2: > > - Add missing staitc modifier to ktz8866_write function. > > > > Changes in v3: > > - Add 2022 to Copyright line. > > - Sort headers. > > - Remove meaningless comment. > > - Use definitions instead of hardcoding. > > - Add missing maintainer info. > > > > Changes in v4: > > - Change 2022 to 2023. > > - Remove useless macro and enum. > > - Describe settings by devicetree. > > - Move header file to C file. > > > > MAINTAINERS | 6 + > > drivers/video/backlight/Kconfig | 8 ++ > > drivers/video/backlight/Makefile | 1 + > > drivers/video/backlight/ktz8866.c | 195 ++++++++++++++++++++++++++++++ > > 4 files changed, 210 insertions(+) > > create mode 100644 drivers/video/backlight/ktz8866.c > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 42fc47c6edfd..2084e74e1b58 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -11674,6 +11674,12 @@ M: John Hawley > > S: Maintained > > F: tools/testing/ktest > > > > +KTZ8866 BACKLIGHT DRIVER > > +M: Jianhua Lu > > +S: Maintained > > +F: Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml > > +F: drivers/video/backlight/ktz8866.c > > + > > L3MDEV > > M: David Ahern > > L: netdev@vger.kernel.org > > diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig > > index 936ba1e4d35e..2845fd7e33ad 100644 > > --- a/drivers/video/backlight/Kconfig > > +++ b/drivers/video/backlight/Kconfig > > @@ -190,6 +190,14 @@ config BACKLIGHT_KTD253 > > which is a 1-wire GPIO-controlled backlight found in some mobile > > phones. > > > > +config BACKLIGHT_KTZ8866 > > + tristate "Backlight Driver for Kinetic KTZ8866" > > + depends on I2C > > + select REGMAP_I2C > > + help > > + Say Y to enabled the backlight driver for the Kinetic KTZ8866 > > + found in Xiaomi Mi Pad 5 series. > > + > > config BACKLIGHT_LM3533 > > tristate "Backlight Driver for LM3533" > > depends on MFD_LM3533 > > diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile > > index e815f3f1deff..f70a819c304c 100644 > > --- a/drivers/video/backlight/Makefile > > +++ b/drivers/video/backlight/Makefile > > @@ -36,6 +36,7 @@ obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o > > obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o > > obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO) += ipaq_micro_bl.o > > obj-$(CONFIG_BACKLIGHT_KTD253) += ktd253-backlight.o > > +obj-$(CONFIG_BACKLIGHT_KTZ8866) += ktz8866.o > > obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_bl.o > > obj-$(CONFIG_BACKLIGHT_LM3630A) += lm3630a_bl.o > > obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o > > diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c > > new file mode 100644 > > index 000000000000..98916f92d069 > > --- /dev/null > > +++ b/drivers/video/backlight/ktz8866.c > > @@ -0,0 +1,195 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* > > + * Backlight driver for the Kinetic KTZ8866 > > + * > > + * Copyright (C) 2023 Jianhua Lu > > Shouldn't this be: > Copyright (C) 2022, 2023 Jianhua Lu > > > +static int ktz8866_probe(struct i2c_client *client, > > + const struct i2c_device_id *id) > > +{ > > + struct backlight_device *backlight_dev; > > + struct backlight_properties props; > > + struct ktz8866 *ktz; > > + > > + ktz = devm_kzalloc(&client->dev, sizeof(*ktz), GFP_KERNEL); > > + if (!ktz) > > + return -ENOMEM; > > + > > + ktz->client = client; > > + ktz->regmap = devm_regmap_init_i2c(client, &ktz8866_regmap_config); > > + > > + if (IS_ERR(ktz->regmap)) { > > + dev_err(&client->dev, "failed to init regmap\n"); > > + return PTR_ERR(ktz->regmap); > > + } > > + > > + memset(&props, 0, sizeof(props)); > > + props.type = BACKLIGHT_RAW; > > + props.max_brightness = MAX_BRIGHTNESS; > > + props.brightness = DEFAULT_BRIGHTNESS; > > There is still pending feedback from v3. > > | Please set the scale property correctly. "Unknown" is never correct for > | new drivers. Do you means backlight_properties.backlight_scale? > > Do not ignore feedback. You should either act on it or, if you disagree > or need additional clarification then, reply on the mail thread. > > > Daniel.