* [PATCH] video: Add a callback 'notify_after' for backlight control
@ 2011-08-09 2:05 dilee
[not found] ` <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: dilee @ 2011-08-09 2:05 UTC (permalink / raw)
To: rpurdie-Fm38FmjxZ/leoWH0uzbU5w, lethal-M7jkjyW5wf5g9hUCZPvPmw,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw,
rmorell-DDmLM1+adcrQT0dZR+AlfA,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw
Cc: jnien-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Dilan Lee
From: Dilan Lee <dilee@nvidia.com>
We need a callback to do some things after pwm_enable, pwm_disable
and pwm_config.
This may be necessary to properly sequence timing on
certain devices.
For example, GPIO backlight_en has to be risen after pwm has been enabled
to meet panel power on sequence defined in panel specification.
Signed-off-by: Dilan Lee <dilee@nvidia.com>
---
drivers/video/backlight/pwm_bl.c | 11 ++++++++++-
include/linux/pwm_backlight.h | 1 +
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b8f38ec..e92e6e0 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -27,7 +27,9 @@ struct pwm_bl_data {
unsigned int period;
unsigned int lth_brightness;
int (*notify)(struct device *,
- int brightness);
+ int brightness);
+ void (*notify_after)(struct device *,
+ int brightness);
int (*check_fb)(struct device *, struct fb_info *);
};
@@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}
+
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, brightness);
+
return 0;
}
@@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
+ pb->notify_after = data->notify_after;
pb->check_fb = data->check_fb;
pb->lth_brightness = data->lth_brightness *
(data->pwm_period_ns / data->max_brightness);
@@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
pb->notify(pb->dev, 0);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, 0);
return 0;
}
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a..63d2df4 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
+ void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
int (*check_fb)(struct device *dev, struct fb_info *info);
};
--
1.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] video: Add a callback 'notify_after' for backlight
[not found] ` <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-08-09 2:12 ` Robert Morell
0 siblings, 0 replies; 6+ messages in thread
From: Robert Morell @ 2011-08-09 2:12 UTC (permalink / raw)
To: Dilan Lee
Cc: rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org,
lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
Jordan Nien, Stephen Warren,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Mon, Aug 08, 2011 at 07:05:25PM -0700, Dilan Lee wrote:
[...]
> For example, GPIO backlight_en has to be risen after pwm has been enabled
> to meet panel power on sequence defined in panel specification.
I still think this information is irrelevant/nonsensical here, and
should be omitted entirely..
[...]
> unsigned int lth_brightness;
> int (*notify)(struct device *,
> - int brightness);
> + int brightness);
Please don't change the line above; unlike the one you added after, it
was already lined up properly with its argument list.
Otherwise,
Reviewed-by: Robert Morell <rmorell@nvidia.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] video: Add a callback 'notify_after' for backlight control
2011-08-09 2:05 [PATCH] video: Add a callback 'notify_after' for backlight control dilee
[not found] ` <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-08-09 2:29 ` dilee
[not found] ` <1312856996-22452-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-08-09 8:32 ` [PATCH] video: Add a callback 'notify_after' for backlight control JinGoo Han
2 siblings, 1 reply; 6+ messages in thread
From: dilee @ 2011-08-09 2:29 UTC (permalink / raw)
To: rpurdie-Fm38FmjxZ/leoWH0uzbU5w, lethal-M7jkjyW5wf5g9hUCZPvPmw,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw,
rmorell-DDmLM1+adcrQT0dZR+AlfA,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw
Cc: jnien-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Dilan Lee
From: Dilan Lee <dilee@nvidia.com>
We need a callback to do some things after pwm_enable, pwm_disable
and pwm_config.
Signed-off-by: Dilan Lee <dilee@nvidia.com>
---
drivers/video/backlight/pwm_bl.c | 9 +++++++++
include/linux/pwm_backlight.h | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b8f38ec..8b5b2a4 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -28,6 +28,8 @@ struct pwm_bl_data {
unsigned int lth_brightness;
int (*notify)(struct device *,
int brightness);
+ void (*notify_after)(struct device *,
+ int brightness);
int (*check_fb)(struct device *, struct fb_info *);
};
@@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}
+
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, brightness);
+
return 0;
}
@@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
+ pb->notify_after = data->notify_after;
pb->check_fb = data->check_fb;
pb->lth_brightness = data->lth_brightness *
(data->pwm_period_ns / data->max_brightness);
@@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
pb->notify(pb->dev, 0);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, 0);
return 0;
}
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a..63d2df4 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
+ void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
int (*check_fb)(struct device *dev, struct fb_info *info);
};
--
1.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH] video: Add a callback 'notify_after' for backlight control
2011-08-09 2:05 [PATCH] video: Add a callback 'notify_after' for backlight control dilee
[not found] ` <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-08-09 2:29 ` [PATCH] video: Add a callback 'notify_after' for backlight control dilee
@ 2011-08-09 8:32 ` JinGoo Han
2 siblings, 0 replies; 6+ messages in thread
From: JinGoo Han @ 2011-08-09 8:32 UTC (permalink / raw)
To: dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org,
lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Cc: jnien-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 994 bytes --]
> -----Original Message-----
> From: linux-fbdev-owner@vger.kernel.org [mailto:linux-fbdev-
> owner@vger.kernel.org] On Behalf Of dilee@nvidia.com
> Sent: Tuesday, August 09, 2011 11:30 AM
> To: rpurdie@rpsys.net; lethal@linux-sh.org; akpm@linux-foundation.org;
> arun.murthy@stericsson.com; rmorell@nvidia.com;
> linus.walleij@stericsson.com
> Cc: jnien@nvidia.com; swarren@nvidia.com; linux-fbdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-tegra@vger.kernel.org; Dilan Lee
> Subject: [PATCH] video: Add a callback 'notify_after' for backlight
> control
>
> From: Dilan Lee <dilee@nvidia.com>
>
> We need a callback to do some things after pwm_enable, pwm_disable
> and pwm_config.
>
> Signed-off-by: Dilan Lee <dilee@nvidia.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
I reviewed and tested the patch.
It works properly.
Thanks,
Jingoo Han
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±ýöÝzÿâØ^nr¡ö¦zË\x1aëh¨èÚ&£ûàz¿äz¹Þú+Ê+zf£¢·h§~Ûiÿÿïêÿêçz_è®\x0fæj:+v¨þ)ߣøm
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-09 8:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-09 2:05 [PATCH] video: Add a callback 'notify_after' for backlight control dilee
[not found] ` <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-08-09 2:12 ` [PATCH] video: Add a callback 'notify_after' for backlight Robert Morell
2011-08-09 2:29 ` [PATCH] video: Add a callback 'notify_after' for backlight control dilee
[not found] ` <1312856996-22452-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-08-09 2:34 ` [PATCH] video: Add a callback 'notify_after' for backlight Robert Morell
2011-08-09 3:43 ` Arun MURTHY
2011-08-09 8:32 ` [PATCH] video: Add a callback 'notify_after' for backlight control JinGoo Han
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).