From: Daniel Thompson <daniel.thompson@linaro.org>
To: Jianhua Lu <lujianhua000@gmail.com>
Cc: Lee Jones <lee@kernel.org>, Jingoo Han <jingoohan1@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Helge Deller <deller@gmx.de>,
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
Date: Tue, 17 Jan 2023 14:04:05 +0000 [thread overview]
Message-ID: <Y8aq1aJd8QJCo3RU@aspen.lan> (raw)
In-Reply-To: <20230117134742.23238-1-lujianhua000@gmail.com>
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 <lujianhua000@gmail.com>
> ---
> 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 <warthog9@eaglescrag.net>
> S: Maintained
> F: tools/testing/ktest
>
> +KTZ8866 BACKLIGHT DRIVER
> +M: Jianhua Lu <lujianhua000@gmail.com>
> +S: Maintained
> +F: Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
> +F: drivers/video/backlight/ktz8866.c
> +
> L3MDEV
> M: David Ahern <dsahern@kernel.org>
> 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 <lujianhua000@gmail.com>
Shouldn't this be:
Copyright (C) 2022, 2023 Jianhua Lu <lujianhua000@gmail.com>
> +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 not ignore feedback. You should either act on it or, if you disagree
or need additional clarification then, reply on the mail thread.
Daniel.
next prev parent reply other threads:[~2023-01-17 14:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 13:47 [PATCH v4 1/2] backlight: ktz8866: Add support for Kinetic KTZ8866 backlight Jianhua Lu
2023-01-17 13:47 ` [PATCH v4 2/2] dt-bindings: leds: backlight: Add " Jianhua Lu
2023-01-17 14:22 ` Daniel Thompson
2023-01-17 14:27 ` Jianhua Lu
2023-01-17 14:04 ` Daniel Thompson [this message]
2023-01-17 14:12 ` [PATCH v4 1/2] backlight: ktz8866: Add support for " Jianhua Lu
2023-01-17 14:37 ` Daniel Thompson
2023-01-17 14:40 ` Jianhua Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y8aq1aJd8QJCo3RU@aspen.lan \
--to=daniel.thompson@linaro.org \
--cc=deller@gmx.de \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lujianhua000@gmail.com \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox