Skip to contentSkip to conversation

Ambient Light Sensor support

PATCH In review Zhang Rui 3 participants 7 messages Aug 31, 2009 – Sep 1, 2009 ACPI

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

v5 cover Ambient Light Sensor support

Hi, all,

this is the patch set I made for the Ambient Light Sensor device support in linux kernel.

There are only several trivial changes compared with patch set v4, and they are made based on the feedback from Len.
1. update the MAINTAINERS file
2. remove the .resume method in ACPI ALS driver.
ACPI ALS driver doesn't use a cached value storing the current Ambient Light illuminace, thus we don't need to re-evaluate the _ALI method (to get the current illuminance) on resume.
3. fix a wrong comment in ACPI ALS driver.

Any comments are welcome.

thanks,
rui

reviewer
#1 lore raw

I put this in the acpi test tree, with the expectation that it will have at least one minor revision update before going upstream.

thanks,
Len Brown, Intel Open Source Technology Center

#2 lore raw
Quoted 7 lines · Len Brown

I put this in the acpi test tree, with the expectation that it will have at least one minor revision update before going upstream.

thanks,
Len Brown, Intel Open Source Technology Center

Breaks build here...

Signature · 13 lines
Dmitry

ACPI: als - fix compile errors

From: Dmitry Torokhov <[email protected]>

PREFIX was undefined causing compiler to barf.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

 drivers/acpi/als.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/acpi/als.c +2 -0
index 6743ba7..51583a8 100644
@@ -30,6 +30,8 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
+#define PREFIX "ACPI: "
+
 #define ACPI_ALS_CLASS			"als"
 #define ACPI_ALS_DEVICE_NAME		"Ambient Light Sensor"
 #define ACPI_ALS_NOTIFY_ILLUMINANCE	0x80
author
#3 lore raw
Quoted 11 lines · Dmitry Torokhov
Quoted 7 lines · Len Brown

I put this in the acpi test tree, with the expectation that it will have at least one minor revision update before going upstream.

thanks,
Len Brown, Intel Open Source Technology Center

Breaks build here...

that's weird.
I didn't encounter this problem in my test.

could you please send your kernel config file?

thanks,
rui

author
#4 lore raw
Quoted 6 lines · Zhang Rui
Quoted 5 lines · Dmitry Torokhov
Quoted 4 lines · Len Brown

I put this in the acpi test tree, with the expectation that it will have at least one minor revision update before going upstream.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

thanks,
Len Brown, Intel Open Source Technology Center

Breaks build here...

that's weird.
I didn't encounter this problem in my test.

PREFIX is defined in include/acpi/acpi_bus.h,
which has already been included in this driver.

I got this after applying your patch,
CC drivers/acpi/als.o
drivers/acpi/als.c:46:1: warning: "PREFIX" redefined
In file included from drivers/acpi/als.c:30:
include/acpi/acpi_bus.h:33:1: warning: this is the location of the previous definition

rui

#5 lore raw
Quoted 19 lines · Zhang Rui
Quoted 6 lines · Zhang Rui
Quoted 5 lines · Dmitry Torokhov
Quoted 4 lines · Len Brown

I put this in the acpi test tree, with the expectation that it will have at least one minor revision update before going upstream.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

thanks,
Len Brown, Intel Open Source Technology Center

Breaks build here...

that's weird.
I didn't encounter this problem in my test.

PREFIX is defined in include/acpi/acpi_bus.h,
which has already been included in this driver.

Quoted 7 lines

I got this after applying your patch,
CC drivers/acpi/als.o
drivers/acpi/als.c:46:1: warning: "PREFIX" redefined
In file included from drivers/acpi/als.c:30:
include/acpi/acpi_bus.h:33:1: warning: this is the location of the previous definition

[dtor@dtor-d630 work]$ grep -r PREFIX include/acpi/acpi_bus.h [dtor@dtor-d630 work]$

This is acpi test branch merged with latest pull from Linus plus my for-linus and next branches that don't touch ACPI code.

Signature · 1 line
Dmitry
author
#6 lore raw
Quoted 28 lines · Dmitry Torokhov
Quoted 19 lines · Zhang Rui
Quoted 6 lines · Zhang Rui
Quoted 5 lines · Dmitry Torokhov
Quoted 4 lines · Len Brown

I put this in the acpi test tree, with the expectation that it will have at least one minor revision update before going upstream.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

thanks,
Len Brown, Intel Open Source Technology Center

Breaks build here...

that's weird.
I didn't encounter this problem in my test.

PREFIX is defined in include/acpi/acpi_bus.h,
which has already been included in this driver.

Quoted 7 lines

I got this after applying your patch,
CC drivers/acpi/als.o
drivers/acpi/als.c:46:1: warning: "PREFIX" redefined
In file included from drivers/acpi/als.c:30:
include/acpi/acpi_bus.h:33:1: warning: this is the location of the previous definition

Quoted 6 lines

[dtor@dtor-d630 work]$ grep -r PREFIX include/acpi/acpi_bus.h [dtor@dtor-d630 work]$

This is acpi test branch merged with latest pull from Linus plus my for-linus and next branches that don't touch ACPI code.

hah, right,
this is caused by commit a192a9580bcc41692be1f36b77c3b681827f566a, which removes the "PREFIX" in include/acpi/acpi_bus.h

commit a192a9580bcc41692be1f36b77c3b681827f566a

Author: Len Brown <[email protected]>
Date:   Tue Jul 28 16:45:54 2009 -0400

ACPI: Move definition of PREFIX from acpi_bus.h to internal..h

Linux/ACPI core files using internal.h all PREFIX "ACPI: ", however, not all ACPI drivers use/want it -- and they should not have to #undef PREFIX to define their own.

Add GPL commment to internal.h while we are there.

This does not change any actual console output, asside from a whitespace fix.

thanks for finding and fixing this.

thanks,
rui