Skip to contentSkip to conversation

yeeloong2f: add platform specific support

PATCH Superseded Wu Zhangjin 1 participant 1 message Nov 22, 2009 MIPS

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 yeeloong2f: add platform specific support

From: Wu Zhangjin <[email protected]>

(This v3 revision fixes the handling of ec version string, avoid to cut
off the strings of arcs_cmdline after EC_VER=xxx)

This patch adds the following subdrivers for YeeLoong netbook:

o Backlight subdriver

Based on the backlight subsystem of linux, provides the standard backlight brightness interface: /sys/class/backlight/, this interface can be used by the user-space applications, e.g. kpowersave, gnome-power-manager.

o Hwmon subdriver

Based on the hwmon subsystem of linux, This driver provide the standard interface for monitoring the hardwares, such as the temperature of cpu and battery, the pwm of the fan, the voltage and current of battery. the interface is: /sys/class/hwmon

o Video output subdriver

Based on the videooutput subsystem of linux, this driver provides the standard video output controlling interface: /sys/class/video_output/

o Thermal cooling devices subdriver

Currently, Only register the backlight device as the cooling device. perhaps we need to regiter the cpu as the cooling device later.

o hotkey input subdriver

Based on the input layer of linux, this driver manage the function keys of yeeloong netbook, those keys include Fn+(ESC,F1~F5,left,right,up,down). the interface is: /sys/class/input

o battery subdriver

Based on the APM Emulation Char Driver, We implement a yeelong specific apm_get_power_status() function to report the battery status to do battery management.

o platform subdriver

This driver register the suspend/resume function for yeeloong platform specific power management(mainling suspend) support.

All of the above drivers have been tested and used in the 2.6.30,2.6.31 kernel for YeeLoong.

---
 arch/mips/kernel/setup.c                       |    1 +
 arch/mips/loongson/Kconfig                     |   18 +
 arch/mips/loongson/lemote-2f/Makefile          |    1 +
 arch/mips/loongson/lemote-2f/ec_kb3310b.h      |  150 +++
 arch/mips/loongson/lemote-2f/yeeloong_laptop.c | 1355 ++++++++++++++++++++++++
 5 files changed, 1525 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop.c
arch/mips/kernel/setup.c +1 -0
index bd55f71..b1e1272 100644
@@ -60,6 +60,7 @@ struct boot_mem_map boot_mem_map;
 
 static char command_line[COMMAND_LINE_SIZE];
        char arcs_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
+EXPORT_SYMBOL(arcs_cmdline);
 
 /*
  * mips_io_port_base is the begin of the address space to which x86 style
arch/mips/loongson/Kconfig +18 -0
index be3f6cf..521e2bd 100644
@@ -112,4 +112,22 @@ config LEMOTE_LYNLOONG2F_PDEV
 	  This driver adds the lynloong specific backlight driver and platform
 	  driver(mainly the suspend support).
 
+config LEMOTE_YEELOONG2F_PDEV
+	tristate "Lemote YeeLoong Platform Specific Driver"
+	depends on LEMOTE_MACH2F
+	default m
+	select INPUT_EVDEV
+	select HWMON
+	select VIDEO_OUTPUT_CONTROL
+	select THERMAL
+	select BACKLIGHT_CLASS_DEVICE
+	select SYS_SUPPORTS_APM_EMULATION
+	help
+	  YeeLoong netbook is a mini laptop made by Lemote, which is basically
+	  compatible to FuLoong2F mini PC, but It has an extra Embedded
+	  Controller(kb3310b) for battery, hotkey, backlight, temperature and
+	  fan management.
+
+	  This driver adds the YeeLoong Platform Specific support.
+
 endif # LOONGSON_PLATFORM_DEVICES
arch/mips/loongson/lemote-2f/Makefile +1 -0
index 81a97d0..4e8bf5d 100644
@@ -14,3 +14,4 @@ obj-$(CONFIG_LOONGSON_SUSPEND) += pm.o
 # Platform Drivers
 #
 obj-$(CONFIG_LEMOTE_LYNLOONG2F_PDEV) += lynloong_pc.o
+obj-$(CONFIG_LEMOTE_YEELOONG2F_PDEV) += yeeloong_laptop.o
arch/mips/loongson/lemote-2f/ec_kb3310b.h +150 -0

160 lines not on this page · raw message

arch/mips/loongson/lemote-2f/yeeloong_laptop.c new file +1355 -0

1,355 lines not on this page · raw message

Signature · 1 line
1.6.2.1