Skip to contentSkip to conversation

introduce ALS sysfs class

PATCH Superseded Zhang Rui 3 participants 3 messages Aug 25, 2009 ACPI

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH v4 1/2 introduce ALS sysfs class

Introduce ALS sysfs class.

ALS sysfs class provides a standard sysfs interface for Ambient Light Sensor devices.

please read Documentation/ABI/testing/sysfs-class-als for detailed sysfs designs.

---
 Documentation/ABI/testing/sysfs-class-als |   32 ++++
 drivers/Kconfig                           |    2 
 drivers/Makefile                          |    1 
 drivers/als/Kconfig                       |   10 +
 drivers/als/Makefile                      |    5 
 drivers/als/als_sys.c                     |  220 ++++++++++++++++++++++++++++++
 include/linux/als_sys.h                   |   55 +++++++
 7 files changed, 325 insertions(+)
drivers/Kconfig +2 -0
Index: linux-2.6/drivers/Kconfig
===================================================================
@@ -62,6 +62,8 @@ source "drivers/power/Kconfig"
 
 source "drivers/hwmon/Kconfig"
 
+source "drivers/als/Kconfig"
+
 source "drivers/thermal/Kconfig"
 
 source "drivers/watchdog/Kconfig"
drivers/Makefile +1 -0
Index: linux-2.6/drivers/Makefile
===================================================================
@@ -76,6 +76,7 @@ obj-$(CONFIG_PPS)		+= pps/
 obj-$(CONFIG_W1)		+= w1/
 obj-$(CONFIG_POWER_SUPPLY)	+= power/
 obj-$(CONFIG_HWMON)		+= hwmon/
+obj-$(CONFIG_ALS)		+= als/
 obj-$(CONFIG_THERMAL)		+= thermal/
 obj-$(CONFIG_WATCHDOG)		+= watchdog/
 obj-$(CONFIG_PHONE)		+= telephony/
drivers/als/Kconfig new file +10 -0
Index: linux-2.6/drivers/als/Kconfig
===================================================================
@@ -0,0 +1,10 @@
+#
+# Ambient Light Sensor sysfs device configuration
+#
+
+menuconfig ALS
+	tristate "Ambient Light Sensor sysfs device"
+	help
+	  This framework provides a generic sysfs interface for
+	  Ambient Light Sensor devices.
+	  If you want this support, you should say Y or M here.
drivers/als/Makefile new file +5 -0
Index: linux-2.6/drivers/als/Makefile
===================================================================
@@ -0,0 +1,5 @@
+#
+# Makefile for Ambient Light Sensor device drivers.
+#
+
+obj-$(CONFIG_ALS)		+= als_sys.o
drivers/als/als_sys.c new file +220 -0

220 lines not on this page · raw message

include/linux/als_sys.h new file +55 -0

55 lines not on this page · raw message

Documentation/ABI/testing/sysfs-class-als new file +32 -0
Index: linux-2.6/Documentation/ABI/testing/sysfs-class-als
===================================================================
@@ -0,0 +1,32 @@
+What:		/sys/class/als/als[0-N]/desc
+Date:		Aug. 2009
+KernelVersion:	2.6.32
+Contact:	Zhang Rui <[email protected]>
+Description:	Strings which descibes the current Ambient Light Sensor
+		device. This is given by native ALS driver as part of
+		registration. e.g: "acpi_als" for ACPI ALS devices.
+		RO
+
+What:		/sys/class/als/als[0-N]/illuminance
+Date:		Aug. 2009
+KernelVersion:	2.6.32
+Contact:	Zhang Rui <[email protected]>
+Description:	Current Ambient Light Illuminance reported by
+		native ALS driver
+		Unit: lux (lumens per square meter)
+		RO
+
+What:		/sys/class/als/als[0-N]/display_adjustment
+Date:		Aug. 2009
+KernelVersion:	2.6.32
+Contact:	Zhang Rui <[email protected]>
+Description:	a relative percentages in order simplify the means
+		by which these adjustments are applied in lieu of
+		changes to the user’s display brightness preference.
+		A value of 100% is used to indicate no display
+		brightness adjustment.
+		Values less than 100% indicate a negative adjustment
+		(dimming); values greater than 100% indicate a positive
+		adjustment (brightening).
+		RO
+

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 10 lines · Zhang Rui

???Introduce ALS sysfs class.

ALS sysfs class provides a standard sysfs interface for Ambient Light Sensor devices.

please read Documentation/ABI/testing/sysfs-class-als for detailed sysfs designs.

ACK.

Documentation/ABI/testing/sysfs-class-als line 31

Quoted 13 lines
Documentation/ABI/testing/sysfs-class-als new file +13 -0
+What:		/sys/class/als/als[0-N]/display_adjustment
+Date:		Aug. 2009
+KernelVersion:	2.6.32
+Contact:	Zhang Rui <[email protected]>
+Description:	a relative percentages in order simplify the means
+		by which these adjustments are applied in lieu of
+		changes to the user???s display brightness preference.
+		A value of 100% is used to indicate no display
+		brightness adjustment.
+		Values less than 100% indicate a negative adjustment
+		(dimming); values greater than 100% indicate a positive
+		adjustment (brightening).
+		RO

And yes, I like the new interface much better.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html