Loongson: YeeLoong: add platform specific drivers
v5 cover Loongson: YeeLoong: add platform specific drivers
From: Wu Zhangjin <[email protected]>
This patchset adds platform specific drivers for YeeLoong.
Changes from the v4 revision:
- Split the drivers into its own module
- Incorporates with the feedback of the Input(hotkey) driver from Dmitry Torokhov.
- Cleanups and fixups
Wu Zhangjin (8):
Loongson: Lemote-2F: add platform specific submenu
Loongson: YeeLoong: add platform specific option
Loongson: YeeLoong: add backlight driver
Loongson: YeeLoong: add battery driver
Loongson: YeeLoong: add hwmon driver
Loongson: YeeLoong: add video output driver
Loongson: YeeLoong: add suspend driver
Loongson: YeeLoong: add hotkey driver
arch/mips/kernel/setup.c | 1 + arch/mips/loongson/Kconfig | 21 + arch/mips/loongson/lemote-2f/Makefile | 7 +- arch/mips/loongson/lemote-2f/ec_kb3310b.c | 130 ------ arch/mips/loongson/lemote-2f/ec_kb3310b.h | 188 -------- arch/mips/loongson/lemote-2f/pm.c | 4 +- arch/mips/loongson/lemote-2f/reset.c | 2 +- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 69 +++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 10 + .../loongson/lemote-2f/yeeloong_laptop/backlight.c | 93 ++++ .../loongson/lemote-2f/yeeloong_laptop/battery.c | 127 ++++++ .../lemote-2f/yeeloong_laptop/ec_kb3310b.c | 126 ++++++ .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 194 ++++++++ .../loongson/lemote-2f/yeeloong_laptop/hotkey.c | 468 ++++++++++++++++++++ .../loongson/lemote-2f/yeeloong_laptop/hwmon.c | 241 ++++++++++ .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++ .../lemote-2f/yeeloong_laptop/video_output.c | 164 +++++++ 17 files changed, 1664 insertions(+), 322 deletions(-) delete mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.c delete mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.h create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/backlight.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/battery.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.h create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/hwmon.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/video_output.c
PATCH v5 1/8 Loongson: Lemote-2F: add platform specific submenu
From: Wu Zhangjin <[email protected]>
--- arch/mips/loongson/Kconfig | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
arch/mips/loongson/Kconfig +20 -0
@@ -83,3 +83,23 @@ config LOONGSON_UART_BASE bool default y depends on EARLY_PRINTK || SERIAL_8250 + +# +# Loongson Platform Specific Drivers +# + +menuconfig LOONGSON_PLATFORM_DEVICES + bool "Loongson Platform Drivers" + default y + help + Say Y here to get to see options for device drivers of various + loongson platforms, including vendor-specific laptop/pc extension + drivers. This option alone does not add any kernel code. + + If you say N, all options in this submenu will be skipped and disabled. + +if LOONGSON_PLATFORM_DEVICES +# Put platform specific stuff here + + +endif # LOONGSON_PLATFORM_DEVICES
Signature · 1 line
1.6.2.1
PATCH v5 2/8 Loongson: YeeLoong: add platform specific option
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch add a new LEMOTE_YEELOONG2F option, a yeeloong_laptop/ directory for the coming yeeloong specific support, and for the ec_kb3310b belongs to yeeloong, so, move it to yeeloong_laptop/ too.
--- arch/mips/loongson/Kconfig | 1 + arch/mips/loongson/lemote-2f/Makefile | 7 +- arch/mips/loongson/lemote-2f/ec_kb3310b.c | 130 -------------- arch/mips/loongson/lemote-2f/ec_kb3310b.h | 188 -------------------- arch/mips/loongson/lemote-2f/pm.c | 4 +- arch/mips/loongson/lemote-2f/reset.c | 2 +- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 15 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 3 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.c | 126 +++++++++++++ .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 187 +++++++++++++++++++ 10 files changed, 341 insertions(+), 322 deletions(-) delete mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.c delete mode 100644 arch/mips/loongson/lemote-2f/ec_kb3310b.h create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.c create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.h
arch/mips/loongson/Kconfig +1 -0
@@ -101,5 +101,6 @@ menuconfig LOONGSON_PLATFORM_DEVICES if LOONGSON_PLATFORM_DEVICES # Put platform specific stuff here +source "arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig" endif # LOONGSON_PLATFORM_DEVICES
arch/mips/loongson/lemote-2f/Makefile +6 -1
@@ -2,10 +2,15 @@ # Makefile for lemote loongson2f family machines # -obj-y += irq.o reset.o ec_kb3310b.o +obj-y += irq.o reset.o # # Suspend Support # obj-$(CONFIG_LOONGSON_SUSPEND) += pm.o + +# +# Platform Drivers +# +obj-y += yeeloong_laptop/
arch/mips/loongson/lemote-2f/ec_kb3310b.c deleted +0 -130
130 lines not on this page · raw message
arch/mips/loongson/lemote-2f/ec_kb3310b.h deleted +0 -188
188 lines not on this page · raw message
arch/mips/loongson/lemote-2f/pm.c +2 -2
@@ -23,7 +23,7 @@#include <loongson.h> #include <cs5536/cs5536_mfgpt.h> -#include "ec_kb3310b.h" +#include "yeeloong_laptop/ec_kb3310b.h" #define I8042_KBD_IRQ 1#define I8042_CTR_KBDINT 0x01
@@ -100,7 +100,7 @@ int wakeup_loongson(void)if (irq <0 )return 0 ; -printk (KERN_INFO "%s: irq = %d\n" , __func__, irq); +pr_info ("%s: irq = %d\n" , __func__, irq);if (irq ==I8042_KBD_IRQ )return 1 ;
arch/mips/loongson/lemote-2f/reset.c +1 -1
@@ -20,7 +20,7 @@#include <loongson.h> #include <cs5536/cs5536.h> -#include "ec_kb3310b.h" +#include "yeeloong_laptop/ec_kb3310b.h" static void reset_cpu (void ) {
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +menuconfig LEMOTE_YEELOONG2F + bool "Lemote YeeLoong Laptop" + depends on LEMOTE_MACH2F + default y + 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. + +if LEMOTE_YEELOONG2F + + + +endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# YeeLoong Specific + +obj-y += ec_kb3310b.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.c new file +126 -0
126 lines not on this page · raw message
arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.h new file +187 -0
187 lines not on this page · raw message
Signature · 1 line
1.6.2.1
PATCH v5 3/8 Loongson: YeeLoong: add backlight driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds YeeLoong Backlight Driver, which provides standard interface for user-space applications to control the brightness of the backlight.
--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++- .../loongson/lemote-2f/yeeloong_laptop/Makefile | 2 + .../loongson/lemote-2f/yeeloong_laptop/backlight.c | 93 ++++++++++++++++++++ .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 1 + 4 files changed, 104 insertions(+), 1 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/backlight.c
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +8 -1
@@ -10,6 +10,13 @@ menuconfig LEMOTE_YEELOONG2F if LEMOTE_YEELOONG2F - +config YEELOONG_BACKLIGHT + tristate "Backlight Driver" + select BACKLIGHT_CLASS_DEVICE + default y + help + This option adds YeeLoong Backlight Driver, which provides standard + interface for user-space applications to control the brightness of + the backlight. endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +2 -0
@@ -1,3 +1,5 @@ # YeeLoong Specific obj-y += ec_kb3310b.o + +obj-$(CONFIG_YEELOONG_BACKLIGHT) += backlight.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/backlight.c new file +93 -0
93 lines not on this page · raw message
arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.h +1 -0
@@ -23,6 +23,7 @@ typedef int (*sci_handler) (int status);extern sci_handler yeeloong_report_lid_status;#define SCI_IRQ_NUM 0x0A +#define MAX_BRIGHTNESS 8/* * The following registers are determined by the EC index configuration.
Signature · 1 line
1.6.2.1
Re: [PATCH v5 3/8] Loongson: YeeLoong: add backlight driver
Quoted 20 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds YeeLoong Backlight Driver, which provides standard interface for user-space applications to control the brightness of the backlight.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++- .../loongson/lemote-2f/yeeloong_laptop/Makefile | 2 + .../loongson/lemote-2f/yeeloong_laptop/backlight.c | 93 ++++++++++++++++++++ .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 1 + 4 files changed, 104 insertions(+), 1 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/backlight.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig menuconfig LEMOTE_YEELOONG2F · line 15
Quoted 7 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-1@@ -10,6 +10,13 @@ menuconfig LEMOTE_YEELOONG2F if LEMOTE_YEELOONG2F - +config YEELOONG_BACKLIGHT + tristate "Backlight Driver" + select BACKLIGHT_CLASS_DEVICE
Will use "depend" instead in the next version.
Best Regards,
Wu Zhangjin
PATCH v5 4/8 Loongson: YeeLoong: add battery driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds APM_EMULATION based Battery Driver, which provides standard interface for user-space applications to manage the battery.
--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/battery.c | 127 ++++++++++++++++++++ 3 files changed, 137 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/battery.c
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +9 -0
@@ -19,4 +19,13 @@ config YEELOONG_BACKLIGHT interface for user-space applications to control the brightness of the backlight. +config YEELOONG_BATTERY + tristate "Battery Driver" + select SYS_SUPPORTS_APM_EMULATION + select APM_EMULATION + default y + help + This option adds APM emulated Battery Driver, which provides standard + interface for user-space applications to manage the battery. + endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +1 -0
@@ -3,3 +3,4 @@ obj-y += ec_kb3310b.o obj-$(CONFIG_YEELOONG_BACKLIGHT) += backlight.o +obj-$(CONFIG_YEELOONG_BATTERY) += battery.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/battery.c new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
1.6.2.1
Re: [PATCH v5 4/8] Loongson: YeeLoong: add battery driver
Quoted 18 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds
APM_EMULATIONbased Battery Driver, which provides standard interface for user-space applications to manage the battery.Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/battery.c | 127 ++++++++++++++++++++ 3 files changed, 137 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/battery.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_BACKLIGHT · line 25
Quoted 7 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +4
-0@@ -19,4 +19,13 @@ config YEELOONG_BACKLIGHT interface for user-space applications to control the brightness of the backlight. +config YEELOONG_BATTERY + tristate "Battery Driver" + select SYS_SUPPORTS_APM_EMULATION + select APM_EMULATION
Will use "depend" on APM_EMULATION instead in the next version, and put this line "select SYS_SUPPORTS_APM_EMULATION" under the LEMOTE_YEELOONG2F.
Regards,
Wu Zhangjin
PATCH v5 5/8 Loongson: YeeLoong: add hwmon driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds hwmon driver for managing the temperature of battery, cpu and controlling the fan.
--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 3 + .../loongson/lemote-2f/yeeloong_laptop/hwmon.c | 241 ++++++++++++++++++++ 4 files changed, 254 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/hwmon.c
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +9 -0
@@ -28,4 +28,13 @@ config YEELOONG_BATTERY This option adds APM emulated Battery Driver, which provides standard interface for user-space applications to manage the battery. +config YEELOONG_HWMON + tristate "Hardware Monitor Driver" + select HWMON + default y + help + This option adds hardware monitor driver, which provides standard + interface for lm-sensors to monitor the temperatures of CPU and + battery, the PWM of fan, the current, voltage of battery. + endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-y += ec_kb3310b.o obj-$(CONFIG_YEELOONG_BACKLIGHT) += backlight.o obj-$(CONFIG_YEELOONG_BATTERY) += battery.o +obj-$(CONFIG_YEELOONG_HWMON) += hwmon.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.h +3 -0
@@ -22,6 +22,9 @@ extern int ec_get_event_num(void);typedef int (*sci_handler ) (int status);extern sci_handler yeeloong_report_lid_status; +extern void set_fan_pwm (int value); +extern void set_fan_pwm_enable (int manual); +#define SCI_IRQ_NUM 0x0A#define MAX_BRIGHTNESS 8
arch/mips/loongson/lemote-2f/yeeloong_laptop/hwmon.c new file +241 -0
241 lines not on this page · raw message
Signature · 7 lines
1.6.2.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v5 5/8] Loongson: YeeLoong: add hwmon driver
Quoted 19 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds hwmon driver for managing the temperature of battery, cpu and controlling the fan.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 3 + .../loongson/lemote-2f/yeeloong_laptop/hwmon.c | 241 ++++++++++++++++++++ 4 files changed, 254 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/hwmon.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_BATTERY · line 33
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-0@@ -28,4 +28,13 @@ config YEELOONG_BATTERY This option adds APM emulated Battery Driver, which provides standard interface for user-space applications to manage the battery. +config YEELOONG_HWMON + tristate "Hardware Monitor Driver" + select HWMON
Will use depend in the next version.
Best Regards,
Wu Zhangjin
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v5 5/8] Loongson: YeeLoong: add hwmon driver
Quoted 23 lines · Wu Zhangjin
Quoted 22 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds hwmon driver for managing the temperature of battery, cpu and controlling the fan.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 3 + .../loongson/lemote-2f/yeeloong_laptop/hwmon.c | 241 ++++++++++++++++++++ 4 files changed, 254 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/hwmon.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0@@ -28,4 +28,13 @@ config YEELOONG_BATTERY This option adds APM emulated Battery Driver, which provides standard interface for user-space applications to manage the battery.
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_BATTERY · line 33
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-0+config YEELOONG_HWMON + tristate "Hardware Monitor Driver" + select HWMONWill use depend in the next version.
Sorry, This must be select, there is no other way to select this stuff.
Quoted 2 lines
Best Regards,
Wu Zhangjin
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v5 5/8] Loongson: YeeLoong: add hwmon driver
Quoted 8 lines · Wu Zhangjin
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_BATTERY · line 33
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-0+config YEELOONG_HWMON + tristate "Hardware Monitor Driver" + select HWMONWill use depend in the next version.
Sorry, This must be select, there is no other way to select this stuff.
Why that?
Ralf
Re: [PATCH v5 5/8] Loongson: YeeLoong: add hwmon driver
Quoted 9 lines · Ralf Baechle
Quoted 7 lines · Wu Zhangjin
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_BATTERY · line 33
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-0+config YEELOONG_HWMON + tristate "Hardware Monitor Driver" + select HWMONWill use depend in the next version.
Quoted 3 lines
Quoted 1 line
Sorry, This must be select, there is no other way to select this stuff.
Why that?
Hmm, sorry, my old explanation is totally Wrong, it's better to select it for us, just as the x86 platform drivers did:
$ cat drivers/platform/x86/Kconfig | grep " HWMON" select HWMON select HWMON
Because the HWMON stuff is put in the device drivers as a menuconfig, but our platform driver is put in its own directory. it will not be convenient for the users to select it themselves, and also, this select have no side effect.
Best Regards,
Wu Zhangjin
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH v5 6/8 Loongson: YeeLoong: add video output driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT.
--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 8 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 3 + .../lemote-2f/yeeloong_laptop/video_output.c | 164 ++++++++++++++++++++ 4 files changed, 176 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/video_output.c
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +8 -0
@@ -37,4 +37,12 @@ config YEELOONG_HWMON interface for lm-sensors to monitor the temperatures of CPU and battery, the PWM of fan, the current, voltage of battery. +config YEELOONG_VO + tristate "Video Output Driver" + select VIDEO_OUTPUT_CONTROL + default y + help + This option adds Video Output Driver, which provides standard + interface to turn on/off the video output of LCD, CRT. + endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-y += ec_kb3310b.o obj-$(CONFIG_YEELOONG_BACKLIGHT) += backlight.o obj-$(CONFIG_YEELOONG_BATTERY) += battery.o obj-$(CONFIG_YEELOONG_HWMON) += hwmon.o +obj-$(CONFIG_YEELOONG_VO) += video_output.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/ec_kb3310b.h +3 -0
@@ -25,6 +25,9 @@ extern sci_handler yeeloong_report_lid_status;extern void set_fan_pwm (int value);extern void set_fan_pwm_enable (int manual); +extern void lcd_vo_set (int status); +extern void crt_vo_set (int status); +#define SCI_IRQ_NUM 0x0A#define MAX_BRIGHTNESS 8
arch/mips/loongson/lemote-2f/yeeloong_laptop/video_output.c new file +164 -0
164 lines not on this page · raw message
Signature · 1 line
1.6.2.1
Re: [PATCH v5 6/8] Loongson: YeeLoong: add video output driver
Quoted 19 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 8 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 3 + .../lemote-2f/yeeloong_laptop/video_output.c | 164 ++++++++++++++++++++ 4 files changed, 176 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/video_output.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_HWMON · line 42
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-0@@ -37,4 +37,12 @@ config YEELOONG_HWMON interface for lm-sensors to monitor the temperatures of CPU and battery, the PWM of fan, the current, voltage of battery. +config YEELOONG_VO + tristate "Video Output Driver" + select VIDEO_OUTPUT_CONTROL
Will use "depend" instead in the next version.
Regards,
Wu Zhangjin
Re: [PATCH v5 6/8] Loongson: YeeLoong: add video output driver
Quoted 23 lines · Wu Zhangjin
Quoted 22 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 8 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../lemote-2f/yeeloong_laptop/ec_kb3310b.h | 3 + .../lemote-2f/yeeloong_laptop/video_output.c | 164 ++++++++++++++++++++ 4 files changed, 176 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/video_output.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0@@ -37,4 +37,12 @@ config YEELOONG_HWMON interface for lm-sensors to monitor the temperatures of CPU and battery, the PWM of fan, the current, voltage of battery.
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_HWMON · line 42
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +3
-0+config YEELOONG_VO + tristate "Video Output Driver" + select VIDEO_OUTPUT_CONTROLWill use "depend" instead in the next version.
Sorry to disturb you, this also must be "select", and the same to BACKLIGHT_CLASS_DEVICE.
Quoted 2 lines
Regards,
Wu Zhangjin
PATCH v5 7/8 Loongson: YeeLoong: add suspend driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.c
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +9 -0
@@ -45,4 +45,13 @@ config YEELOONG_VO This option adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT. +config YEELOONG_SUSPEND + tristate "Suspend Driver" + depends on YEELOONG_HWMON && YEELOONG_VO + select SUSPEND + default y + help + This option adds Suspend Driver, which will suspend the YeeLoong + Platform specific devices. + endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_YEELOONG_BACKLIGHT) += backlight.o obj-$(CONFIG_YEELOONG_BATTERY) += battery.o obj-$(CONFIG_YEELOONG_HWMON) += hwmon.o obj-$(CONFIG_YEELOONG_VO) += video_output.o +obj-$(CONFIG_YEELOONG_SUSPEND) += suspend.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.c new file +141 -0
141 lines not on this page · raw message
Signature · 1 line
1.6.2.1
PATCH v5 7/8 Loongson: YeeLoong: add suspend driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.c
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +9 -0
@@ -45,4 +45,13 @@ config YEELOONG_VO This option adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT. +config YEELOONG_SUSPEND + tristate "Suspend Driver" + depends on YEELOONG_HWMON && YEELOONG_VO + select SUSPEND + default y + help + This option adds Suspend Driver, which will suspend the YeeLoong + Platform specific devices. + endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_YEELOONG_BACKLIGHT) += backlight.o obj-$(CONFIG_YEELOONG_BATTERY) += battery.o obj-$(CONFIG_YEELOONG_HWMON) += hwmon.o obj-$(CONFIG_YEELOONG_VO) += video_output.o +obj-$(CONFIG_YEELOONG_SUSPEND) += suspend.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.c new file +141 -0
141 lines not on this page · raw message
Signature · 1 line
1.6.2.1
Re: [PATCH v5 7/8] Loongson: YeeLoong: add suspend driver
Quoted 6 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
Signed-off-by Wu Zhangjin <[email protected]>
ACK.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [PATCH v5 7/8] Loongson: YeeLoong: add suspend driver
In reply to Wu ZhangjinQuoted 6 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
Signed-off-by Wu Zhangjin <[email protected]>
ACK.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [PATCH v5 7/8] Loongson: YeeLoong: add suspend driver
In reply to Wu ZhangjinQuoted 18 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 49
Quoted 5 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0@@ -45,4 +45,13 @@ config YEELOONG_VO This option adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT. +config YEELOONG_SUSPEND + tristate "Suspend Driver"
Why tristate?
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 51
Quoted 2 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ depends on YEELOONG_HWMON && YEELOONG_VO + select SUSPEND
I'm not sure if that's going to work. Please make it depend on SUSPEND rather than select it.
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 57
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +5
-0+ default y + help + This option adds Suspend Driver, which will suspend the YeeLoong + Platform specific devices. + endif
Thanks,
Rafael
Re: [PATCH v5 7/8] Loongson: YeeLoong: add suspend driver
Quoted 22 lines · Rafael J. Wysocki
Quoted 21 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0@@ -45,4 +45,13 @@ config YEELOONG_VO This option adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT.
Quoted 4 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 49
Quoted 2 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+config YEELOONG_SUSPEND + tristate "Suspend Driver"Why tristate?
Allow it to be available as a module.
There are lots of platform specific drivers for Lemote-2F family machines, benefit from tristate, the distribution developers can compile them as modules, and then the users can load what they want for their own machines.
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 51
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ depends on YEELOONG_HWMON && YEELOONG_VO + select SUSPENDI'm not sure if that's going to work. Please make it depend on SUSPEND rather than select it.
Yes, Have replaced "select" by "depend on", thanks!
Quoted 10 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 57
Quoted 7 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +5
-0+ default y + help + This option adds Suspend Driver, which will suspend the YeeLoong + Platform specific devices. + endifThanks,
Rafael
Thanks & Regards,
Wu Zhangjin
Re: [PATCH v5 7/8] Loongson: YeeLoong: add suspend driver
In reply to Rafael J. WysockiQuoted 22 lines · Rafael J. Wysocki
Quoted 21 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0@@ -45,4 +45,13 @@ config YEELOONG_VO This option adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT.
Quoted 4 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 49
Quoted 2 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+config YEELOONG_SUSPEND + tristate "Suspend Driver"Why tristate?
Allow it to be available as a module.
There are lots of platform specific drivers for Lemote-2F family machines, benefit from tristate, the distribution developers can compile them as modules, and then the users can load what they want for their own machines.
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 51
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ depends on YEELOONG_HWMON && YEELOONG_VO + select SUSPENDI'm not sure if that's going to work. Please make it depend on SUSPEND rather than select it.
Yes, Have replaced "select" by "depend on", thanks!
Quoted 10 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 57
Quoted 7 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +5
-0+ default y + help + This option adds Suspend Driver, which will suspend the YeeLoong + Platform specific devices. + endifThanks,
Rafael
Thanks & Regards,
Wu Zhangjin
Re: [PATCH v5 7/8] Loongson: YeeLoong: add suspend driver
In reply to Wu ZhangjinQuoted 18 lines · Wu Zhangjin
From: Wu Zhangjin <[email protected]>
This patch adds Suspend Driver, which will suspend the YeeLoong Platform specific devices.
Signed-off-by Wu Zhangjin <[email protected]>--- .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 9 ++ .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/suspend.c | 141 ++++++++++++++++++++ 3 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/suspend.carch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +0
-0
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 49
Quoted 5 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0@@ -45,4 +45,13 @@ config YEELOONG_VO This option adds Video Output Driver, which provides standard interface to turn on/off the video output of LCD, CRT. +config YEELOONG_SUSPEND + tristate "Suspend Driver"
Why tristate?
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 51
Quoted 2 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ depends on YEELOONG_HWMON && YEELOONG_VO + select SUSPEND
I'm not sure if that's going to work. Please make it depend on SUSPEND rather than select it.
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_VO · line 57
Quoted 6 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +5
-0+ default y + help + This option adds Suspend Driver, which will suspend the YeeLoong + Platform specific devices. + endif
Thanks,
Rafael
PATCH v5 8/8 Loongson: YeeLoong: add hotkey driver
In reply to Wu ZhangjinFrom: Wu Zhangjin <[email protected]>
This patch adds Hotkey Driver, which will do relative actions for The hotkey event and report the corresponding input keys to the user-space applications.
--- arch/mips/kernel/setup.c | 1 + .../loongson/lemote-2f/yeeloong_laptop/Kconfig | 12 + .../loongson/lemote-2f/yeeloong_laptop/Makefile | 1 + .../loongson/lemote-2f/yeeloong_laptop/hotkey.c | 468 ++++++++++++++++++++ 4 files changed, 482 insertions(+), 0 deletions(-) create mode 100644 arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c
arch/mips/kernel/setup.c +1 -0
@@ -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/lemote-2f/yeeloong_laptop/Kconfig +12 -0
@@ -54,4 +54,16 @@ config YEELOONG_SUSPEND This option adds Suspend Driver, which will suspend the YeeLoong Platform specific devices. +config YEELOONG_HOTKEY + tristate "Hotkey Driver" + depends on YEELOONG_VO + select INPUT + select INPUT_EVDEV + select SUSPEND + default y + help + This option adds Hotkey Driver, which will do relative actions for + The hotkey event and report the corresponding input keys to the + user-space applications. + endif
arch/mips/loongson/lemote-2f/yeeloong_laptop/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-$(CONFIG_YEELOONG_BATTERY) += battery.o obj-$(CONFIG_YEELOONG_HWMON) += hwmon.o obj-$(CONFIG_YEELOONG_VO) += video_output.o obj-$(CONFIG_YEELOONG_SUSPEND) += suspend.o +obj-$(CONFIG_YEELOONG_HOTKEY) += hotkey.o
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c new file +468 -0
468 lines not on this page · raw message
Signature · 1 line
1.6.2.1
Re: [PATCH v5 8/8] Loongson: YeeLoong: add hotkey driver
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 60
Quoted 5 lines · Wu Zhangjin
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +4
-0+config YEELOONG_HOTKEY + tristate "Hotkey Driver" + depends on YEELOONG_VO + select INPUT
I think this should be depend, not select.
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 62
Quoted 2 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ select INPUT_EVDEV + select SUSPEND
Does it break without SUSPEND? I am pretty sure that it will work fine without EVDEV (however unlikely it is not present).
Signature · 1 line
Dmitry
Re: [PATCH v5 8/8] Loongson: YeeLoong: add hotkey driver
Quoted 8 lines · Dmitry Torokhov
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 60
Quoted 5 lines · Wu Zhangjin
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +4
-0+config YEELOONG_HOTKEY + tristate "Hotkey Driver" + depends on YEELOONG_VO + select INPUTI think this should be depend, not select.
Hmm, okay, will replace it by depend later ;)
Quoted 5 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 62
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ select INPUT_EVDEV + select SUSPENDDoes it break without SUSPEND?
not break, but I just want to select something for users, so, they will have no need to care about which extra option is needed.
anyway, I will use #ifdef ... #endif instead later.
Quoted 2 lines
I am pretty sure that it will work fine
without EVDEV (however unlikely it is not present).
Yes, without EVDEV, it can be compiled, but without the EVDEV module, no event will be sent to the user-space, as a result, we just get a broken input support. so, let the users make their decision?
Regards,
Wu Zhangjin
Re: [PATCH v5 8/8] Loongson: YeeLoong: add hotkey driver
Quoted 13 lines · Wu Zhangjin
Quoted 8 lines · Dmitry Torokhov
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 60
Quoted 5 lines · Wu Zhangjin
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +4
-0+config YEELOONG_HOTKEY + tristate "Hotkey Driver" + depends on YEELOONG_VO + select INPUTI think this should be depend, not select.
Hmm, okay, will replace it by depend later ;)
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 62
Quoted 2 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ select INPUT_EVDEV + select SUSPENDDoes it break without SUSPEND?
not break, but I just want to select something for users, so, they will have no need to care about which extra option is needed.
We use select extensively on MIPS but select is dangerous and you stepped into its trap. When SUSPEND is enabled by a user in kernel/power/Kconfig it can only be choosen if PM is enabled. By "select SUSPEND" this dependency so now it is possible to have a kernel where SUSPEND is enabled without PM which won't work.
Ralf
Re: [PATCH v5 8/8] Loongson: YeeLoong: add hotkey driver
Quoted 20 lines · Ralf Baechle
Quoted 18 lines · Wu Zhangjin
Quoted 8 lines · Dmitry Torokhov
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 60
Quoted 5 lines · Wu Zhangjin
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +4
-0+config YEELOONG_HOTKEY + tristate "Hotkey Driver" + depends on YEELOONG_VO + select INPUTI think this should be depend, not select.
Hmm, okay, will replace it by depend later ;)
Quoted 5 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig config YEELOONG_SUSPEND · line 62
Quoted 3 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/Kconfig +2
-0+ select INPUT_EVDEV + select SUSPENDDoes it break without SUSPEND?
Quoted 9 lines
Quoted 2 lines
not break, but I just want to select something for users, so, they will have no need to care about which extra option is needed.
We use select extensively on MIPS but select is dangerous and you stepped into its trap. When SUSPEND is enabled by a user in
kernel/power/Kconfigit can only be choosen if PM is enabled. By "select SUSPEND" this dependency so now it is possible to have a kernel where SUSPEND is enabled without PM which won't work.
Get it, thanks for your clarification ;)
Regards,
Wu Zhangjin
Re: [PATCH v5 8/8] Loongson: YeeLoong: add hotkey driver
In reply to Wu ZhangjinOn Sat, 2009-11-28 at 21:44 +0800, Wu Zhangjin wrote:
[...]
Quoted 4 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c new file +4
-0+ +static int camera_handler (int status) +{ +int value;
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c line 228
Quoted 10 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c new file +10
-0+static int camera_status; + + status = !!status; + camera_status =ec_read (REG_CAMERA_STATUS ); +if (status != camera_status) { + value =ec_read (REG_CAMERA_CONTROL ); +ec_write (REG_CAMERA_CONTROL , value | (1 <<1 )); + } +return ec_read (REG_CAMERA_STATUS ); +}
The above stuff is very awful, the camera event work as a switch, so this is enough:
static int camera_handler(int status)
{
int value;
value = ec_read(REG_CAMERA_CONTROL);
ec_write(REG_CAMERA_CONTROL, value | (1 << 1));
return status;
}[...]
Quoted 13 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c new file +13
-0+/* +* SCI(system control interrupt) main interrupt routine +* +* We will do the query and get event number together so the interrupt routine +* should be longer than 120us now at least 3ms elpase for it. +*/ +static irqreturn_t sci_irq_handler (int irq,void *dev_id) +{ +int ret; + +if (SCI_IRQ_NUM != irq) +return IRQ_NONE ; +
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c line 311
Quoted 10 lines
arch/mips/loongson/lemote-2f/yeeloong_laptop/hotkey.c new file +10
-0+/* Query the event number */ + ret =ec_query_event_num (); +if (ret <0 ) +return IRQ_NONE ; + + event =ec_get_event_num (); +if (event <0 ) +return IRQ_NONE ; + +if ((event !=0x00 ) && (event !=0xff )) {
It's better to use somethig else:
if (event >= EVENT_START && event <= EVENT_END) {
....
Best Regards,
Wu Zhangjin