* [patch 1/5] video sysfs support - take 2: Add dev argument for backlight_device_register.
@ 2006-11-07 16:33 Yu Luming
2006-12-30 15:35 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Yu Luming @ 2006-11-07 16:33 UTC (permalink / raw)
To: Andrew Morton
Cc: Pavel Machek, len.brown, Matt Domsch, Alessandro Guido,
linux-kernel, linux-acpi, jengelh, gelma, ismail, Richard Hughes
This patch set adds generic abstract layer support for acpi video driver to have
generic user interface to control backlight and output switch control by leveraging
the existing backlight sysfs class driver, and by adding a new video output sysfs
class driver.
Patch 1/5: adds dev argument for backlight_device_register to link the class device
to real device object. The platform specific driver should find a way to get the real
device object for their video device.
signed-off-by: Luming Yu <Luming.yu@intel.com>
---
drivers/acpi/asus_acpi.c | 2 +-
drivers/acpi/ibm_acpi.c | 2 +-
drivers/acpi/toshiba_acpi.c | 3 ++-
drivers/video/backlight/backlight.c | 7 +++++--
include/linux/backlight.h | 2 +-
5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index a36436f..4d24efc 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1401,7 +1401,7 @@ static int __init asus_acpi_init(void)
return -ENODEV;
}
- asus_backlight_device = backlight_device_register("asus", NULL,
+ asus_backlight_device = backlight_device_register("asus",NULL,NULL,
&asus_backlight_data);
if (IS_ERR(asus_backlight_device)) {
printk(KERN_ERR "Could not register asus backlight device\n");
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 9658253..ba52b78 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -2072,7 +2072,7 @@ #endif
}
}
- ibm_backlight_device = backlight_device_register("ibm", NULL,
+ ibm_backlight_device = backlight_device_register("ibm",NULL,NULL,
&ibm_backlight_data);
if (IS_ERR(ibm_backlight_device)) {
printk(IBM_ERR "Could not register ibm backlight device\n");
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 2f35f89..88aeccb 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -590,7 +590,8 @@ static int __init toshiba_acpi_init(void
remove_proc_entry(PROC_TOSHIBA, acpi_root_dir);
}
- toshiba_backlight_device = backlight_device_register("toshiba", NULL,
+ toshiba_backlight_device = backlight_device_register("toshiba",NULL,
+ NULL,
&toshiba_backlight_data);
if (IS_ERR(toshiba_backlight_device)) {
printk(KERN_ERR "Could not register toshiba backlight device\n");
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 27597c5..1d97cdf 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -190,8 +190,10 @@ static int fb_notifier_callback(struct n
* Creates and registers new backlight class_device. Returns either an
* ERR_PTR() or a pointer to the newly allocated device.
*/
-struct backlight_device *backlight_device_register(const char *name, void *devdata,
- struct backlight_properties *bp)
+struct backlight_device *backlight_device_register(const char *name,
+ struct device *dev,
+ void *devdata,
+ struct backlight_properties *bp)
{
int i, rc;
struct backlight_device *new_bd;
@@ -206,6 +208,7 @@ struct backlight_device *backlight_devic
new_bd->props = bp;
memset(&new_bd->class_dev, 0, sizeof(new_bd->class_dev));
new_bd->class_dev.class = &backlight_class;
+ new_bd->class_dev.dev = dev;
strlcpy(new_bd->class_dev.class_id, name, KOBJ_NAME_LEN);
class_set_devdata(&new_bd->class_dev, devdata);
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 75e91f5..a5cf1be 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -54,7 +54,7 @@ struct backlight_device {
};
extern struct backlight_device *backlight_device_register(const char *name,
- void *devdata, struct backlight_properties *bp);
+ struct device *dev,void *devdata,struct backlight_properties *bp);
extern void backlight_device_unregister(struct backlight_device *bd);
#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch 1/5] video sysfs support - take 2: Add dev argument for backlight_device_register.
2006-11-07 16:33 [patch 1/5] video sysfs support - take 2: Add dev argument for backlight_device_register Yu Luming
@ 2006-12-30 15:35 ` Richard Purdie
2007-01-09 15:09 ` Luming Yu
0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2006-12-30 15:35 UTC (permalink / raw)
To: Yu Luming
Cc: Andrew Morton, Pavel Machek, len.brown, Matt Domsch,
Alessandro Guido, linux-kernel, linux-acpi, jengelh, gelma,
ismail, Richard Hughes
On Wed, 2006-11-08 at 00:33 +0800, Yu Luming wrote:
> This patch set adds generic abstract layer support for acpi video driver to have
> generic user interface to control backlight and output switch control by leveraging
> the existing backlight sysfs class driver, and by adding a new video output sysfs
> class driver.
>
> Patch 1/5: adds dev argument for backlight_device_register to link the class device
> to real device object. The platform specific driver should find a way to get the real
> device object for their video device.
>
> signed-off-by: Luming Yu <Luming.yu@intel.com>
> ---
> drivers/acpi/asus_acpi.c | 2 +-
> drivers/acpi/ibm_acpi.c | 2 +-
> drivers/acpi/toshiba_acpi.c | 3 ++-
> drivers/video/backlight/backlight.c | 7 +++++--
> include/linux/backlight.h | 2 +-
> 5 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index 27597c5..1d97cdf 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -190,8 +190,10 @@ static int fb_notifier_callback(struct n
> * Creates and registers new backlight class_device. Returns either an
> * ERR_PTR() or a pointer to the newly allocated device.
> */
> -struct backlight_device *backlight_device_register(const char *name, void *devdata,
> - struct backlight_properties *bp)
> +struct backlight_device *backlight_device_register(const char *name,
> + struct device *dev,
> + void *devdata,
> + struct backlight_properties *bp)
> {
> int i, rc;
> struct backlight_device *new_bd;
This patch breaks several platforms. If you're going to add parameters
to a function like backlight_device_register, you could at least grep
the tree and update all the users :-(.
To top it off, someone noticed some of the failures and fixed them but
nobody thought to fix the drivers in drivers/video/backlight itself and
a mac reference seems to have escaped too.
I'll send a patch to to Andrew to clean up this mess...
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/5] video sysfs support - take 2: Add dev argument for backlight_device_register.
2006-12-30 15:35 ` Richard Purdie
@ 2007-01-09 15:09 ` Luming Yu
2007-01-09 17:05 ` James Simmons
0 siblings, 1 reply; 4+ messages in thread
From: Luming Yu @ 2007-01-09 15:09 UTC (permalink / raw)
To: Richard Purdie
Cc: Andrew Morton, Pavel Machek, len.brown, Matt Domsch,
Alessandro Guido, linux-kernel, linux-acpi, jengelh, gelma,
ismail, Richard Hughes
On 12/30/06, Richard Purdie <rpurdie@rpsys.net> wrote:
> On Wed, 2006-11-08 at 00:33 +0800, Yu Luming wrote:
> > This patch set adds generic abstract layer support for acpi video driver to have
> > generic user interface to control backlight and output switch control by leveraging
> > the existing backlight sysfs class driver, and by adding a new video output sysfs
> > class driver.
> >
> > Patch 1/5: adds dev argument for backlight_device_register to link the class device
> > to real device object. The platform specific driver should find a way to get the real
> > device object for their video device.
> >
> > signed-off-by: Luming Yu <Luming.yu@intel.com>
> > ---
> > drivers/acpi/asus_acpi.c | 2 +-
> > drivers/acpi/ibm_acpi.c | 2 +-
> > drivers/acpi/toshiba_acpi.c | 3 ++-
> > drivers/video/backlight/backlight.c | 7 +++++--
> > include/linux/backlight.h | 2 +-
> > 5 files changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> > index 27597c5..1d97cdf 100644
> > --- a/drivers/video/backlight/backlight.c
> > +++ b/drivers/video/backlight/backlight.c
> > @@ -190,8 +190,10 @@ static int fb_notifier_callback(struct n
> > * Creates and registers new backlight class_device. Returns either an
> > * ERR_PTR() or a pointer to the newly allocated device.
> > */
> > -struct backlight_device *backlight_device_register(const char *name, void *devdata,
> > - struct backlight_properties *bp)
> > +struct backlight_device *backlight_device_register(const char *name,
> > + struct device *dev,
> > + void *devdata,
> > + struct backlight_properties *bp)
> > {
> > int i, rc;
> > struct backlight_device *new_bd;
>
> This patch breaks several platforms. If you're going to add parameters
> to a function like backlight_device_register, you could at least grep
> the tree and update all the users :-(.
yes, you are right. I just noticed that there are so many users when I sent
out that patch. And all these users were disabled when I was testing patch.
I'm sorry for that.
>
> To top it off, someone noticed some of the failures and fixed them but
> nobody thought to fix the drivers in drivers/video/backlight itself and
> a mac reference seems to have escaped too.
If my memory serves me well, there is a patch for mac in mm.
Not sure other drivers in video/backlight. But I should have sent it
to some place.
Need to check.
>
> I'll send a patch to to Andrew to clean up this mess...
>
thank you!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/5] video sysfs support - take 2: Add dev argument for backlight_device_register.
2007-01-09 15:09 ` Luming Yu
@ 2007-01-09 17:05 ` James Simmons
0 siblings, 0 replies; 4+ messages in thread
From: James Simmons @ 2007-01-09 17:05 UTC (permalink / raw)
To: Luming Yu
Cc: Richard Purdie, Andrew Morton, Pavel Machek, len.brown,
Matt Domsch, Alessandro Guido, linux-kernel, linux-acpi, jengelh,
gelma, ismail, Richard Hughes
> > To top it off, someone noticed some of the failures and fixed them but
> > nobody thought to fix the drivers in drivers/video/backlight itself and
> > a mac reference seems to have escaped too.
>
> If my memory serves me well, there is a patch for mac in mm.
> Not sure other drivers in video/backlight. But I should have sent it
> to some place.
> Need to check.
I sent a patch some time ago to Andrew Morton for the fbdev drivers in
the video directory. I belive that patch is main stream now.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-01-09 17:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-07 16:33 [patch 1/5] video sysfs support - take 2: Add dev argument for backlight_device_register Yu Luming
2006-12-30 15:35 ` Richard Purdie
2007-01-09 15:09 ` Luming Yu
2007-01-09 17:05 ` James Simmons
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox