* [PATCH 8/8] staging: sm750fb: change sii164ClearInterrupt to snake_case
From: Richard Akintola @ 2025-04-05 13:00 UTC (permalink / raw)
To: outreachy
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel, Richard Akintola
In-Reply-To: <cover.1743857160.git.princerichard17a@gmail.com>
Change camelCase function name sii164ClearInterrupt to
sii164_clear_interrupt in order to conform to kernel code styles
as reported by checkpatch.pl
CHECK: Avoid camelCase: <sii164ClearInterrupt>
Signed-off-by: Richard Akintola <princerichard17a@gmail.com>
---
drivers/staging/sm750fb/ddk750_dvi.c | 2 +-
drivers/staging/sm750fb/ddk750_sii164.c | 4 ++--
drivers/staging/sm750fb/ddk750_sii164.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
index 1def02be4cce..6fef1ab484c1 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -24,7 +24,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = {
.enable_hot_plug_detection = sii164_enable_hot_plug_detection,
.is_connected = sii164_is_connected,
.check_interrupt = sii164_check_interrupt,
- .clear_interrupt = sii164ClearInterrupt,
+ .clear_interrupt = sii164_clear_interrupt,
#endif
},
#endif
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c
index aebde3d8b903..fc725a9952d4 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -390,10 +390,10 @@ unsigned char sii164_check_interrupt(void)
}
/*
- * sii164ClearInterrupt
+ * sii164_clear_interrupt
* Clear the hot plug interrupt.
*/
-void sii164ClearInterrupt(void)
+void sii164_clear_interrupt(void)
{
unsigned char detectReg;
diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h
index aa3f34c13979..ebc173658f0e 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.h
+++ b/drivers/staging/sm750fb/ddk750_sii164.h
@@ -37,7 +37,7 @@ void sii164_set_power(unsigned char powerUp);
void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug);
unsigned char sii164_is_connected(void);
unsigned char sii164_check_interrupt(void);
-void sii164ClearInterrupt(void);
+void sii164_clear_interrupt(void);
#endif
/*
* below register definition is used for
--
2.39.5
^ permalink raw reply related
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Greg KH @ 2025-04-05 13:35 UTC (permalink / raw)
To: Richard Akintola
Cc: outreachy, sudipm.mukherjee, teddy.wang, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <cover.1743857160.git.princerichard17a@gmail.com>
On Sat, Apr 05, 2025 at 02:00:51PM +0100, Richard Akintola wrote:
> Address checkpatch's "Avoid camelCase" for sm750fb module by changing
> function name to conform to kernel code style.
>
> The patches are required to be applied in sequence.
>
> Richard Akintola (8):
> staging: sm750fb: change sii164GetDeviceID to snake_case
> staging: sm750fb: change sii164ResetChip to snake_case
> staging: sm750fb: change sii164SetPower to snake_case
> staging: sm750fb: change sii164GetChipString to snake_case
> staging: sm750fb: change sii164EnableHotPlugDetection to snake_case
> staging: sm750fb: change sii164IsConnected to snake_case
> staging: sm750fb: change sii164CheckInterrupt to snake_case
> staging: sm750fb: change sii164ClearInterrupt to snake_case
>
> drivers/staging/sm750fb/ddk750_dvi.c | 16 +++++-----
> drivers/staging/sm750fb/ddk750_sii164.c | 42 ++++++++++++-------------
> drivers/staging/sm750fb/ddk750_sii164.h | 16 +++++-----
> 3 files changed, 37 insertions(+), 37 deletions(-)
>
> --
> 2.39.5
>
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Richard Akintola @ 2025-04-05 14:07 UTC (permalink / raw)
To: Greg KH
Cc: outreachy, sudipm.mukherjee, teddy.wang, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <2025040538-breeze-espionage-dc6e@gregkh>
On Sat, Apr 5, 2025 at 2:37 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> - This looks like a new version of a previously submitted patch, but you
> did not list below the --- line any changes from the previous version.
Please, how do I resolve this issue?
Richard Akintola
^ permalink raw reply
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Samuel Abraham @ 2025-04-05 14:16 UTC (permalink / raw)
To: Richard Akintola
Cc: Greg KH, outreachy, sudipm.mukherjee, teddy.wang, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <CAMyr_bL4Qo_eeVSHhy-_z9_PwcQAvD6N4jfqBb+rtN-Lj+YdmA@mail.gmail.com>
On Sat, Apr 5, 2025 at 3:07 PM Richard Akintola
<princerichard17a@gmail.com> wrote:
>
> On Sat, Apr 5, 2025 at 2:37 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> > - This looks like a new version of a previously submitted patch, but you
> > did not list below the --- line any changes from the previous version.
>
> Please, how do I resolve this issue?
>
> Richard Akintola
Hello Richard
THis is the main message from the bot
This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
It basically means that if you made a change to a patch, you will have
a new version.
You will have to indicate the patch version and also what changed
So lets say you have a first Patch then after review, or you edited
the commit message
or made a change in the code or something,
you will now have a new patch which you will call v2.
you will use git format-patch -o /tmp/ --subject-prefix="PATCH v2" <commit-ID>
then when you want to send with mutt, immediately after the signed-off
by line there are three dashes (---),
You will then write what changes under these three dashes in the format
signedoff-by: Richard
---
Changes in v1:
- This is what changed in v1.
I hope this helps
Adekunle.
^ permalink raw reply
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Samuel Abraham @ 2025-04-05 14:23 UTC (permalink / raw)
To: Richard Akintola
Cc: Greg KH, outreachy, sudipm.mukherjee, teddy.wang, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <CADYq+fY-twT=NruAmfb6EpmYJLM971aTu-CUi-We_Fd6JSP47Q@mail.gmail.com>
On Sat, Apr 5, 2025 at 3:16 PM Samuel Abraham
<abrahamadekunle50@gmail.com> wrote:
>
> On Sat, Apr 5, 2025 at 3:07 PM Richard Akintola
> <princerichard17a@gmail.com> wrote:
> >
> > On Sat, Apr 5, 2025 at 2:37 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > > - This looks like a new version of a previously submitted patch, but you
> > > did not list below the --- line any changes from the previous version.
> >
> > Please, how do I resolve this issue?
> >
> > Richard Akintola
>
> Hello Richard
>
> THis is the main message from the bot
>
> This looks like a new version of a previously submitted patch, but you
> did not list below the --- line any changes from the previous version.
> Please read the section entitled "The canonical patch format" in the
> kernel file, Documentation/process/submitting-patches.rst for what
> needs to be done here to properly describe this.
>
> It basically means that if you made a change to a patch, you will have
> a new version.
> You will have to indicate the patch version and also what changed
>
> So lets say you have a first Patch then after review, or you edited
> the commit message
> or made a change in the code or something,
> you will now have a new patch which you will call v2.
>
> you will use git format-patch -o /tmp/ --subject-prefix="PATCH v2" <commit-ID>
>
> then when you want to send with mutt, immediately after the signed-off
> by line there are three dashes (---),
> You will then write what changes under these three dashes in the format
>
> signedoff-by: Richard
> ---
> Changes in v1:
> - This is what changed in v1.
>
> I hope this helps
>
Also, you can go to the "Submitting a Patchset" section down the page
of the firstPatch
documentation for more information on versioning patchsets.
Adekunle
^ permalink raw reply
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Richard Akintola @ 2025-04-07 5:57 UTC (permalink / raw)
To: Samuel Abraham
Cc: Greg KH, outreachy, sudipm.mukherjee, teddy.wang, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <CADYq+fY-twT=NruAmfb6EpmYJLM971aTu-CUi-We_Fd6JSP47Q@mail.gmail.com>
On Sat, Apr 5, 2025 at 3:16 PM Samuel Abraham
<abrahamadekunle50@gmail.com> wrote:
> This looks like a new version of a previously submitted patch, but you
> did not list below the --- line any changes from the previous version.
> Please read the section entitled "The canonical patch format" in the
> kernel file, Documentation/process/submitting-patches.rst for what
> needs to be done here to properly describe this.
Hi Samuel,
I sent the patches individually before, but I was instructed to send a
patch series.
Given that I didn't change any code, should I still add version number
and sending
patch series as the difference?
Richard Akintola
^ permalink raw reply
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Greg KH @ 2025-04-07 5:59 UTC (permalink / raw)
To: Richard Akintola
Cc: Samuel Abraham, outreachy, sudipm.mukherjee, teddy.wang,
linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <CAMyr_bLkvFBTpYehG4fs-tqVE18YBf53okddU2=i7+Rr-zbCsw@mail.gmail.com>
On Mon, Apr 07, 2025 at 06:57:38AM +0100, Richard Akintola wrote:
> On Sat, Apr 5, 2025 at 3:16 PM Samuel Abraham
> <abrahamadekunle50@gmail.com> wrote:
>
> > This looks like a new version of a previously submitted patch, but you
> > did not list below the --- line any changes from the previous version.
> > Please read the section entitled "The canonical patch format" in the
> > kernel file, Documentation/process/submitting-patches.rst for what
> > needs to be done here to properly describe this.
>
>
> Hi Samuel,
>
> I sent the patches individually before, but I was instructed to send a
> patch series.
>
> Given that I didn't change any code, should I still add version number
> and sending
> patch series as the difference?
Yes.
Think about it from our side, what would you want to see if you had to
review hundreds of different patches a day?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 0/8] staging: sm750fb: change function naming style
From: Richard Akintola @ 2025-04-07 6:23 UTC (permalink / raw)
To: Greg KH
Cc: Samuel Abraham, outreachy, sudipm.mukherjee, teddy.wang,
linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <2025040711-refutable-monetary-f0c4@gregkh>
On Mon, Apr 7, 2025 at 7:01 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> Yes.
>
> Think about it from our side, what would you want to see if you had to
> review hundreds of different patches a day?
Thank you for the clarification Greg K-H, the change in perspective made
it clear, would send them in as soon as I get hold of my PC.
Richard Akintola
^ permalink raw reply
* [PATCH 0/4] backlight: ktz8866: improve it and support slave
From: Pengyu Luo @ 2025-04-07 9:51 UTC (permalink / raw)
To: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Pengyu Luo
Sending this patchset to support coming devices which are using dual
ktz8866, original driver would only handle half backlight region on
these devices, registering it twice is unreasonable, and two devices
share the same resources(pinctrl) which is required for every single
node under recent dt-bindings, so adding new support. and improve
original driver. Details in every commit log.
Pengyu Luo (4):
dt-bindings: backlight: kinetic,ktz8866: add ktz8866 slave compatible
backlight: ktz8866: add slave handler
backlight: ktz8866: improve current sinks setting
backlight: ktz8866: add definitions to make it more readable
.../leds/backlight/kinetic,ktz8866.yaml | 29 +++++-
drivers/video/backlight/ktz8866.c | 99 ++++++++++++++++---
2 files changed, 108 insertions(+), 20 deletions(-)
--
2.49.0
^ permalink raw reply
* [PATCH 1/4] dt-bindings: backlight: kinetic,ktz8866: add ktz8866 slave compatible
From: Pengyu Luo @ 2025-04-07 9:51 UTC (permalink / raw)
To: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Pengyu Luo
In-Reply-To: <20250407095119.588920-1-mitltlatltl@gmail.com>
Kinetic ktz8866, found in many android devices, nowadays, some oem use
dual ktz8866 to support a larger panel and higher brightness, add the
binding for slave case.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
.../leds/backlight/kinetic,ktz8866.yaml | 29 +++++++++++++++----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml b/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
index c914e1276..825a6fbf1 100644
--- a/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
+++ b/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
@@ -19,7 +19,9 @@ allOf:
properties:
compatible:
- const: kinetic,ktz8866
+ enum:
+ - kinetic,ktz8866
+ - kinetic,ktz8866-slave
reg:
maxItems: 1
@@ -58,9 +60,16 @@ properties:
required:
- compatible
- reg
- - vddpos-supply
- - vddneg-supply
- - enable-gpios
+
+if:
+ properties:
+ compatible:
+ const: kinetic,ktz8866
+then:
+ required:
+ - vddpos-supply
+ - vddneg-supply
+ - enable-gpios
unevaluatedProperties: false
@@ -68,7 +77,7 @@ examples:
- |
#include <dt-bindings/gpio/gpio.h>
- i2c {
+ i2c0 {
#address-cells = <1>;
#size-cells = <0>;
@@ -84,3 +93,13 @@ examples:
kinetic,enable-lcd-bias;
};
};
+
+ i2c1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ backlight@11 {
+ compatible = "kinetic,ktz8866-slave";
+ reg = <0x11>;
+ };
+ };
--
2.49.0
^ permalink raw reply related
* [PATCH 2/4] backlight: ktz8866: add slave handler
From: Pengyu Luo @ 2025-04-07 9:51 UTC (permalink / raw)
To: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Pengyu Luo
In-Reply-To: <20250407095119.588920-1-mitltlatltl@gmail.com>
Kinetic ktz8866, found in many android devices, nowadays, some oem use
dual ktz8866 to support a larger panel and higher brightness, original
driver would only handle half backlight region on these devices,
registering it twice is unreasonable, so adding the slave handler to
support it.
Note that, none of the devices supported by upstream require this, the
devices using this is porting.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
drivers/video/backlight/ktz8866.c | 68 +++++++++++++++++++++++++++----
1 file changed, 59 insertions(+), 9 deletions(-)
diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c
index 351c2b4d6..017ad80dd 100644
--- a/drivers/video/backlight/ktz8866.c
+++ b/drivers/video/backlight/ktz8866.c
@@ -3,6 +3,9 @@
* Backlight driver for the Kinetic KTZ8866
*
* Copyright (C) 2022, 2023 Jianhua Lu <lujianhua000@gmail.com>
+ *
+ * Apr 2025 - Pengyu Luo <mitltlatltl@gmail.com>
+ * Added handling for dual KTZ8866(master and slave)
*/
#include <linux/backlight.h>
@@ -43,11 +46,17 @@
#define LCD_BIAS_EN 0x9F
#define PWM_HYST 0x5
+struct ktz8866_slave {
+ struct i2c_client *client;
+ struct regmap *regmap;
+};
+
struct ktz8866 {
struct i2c_client *client;
struct regmap *regmap;
- bool led_on;
struct gpio_desc *enable_gpio;
+ struct ktz8866_slave *slave;
+ bool led_on;
};
static const struct regmap_config ktz8866_regmap_config = {
@@ -56,16 +65,22 @@ static const struct regmap_config ktz8866_regmap_config = {
.max_register = REG_MAX,
};
-static int ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
- unsigned int val)
+static void ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
+ unsigned int val)
{
- return regmap_write(ktz->regmap, reg, val);
+ regmap_write(ktz->regmap, reg, val);
+
+ if (ktz->slave)
+ regmap_write(ktz->slave->regmap, reg, val);
}
-static int ktz8866_update_bits(struct ktz8866 *ktz, unsigned int reg,
- unsigned int mask, unsigned int val)
+static void ktz8866_update_bits(struct ktz8866 *ktz, unsigned int reg,
+ unsigned int mask, unsigned int val)
{
- return regmap_update_bits(ktz->regmap, reg, mask, val);
+ regmap_update_bits(ktz->regmap, reg, mask, val);
+
+ if (ktz->slave)
+ regmap_update_bits(ktz->slave->regmap, reg, mask, val);
}
static int ktz8866_backlight_update_status(struct backlight_device *backlight_dev)
@@ -124,10 +139,41 @@ static void ktz8866_init(struct ktz8866 *ktz)
ktz8866_write(ktz, LCD_BIAS_CFG1, LCD_BIAS_EN);
}
+static int ktz8866_slave_register(struct ktz8866 *ktz)
+{
+ struct device *dev = &ktz->client->dev;
+ struct ktz8866_slave *slave;
+ struct i2c_client *client;
+ struct device_node *np;
+
+ np = of_find_compatible_node(NULL, NULL, "kinetic,ktz8866-slave");
+ if (!np)
+ return 0;
+
+ client = of_find_i2c_device_by_node(np);
+ of_node_put(np);
+ if (!client)
+ return 0;
+
+ slave = devm_kzalloc(dev, sizeof(*slave), GFP_KERNEL);
+ if (!slave)
+ return -ENOMEM;
+
+ slave->client = client;
+ slave->regmap = devm_regmap_init_i2c(client, &ktz8866_regmap_config);
+ if (IS_ERR(slave->regmap))
+ return dev_err_probe(&client->dev, PTR_ERR(slave->regmap),
+ "failed to init regmap\n");
+
+ ktz->slave = slave;
+
+ return 0;
+}
+
static int ktz8866_probe(struct i2c_client *client)
{
struct backlight_device *backlight_dev;
- struct backlight_properties props;
+ struct backlight_properties props = {};
struct ktz8866 *ktz;
int ret = 0;
@@ -151,7 +197,6 @@ static int ktz8866_probe(struct i2c_client *client)
if (IS_ERR(ktz->enable_gpio))
return PTR_ERR(ktz->enable_gpio);
- memset(&props, 0, sizeof(props));
props.type = BACKLIGHT_RAW;
props.max_brightness = MAX_BRIGHTNESS;
props.brightness = DEFAULT_BRIGHTNESS;
@@ -163,6 +208,11 @@ static int ktz8866_probe(struct i2c_client *client)
return dev_err_probe(&client->dev, PTR_ERR(backlight_dev),
"failed to register backlight device\n");
+ ret = ktz8866_slave_register(ktz);
+ if (ret)
+ return dev_err_probe(&client->dev, ret,
+ "failed to register slave\n");
+
ktz8866_init(ktz);
i2c_set_clientdata(client, backlight_dev);
--
2.49.0
^ permalink raw reply related
* [PATCH 3/4] backlight: ktz8866: improve current sinks setting
From: Pengyu Luo @ 2025-04-07 9:51 UTC (permalink / raw)
To: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Pengyu Luo
In-Reply-To: <20250407095119.588920-1-mitltlatltl@gmail.com>
I polled all registers when the module was loading, found that
current sinks have already been configured. Bootloader would set
when booting. So checking it before setting the all channels.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
drivers/video/backlight/ktz8866.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c
index 017ad80dd..b67ca136d 100644
--- a/drivers/video/backlight/ktz8866.c
+++ b/drivers/video/backlight/ktz8866.c
@@ -46,6 +46,8 @@
#define LCD_BIAS_EN 0x9F
#define PWM_HYST 0x5
+#define CURRENT_SINKS_MASK GENMASK(5, 0)
+
struct ktz8866_slave {
struct i2c_client *client;
struct regmap *regmap;
@@ -65,6 +67,12 @@ static const struct regmap_config ktz8866_regmap_config = {
.max_register = REG_MAX,
};
+static inline void ktz8866_read(struct ktz8866 *ktz, unsigned int reg,
+ unsigned int *val)
+{
+ regmap_read(ktz->regmap, reg, &val);
+}
+
static void ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
unsigned int val)
{
@@ -112,11 +120,18 @@ static void ktz8866_init(struct ktz8866 *ktz)
{
unsigned int val = 0;
- if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val))
+ if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) {
ktz8866_write(ktz, BL_EN, BIT(val) - 1);
- else
- /* Enable all 6 current sinks if the number of current sinks isn't specified. */
- ktz8866_write(ktz, BL_EN, BIT(6) - 1);
+ } else {
+ /*
+ * Enable all 6 current sinks if the number of current
+ * sinks isn't specified and the bootloader didn't set
+ * the value.
+ */
+ ktz8866_read(ktz, BL_EN, &val);
+ if (!(val && CURRENT_SINKS_MASK))
+ ktz8866_write(ktz, BL_EN, CURRENT_SINKS_MASK);
+ }
if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) {
if (val <= 128)
--
2.49.0
^ permalink raw reply related
* [PATCH 4/4] backlight: ktz8866: add definitions to make it more readable
From: Pengyu Luo @ 2025-04-07 9:51 UTC (permalink / raw)
To: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Pengyu Luo
In-Reply-To: <20250407095119.588920-1-mitltlatltl@gmail.com>
LSB, MSB and their handling are slightly confused, so improve it.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
drivers/video/backlight/ktz8866.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c
index b67ca136d..5364ecfc0 100644
--- a/drivers/video/backlight/ktz8866.c
+++ b/drivers/video/backlight/ktz8866.c
@@ -24,7 +24,9 @@
#define DEVICE_ID 0x01
#define BL_CFG1 0x02
#define BL_CFG2 0x03
+/* least significant byte */
#define BL_BRT_LSB 0x04
+/* most significant byte */
#define BL_BRT_MSB 0x05
#define BL_EN 0x08
#define LCD_BIAS_CFG1 0x09
@@ -47,6 +49,8 @@
#define PWM_HYST 0x5
#define CURRENT_SINKS_MASK GENMASK(5, 0)
+#define LOWER_BYTE GENMASK(2, 0)
+#define HIGHER_BYTE GENMASK(10, 3)
struct ktz8866_slave {
struct i2c_client *client;
@@ -105,8 +109,8 @@ static int ktz8866_backlight_update_status(struct backlight_device *backlight_de
}
/* Set brightness */
- ktz8866_write(ktz, BL_BRT_LSB, brightness & 0x7);
- ktz8866_write(ktz, BL_BRT_MSB, (brightness >> 3) & 0xFF);
+ ktz8866_write(ktz, BL_BRT_LSB, FIELD_GET(LOWER_BYTE, brightness);
+ ktz8866_write(ktz, BL_BRT_MSB, FIELD_GET(HIGHER_BYTE, brightness);
return 0;
}
--
2.49.0
^ permalink raw reply related
* Re: [PATCH 1/4] dt-bindings: backlight: kinetic,ktz8866: add ktz8866 slave compatible
From: Krzysztof Kozlowski @ 2025-04-07 9:57 UTC (permalink / raw)
To: Pengyu Luo, Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev
In-Reply-To: <20250407095119.588920-2-mitltlatltl@gmail.com>
On 07/04/2025 11:51, Pengyu Luo wrote:
> Kinetic ktz8866, found in many android devices, nowadays, some oem use
> dual ktz8866 to support a larger panel and higher brightness, add the
Just one space after 'and'.
> binding for slave case.
>
> Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> ---
> .../leds/backlight/kinetic,ktz8866.yaml | 29 +++++++++++++++----
> 1 file changed, 24 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml b/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
> index c914e1276..825a6fbf1 100644
> --- a/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
> +++ b/Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml
> @@ -19,7 +19,9 @@ allOf:
>
> properties:
> compatible:
> - const: kinetic,ktz8866
> + enum:
> + - kinetic,ktz8866
> + - kinetic,ktz8866-slave
Does not look right. That's the same device. Same devices have same
compatible.
>
> reg:
> maxItems: 1
> @@ -58,9 +60,16 @@ properties:
> required:
> - compatible
> - reg
> - - vddpos-supply
> - - vddneg-supply
> - - enable-gpios
> +
> +if:
> + properties:
> + compatible:
> + const: kinetic,ktz8866
> +then:
> + required:
> + - vddpos-supply
> + - vddneg-supply
> + - enable-gpios
I don't understand why other device does not need power.
>
> unevaluatedProperties: false
>
> @@ -68,7 +77,7 @@ examples:
> - |
> #include <dt-bindings/gpio/gpio.h>
>
> - i2c {
> + i2c0 {
No, don't change.
> #address-cells = <1>;
> #size-cells = <0>;
>
> @@ -84,3 +93,13 @@ examples:
> kinetic,enable-lcd-bias;
> };
> };
> +
> + i2c1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + backlight@11 {
> + compatible = "kinetic,ktz8866-slave";
> + reg = <0x11>;
No real differences here, so drop the example. Anyway, new examples
would start from - | (see other bindings).
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 2/4] backlight: ktz8866: add slave handler
From: Krzysztof Kozlowski @ 2025-04-07 10:00 UTC (permalink / raw)
To: Pengyu Luo, Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev
In-Reply-To: <20250407095119.588920-3-mitltlatltl@gmail.com>
On 07/04/2025 11:51, Pengyu Luo wrote:
> Kinetic ktz8866, found in many android devices, nowadays, some oem use
> dual ktz8866 to support a larger panel and higher brightness, original
> driver would only handle half backlight region on these devices,
> registering it twice is unreasonable, so adding the slave handler to
> support it.
>
> Note that, none of the devices supported by upstream require this, the
> devices using this is porting.
>
> Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> ---
> drivers/video/backlight/ktz8866.c | 68 +++++++++++++++++++++++++++----
> 1 file changed, 59 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c
> index 351c2b4d6..017ad80dd 100644
> --- a/drivers/video/backlight/ktz8866.c
> +++ b/drivers/video/backlight/ktz8866.c
> @@ -3,6 +3,9 @@
> * Backlight driver for the Kinetic KTZ8866
> *
> * Copyright (C) 2022, 2023 Jianhua Lu <lujianhua000@gmail.com>
> + *
> + * Apr 2025 - Pengyu Luo <mitltlatltl@gmail.com>
> + * Added handling for dual KTZ8866(master and slave)
> */
>
> #include <linux/backlight.h>
> @@ -43,11 +46,17 @@
> #define LCD_BIAS_EN 0x9F
> #define PWM_HYST 0x5
>
> +struct ktz8866_slave {
> + struct i2c_client *client;
> + struct regmap *regmap;
> +};
> +
> struct ktz8866 {
> struct i2c_client *client;
> struct regmap *regmap;
> - bool led_on;
> struct gpio_desc *enable_gpio;
> + struct ktz8866_slave *slave;
> + bool led_on;
> };
>
> static const struct regmap_config ktz8866_regmap_config = {
> @@ -56,16 +65,22 @@ static const struct regmap_config ktz8866_regmap_config = {
> .max_register = REG_MAX,
> };
>
> -static int ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
> - unsigned int val)
> +static void ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
> + unsigned int val)
> {
> - return regmap_write(ktz->regmap, reg, val);
> + regmap_write(ktz->regmap, reg, val);
> +
> + if (ktz->slave)
> + regmap_write(ktz->slave->regmap, reg, val);
> }
>
> -static int ktz8866_update_bits(struct ktz8866 *ktz, unsigned int reg,
> - unsigned int mask, unsigned int val)
> +static void ktz8866_update_bits(struct ktz8866 *ktz, unsigned int reg,
> + unsigned int mask, unsigned int val)
> {
> - return regmap_update_bits(ktz->regmap, reg, mask, val);
> + regmap_update_bits(ktz->regmap, reg, mask, val);
> +
> + if (ktz->slave)
> + regmap_update_bits(ktz->slave->regmap, reg, mask, val);
> }
>
> static int ktz8866_backlight_update_status(struct backlight_device *backlight_dev)
> @@ -124,10 +139,41 @@ static void ktz8866_init(struct ktz8866 *ktz)
> ktz8866_write(ktz, LCD_BIAS_CFG1, LCD_BIAS_EN);
> }
>
> +static int ktz8866_slave_register(struct ktz8866 *ktz)
> +{
> + struct device *dev = &ktz->client->dev;
> + struct ktz8866_slave *slave;
> + struct i2c_client *client;
> + struct device_node *np;
> +
> + np = of_find_compatible_node(NULL, NULL, "kinetic,ktz8866-slave");
> + if (!np)
> + return 0;
> +
> + client = of_find_i2c_device_by_node(np);
I wrote on IRC - phandle to express the relationship between hardware -
and I do not see it implemented.
If you have devices depending on each other, you need to express it -
for links, for resource dependencies etc. phandle is for that usually.
Or OF graph. Or parent-child relationship.
You did not provide any description of the hardware in the binding, so I
really do not have any idea what is this setup thus how to represent it.
Use hardware terms, diagrams etc to explain the hardware in the bindings
commit. What are the addresses? Are there any shared resources? What
buses are devices sitting on, etc.
Best regards,
Krzysztof
^ permalink raw reply
* [PATCH] fbdev/nvidiafb: Correct const string length in nvidiafb_setup()
From: Zijun Hu @ 2025-04-07 11:55 UTC (permalink / raw)
To: Antonino Daplas, Helge Deller
Cc: Zijun Hu, linux-fbdev, dri-devel, linux-kernel, Zijun Hu
From: Zijun Hu <quic_zijuhu@quicinc.com>
The actual length of const string "noaccel" is 7, but the strncmp()
branch in nvidiafb_setup() wrongly hard codes it as 6.
Fix by using actual length 7 as argument of the strncmp().
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
drivers/video/fbdev/nvidia/nvidia.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c
index 8900f181f1952acd2acc16a6ab49a5a42ec056ac..cfaf9454014d8161bedc3598fb68855e04ea9408 100644
--- a/drivers/video/fbdev/nvidia/nvidia.c
+++ b/drivers/video/fbdev/nvidia/nvidia.c
@@ -1484,7 +1484,7 @@ static int nvidiafb_setup(char *options)
flatpanel = 1;
} else if (!strncmp(this_opt, "hwcur", 5)) {
hwcur = 1;
- } else if (!strncmp(this_opt, "noaccel", 6)) {
+ } else if (!strncmp(this_opt, "noaccel", 7)) {
noaccel = 1;
} else if (!strncmp(this_opt, "noscale", 7)) {
noscale = 1;
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250407-fix_nvidia-a9d72c98a808
Best regards,
--
Zijun Hu <quic_zijuhu@quicinc.com>
^ permalink raw reply related
* Re: [PATCH 3/4] backlight: ktz8866: improve current sinks setting
From: Daniel Thompson @ 2025-04-07 16:13 UTC (permalink / raw)
To: Pengyu Luo
Cc: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller,
dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev
In-Reply-To: <20250407095119.588920-4-mitltlatltl@gmail.com>
On Mon, Apr 07, 2025 at 05:51:18PM +0800, Pengyu Luo wrote:
> I polled all registers when the module was loading, found that
> current sinks have already been configured. Bootloader would set
> when booting. So checking it before setting the all channels.
Can you rephrase this so the problem and solution are more clearly
expressed. Perhaps template Ingo suggests here would be good:
https://www.spinics.net/lists/kernel/msg1633438.html
> Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> ---
> drivers/video/backlight/ktz8866.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c
> index 017ad80dd..b67ca136d 100644
> --- a/drivers/video/backlight/ktz8866.c
> +++ b/drivers/video/backlight/ktz8866.c
> @@ -46,6 +46,8 @@
> #define LCD_BIAS_EN 0x9F
> #define PWM_HYST 0x5
>
> +#define CURRENT_SINKS_MASK GENMASK(5, 0)
> +
Call this BL_EN_CURRENT_SINKS_MASK and keep it next to the register it
applies to.
> struct ktz8866_slave {
> struct i2c_client *client;
> struct regmap *regmap;
> @@ -112,11 +120,18 @@ static void ktz8866_init(struct ktz8866 *ktz)
> {
> unsigned int val = 0;
>
> - if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val))
> + if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) {
> ktz8866_write(ktz, BL_EN, BIT(val) - 1);
> - else
> - /* Enable all 6 current sinks if the number of current sinks isn't specified. */
> - ktz8866_write(ktz, BL_EN, BIT(6) - 1);
> + } else {
> + /*
> + * Enable all 6 current sinks if the number of current
> + * sinks isn't specified and the bootloader didn't set
> + * the value.
> + */
> + ktz8866_read(ktz, BL_EN, &val);
> + if (!(val && CURRENT_SINKS_MASK))
This is the wrong form of AND.
> + ktz8866_write(ktz, BL_EN, CURRENT_SINKS_MASK);
> + }
Daniel.
^ permalink raw reply
* Re: [PATCH 4/4] backlight: ktz8866: add definitions to make it more readable
From: Daniel Thompson @ 2025-04-07 16:18 UTC (permalink / raw)
To: Pengyu Luo
Cc: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller,
dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev
In-Reply-To: <20250407095119.588920-5-mitltlatltl@gmail.com>
On Mon, Apr 07, 2025 at 05:51:19PM +0800, Pengyu Luo wrote:
> LSB, MSB and their handling are slightly confused, so improve it.
>
> Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> ---
> drivers/video/backlight/ktz8866.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c
> index b67ca136d..5364ecfc0 100644
> --- a/drivers/video/backlight/ktz8866.c
> +++ b/drivers/video/backlight/ktz8866.c
> @@ -24,7 +24,9 @@
> #define DEVICE_ID 0x01
> #define BL_CFG1 0x02
> #define BL_CFG2 0x03
> +/* least significant byte */
> #define BL_BRT_LSB 0x04
> +/* most significant byte */
I'm not convinced these comments are necessary.
> #define BL_BRT_MSB 0x05
> #define BL_EN 0x08
> #define LCD_BIAS_CFG1 0x09
> @@ -47,6 +49,8 @@
> #define PWM_HYST 0x5
>
> #define CURRENT_SINKS_MASK GENMASK(5, 0)
> +#define LOWER_BYTE GENMASK(2, 0)
I like using masks and FIELD_GET() but this is not a byte. These are
the least significant bits.
Daniel.
^ permalink raw reply
* Re: [PATCH 2/4] backlight: ktz8866: add slave handler
From: Daniel Thompson @ 2025-04-07 16:27 UTC (permalink / raw)
To: Pengyu Luo
Cc: Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Helge Deller,
dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev
In-Reply-To: <20250407095119.588920-3-mitltlatltl@gmail.com>
On Mon, Apr 07, 2025 at 05:51:17PM +0800, Pengyu Luo wrote:
> Kinetic ktz8866, found in many android devices, nowadays, some oem use
> dual ktz8866 to support a larger panel and higher brightness, original
> driver would only handle half backlight region on these devices,
> registering it twice is unreasonable, so adding the slave handler to
> support it.
Is there anything unique about KTZ8866 that allows it to be used like
this? I think it would be better to add support for secondary backlight
controllers into the backlight framework, rather than having to
implement driver specific hacks for every backlight controller that
appears in a primary/secondary configuration.
Also, the kernel seeks to avoid adding new instances of master/slave
terminology. See the coding style doc for suggested alternatives:
https://www.kernel.org/doc/html/latest/process/coding-style.html#naming
Daniel.
^ permalink raw reply
* Re: [PATCH 3/4] backlight: ktz8866: improve current sinks setting
From: kernel test robot @ 2025-04-08 3:45 UTC (permalink / raw)
To: Pengyu Luo, Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: llvm, oe-kbuild-all, dri-devel, linux-leds, devicetree,
linux-kernel, linux-fbdev, Pengyu Luo
In-Reply-To: <20250407095119.588920-4-mitltlatltl@gmail.com>
Hi Pengyu,
kernel test robot noticed the following build errors:
[auto build test ERROR on lee-backlight/for-backlight-next]
[also build test ERROR on lee-leds/for-leds-next lee-backlight/for-backlight-fixes linus/master v6.15-rc1 next-20250407]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pengyu-Luo/dt-bindings-backlight-kinetic-ktz8866-add-ktz8866-slave-compatible/20250407-175635
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
patch link: https://lore.kernel.org/r/20250407095119.588920-4-mitltlatltl%40gmail.com
patch subject: [PATCH 3/4] backlight: ktz8866: improve current sinks setting
config: riscv-randconfig-002-20250408 (https://download.01.org/0day-ci/archive/20250408/202504081109.E7PjHxpa-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250408/202504081109.E7PjHxpa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504081109.E7PjHxpa-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> drivers/video/backlight/ktz8866.c:73:32: error: incompatible pointer types passing 'unsigned int **' to parameter of type 'unsigned int *'; remove & [-Werror,-Wincompatible-pointer-types]
73 | regmap_read(ktz->regmap, reg, &val);
| ^~~~
include/linux/regmap.h:1297:69: note: passing argument to parameter 'val' here
1297 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
| ^
>> drivers/video/backlight/ktz8866.c:132:13: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
132 | if (!(val && CURRENT_SINKS_MASK))
| ^ ~~~~~~~~~~~~~~~~~~
drivers/video/backlight/ktz8866.c:132:13: note: use '&' for a bitwise operation
132 | if (!(val && CURRENT_SINKS_MASK))
| ^~
| &
drivers/video/backlight/ktz8866.c:132:13: note: remove constant to silence this warning
132 | if (!(val && CURRENT_SINKS_MASK))
| ^~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +73 drivers/video/backlight/ktz8866.c
69
70 static inline void ktz8866_read(struct ktz8866 *ktz, unsigned int reg,
71 unsigned int *val)
72 {
> 73 regmap_read(ktz->regmap, reg, &val);
74 }
75
76 static void ktz8866_write(struct ktz8866 *ktz, unsigned int reg,
77 unsigned int val)
78 {
79 regmap_write(ktz->regmap, reg, val);
80
81 if (ktz->slave)
82 regmap_write(ktz->slave->regmap, reg, val);
83 }
84
85 static void ktz8866_update_bits(struct ktz8866 *ktz, unsigned int reg,
86 unsigned int mask, unsigned int val)
87 {
88 regmap_update_bits(ktz->regmap, reg, mask, val);
89
90 if (ktz->slave)
91 regmap_update_bits(ktz->slave->regmap, reg, mask, val);
92 }
93
94 static int ktz8866_backlight_update_status(struct backlight_device *backlight_dev)
95 {
96 struct ktz8866 *ktz = bl_get_data(backlight_dev);
97 unsigned int brightness = backlight_get_brightness(backlight_dev);
98
99 if (!ktz->led_on && brightness > 0) {
100 ktz8866_update_bits(ktz, BL_EN, BL_EN_BIT, BL_EN_BIT);
101 ktz->led_on = true;
102 } else if (brightness == 0) {
103 ktz8866_update_bits(ktz, BL_EN, BL_EN_BIT, 0);
104 ktz->led_on = false;
105 }
106
107 /* Set brightness */
108 ktz8866_write(ktz, BL_BRT_LSB, brightness & 0x7);
109 ktz8866_write(ktz, BL_BRT_MSB, (brightness >> 3) & 0xFF);
110
111 return 0;
112 }
113
114 static const struct backlight_ops ktz8866_backlight_ops = {
115 .options = BL_CORE_SUSPENDRESUME,
116 .update_status = ktz8866_backlight_update_status,
117 };
118
119 static void ktz8866_init(struct ktz8866 *ktz)
120 {
121 unsigned int val = 0;
122
123 if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) {
124 ktz8866_write(ktz, BL_EN, BIT(val) - 1);
125 } else {
126 /*
127 * Enable all 6 current sinks if the number of current
128 * sinks isn't specified and the bootloader didn't set
129 * the value.
130 */
131 ktz8866_read(ktz, BL_EN, &val);
> 132 if (!(val && CURRENT_SINKS_MASK))
133 ktz8866_write(ktz, BL_EN, CURRENT_SINKS_MASK);
134 }
135
136 if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) {
137 if (val <= 128)
138 ktz8866_write(ktz, BL_CFG2, BIT(7) | (ilog2(val) << 3) | PWM_HYST);
139 else
140 ktz8866_write(ktz, BL_CFG2, BIT(7) | ((5 + val / 64) << 3) | PWM_HYST);
141 }
142
143 if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,led-enable-ramp-delay-ms", &val)) {
144 if (val == 0)
145 ktz8866_write(ktz, BL_DIMMING, 0);
146 else {
147 unsigned int ramp_off_time = ilog2(val) + 1;
148 unsigned int ramp_on_time = ramp_off_time << 4;
149 ktz8866_write(ktz, BL_DIMMING, ramp_on_time | ramp_off_time);
150 }
151 }
152
153 if (of_property_read_bool(ktz->client->dev.of_node, "kinetic,enable-lcd-bias"))
154 ktz8866_write(ktz, LCD_BIAS_CFG1, LCD_BIAS_EN);
155 }
156
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [PATCH 3/4] backlight: ktz8866: improve current sinks setting
From: kernel test robot @ 2025-04-08 3:55 UTC (permalink / raw)
To: Pengyu Luo, Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: oe-kbuild-all, dri-devel, linux-leds, devicetree, linux-kernel,
linux-fbdev, Pengyu Luo
In-Reply-To: <20250407095119.588920-4-mitltlatltl@gmail.com>
Hi Pengyu,
kernel test robot noticed the following build errors:
[auto build test ERROR on lee-backlight/for-backlight-next]
[also build test ERROR on lee-leds/for-leds-next lee-backlight/for-backlight-fixes linus/master v6.15-rc1 next-20250407]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pengyu-Luo/dt-bindings-backlight-kinetic-ktz8866-add-ktz8866-slave-compatible/20250407-175635
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
patch link: https://lore.kernel.org/r/20250407095119.588920-4-mitltlatltl%40gmail.com
patch subject: [PATCH 3/4] backlight: ktz8866: improve current sinks setting
config: sparc64-randconfig-002-20250408 (https://download.01.org/0day-ci/archive/20250408/202504081106.mAYfJsQj-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250408/202504081106.mAYfJsQj-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504081106.mAYfJsQj-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/video/backlight/ktz8866.c: In function 'ktz8866_read':
>> drivers/video/backlight/ktz8866.c:73:39: error: passing argument 3 of 'regmap_read' from incompatible pointer type [-Wincompatible-pointer-types]
73 | regmap_read(ktz->regmap, reg, &val);
| ^~~~
| |
| unsigned int **
In file included from drivers/video/backlight/ktz8866.c:17:
include/linux/regmap.h:1297:69: note: expected 'unsigned int *' but argument is of type 'unsigned int **'
1297 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
| ~~~~~~~~~~~~~~^~~
vim +/regmap_read +73 drivers/video/backlight/ktz8866.c
69
70 static inline void ktz8866_read(struct ktz8866 *ktz, unsigned int reg,
71 unsigned int *val)
72 {
> 73 regmap_read(ktz->regmap, reg, &val);
74 }
75
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [PATCH 4/4] backlight: ktz8866: add definitions to make it more readable
From: kernel test robot @ 2025-04-08 5:19 UTC (permalink / raw)
To: Pengyu Luo, Jianhua Lu, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: llvm, oe-kbuild-all, dri-devel, linux-leds, devicetree,
linux-kernel, linux-fbdev, Pengyu Luo
In-Reply-To: <20250407095119.588920-5-mitltlatltl@gmail.com>
Hi Pengyu,
kernel test robot noticed the following build errors:
[auto build test ERROR on lee-backlight/for-backlight-next]
[also build test ERROR on lee-leds/for-leds-next lee-backlight/for-backlight-fixes linus/master v6.15-rc1 next-20250407]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pengyu-Luo/dt-bindings-backlight-kinetic-ktz8866-add-ktz8866-slave-compatible/20250407-175635
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
patch link: https://lore.kernel.org/r/20250407095119.588920-5-mitltlatltl%40gmail.com
patch subject: [PATCH 4/4] backlight: ktz8866: add definitions to make it more readable
config: riscv-randconfig-002-20250408 (https://download.01.org/0day-ci/archive/20250408/202504081215.rL4DExNA-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250408/202504081215.rL4DExNA-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504081215.rL4DExNA-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/video/backlight/ktz8866.c:77:32: error: incompatible pointer types passing 'unsigned int **' to parameter of type 'unsigned int *'; remove & [-Werror,-Wincompatible-pointer-types]
77 | regmap_read(ktz->regmap, reg, &val);
| ^~~~
include/linux/regmap.h:1297:69: note: passing argument to parameter 'val' here
1297 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
| ^
>> drivers/video/backlight/ktz8866.c:112:66: error: expected ')'
112 | ktz8866_write(ktz, BL_BRT_LSB, FIELD_GET(LOWER_BYTE, brightness);
| ^
drivers/video/backlight/ktz8866.c:112:15: note: to match this '('
112 | ktz8866_write(ktz, BL_BRT_LSB, FIELD_GET(LOWER_BYTE, brightness);
| ^
drivers/video/backlight/ktz8866.c:113:67: error: expected ')'
113 | ktz8866_write(ktz, BL_BRT_MSB, FIELD_GET(HIGHER_BYTE, brightness);
| ^
drivers/video/backlight/ktz8866.c:113:15: note: to match this '('
113 | ktz8866_write(ktz, BL_BRT_MSB, FIELD_GET(HIGHER_BYTE, brightness);
| ^
drivers/video/backlight/ktz8866.c:136:13: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
136 | if (!(val && CURRENT_SINKS_MASK))
| ^ ~~~~~~~~~~~~~~~~~~
drivers/video/backlight/ktz8866.c:136:13: note: use '&' for a bitwise operation
136 | if (!(val && CURRENT_SINKS_MASK))
| ^~
| &
drivers/video/backlight/ktz8866.c:136:13: note: remove constant to silence this warning
136 | if (!(val && CURRENT_SINKS_MASK))
| ^~~~~~~~~~~~~~~~~~~~~
1 warning and 3 errors generated.
vim +112 drivers/video/backlight/ktz8866.c
97
98 static int ktz8866_backlight_update_status(struct backlight_device *backlight_dev)
99 {
100 struct ktz8866 *ktz = bl_get_data(backlight_dev);
101 unsigned int brightness = backlight_get_brightness(backlight_dev);
102
103 if (!ktz->led_on && brightness > 0) {
104 ktz8866_update_bits(ktz, BL_EN, BL_EN_BIT, BL_EN_BIT);
105 ktz->led_on = true;
106 } else if (brightness == 0) {
107 ktz8866_update_bits(ktz, BL_EN, BL_EN_BIT, 0);
108 ktz->led_on = false;
109 }
110
111 /* Set brightness */
> 112 ktz8866_write(ktz, BL_BRT_LSB, FIELD_GET(LOWER_BYTE, brightness);
113 ktz8866_write(ktz, BL_BRT_MSB, FIELD_GET(HIGHER_BYTE, brightness);
114
115 return 0;
116 }
117
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* [PATCH] fbdev: via: use new GPIO line value setter callbacks
From: Bartosz Golaszewski @ 2025-04-08 7:42 UTC (permalink / raw)
To: Florian Tobias Schandinat, Helge Deller, Linus Walleij,
Bartosz Golaszewski
Cc: linux-fbdev, dri-devel, linux-kernel, linux-gpio,
Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Commit 98ce1eb1fd87e ("gpiolib: introduce gpio_chip setters that return
values") added new line setter callbacks to struct gpio_chip. They allow
to indicate failures to callers. We're in the process of converting all
GPIO controllers to using them before removing the old ones.
---
drivers/video/fbdev/via/via-gpio.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/via/via-gpio.c b/drivers/video/fbdev/via/via-gpio.c
index 9577c2cd52c7..27226a8f3f42 100644
--- a/drivers/video/fbdev/via/via-gpio.c
+++ b/drivers/video/fbdev/via/via-gpio.c
@@ -81,8 +81,7 @@ struct viafb_gpio_cfg {
/*
* GPIO access functions
*/
-static void via_gpio_set(struct gpio_chip *chip, unsigned int nr,
- int value)
+static int via_gpio_set(struct gpio_chip *chip, unsigned int nr, int value)
{
struct viafb_gpio_cfg *cfg = gpiochip_get_data(chip);
u8 reg;
@@ -99,13 +98,14 @@ static void via_gpio_set(struct gpio_chip *chip, unsigned int nr,
reg &= ~(0x10 << gpio->vg_mask_shift);
via_write_reg(VIASR, gpio->vg_port_index, reg);
spin_unlock_irqrestore(&cfg->vdev->reg_lock, flags);
+
+ return 0;
}
static int via_gpio_dir_out(struct gpio_chip *chip, unsigned int nr,
int value)
{
- via_gpio_set(chip, nr, value);
- return 0;
+ return via_gpio_set(chip, nr, value);
}
/*
@@ -146,7 +146,7 @@ static struct viafb_gpio_cfg viafb_gpio_config = {
.label = "VIAFB onboard GPIO",
.owner = THIS_MODULE,
.direction_output = via_gpio_dir_out,
- .set = via_gpio_set,
+ .set_rv = via_gpio_set,
.direction_input = via_gpio_dir_input,
.get = via_gpio_get,
.base = -1,
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250331-gpiochip-set-rv-video-6bf1584aa770
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply related
* [PATCH v2 0/8] staging: sm750fb: change function naming style
From: Richard Akintola @ 2025-04-08 10:20 UTC (permalink / raw)
To: outreachy
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel, Richard Akintola
Address checkpatch's "Avoid camelCase" for sm750fb module by changing
function name to conform to kernel code style.
The patches are required to be applied in sequence.
---
changes in v2:
- Fixed typo in the commit message for patch 1
- Sent patches as patchset
Richard Akintola (8):
staging: sm750fb: change sii164GetDeviceID to snake_case
staging: sm750fb: change sii164ResetChip to snake_case
staging: sm750fb: change sii164SetPower to snake_case
staging: sm750fb: change sii164GetChipString to snake_case
staging: sm750fb: change sii164EnableHotPlugDetection to snake_case
staging: sm750fb: change sii164IsConnected to snake_case
staging: sm750fb: change sii164CheckInterrupt to snake_case
staging: sm750fb: change sii164ClearInterrupt to snake_case
drivers/staging/sm750fb/ddk750_dvi.c | 16 +++++-----
drivers/staging/sm750fb/ddk750_sii164.c | 42 ++++++++++++-------------
drivers/staging/sm750fb/ddk750_sii164.h | 16 +++++-----
3 files changed, 37 insertions(+), 37 deletions(-)
--
2.39.5
^ permalink raw reply
* [PATCH v2 1/8] staging: sm750fb: change sii164GetDeviceID to snake_case
From: Richard Akintola @ 2025-04-08 10:20 UTC (permalink / raw)
To: outreachy
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel, Richard Akintola
In-Reply-To: <cover.1744105388.git.princerichard17a@gmail.com>
Change camelCase function name sii164GetDeviceID to sii164_get_device_id
to conform to kernel code styles as reported by checkpatch.pl
CHECK: Avoid camelCase: <sii164GetDeviceID>
Signed-off-by: Richard Akintola <princerichard17a@gmail.com>
---
drivers/staging/sm750fb/ddk750_dvi.c | 2 +-
drivers/staging/sm750fb/ddk750_sii164.c | 6 +++---
drivers/staging/sm750fb/ddk750_sii164.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
index 8b81e8642f9e..3fb14eff2de1 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -16,7 +16,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = {
{
.init = sii164_init_chip,
.get_vendor_id = sii164_get_vendor_id,
- .get_device_id = sii164GetDeviceID,
+ .get_device_id = sii164_get_device_id,
#ifdef SII164_FULL_FUNCTIONS
.reset_chip = sii164ResetChip,
.get_chip_string = sii164GetChipString,
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c
index 2532b60245ac..223c181dc649 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -48,13 +48,13 @@ unsigned short sii164_get_vendor_id(void)
}
/*
- * sii164GetDeviceID
+ * sii164_get_device_id
* This function gets the device ID of the DVI controller chip.
*
* Output:
* Device ID
*/
-unsigned short sii164GetDeviceID(void)
+unsigned short sii164_get_device_id(void)
{
unsigned short deviceID;
@@ -141,7 +141,7 @@ long sii164_init_chip(unsigned char edge_select,
/* Check if SII164 Chip exists */
if ((sii164_get_vendor_id() == SII164_VENDOR_ID) &&
- (sii164GetDeviceID() == SII164_DEVICE_ID)) {
+ (sii164_get_device_id() == SII164_DEVICE_ID)) {
/*
* Initialize SII164 controller chip.
*/
diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h
index 71a7c1cb42c4..a76091f6622b 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.h
+++ b/drivers/staging/sm750fb/ddk750_sii164.h
@@ -28,7 +28,7 @@ long sii164_init_chip(unsigned char edgeSelect,
unsigned char pllFilterValue);
unsigned short sii164_get_vendor_id(void);
-unsigned short sii164GetDeviceID(void);
+unsigned short sii164_get_device_id(void);
#ifdef SII164_FULL_FUNCTIONS
void sii164ResetChip(void);
--
2.39.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox