* [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series
@ 2020-10-11 12:28 Dario Binacchi
2020-10-11 12:28 ` [PATCH 1/2] video: backlight: fix pwm data structure description Dario Binacchi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dario Binacchi @ 2020-10-11 12:28 UTC (permalink / raw)
To: u-boot
As suggested by Grygorii Strashko I have removed these patches from the
'Add DM support for omap PWM backlight' series and grouped them into
this one. One of the two patches has already been reviewed by Simon Glass.
Dario Binacchi (2):
video: backlight: fix pwm data structure description
video: backlight: fix pwm's duty cycle calculation
drivers/video/pwm_backlight.c | 4 ++--
test/dm/panel.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] video: backlight: fix pwm data structure description
2020-10-11 12:28 [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Dario Binacchi
@ 2020-10-11 12:28 ` Dario Binacchi
2020-10-11 12:28 ` [PATCH 2/2] video: backlight: fix pwm's duty cycle calculation Dario Binacchi
2020-10-19 21:30 ` [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Anatolij Gustschin
2 siblings, 0 replies; 4+ messages in thread
From: Dario Binacchi @ 2020-10-11 12:28 UTC (permalink / raw)
To: u-boot
The description of the 'max_level' field was incorrectly assigned to the
'min_level' field.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
---
drivers/video/pwm_backlight.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index 468a5703bd..acfde7ba3d 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -33,7 +33,7 @@
* @cur_level: Current level for the backlight (index or value)
* @default_level: Default level for the backlight (index or value)
* @min_level: Minimum level of the backlight (full off)
- * @min_level: Maximum level of the backlight (full on)
+ * @max_level: Maximum level of the backlight (full on)
* @enabled: true if backlight is enabled
*/
struct pwm_backlight_priv {
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] video: backlight: fix pwm's duty cycle calculation
2020-10-11 12:28 [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Dario Binacchi
2020-10-11 12:28 ` [PATCH 1/2] video: backlight: fix pwm data structure description Dario Binacchi
@ 2020-10-11 12:28 ` Dario Binacchi
2020-10-19 21:30 ` [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Anatolij Gustschin
2 siblings, 0 replies; 4+ messages in thread
From: Dario Binacchi @ 2020-10-11 12:28 UTC (permalink / raw)
To: u-boot
For levels equal to the maximum value, the duty cycle must be equal to
the period.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
drivers/video/pwm_backlight.c | 2 +-
test/dm/panel.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index acfde7ba3d..9519180ceb 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -63,7 +63,7 @@ static int set_pwm(struct pwm_backlight_priv *priv)
int ret;
duty_cycle = priv->period_ns * (priv->cur_level - priv->min_level) /
- (priv->max_level - priv->min_level + 1);
+ (priv->max_level - priv->min_level);
ret = pwm_set_config(priv->pwm, priv->channel, priv->period_ns,
duty_cycle);
if (ret)
diff --git a/test/dm/panel.c b/test/dm/panel.c
index a840fb4951..49f5ac7169 100644
--- a/test/dm/panel.c
+++ b/test/dm/panel.c
@@ -40,7 +40,7 @@ static int dm_test_panel(struct unit_test_state *uts)
ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns,
&enable, &polarity));
ut_asserteq(1000, period_ns);
- ut_asserteq(170 * 1000 / 256, duty_ns);
+ ut_asserteq(170 * 1000 / 255, duty_ns);
ut_asserteq(true, enable);
ut_asserteq(false, polarity);
ut_asserteq(1, sandbox_gpio_get_value(gpio, 1));
@@ -49,29 +49,29 @@ static int dm_test_panel(struct unit_test_state *uts)
ut_assertok(panel_set_backlight(dev, 40));
ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns,
&enable, &polarity));
- ut_asserteq(64 * 1000 / 256, duty_ns);
+ ut_asserteq(64 * 1000 / 255, duty_ns);
ut_assertok(panel_set_backlight(dev, BACKLIGHT_MAX));
ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns,
&enable, &polarity));
- ut_asserteq(255 * 1000 / 256, duty_ns);
+ ut_asserteq(255 * 1000 / 255, duty_ns);
ut_assertok(panel_set_backlight(dev, BACKLIGHT_MIN));
ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns,
&enable, &polarity));
- ut_asserteq(0 * 1000 / 256, duty_ns);
+ ut_asserteq(0 * 1000 / 255, duty_ns);
ut_asserteq(1, sandbox_gpio_get_value(gpio, 1));
ut_assertok(panel_set_backlight(dev, BACKLIGHT_DEFAULT));
ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns,
&enable, &polarity));
ut_asserteq(true, enable);
- ut_asserteq(170 * 1000 / 256, duty_ns);
+ ut_asserteq(170 * 1000 / 255, duty_ns);
ut_assertok(panel_set_backlight(dev, BACKLIGHT_OFF));
ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns,
&enable, &polarity));
- ut_asserteq(0 * 1000 / 256, duty_ns);
+ ut_asserteq(0 * 1000 / 255, duty_ns);
ut_asserteq(0, sandbox_gpio_get_value(gpio, 1));
ut_asserteq(false, regulator_get_enable(reg));
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series
2020-10-11 12:28 [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Dario Binacchi
2020-10-11 12:28 ` [PATCH 1/2] video: backlight: fix pwm data structure description Dario Binacchi
2020-10-11 12:28 ` [PATCH 2/2] video: backlight: fix pwm's duty cycle calculation Dario Binacchi
@ 2020-10-19 21:30 ` Anatolij Gustschin
2 siblings, 0 replies; 4+ messages in thread
From: Anatolij Gustschin @ 2020-10-19 21:30 UTC (permalink / raw)
To: u-boot
On Sun, 11 Oct 2020 14:28:02 +0200
Dario Binacchi dariobin at libero.it wrote:
...
> Dario Binacchi (2):
> video: backlight: fix pwm data structure description
> video: backlight: fix pwm's duty cycle calculation
Series applied to u-boot-video/master, thanks!
--
Anatolij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-19 21:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-11 12:28 [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Dario Binacchi
2020-10-11 12:28 ` [PATCH 1/2] video: backlight: fix pwm data structure description Dario Binacchi
2020-10-11 12:28 ` [PATCH 2/2] video: backlight: fix pwm's duty cycle calculation Dario Binacchi
2020-10-19 21:30 ` [PATCH 0/2] PWM backlight patches from 'Add DM support for omap PWM backlight' series Anatolij Gustschin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox