diff --git a/packages/audio/alsa/config/asound.conf b/packages/audio/alsa/config/asound.conf new file mode 100644 index 0000000000..faac879698 --- /dev/null +++ b/packages/audio/alsa/config/asound.conf @@ -0,0 +1,69 @@ +pcm.!default { +type plug +slave { +pcm "both" +} +} + +pcm.both { +type route +slave { +pcm multi +channels 6 +} +ttable.0.0 1.0 +ttable.1.1 1.0 +ttable.0.2 1.0 +ttable.1.3 1.0 +ttable.0.4 1.0 +ttable.1.5 1.0 +} + +pcm.multi { +type multi +slaves.a { +pcm "tv" +channels 2 +} +slaves.b { +pcm "receiver" +channels 2 +} +slaves.c { +pcm "analog" +channels 2 +} +bindings.0.slave a +bindings.0.channel 0 +bindings.1.slave a +bindings.1.channel 1 +bindings.2.slave b +bindings.2.channel 0 +bindings.3.slave b +bindings.3.channel 1 +bindings.4.slave c +bindings.4.channel 0 +bindings.5.slave c +bindings.5.channel 1 +} + +pcm.tv { +type hw +card 0 +device 3 +channels 2 +} + +pcm.receiver { +type hw +card 0 +device 1 +channels 2 +} + +pcm.analog { +type hw +card 0 +device 0 +channels 2 +} diff --git a/packages/debug/install b/packages/debug/install index e9ac17a4fa..8a476775a2 100755 --- a/packages/debug/install +++ b/packages/debug/install @@ -5,6 +5,3 @@ $SCRIPTS/install strace $SCRIPTS/install gdb $SCRIPTS/install bootchart - -$SCRIPTS/install mrxvt -$SCRIPTS/install evilwm diff --git a/packages/graphics/Mesa/build b/packages/graphics/Mesa/build index c4543087c8..73a404271c 100755 --- a/packages/graphics/Mesa/build +++ b/packages/graphics/Mesa/build @@ -17,7 +17,6 @@ get_graphicdrivers cd $PKG_BUILD HOST_CC=$HOST_CC \ -OPT_FLAGS="$CFLAGS -D_GNU_SOURCE" \ HOST_OPT_FLAGS="$HOST_CFLAGS" \ X11_INCLUDES= \ DRI_DRIVER_INSTALL_DIR="$XORG_PATH_DRI" \ @@ -48,7 +47,12 @@ DRI_DRIVER_SEARCH_DIR="$XORG_PATH_DRI" \ --without-demos \ --disable-gallium \ -make +make -C src/glsl CC=$HOST_CC CFLAGS="" +mv src/glsl/apps/compile ./host_compile + +make clean + +make GLSL_CL="\$(TOP)/host_compile" make -C progs/xdemos diff --git a/packages/graphics/Mesa/install b/packages/graphics/Mesa/install index d8bd307281..9c7aee264c 100755 --- a/packages/graphics/Mesa/install +++ b/packages/graphics/Mesa/install @@ -25,4 +25,4 @@ if [ "$DEVTOOLS" = yes ]; then cp -P $PKG_BUILD/progs/xdemos/glxdemo $INSTALL/usr/bin cp -P $PKG_BUILD/progs/xdemos/glxgears $INSTALL/usr/bin cp -P $PKG_BUILD/progs/xdemos/glxinfo $INSTALL/usr/bin -fi \ No newline at end of file +fi diff --git a/packages/graphics/Mesa/patches/101_ubuntu_hidden_glname.patch b/packages/graphics/Mesa/patches/101_ubuntu_hidden_glname.patch deleted file mode 100644 index a04106c4b0..0000000000 --- a/packages/graphics/Mesa/patches/101_ubuntu_hidden_glname.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: mesa/src/mesa/x86/glapi_x86.S -=================================================================== ---- mesa.orig/src/mesa/x86/glapi_x86.S 2009-06-29 14:43:07.000000000 +0300 -+++ mesa/src/mesa/x86/glapi_x86.S 2009-06-29 14:45:38.000000000 +0300 -@@ -148,7 +148,6 @@ - - ALIGNTEXT16 - GLOBL GLNAME(gl_dispatch_functions_start) -- HIDDEN(GLNAME(gl_dispatch_functions_start)) - GLNAME(gl_dispatch_functions_start): - - GL_STUB(NewList, _gloffset_NewList, NewList@8) diff --git a/packages/graphics/Mesa/patches/102_dont-vblank.diff b/packages/graphics/Mesa/patches/102_dont-vblank.diff deleted file mode 100644 index 3f1c3ae615..0000000000 --- a/packages/graphics/Mesa/patches/102_dont-vblank.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c -index 5233e58..5dded4b 100644 ---- a/src/mesa/drivers/dri/intel/intel_screen.c -+++ b/src/mesa/drivers/dri/intel/intel_screen.c -@@ -55,7 +55,7 @@ PUBLIC const char __driConfigOptions[] = - DRI_CONF_BEGIN - DRI_CONF_SECTION_PERFORMANCE - DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) -- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_ALWAYS_SYNC) -+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) - /* Options correspond to DRI_CONF_BO_REUSE_DISABLED, - * DRI_CONF_BO_REUSE_ALL - */ - diff --git a/packages/graphics/Mesa/patches/108_big_endian.patch b/packages/graphics/Mesa/patches/108_big_endian.patch deleted file mode 100644 index 7341119082..0000000000 --- a/packages/graphics/Mesa/patches/108_big_endian.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -Nurp mesa-7.6.0~git20090817.7c422387/src/mesa/drivers/dri/r300/r300_draw.c mesa-7.6.0~git20090817.7c422387-working/src/mesa/drivers/dri/r300/r300_draw.c ---- mesa-7.6.0~git20090817.7c422387/src/mesa/drivers/dri/r300/r300_draw.c 2009-08-17 07:30:14.000000000 -0700 -+++ mesa-7.6.0~git20090817.7c422387-working/src/mesa/drivers/dri/r300/r300_draw.c 2009-08-26 13:38:46.000000000 -0700 -@@ -108,12 +108,13 @@ static void r300FixupIndexBuffer(GLconte - - #if MESA_BIG_ENDIAN - } else { /* if (mesa_ind_buf->type == GL_UNSIGNED_SHORT) */ -+ GLuint size; - GLushort *in = (GLushort *)src_ptr; - size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); - - radeonAllocDmaRegion(&r300->radeon, &r300->ind_buf.bo, &r300->ind_buf.bo_offet, size, 4); - -- assert(r300->ind_buf.bo->ptr != NULL) -+ assert(r300->ind_buf.bo->ptr != NULL); - out = (GLuint *)ADD_POINTERS(r300->ind_buf.bo->ptr, r300->ind_buf.bo_offset); - - for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) { diff --git a/packages/graphics/Mesa/patches/109_fix_relocation_delta_for_wm_surfaces.patch b/packages/graphics/Mesa/patches/109_fix_relocation_delta_for_wm_surfaces.patch deleted file mode 100644 index 34279dda97..0000000000 --- a/packages/graphics/Mesa/patches/109_fix_relocation_delta_for_wm_surfaces.patch +++ /dev/null @@ -1,26 +0,0 @@ -From acfea5c705f383692e661d37c5cd7da2f3db559b Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 09 Sep 2009 19:35:30 +0000 -Subject: i965: Fix relocation delta for WM surfaces. - -This was a regression in 0f328c90dbc893e15005f2ab441d309c1c176245. - -Bug #23688 -Bug #23254 -(cherry picked from commit 5604b27b9326ac542069a49ed9650c4b0d3e939a) ---- -diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c -index 096f743..3dcc592 100644 ---- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c -+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c -@@ -629,7 +629,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, - drm_intel_bo_emit_reloc(brw->wm.surf_bo[unit], - offsetof(struct brw_surface_state, ss1), - region_bo, -- surf.ss1.base_addr, -+ surf.ss1.base_addr - region_bo->offset, - I915_GEM_DOMAIN_RENDER, - I915_GEM_DOMAIN_RENDER); - } --- -cgit v0.8.2 diff --git a/packages/graphics/Mesa/url b/packages/graphics/Mesa/url index d0aecb9798..2e47b0d64e 100644 --- a/packages/graphics/Mesa/url +++ b/packages/graphics/Mesa/url @@ -1,2 +1,2 @@ -ftp://ftp.freedesktop.org/pub/mesa/7.7.1/MesaLib-7.7.1.tar.bz2 -ftp://ftp.freedesktop.org/pub/mesa/7.7.1/MesaDemos-7.7.1.tar.bz2 \ No newline at end of file +ftp://freedesktop.org/pub/mesa/7.8.1/MesaLib-7.8.1.tar.bz2 +ftp://freedesktop.org/pub/mesa/7.8.1/MesaDemos-7.8.1.tar.bz2 diff --git a/packages/image/install b/packages/image/install index 499c3f864a..4fb78123f7 100755 --- a/packages/image/install +++ b/packages/image/install @@ -55,8 +55,6 @@ case "$2" in $SCRIPTS/install linux $2 $SCRIPTS/install busybox $SCRIPTS/install util-linux-ng - - $SCRIPTS/install pm-utils $SCRIPTS/install ureadahead echo "OpenELEC" > $INSTALL/etc/distribution diff --git a/packages/linux/patches/linux-2.6.33-02-add_lirc_driver_nct667x-0.5.diff b/packages/linux/patches/linux-2.6.33-02-add_lirc_driver_nct667x-0.5.diff new file mode 100644 index 0000000000..44fb32e0ce --- /dev/null +++ b/packages/linux/patches/linux-2.6.33-02-add_lirc_driver_nct667x-0.5.diff @@ -0,0 +1,3700 @@ +diff -Naur linux-2.6.33.2/drivers/input/lirc/Kconfig linux-2.6.33.2.patch/drivers/input/lirc/Kconfig +--- linux-2.6.33.2/drivers/input/lirc/Kconfig 2010-04-03 18:40:52.365577611 +0200 ++++ linux-2.6.33.2.patch/drivers/input/lirc/Kconfig 2010-04-03 18:42:04.203701785 +0200 +@@ -64,6 +64,12 @@ + help + Driver for Windows Media Center Ed. USB IR Transceivers + ++config LIRC_NCT667X ++ tristate "Nuvolo (Winbond) 667x IR Transeiver" ++ depends on INPUT_LIRC && PNP ++ help ++ Driver for Nuvolo (Winbond) 667x IR Transeiver IR Transceivers ++ + config LIRC_PARALLEL + tristate "Homebrew Parallel Port Receiver" + depends on INPUT_LIRC && !SMP +diff -Naur linux-2.6.33.2/drivers/input/lirc/lirc_wb677_common_extern.h linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_common_extern.h +--- linux-2.6.33.2/drivers/input/lirc/lirc_wb677_common_extern.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_common_extern.h 2010-04-03 18:46:59.068576829 +0200 +@@ -0,0 +1,118 @@ ++#ifndef __LIRC_WB677_COMMON_EXTERN_HEADER__ ++#define __LIRC_WB677_COMMON_EXTERN_HEADER__ ++ ++#include ++ ++#include ++#include "lirc_dev.h" ++ ++extern char *DRVNAME; ++ ++/* chip id string, at most 7 characters */ ++extern char *chip_id; ++ ++ ++ ++ ++/* allow show debug messages ++ * without additional debug setting, only show current IRQ number, I/O port and final decode output */ ++/*//#define IR_667_DEBUG*/ ++ ++/* show debug message while decode mce keyboard and mouse signals */ ++#ifdef IR_667_DEBUG ++/*//#define ALLOW_DEBUG_DECODE*/ ++#endif ++ ++/* show incoming interrupt signals ++ * may block machine, mask it if sure interrupt signal is good */ ++#ifdef IR_667_DEBUG ++/*//#define ALLOW_DEBUG_INTERRUPT*/ ++#endif ++ ++/* show received infrared pulse and cancel decode functions, mask it in stable version ++ * it will stop decode MCE controller, keyboard and mouse ++ * mask it if want to decode incoming signals ++ */ ++#ifdef IR_667_DEBUG ++/*//#define ALLOW_DEBUG_PRINT_PULSE*/ ++#endif ++ ++/* show debug message while set WAKE UP key ++ * it will print cir_wake buf message while setting wake up key ++ * mask it in stable version ++ */ ++#ifdef IR_667_DEBUG ++#define ALLOW_DEBUG_WAKE ++#endif ++ ++/* show STUDY debug messages */ ++#ifdef IR_667_DEBUG ++#define ALLOW_DEBUG_STUDY ++#endif ++ ++/* show ioctl debug messages */ ++#ifdef IR_667_DEBUG ++#define ALLOW_DEBUG_IOCTL ++#endif ++ ++/* step debug */ ++#ifdef IR_667_DEBUG ++#define ALLOW_DEBUG_STEP ++#endif ++ ++#ifdef ALLOW_DEBUG_STEP ++#define STEP_DBG \ ++ do { \ ++ printk("w83667hg_ir step debug: %s, %d\n", __FILE__, __LINE__); \ ++ } while (0); ++#else ++#define STEP_DBG ++#endif ++ ++#ifdef ALLOW_DEBUG_PRINT_PULSE ++/* print current received ir pulse ++ * it will output all data, clean CIR_IRSTS so make all following irq_handler ignore ++ */ ++void debug_print_pulse(void); ++ ++void debug_print_wake_pulse(void); ++#endif ++ ++ ++ ++ ++/* register lirc device & buffer */ ++ ++/* mininum value 76, recommend 256 */ ++#define IRCTL_BUF_LIMIT 2048 ++ ++ ++struct irctl { ++ struct input_dev *input_dev; /* allocate by input_init */ ++ struct lirc_buffer *lirc_buffer; ++ struct lirc_driver *lirc_plugin; ++ spinlock_t lock; ++ /* for controller */ ++ int lircdata; ++ u8 ctrl_fix_head; /* fix controller not sync problem*/ ++ /* for keyboard */ ++ u8 pressed_keycode; /* initialize as 0*/ ++ u8 pressed_shiftmask; /* initialize as 0*/ ++ /* for decode */ ++ u8 buf[IRCTL_BUF_LIMIT]; ++ unsigned int buf_count; /* init as 0, reset 0 after decode*/ ++ unsigned int cur_buf_num; /* init as 0, set as 0 while clean*/ ++ /* for study */ ++#define ST_STUDY_NONE 0x0 ++#define ST_STUDY_START 0x01 ++#define ST_STUDY_CARRIER 0x02 ++#define ST_STUDY_ALL_RECV 0x04 ++ u8 study_state; ++ /* carrier period = 1 / frequency */ ++ unsigned int carrier; ++ wait_queue_head_t queue; ++}; ++ ++extern unsigned int usb_kbd_keycode[256]; ++ ++#endif +diff -Naur linux-2.6.33.2/drivers/input/lirc/lirc_wb677.h linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677.h +--- linux-2.6.33.2/drivers/input/lirc/lirc_wb677.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677.h 2010-04-03 18:47:28.580576601 +0200 +@@ -0,0 +1,683 @@ ++/* ++* LIRC driver for Nuvoton w83667hg/w83677hg-i ++* ++* Copyright (C) 2009 Nuvoton PS Team ++* ++* This program is free software; you can redistribute it and/or ++* modify it under the terms of the GNU General Public License as ++* published by the Free Software Foundation; either version 2 of the ++* License, or (at your option) any later version. ++* ++* This program is distributed in the hope that it will be useful, but ++* WITHOUT ANY WARRANTY; without even the implied warranty of ++* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++* General Public License for more details. ++* ++* You should have received a copy of the GNU General Public License ++* along with this program; if not, write to the Free Software ++* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ++* USA ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/*//#include */ ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++ ++ ++#include "lirc_wb677_common_extern.h" ++ ++ ++ ++/* CIR settings */ ++ ++/* total length of CIR and CIR WAKE */ ++#define CIR_IOREG_LENGTH 0x0f ++ ++/* RX limit length, 8 high bits for SLCH, 8 low bits for SLCL ++ * 0x7d0 = 2000 */ ++#define CIR_RX_LIMIT_COUNT 0x7d0 ++ ++/* CIR Regs */ ++#define CIR_IRCON 0x00 ++#define CIR_IRSTS 0x01 ++#define CIR_IREN 0x02 ++#define CIR_RXFCONT 0x03 ++#define CIR_CP 0x04 ++#define CIR_CC 0x05 ++#define CIR_SLCH 0x06 ++#define CIR_SLCL 0x07 ++#define CIR_FIFOCON 0x08 ++#define CIR_IRFIFOSTS 0x09 ++#define CIR_SRXFIFO 0x0A ++#define CIR_TXFCONT 0x0B ++#define CIR_STXFIFO 0x0C ++#define CIR_FCCH 0x0D ++#define CIR_FCCL 0x0E ++#define CIR_IRFSM 0x0F ++ ++/* CIR IRCON settings */ ++#define CIR_IRCON_RECV 0x80 ++#define CIR_IRCON_WIREN 0x40 ++#define CIR_IRCON_TXEN 0x20 ++#define CIR_IRCON_RXEN 0x10 ++#define CIR_IRCON_WRXINV 0x08 ++#define CIR_IRCON_RXINV 0x04 ++ ++#define CIR_IRCON_SAMPLE_PERIOD_SEL_1 0x00 ++#define CIR_IRCON_SAMPLE_PERIOD_SEL_25 0x01 ++#define CIR_IRCON_SAMPLE_PERIOD_SEL_50 0x02 ++#define CIR_IRCON_SAMPLE_PERIOD_SEL_100 0x03 ++ ++/* select sample period as 50us */ ++#define CIR_IRCON_SAMPLE_PERIOD_SEL CIR_IRCON_SAMPLE_PERIOD_SEL_50 ++ ++/* CIR IRSTS settings */ ++#define CIR_IRSTS_RDR 0x80 ++#define CIR_IRSTS_RTR 0x40 ++#define CIR_IRSTS_PE 0x20 ++#define CIR_IRSTS_RFO 0x10 ++#define CIR_IRSTS_TE 0x08 ++#define CIR_IRSTS_TTR 0x04 ++#define CIR_IRSTS_TFU 0x02 ++#define CIR_IRSTS_GH 0x01 ++ ++/* CIR IREN settings */ ++#define CIR_IREN_RDR 0x80 ++#define CIR_IREN_RTR 0x40 ++#define CIR_IREN_PE 0x20 ++#define CIR_IREN_RFO 0x10 ++#define CIR_IREN_TE 0x08 ++#define CIR_IREN_TTR 0x04 ++#define CIR_IREN_TFU 0x02 ++#define CIR_IREN_GH 0x01 ++ ++/* CIR FIFOCON settings */ ++#define CIR_FIFOCON_TXFIFOCLR 0x80 ++ ++#define CIR_FIFOCON_TX_TRIGGER_LEV_31 0x00 ++#define CIR_FIFOCON_TX_TRIGGER_LEV_24 0x10 ++#define CIR_FIFOCON_TX_TRIGGER_LEV_16 0x20 ++#define CIR_FIFOCON_TX_TRIGGER_LEV_8 0x30 ++ ++/* select TX trigger level as 16 */ ++#define CIR_FIFOCON_TX_TRIGGER_LEV CIR_FIFOCON_TX_TRIGGER_LEV_16 ++ ++#define CIR_FIFOCON_RXFIFOCLR 0x08 ++ ++#define CIR_FIFOCON_RX_TRIGGER_LEV_1 0x00 ++#define CIR_FIFOCON_RX_TRIGGER_LEV_8 0x01 ++#define CIR_FIFOCON_RX_TRIGGER_LEV_16 0x02 ++#define CIR_FIFOCON_RX_TRIGGER_LEV_24 0x03 ++ ++/* select RX trigger level as 1 */ ++#define CIR_FIFOCON_RX_TRIGGER_LEV CIR_FIFOCON_RX_TRIGGER_LEV_1 ++ ++/* CIR IRFIFOSTS settings */ ++#define CIR_IRFIFOSTS_IR_PENDING 0x80 ++#define CIR_IRFIFOSTS_RX_GS 0x40 ++#define CIR_IRFIFOSTS_RX_FTA 0x20 ++#define CIR_IRFIFOSTS_RX_EMPTY 0x10 ++#define CIR_IRFIFOSTS_RX_FULL 0x08 ++#define CIR_IRFIFOSTS_TX_FTA 0x04 ++#define CIR_IRFIFOSTS_TX_EMPTY 0x02 ++#define CIR_IRFIFOSTS_TX_FULL 0x01 ++ ++ ++/* CIR WAKE UP Regs */ ++#define CIR_WAKE_IRCON 0x00 ++#define CIR_WAKE_IRSTS 0x01 ++#define CIR_WAKE_IREN 0x02 ++#define CIR_WAKE_FIFO_CMP_DEEP 0x03 ++#define CIR_WAKE_FIFO_CMP_TOL 0x04 ++#define CIR_WAKE_FIFO_COUNT 0x05 ++#define CIR_WAKE_SLCH 0x06 ++#define CIR_WAKE_SLCL 0x07 ++#define CIR_WAKE_FIFOCON 0x08 ++#define CIR_WAKE_SRXFSTS 0x09 ++#define CIR_WAKE_SAMPLE_RX_FIFO 0x0A ++#define CIR_WAKE_WR_FIFO_DATA 0x0B ++#define CIR_WAKE_RD_FIFO_ONLY 0x0C ++#define CIR_WAKE_RD_FIFO_ONLY_IDX 0x0D ++#define CIR_WAKE_FIFO_IGNORE 0x0E ++#define CIR_WAKE_IRFSM 0x0F ++ ++/* CIR WAKE UP IRCON settings */ ++#define CIR_WAKE_IRCON_DEC_RST 0x80 ++#define CIR_WAKE_IRCON_MODE1 0x40 ++#define CIR_WAKE_IRCON_MODE0 0x20 ++#define CIR_WAKE_IRCON_RXEN 0x10 ++#define CIR_WAKE_IRCON_R 0x08 ++#define CIR_WAKE_IRCON_RXINV 0x04 ++ ++/* select a same sample period like cir register */ ++#define CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL CIR_IRCON_SAMPLE_PERIOD_SEL_50 ++ ++/* CIR WAKE UP IRSTS settings */ ++#define CIR_WAKE_IRSTS_RDR 0x80 ++#define CIR_WAKE_IRSTS_RTR 0x40 ++#define CIR_WAKE_IRSTS_PE 0x20 ++#define CIR_WAKE_IRSTS_RFO 0x10 ++#define CIR_WAKE_IRSTS_GH 0x08 ++#define CIR_WAKE_IRSTS_IR_PENDING 0x01 ++ ++/* CIR WAKE UP IREN settings */ ++#define CIR_WAKE_IREN_RDR 0x80 ++#define CIR_WAKE_IREN_RTR 0x40 ++#define CIR_WAKE_IREN_PE 0x20 ++#define CIR_WAKE_IREN_RFO 0x10 ++#define CIR_WAKE_IREN_TE 0x08 ++#define CIR_WAKE_IREN_TTR 0x04 ++#define CIR_WAKE_IREN_TFU 0x02 ++#define CIR_WAKE_IREN_GH 0x01 ++ ++/* CIR WAKE FIFOCON settings */ ++#define CIR_WAKE_FIFOCON_RXFIFOCLR 0x08 ++ ++#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_67 0x00 ++#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_66 0x01 ++#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_65 0x02 ++#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_64 0x03 ++ ++/* select WAKE UP RX trigger level as 67 */ ++#define CIR_WAKE_FIFOCON_RX_TRIGGER_LEV CIR_WAKE_FIFOCON_RX_TRIGGER_LEV_67 ++ ++/* CIR WAKE SRXFSTS settings */ ++#define CIR_WAKE_IRFIFOSTS_RX_GS 0x80 ++#define CIR_WAKE_IRFIFOSTS_RX_FTA 0x40 ++#define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20 ++#define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10 ++ ++ ++ ++ ++/* Config Regs */ ++ ++/* Chip Control Regs */ ++#define cr_cfg_idx 0x2e ++#define cr_cfg_dat 0x2f ++ ++#define cr_cfg_idx2 0x4e ++#define cr_cfg_dat2 0x4f ++ ++static u8 CFG_idx = cr_cfg_idx; ++static u8 CFG_dat = cr_cfg_dat; ++ ++#define CHIP_ID_HIGH_ADDR 0x20 ++#define CHIP_ID_LOW_ADDR 0x21 ++ ++#define CHIP_ID_HIGH 0xB4 ++#define CHIP_ID_LOW 0x73 ++ ++#define ACTIVE_LOG_DEV 0x01 ++#define DEACTIVE_LOG_DEV 0x0 ++ ++#define CIR_LOG_DEV 0x06 ++ ++#define ACPI_LOG_DEV 0x0A ++ ++#define ENABLE_CIR_WAKE 0x08 ++#define DISABLE_CIR_WAKE 0xF7 ++ ++#define ENABLE_CIR_INTR_OF_MOUSE_IRQ 0x80 ++#define DISABLE_CIR_INTR_OF_MOUSE_IRQ 0x7F ++ ++#define ENABLE_PME_INTR_OF_CIR_PASS 0x08 ++#define DISABLE_PME_INTR_OF_CIR_PASS 0xF7 ++ ++#define CIR_WAKE_LOG_DEV 0x0E ++ ++ ++/* read/update registers functions */ ++ ++/* enter extended function mode */ ++static inline void cr_enter_ext(void); ++ ++/* exit extended function mode */ ++static inline void cr_exit_ext(void); ++ ++/* select logical device */ ++static inline void cr_select_log_dev(int cr); ++ ++static inline void cr_update(int dat, int cr); ++ ++static inline u8 cr_read(int cr); ++ ++/* update cr register without change other bits */ ++static inline void cr_safe_update(u8 dat, int cr); ++ ++/* clear cr register without change other bits */ ++static inline void cr_safe_clear(u8 dat, int cr); ++ ++ ++ ++/* read/write cir registers */ ++ ++static inline void cir_update(u8 dat, int cir); ++ ++static u8 cir_read(int cir); ++ ++/* read/write cir wake registers */ ++ ++static inline void cir_wake_update(u8 dat, int cir); ++ ++static u8 cir_wake_read(int cir); ++ ++ ++/* dump current cir registers */ ++static void cir_dump_reg(void); ++ ++/* dump current cir wake up registers */ ++static void cir_wake_dump_reg(void); ++ ++ ++ ++ ++ ++/* driver module load/unload functions */ ++ ++/* Config Registers init */ ++/* ++ * initialize cr, cir, apci, cir wake logical devices ++ * open these devices and irq ++ */ ++static int w83667hg_cr_init(void); ++ ++/* Config Registers uninit */ ++/* ++ * close cir and cir wake logical devices ++ */ ++static void w83667hg_cr_uninit(void); ++ ++ ++/* register input device (keyboard and mouse) ++ * ++ */ ++ ++/* Define it for decoding keyboard and mouse in driver */ ++#define DECODE_KEYBOARD_MOUSE ++ ++/* this is the keycode table of US-EN layout keyboard ++ * modify it to support other layout keyboard ++ */ ++unsigned int usb_kbd_keycode[256] = { ++ 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, ++ 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, ++ 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, ++ 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64, ++ 65, 66, 67, 68, 87, 88, 99, 70, 119, 110, 102, 104, 111, 107, 109, 106, ++ 105, 108, 103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71, ++ 72, 73, 82, 83, 86, 127, 116, 117, 183, 184, 185, 186, 187, 188, 189, 190, ++ 191, 192, 193, 194, 134, 138, 130, 132, 128, 129, 131, 137, 133, 135, 136, 113, ++ 115, 114, 0, 0, 0, 121, 0, 89, 93, 124, 92, 94, 95, 0, 0, 0, ++ 122, 123, 90, 91, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 29, 42, 56, 125, 97, 54, 100, 126, 164, 166, 165, 163, 161, 115, 114, 113, ++ 150, 158, 159, 128, 136, 177, 178, 176, 142, 152, 173, 140 ++}; ++ ++/* input device name, locate in /sys/input/inputNUM/name */ ++static char *INPUTNAME = "MCE Remote Keyboard"; ++ ++static struct input_id w83667hg_input_id = { ++ .bustype = BUS_HOST, /* comunicate 667 by HOST, or I2C ? */ ++ .vendor = 0x1050, /* Winbond PCI VENDOR ID */ ++ .product = 1, /* for basic devices, like keyboard & mouse */ ++ .version = 0, /* ignore it */ ++}; ++ ++ ++static int w83667hg_input_open(struct input_dev *cur_input_dev); ++ ++static void w83667hg_input_close(struct input_dev *cur_input_dev); ++ ++static struct input_dev *w83667hg_input_init(void); ++ ++static void w83667hg_input_uninit(struct input_dev *cur_input_dev); ++ ++/* internal call for register lirc */ ++static int lirc_set_use_inc(void *data); ++ ++static void lirc_set_use_dec(void *data); ++ ++ ++ ++static struct ir_recv_t { ++ spinlock_t lock; ++ u8 buf[IRCTL_BUF_LIMIT]; ++ unsigned int buf_count; ++ wait_queue_head_t queue; ++ /* for wake */ ++#define ST_WAKE_NONE 0x0 ++#define ST_WAKE_START 0x01 ++#define ST_WAKE_FINISH 0x02 ++ u8 wake_state; ++ /* for recv */ ++#define ST_RECV_WAIT_7F 0x01 ++#define ST_RECV_WAIT_HEAD 0x02 ++#define ST_RECV_WAIT_SILENT_END 0x04 ++ u8 recv_state; ++} w83667hg_ir_recv; ++ ++static struct ir_send_t { ++ spinlock_t lock; ++ u8 buf[IRCTL_BUF_LIMIT]; ++ unsigned int buf_count; ++ unsigned int cur_buf_num; ++ wait_queue_head_t queue; ++ /* for send */ ++#define ST_SEND_NONE 0x0 ++#define ST_SEND_REQUEST 0x02 ++#define ST_SEND_REPLY 0x04 ++ u8 send_state; ++} w83667hg_ir_send; ++ ++/* We initialise it at lirc_wb667_init() becuase of lirc group does not allow to initialise static varialbe to null.*/ ++static struct input_dev *w83667hg_input_dev; ++ ++/* We initialise it at lirc_wb667_init() becuase of lirc group does not allow to initialise static varialbe to null.*/ ++static struct lirc_driver *w83667hg_lirc_plugin; ++ ++#define LIRCBUF_SIZE 256 ++ ++/* We initialise it at lirc_wb667_init() becuase of lirc group does not allow to initialise static varialbe to null.*/ ++static struct lirc_buffer *w83667hg_lirc_buffer; ++ ++static void w83667hg_ir_recv_init(struct ir_recv_t *ir_recv); ++ ++static void w83667hg_ir_send_init(struct ir_send_t *ir_send); ++ ++static int w83667hg_irctl_init(struct irctl *ir); ++ ++static void w83667hg_irctl_uninit(struct irctl *ir); ++ ++ ++ ++ ++/* MCE CIR signal length, related on sample period */ ++ ++/* MCE CIR controller signal length: about 43ms ++ * 43ms / 50us (sample period) * 0.85 (inaccuracy) ++ */ ++#define CONTROLLER_BUF_LEN_MIN 830 ++ ++/* MCE CIR keyboard signal length: about 26ms ++ * 26ms / 50us (sample period) * 0.85 (inaccuracy) ++ */ ++#define KEYBOARD_BUF_LEN_MAX 650 ++#define KEYBOARD_BUF_LEN_MIN 610 ++ ++/* MCE CIR mouse signal length: about 24ms ++ * 24ms / 50us (sample period) * 0.85 (inaccuracy) ++ */ ++#define MOUSE_BUF_LEN_MIN 565 ++ ++ ++#define CIR_SAMPLE_PERIOD 50 ++#define CIR_SAMPLE_LOW_INACCURACY 0.85 ++ ++ ++/* MAX silence time that driver will sent to lirc */ ++#define MAX_SILENCE_TIME 60000 ++ ++ ++/* fops */ ++/* set carrier frequency by ioctl IR_IOSETCARRIER ++ * ++ * that value can be get by ioctl value IR_IOGETCARRIER ++ * on 667, set carrier on 2 registers: CP & CC ++ * always set CP as 0x81 ++ * set CC by SPEC, CC = 3MHz/carrier - 1 ++ */ ++static int w83667hg_set_carrier(unsigned int *carrier); ++ ++static int lirc_ioctl(struct inode *node, struct file *filep, unsigned int cmd, ++ unsigned long arg); ++ ++/* lirc_write ++ * ++ * 1) clean TX fifo first (handled by AP) ++ * 2) copy data from user space ++ * 3) open TX interrupt: TTR & TFU ++ * 4) send 9 pulses to open TTR ++ * in interrupt_handler: ++ * 5) send all data out ++ * go back to write(): ++ * 6) close TX interrupt ++ * ++ * The key problem of this function is user space data may larger than ++ * driver's data buf length. So lirc_wirte() only copy IRCTL_BUF_LIMIT data to ++ * buf. And keep current copied data buf num in cur_buf_num. But driver's buf ++ * number may larger than TXFCONT (0xFF). So in interrupt_handler, it has to ++ * set TXFCONT as 0xff, until buf_count less than 0xff. ++ * The confustion is cur_buf_num in decode, study and send is designed on ++ * different meaning. ++ * ++ */ ++static ssize_t lirc_write(struct file *file, const char *buf, size_t n, loff_t * ppos); ++ ++ ++ ++/* 1) clean lircdata and buf_count in irctl struct ++ * 2) clean RX and TX fifo ++ */ ++static void w83667hg_clean_data(struct ir_recv_t *ir_recv, struct irctl *ir); ++ ++ ++ ++ ++/* send 1 recorded controller signal to lirc */ ++static void w83667hg_send_packet_to_lirc_1(struct irctl *ir, int *val); ++ ++/* this value copy from lirc_mod_mce */ ++#if CIR_IRCON_SAMPLE_PERIOD_SEL == CIR_IRCON_SAMPLE_PERIOD_SEL_100 ++ #define MCE_TIME_UNIT 100 ++#elif CIR_IRCON_SAMPLE_PERIOD_SEL == CIR_IRCON_SAMPLE_PERIOD_SEL_50 ++ #define MCE_TIME_UNIT 50 ++#elif CIR_IRCON_SAMPLE_PERIOD_SEL == CIR_IRCON_SAMPLE_PERIOD_SEL_25 ++ #define MCE_TIME_UNIT 25 ++#else ++ #define MCE_TIME_UNIT 1 ++#endif ++ ++/* recode mce controller signal and send to lirc ++ * ++ * recode steps: ++ * 1) high pulse, +128 ++ * 2) low pulse, do nothing ++ * 3) keycode = pulse * 50 ++ * 4) sync head: PULSE_MASK (0xFF FFFF) ++ * 5) 1, |PULSE_BIT (0x100 0000) ++ * 0, +keycode ++ * ++ * function steps: ++ * 0) clean lircdata[] ++ * 1) jump head, put PULSE_BIT in lircdata[0] ++ * 2) normal decode, "10"=>1 |PULSE_BIT ++ * save in lircdata[] ++ * 3) send lircdata[] to lirc ++ */ ++static void w83667hg_submit_controller(struct irctl *ir); ++ ++ ++/* copy data from hardware fifo to driver buf ++ * ++ * 1. initial state is WAIT_7F ++ * 2. if data is not 0x7f, copy data from hardware fifo to struct ir_recv buf ++ * 3. if data is 0x7f, set recv_state as WAIT_HEAD, copy data from ir_recv to irctl ++ * 4. depend on received buf length to select submit_ function ++ * 5. set irctl buf len as 0 ++ * 5. receive data until data is not 0x7f, drop received 0x7f data, set recv_state as WAIT_7F again ++ * ++ * in normal, there are 3 parts in one infrared signal: ++ * 1. not silent pulse (ST_WAIT_7F) ++ * 2. 0x7f silent pulse (ST_WAIT_HEAD) ++ * 3. silent pulse shorter than 0x7f (ST_WAIT_HEAD) ++ * ++ * so this function copy signal part 1 and a 0x7f (for decode) to submit_() functions. ++ * when receive 0x7f, this function copy data from ir_recv to irctl, and wait for next high pulse. ++ */ ++static void w83667hg_recv(struct ir_recv_t *ir_recv, struct irctl *ir); ++ ++ ++/* as VISTA MCE definition, valid carrier value */ ++#define MAX_CARRIER 60000 ++#define MIN_CARRIER 30000 ++ ++/* receive function for STUDY ++ * ++ * 0. not receive 0x80, copy received data to ir_recv buf ++ * when get 0x80, it means user released controller, and only need process received data ++ * 1. get carrier ++ * 2. get pulse ++ */ ++static void w83667hg_study_recv(struct ir_recv_t *ir_recv, struct irctl *ir); ++ ++static irqreturn_t w83667hg_wake_interrupt_handler(int irq, void *dev); ++ ++static irqreturn_t w83667hg_interrupt_handler(int irq, void *dev); ++ ++ ++/* pnp device */ ++#ifdef CONFIG_PNP ++ ++ ++/* CIR and CIR WAKE */ ++static const struct pnp_device_id pnp_dev_table[] = { ++ { "WEC0530", 0 }, /* CIR */ ++ { "NTN0530", 0 }, /* CIR for new chip's pnp id*/ ++ { "", 0 }, ++}; ++ ++ ++MODULE_DEVICE_TABLE(pnp, pnp_dev_table); ++ ++static int __devinit lirc_wb667_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id); ++ ++static void __devexit lirc_wb667_pnp_remove(struct pnp_dev *dev); ++ ++/* before suspend ++ * 1. set all states as NONE ++ * 2. close CIR and WAKE interrupt ++ * 3. close CIR and WAKE cr ++ * 4. close input ++ */ ++static int lirc_wb667_pnp_suspend(struct pnp_dev *dev, pm_message_t state); ++ ++/* resume all register and input device ++ */ ++static int lirc_wb667_pnp_resume(struct pnp_dev *dev); ++ ++/* We initialise it as lirc_wb667_init because lirc group does not allow us to initialise static vaiable as 0 here. */ ++static unsigned int nopnp; ++ ++#else ++ ++/* We initialise it as lirc_lirc_wb667_init because lirc group does not allow us to initialise static vaiable as 0 here. */ ++static unsigned int nopnp; ++ ++#endif ++ ++ ++/* create io region for cir and cir wake ++ * create irq handler ++ * create dev and data struct ++ */ ++static int w83667hg_cir_probe(void); ++ ++/* uninit cir, cir wake, dev and data struct, release irq and io port */ ++static void w83667hg_cir_remove(void); ++ ++ ++static int lirc_wb667_init(void); ++ ++void lirc_wb667_uninit(void); ++ ++ ++/* ++ * 1. init cr ++ * 2. init input ++ * 3. init lirc buffer, register, irctl ++ * 4. init 667 cir dev, req_region, req_irq ++ */ ++/*int init_module(void); ++void cleanup_module(void);*/ ++int init_module_wb667(void); ++void cleanup_module_wb667(void); ++ ++MODULE_DESCRIPTION("LIRC driver for Nuvoton W83667HG-A & W83677HG CIR"); ++MODULE_AUTHOR("Nuvoton PS Team"); ++MODULE_LICENSE("GPL"); ++ ++/* device file name, locate in /dev/ directory */ ++/*//static char *DRVNAME = "w83667hg_ir";*/ ++/* FIXME, stable name*/ ++char *DRVNAME = "lirc_wb677"; ++module_param(DRVNAME, charp, S_IRUGO); ++MODULE_PARM_DESC(DRVNAME, "Device file name in /dev/ and /sys/class/."); ++ ++/* platform driver name to register */ ++#define PLATNAME "lirc_wb677_cir" ++#define PLATNAME_W "lirc_wb667_wake" ++ ++/* device file major number */ ++#define CIR_MAJOR 229 ++ ++/* cir device base address */ ++static u16 CIR_BASE = 0x240; ++module_param(CIR_BASE, ushort, S_IRUGO); ++MODULE_PARM_DESC(CIR_BASE, "Base IO port address of 667/677 CIR device."); ++ ++/* cir base i/o address */ ++static unsigned int cir_address; ++ ++/* cir irq */ ++static ushort CIR_IRQ_NUM = 5; ++module_param(CIR_IRQ_NUM, ushort, S_IRUGO); ++MODULE_PARM_DESC(CIR_IRQ_NUM, "IRQ number for 667/677 CIR device."); ++ ++/* handle cir wake up request in driver or not */ ++#define ENABLE_CIR_WAKE_IRQ ++ ++/* cir wake up device base address */ ++static u16 CIR_WAKE_BASE = 0x250; ++module_param(CIR_WAKE_BASE, ushort, S_IRUGO); ++MODULE_PARM_DESC(CIR_WAKE_BASE, "Base IO port address of 667/677 CIR WAKE device."); ++ ++/* cir wake up base i/o address */ ++static unsigned int cir_wake_address; ++ ++/* cir wake up irq */ ++static ushort CIR_WAKE_IRQ_NUM = 5; ++module_param(CIR_WAKE_IRQ_NUM, ushort, S_IRUGO); ++MODULE_PARM_DESC(CIR_WAKE_IRQ_NUM, "IRQ number for 667/677 CIR WAKE device."); ++ ++/* nopnp option */ ++#ifdef CONFIG_PNP ++module_param(nopnp, uint, S_IRUGO); ++MODULE_PARM_DESC(nopnp, "Scan for device instead of relying on PNP. (default 0)"); ++#endif ++ ++/*//EXPORT_NO_SYMBOLS;*/ ++ ++ ++ +diff -Naur linux-2.6.33.2/drivers/input/lirc/lirc_wb677_main.c linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_main.c +--- linux-2.6.33.2/drivers/input/lirc/lirc_wb677_main.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_main.c 2010-04-04 00:13:44.035576247 +0200 +@@ -0,0 +1,1723 @@ ++#define _GNU_SOURCE ++#include ++#include ++ ++#define MOD_INC_USE_COUNT ++#define MOD_DEC_USE_COUNT ++ ++#include "lirc_wb677.h" ++#include "lirc_wb677_mouse_kbd.h" ++#include "wb83677hg_ir.h" ++ ++struct irctl w83667hg_irctl; ++ ++/* chip id string, at most 7 characters */ ++char *chip_id = "w677hga"; ++ ++ ++ ++ ++/* enter extended function mode */ ++static inline void cr_enter_ext(void) ++{ ++ outb(0x87, CFG_idx); ++ outb(0x87, CFG_idx); ++ ++ if (0xff == cr_read(0x20)) { ++ CFG_idx = cr_cfg_idx2; ++ CFG_dat = cr_cfg_dat2; ++ outb(0x87, CFG_idx); ++ outb(0x87, CFG_idx); ++ } ++} ++ ++ ++/* exit extended function mode */ ++static inline void cr_exit_ext(void) ++{ ++ outb(0xaa, CFG_idx); ++} ++ ++/* select logical device */ ++static inline void cr_select_log_dev(int cr) ++{ ++ outb(0x07, CFG_idx); ++ outb(cr, CFG_dat); ++} ++ ++static inline void cr_update(int dat, int cr) ++{ ++ outb(cr, CFG_idx); ++ outb(dat, CFG_dat); ++} ++ ++static inline u8 cr_read(int cr) ++{ ++ outb(cr, CFG_idx); ++ return inb(CFG_dat); ++} ++ ++static inline void cr_safe_update(u8 dat, int cr) ++{ ++ cr_update(cr_read(cr) | dat, cr); ++} ++ ++static inline void cr_safe_clear(u8 dat, int cr) ++{ ++ cr_update(cr_read(cr) & dat, cr); ++} ++ ++ ++/* read/write cir registers */ ++ ++static inline void cir_update(u8 dat, int cir) ++{ ++ outb(dat, cir_address + (cir & 0xff)); ++} ++ ++static u8 cir_read(int cir) ++{ ++ u8 val; ++ ++ val = inb(cir_address + (cir & 0xff)); ++ ++ return val; ++} ++ ++static inline void cir_wake_update(u8 dat, int cir) ++{ ++ ++ outb(dat, cir_wake_address + (cir & 0xff)); ++ ++} ++ ++static u8 cir_wake_read(int cir) ++{ ++ u8 val; ++ ++ val = inb(cir_wake_address + (cir & 0xff)); ++ ++ return val; ++} ++ ++static void cir_dump_reg(void) ++{ ++ cr_enter_ext(); ++ printk("Dump CIR CR logical device:\n"); ++ cr_select_log_dev(CIR_LOG_DEV); ++ printk("CR CIR ACTIVE : 0x%x\n", cr_read(0x30)); ++ printk("CR CIR BASE ADDR: 0x%x\n", (cr_read(0x61) << 8)|cr_read(0x60)); ++ printk("CR CIR IRQ NUM: 0x%x\n", cr_read(0x70)); ++ cr_exit_ext(); ++ ++ printk("Dump CIR Registers\n"); ++ printk("CIR IRCON: 0x%x\n", cir_read(CIR_IRCON)); ++ printk("CIR IRSTS: 0x%x\n", cir_read(CIR_IRSTS)); ++ printk("CIR IREN: 0x%x\n", cir_read(CIR_IREN)); ++ printk("CIR RXFCONT: 0x%x\n", cir_read(CIR_RXFCONT)); ++ printk("CIR CP: 0x%x\n", cir_read(CIR_CP)); ++ printk("CIR CC: 0x%x\n", cir_read(CIR_CC)); ++ printk("CIR SLCH: 0x%x\n", cir_read(CIR_SLCH)); ++ printk("CIR SLCL: 0x%x\n", cir_read(CIR_SLCL)); ++ printk("CIR FIFOCON: 0x%x\n", cir_read(CIR_FIFOCON)); ++ printk("CIR IRFIFOSTS: 0x%x\n", cir_read(CIR_IRFIFOSTS)); ++ printk("CIR SRXFIFO: 0x%x\n", cir_read(CIR_SRXFIFO)); ++ printk("CIR TXFCONT: 0x%x\n", cir_read(CIR_TXFCONT)); ++ printk("CIR STXFIFO: 0x%x\n", cir_read(CIR_STXFIFO)); ++ printk("CIR FCCH: 0x%x\n", cir_read(CIR_FCCH)); ++ printk("CIR FCCL: 0x%x\n", cir_read(CIR_FCCL)); ++ printk("CIR IRFSM: 0x%x\n", cir_read(CIR_IRFSM)); ++ ++} ++ ++static void cir_wake_dump_reg(void) ++{ ++ u8 i = 0; ++ ++ cr_enter_ext(); ++ printk("Dump CIR WKAE CR logical device:\n"); ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ printk("CR CIR WAKE ACTIVE : 0x%x \n", cr_read(0x30)); ++ printk("CR CIR WAKE BASE ADDR: 0x%x\n", (cr_read(0x61) << 8)|cr_read(0x60)); ++ printk("CR CIR WAKE IRQ NUM: 0x%x\n", cr_read(0x70)); ++ cr_exit_ext(); ++ ++ printk("Dump CIR WAKE Registers\n"); ++ printk("CIR WAKE IRCON: 0x%x\n", cir_wake_read(CIR_WAKE_IRCON)); ++ printk("CIR IRSTS: 0x%x\n", cir_wake_read(CIR_WAKE_IRSTS)); ++ printk("CIR IREN: 0x%x\n", cir_wake_read(CIR_WAKE_IREN)); ++ printk("CIR WAKE FIFO CMP DEEP: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_CMP_DEEP)); ++ printk("CIR WAKE FIFO CMP TOL: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_CMP_TOL)); ++ printk("CIR WAKE FIFO COUNT: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_COUNT)); ++ printk("CIR WAKE SLCH: 0x%x\n", cir_wake_read(CIR_WAKE_SLCH)); ++ printk("CIR WAKE SLCL: 0x%x\n", cir_wake_read(CIR_WAKE_SLCL)); ++ printk("CIR WAKE FIFOCON: 0x%x\n", cir_wake_read(CIR_WAKE_FIFOCON)); ++ printk("CIR WAKE SRXFSTS: 0x%x\n", cir_wake_read(CIR_WAKE_SRXFSTS)); ++ printk("CIR WAKE SAMPLE RX FIFO: 0x%x\n", cir_wake_read(CIR_WAKE_SAMPLE_RX_FIFO)); ++ printk("CIR WAKE WR FIFO DATA: 0x%x\n", cir_wake_read(CIR_WAKE_WR_FIFO_DATA)); ++ printk("CIR WAKE RD FIFO ONLY: 0x%x\n", cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); ++ printk("CIR WAKE RD FIFO ONLY IDX: 0x%x\n", cir_wake_read(CIR_WAKE_RD_FIFO_ONLY_IDX)); ++ printk("CIR WAKE FIFO IGNORE: 0x%x\n", cir_wake_read(CIR_WAKE_FIFO_IGNORE)); ++ printk("CIR WAKE IRFSM: 0x%x\n", cir_wake_read(CIR_WAKE_IRFSM)); ++ ++ printk("Dump CIR WAKE keys\n"); ++ printk("%s FIFO count len = %d\n", DRVNAME, cir_wake_read(CIR_WAKE_FIFO_COUNT)); ++ i = 0; ++ for (; i < 67; i++) { ++ printk("%s FIFO = 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); ++ } ++ ++} ++ ++ ++/* 1. */ ++/* 677HG Config Registers init */ ++static int w83667hg_cr_init(void) ++{ ++ int val = 0; ++ ++ cr_enter_ext(); ++ ++ /* Check 677 CHIP ID first */ ++ val = cr_read(CHIP_ID_HIGH_ADDR); ++ if (val != CHIP_ID_HIGH) { ++ printk("%s %s: chip id high: 0x%x expect:0x%x\n", DRVNAME, chip_id, val, CHIP_ID_HIGH); ++ /*// cr_exit_ext(); ++ // return -ENODEV;*/ ++ } ++ else{ ++ printk("%s %s: chip id high: 0x%x\n", DRVNAME, chip_id, val); ++ } ++ ++ /* now check chip id, LSB */ ++ val = cr_read(CHIP_ID_LOW_ADDR); ++ if (CHIP_ID_LOW == (val & CHIP_ID_LOW)) { ++ printk("%s %s: chip id low: 0x%x expect:0x%x\n", DRVNAME, chip_id, val, CHIP_ID_LOW); ++ /*// cr_exit_ext(); ++ // return -ENODEV;*/ ++ } else{ ++ printk("%s %s: chip id low: 0x%x\n", DRVNAME, chip_id, val); ++ } ++ ++ /* for multi-function pin selection */ ++ val = cr_read(0x27); ++ val = (val&0xbc) | 0x41; ++ cr_update(val, 0x27); /*For W83677, CIR TX,RX, CIRWB pin selection*/ ++ ++ ++ ++ /* FIXME*/ ++ /* set Logical Dev 1: LPT */ ++ /* not sure really need it or not, find it in 667 wake up windows driver */ ++ cr_select_log_dev(0x01); ++ cr_update(DEACTIVE_LOG_DEV, 0x30); ++ cr_update(0, 0x70); ++ ++ /* Then set Logical Dev 6: CIR */ ++ cr_select_log_dev(CIR_LOG_DEV); ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ ++ cir_address = CIR_BASE; ++ cr_update(((CIR_BASE & 0xff00) >> 8), 0x60); ++ cr_update((CIR_BASE & 0xff), 0x61); ++#ifdef IR_667_DEBUG ++ printk("%s base io port address: 0x%x\n", DRVNAME, cir_address); ++#endif ++ ++ cr_update(CIR_IRQ_NUM, 0x70); ++#ifdef IR_667_DEBUG ++ printk("%s irq number: %d\n", DRVNAME, CIR_IRQ_NUM); ++#endif ++ ++ ++ /* Then set Logical Dev A: ACPI */ ++ cr_select_log_dev(ACPI_LOG_DEV); ++ ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ ++ /* enable cir wake up via PSOUT# (pin 60) */ ++ cr_safe_update(ENABLE_CIR_WAKE, 0xe0); ++ ++ /* enable cir interrupt of mouse IRQ event */ ++ /*//cr_safe_update(ENABLE_CIR_INTR_OF_MOUSE_IRQ, 0xf6);*/ ++ ++ /* enable pme interrupt of cir password event */ ++ /*//cr_safe_update(ENABLE_PME_INTR_OF_CIR_PASS, 0xf7);*/ ++ ++ ++ /* Then set Logical Dev E: CIR WAKE */ ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ ++ cir_wake_address = CIR_WAKE_BASE; ++ cr_update(((CIR_WAKE_BASE & 0xff00) >> 8), 0x60); ++ cr_update((CIR_WAKE_BASE & 0xff), 0x61); ++#ifdef IR_667_DEBUG ++ printk("%s cir wake up base io port address: 0x%x\n", DRVNAME, cir_wake_address); ++#endif ++ ++#ifdef ENABLE_CIR_WAKE_IRQ ++ cr_update(CIR_WAKE_IRQ_NUM, 0x70); ++#ifdef IR_667_DEBUG ++ printk("%s cir wake up irq number: %d\n", DRVNAME, CIR_WAKE_IRQ_NUM); ++#endif ++#endif ++ ++ cr_exit_ext(); ++ ++ return 0; ++} ++ ++static void w83667hg_cr_uninit(void) ++{ ++ cr_enter_ext(); ++ ++ /* close CIR */ ++ /* Don't close CIR Wake. When wake-up at power-on, it needs the function. 20091224 ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ cr_update(DEACTIVE_LOG_DEV, 0x30); ++ */ ++ ++ ++ /* Close Logical Dev A: ACPI */ ++ /*//cr_select_log_dev(ACPI_LOG_DEV);*/ ++ ++ /* enable cir wake up via PSOUT# (pin 60) */ ++ /*//cr_safe_clear(DISABLE_CIR_WAKE, 0xe0);*/ ++ ++ /* enable cir interrupt of mouse IRQ event */ ++ /*//cr_safe_clear(DISABLE_CIR_INTR_OF_MOUSE_IRQ, 0xf6);*/ ++ ++ /* enable pme interrupt of cir password event */ ++ /*//cr_safe_clear(DISABLE_PME_INTR_OF_CIR_PASS, 0xf7);*/ ++ ++ ++ /* close CIR wake up XXX */ ++ /*//cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ //cr_update(DEACTIVE_LOG_DEV, 0x30);*/ ++ ++ cr_exit_ext(); ++} ++ ++static int w83667hg_input_open(struct input_dev *cur_input_dev) ++{ ++ return 0; ++} ++ ++static void w83667hg_input_close(struct input_dev *cur_input_dev) ++{ ++} ++ ++/* 2. */ ++/* init linux input structure */ ++static struct input_dev *w83667hg_input_init(void) ++{ ++ int i; ++ struct input_dev *cur_input_dev = NULL; ++ ++ cur_input_dev = input_allocate_device(); ++ if (NULL == cur_input_dev) { ++ printk("alloc input device error\n"); ++ return NULL; ++ } ++ ++ cur_input_dev->name = INPUTNAME; ++ cur_input_dev->phys = DRVNAME; ++ memcpy(&cur_input_dev->id, &w83667hg_input_id, sizeof(struct input_id)); ++ ++ cur_input_dev->open = w83667hg_input_open; ++ cur_input_dev->close = w83667hg_input_close; ++ ++ /*//cur_input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); ++ //cur_input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);*/ ++ cur_input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); ++ cur_input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); ++ for (i = 0; i < 256; i++) { ++ set_bit(usb_kbd_keycode[i], cur_input_dev->keybit); ++ } ++ clear_bit(0, cur_input_dev->keybit); ++/*// cur_input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);*/ ++ cur_input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT); ++ ++ ++ if (input_register_device(cur_input_dev)) { ++ printk("register input device error\n"); ++ return NULL; ++ } ++ ++ return cur_input_dev; ++} ++ ++static void w83667hg_input_uninit(struct input_dev *cur_input_dev) ++{ ++ input_get_device(cur_input_dev); ++ input_unregister_device(cur_input_dev); ++ input_free_device(cur_input_dev); ++ cur_input_dev = NULL; ++} ++ ++ ++/* internal call for register lirc */ ++static int lirc_set_use_inc(void *data) ++{ ++ struct irctl *ir = data; ++ ++ if (!ir) { ++ printk("%s: set_use_inc called with no context\n", DRVNAME); ++ return -EIO; ++ } ++#ifdef IR_667_DEBUG ++ printk("%s : set use inc\n", DRVNAME); ++#endif ++ spin_lock(&ir->lock); ++ ir->ctrl_fix_head = 1; ++ spin_unlock(&ir->lock); ++ ++ ++ MOD_INC_USE_COUNT; ++ ++ return 0; ++} ++ ++static void lirc_set_use_dec(void *data) ++{ ++ struct irctl *ir = data; ++ ++ if (!ir) { ++ printk("%s: set_use_dec called with no context\n", DRVNAME); ++ return; ++ } ++#ifdef IR_667_DEBUG ++ printk("%s : set use dec\n", DRVNAME); ++#endif ++ ++ MOD_DEC_USE_COUNT; ++} ++ ++ ++static int lirc_ioctl(struct inode *node, struct file *filep, unsigned int cmd, unsigned long arg) ++{ ++ int ret = 0; ++ void __user *uptr = (void __user *)arg; ++ ++ int mode = 0; ++ struct irctl *ir = &w83667hg_irctl; ++ struct ir_recv_t *ir_recv = &w83667hg_ir_recv; ++ ++#ifdef ALLOW_DEBUG_IOCTL ++ printk("%s: IO Ctrl Code:%d\n", DRVNAME, cmd); ++#endif ++ ++ switch (cmd) { ++ /* lirc ioctl commands */ ++ case LIRC_GET_FEATURES: ++ ret = put_user(w83667hg_lirc_plugin->features, (unsigned long *)arg); ++ break; ++ case LIRC_GET_SEND_MODE: ++ if (!(w83667hg_lirc_plugin->features & LIRC_CAN_REC_MASK)) ++ return -ENOSYS; ++ ++ ret = put_user(LIRC_REC2MODE ++ (w83667hg_lirc_plugin->features & LIRC_CAN_REC_MASK), ++ (unsigned long *)arg); ++ if (ret) ++ return ret; ++ break; ++ case LIRC_SET_SEND_MODE: ++ ret = get_user(mode, (unsigned long *)arg); ++ if (ret) ++ return ret; ++ if (mode != (LIRC_MODE_PULSE&LIRC_CAN_SEND_MASK)) ++ return -EINVAL; ++ break; ++ case LIRC_GET_LENGTH: ++ ret = put_user((unsigned long)w83667hg_lirc_plugin->code_length, ++ (unsigned long *)arg); ++ break; ++ ++ /* ioctl commands for lirc_wb667 */ ++ case IR_DUMPCIRREG: ++ cir_dump_reg(); ++ break; ++ case IR_DUMPWAKEREG: ++ cir_wake_dump_reg(); ++ break; ++ case IR_IOLEARNWAKE: ++ spin_lock(&ir_recv->lock); ++ if (ir_recv->wake_state) { ++ spin_unlock(&ir_recv->lock); ++ ret = -EFAULT; ++ break; ++ } ++ ir_recv->wake_state = ST_WAKE_START; ++ spin_unlock(&ir_recv->lock); ++ ++ /* close cir first */ ++ cr_enter_ext(); ++ cr_select_log_dev(CIR_LOG_DEV); ++ cr_update(DEACTIVE_LOG_DEV, 0x30); ++ cr_exit_ext(); ++ /*//cir_update(0, CIR_IREN);*/ ++ cir_update(0xff, CIR_IRSTS); ++ ++ /* set cir wake */ ++ cir_wake_update(CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); ++ cir_wake_update(0xff, CIR_WAKE_IRSTS); ++ cir_wake_update(0xff, CIR_WAKE_FIFOCON); ++ cir_wake_update(0, CIR_WAKE_FIFOCON); ++#ifdef ALLOW_DEBUG_WAKE ++ printk("%s FIFO count len = %d\n", DRVNAME, cir_wake_read(CIR_WAKE_FIFO_COUNT)); ++#endif ++ cir_wake_update(CIR_WAKE_IREN_PE, CIR_WAKE_IREN); ++ ++ wait_event(ir_recv->queue, ir_recv->wake_state == ST_WAKE_FINISH); ++ while ((cir_wake_read(CIR_WAKE_RD_FIFO_ONLY_IDX)) != 0) { ++#ifdef ALLOW_DEBUG_WAKE ++ printk("%s setting wake up key: 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); ++#else ++ cir_wake_read(CIR_WAKE_RD_FIFO_ONLY); ++#endif ++ } ++ ++ /* learn wake up complete */ ++ spin_lock(&ir_recv->lock); ++ ir_recv->wake_state = ST_WAKE_NONE; ++ spin_unlock(&ir_recv->lock); ++ ++#ifdef ALLOW_DEBUG_WAKE ++ ret = 0; ++ for (; ret < 67; ret++) { ++ printk("%s FIFO count = 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); ++ } ++ printk("%s FIFO count len = %d\n", DRVNAME, cir_wake_read(CIR_WAKE_FIFO_COUNT)); ++#endif ++ ++ /* cir wake interrupt stop, resume cir */ ++ cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); ++ cir_wake_update(0xff, CIR_WAKE_IRSTS); ++ cir_wake_update(0, CIR_WAKE_IREN); ++ cr_enter_ext(); ++ cr_select_log_dev(CIR_LOG_DEV); ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ cr_exit_ext(); ++ ret = 0; ++ ++ break; ++ case IR_IOUNSETWAKE: ++ cir_wake_update(0, CIR_WAKE_IRCON); ++ cir_wake_update(0, CIR_WAKE_IREN); ++ cir_wake_update(0xFF, CIR_WAKE_IRSTS); ++ cir_wake_update(0, CIR_WAKE_IRSTS); ++ cr_enter_ext(); ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ cr_update(DEACTIVE_LOG_DEV, 0x30); ++ cr_exit_ext(); ++ /*//cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON);*/ ++ break; ++ case IR_IOSETWAKE: ++ cr_enter_ext(); ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ cr_exit_ext(); ++ cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); ++ cir_wake_update(0xFF, CIR_WAKE_IRSTS); ++ cir_wake_update(0, CIR_WAKE_IRSTS); ++ cir_wake_update(0, CIR_WAKE_IREN); ++ break; ++ case IR_IOCLEANDATA: ++ w83667hg_clean_data(&w83667hg_ir_recv, &w83667hg_irctl); ++ break; ++ case IR_IOSTARTSTUDY: ++ spin_lock(&ir->lock); ++ ir->study_state = ST_STUDY_START; ++ spin_unlock(&ir->lock); ++ /*//cir_update(cir_read(CIR_IRCON) | CIR_IRCON_WIREN, CIR_IRCON);*/ ++ cir_update(CIR_IRCON_WIREN | CIR_IRCON_RXEN | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ ++/* for WRX RTR ++ cir_update(CIR_FIFOCON_RX_TRIGGER_LEV_8, CIR_FIFOCON); ++ //cir_update(CIR_IREN_RTR, CIR_IREN); ++ cir_update(0, CIR_IREN); ++*/ ++ break; ++ case IR_IOSTOPSTUDY: ++ cir_update(CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ spin_lock(&ir->lock); ++ ir->study_state = ST_STUDY_NONE; ++ ir->buf_count = 0; ++ ir->cur_buf_num = 0; ++ wake_up(&ir->queue); ++ spin_unlock(&ir->lock); ++ break; ++ case IR_IOGETCARRIER: ++ spin_lock(&ir->lock); ++ if (!(ir->study_state > ST_STUDY_NONE)) { ++ ret = -EFAULT; ++ spin_unlock(&ir->lock); ++ break; ++ } ++ /*//w83667hg_record_study_carrier(ir);*/ ++#ifdef ALLOW_DEBUG_IOCTL ++ printk("%s: current get carrier: %d\n", DRVNAME, ir->carrier); ++#endif ++ if (copy_to_user(uptr, &ir->carrier, sizeof(unsigned int))) { ++ ret = -EFAULT; ++ } ++ spin_unlock(&ir->lock); ++ break; ++ case IR_IOSETCARRIER: ++ spin_lock(&ir->lock); ++ /* you can set carrier at any time */ ++ /* ++ if (~(ir->send_state)) { ++ ret = -EFAULT; ++ up(&ir->lock); ++ break; ++ } ++ */ ++ if (copy_from_user(&ir->carrier, uptr, sizeof(unsigned int))) { ++ ret = -EFAULT; ++ spin_unlock(&ir->lock); ++ break; ++ } ++#ifdef ALLOW_DEBUG_IOCTL ++ printk("%s: current set carrier: %x\n", DRVNAME, ir->carrier); ++#endif ++ w83667hg_set_carrier(&ir->carrier); ++ spin_unlock(&ir->lock); ++ break; ++ case IR_IOSTUDYLEN: ++ spin_lock(&ir->lock); ++ if (ir->study_state == ST_STUDY_NONE) { ++ spin_unlock(&ir->lock); ++#ifdef ALLOW_DEBUG_IOCTL ++ printk("%s: open STUDY first\n", DRVNAME); ++#endif ++ ret = -EFAULT; ++ break; ++ } ++ ir->study_state = ST_STUDY_START; ++ spin_unlock(&ir->lock); ++ wait_event(ir->queue, ir->study_state == ST_STUDY_ALL_RECV); ++ spin_lock(&ir->lock); ++ ++ /* in STUDY, copy data buf len to user space for read() */ ++ ir->cur_buf_num = 0; ++ if (ir->buf_count == 0) { ++ ret = -EFAULT; ++ } else if (copy_to_user(uptr, &ir->buf_count, sizeof(unsigned int))) { ++ ret = -EFAULT; ++ } ++ /* copy data to lirc plugin buffer, ready copy to user space */ ++ spin_unlock(&ir->lock); ++ break; ++ case IR_IOSTUDYBUF: ++ spin_lock(&ir->lock); ++ if (ir->study_state != ST_STUDY_ALL_RECV) { ++ spin_unlock(&ir->lock); ++ ret = -EFAULT; ++ break; ++ } ++ if (copy_to_user(uptr, &ir->buf[ir->cur_buf_num], sizeof(unsigned char))) { ++ spin_unlock(&ir->lock); ++ ret = -EFAULT; ++ break; ++ } ++ if (ir->cur_buf_num < ir->buf_count) { ++ ir->cur_buf_num++; ++ } ++ spin_unlock(&ir->lock); ++ break; ++ case IR_IORESTUDYBUF: ++ spin_lock(&ir->lock); ++ ir->cur_buf_num = 0; ++ spin_unlock(&ir->lock); ++ break; ++ case IR_CHECKCHIP: ++ if (copy_to_user(uptr, chip_id, sizeof(unsigned long long))) { ++ ret = -EFAULT; ++ } ++ break; ++ default: ++ return -ENOIOCTLCMD; ++ } ++ ++ return ret; ++} ++ ++static int w83667hg_set_carrier(unsigned int *carrier) ++{ ++ u16 val; ++ ++ cir_update(1, CIR_CP); ++ val = 3000000 / (*carrier) - 1; ++ cir_update(val & 0xff, CIR_CC); ++ ++#ifdef ALLOW_DEBUG_STUDY ++ printk("cp: 0x%x cc: 0x%x\n", cir_read(CIR_CP), cir_read(CIR_CC)); ++#endif ++ return 0; ++} ++ ++static ssize_t lirc_write(struct file *file, const char *buf, size_t n, loff_t * ppos) ++{ ++ size_t cur_count; ++ struct ir_send_t *ir_send = &w83667hg_ir_send; ++ unsigned int i; ++ ssize_t ret; ++ ++ spin_lock(&ir_send->lock); ++ ++ if (n >= IRCTL_BUF_LIMIT) { ++ ir_send->buf_count = cur_count = IRCTL_BUF_LIMIT; ++ ret = IRCTL_BUF_LIMIT; ++ } else { ++ ir_send->buf_count = cur_count = n; ++ ret = n; ++ } ++ ++ /* the first copy from user and open interrupt for TX */ ++ if (copy_from_user(ir_send->buf, buf, ir_send->buf_count)) { ++ ir_send->buf_count = 0; ++ spin_unlock(&ir_send->lock); ++ return -EFAULT; ++ } ++ ++ ir_send->cur_buf_num = 0; ++ ++ /* for safety, close RX while TX */ ++ cir_update(CIR_IREN_TFU | CIR_IREN_TTR, CIR_IREN); ++ ++ ir_send->send_state = ST_SEND_REPLY; ++ ++ cir_update(CIR_FIFOCON_TX_TRIGGER_LEV_8 | CIR_FIFOCON_RXFIFOCLR, CIR_FIFOCON); ++ /* turn on TTR interrupt, it's ugly */ ++ i = 0; ++ for (; i < 9; i++) { ++ cir_update(0x01, CIR_STXFIFO); ++ } ++ spin_unlock(&ir_send->lock); ++ ++ wait_event(ir_send->queue, ir_send->send_state == ST_SEND_REQUEST); ++ ++ spin_lock(&ir_send->lock); ++ ir_send->send_state = ST_SEND_NONE; ++ spin_unlock(&ir_send->lock); ++ ++ cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); ++ ++ return ret; ++} ++ ++static void w83667hg_clean_data(struct ir_recv_t *ir_recv, struct irctl *ir) ++{ ++ spin_lock(&ir_recv->lock); ++ ir_recv->buf_count = 0; ++ /*//ir_recv->wake_state = ST_WAKE_NONE;*/ ++ wake_up(&ir_recv->queue); ++ spin_unlock(&ir_recv->lock); ++ ++ spin_lock(&ir->lock); ++ ir->lircdata = 0; ++ /* ++ for (i = 0; i < IRCTL_BUF_LIMIT; i++) { ++ ir->buf = 0; ++ } ++ */ ++ ir->pressed_keycode = 0; ++ ir->pressed_shiftmask = 0; ++ ir->buf_count = 0; ++ ir->cur_buf_num = 0; ++ /* ++ ir->study_state = ST_STUDY_NONE; ++ ir->send_state = ST_SEND_NONE; ++ */ ++ wake_up(&ir->queue); ++ spin_unlock(&ir->lock); ++ ++ cir_update(cir_read(CIR_FIFOCON) | 0x88, CIR_FIFOCON); ++ cir_wake_update(cir_wake_read(CIR_WAKE_FIFOCON) | 0x8, CIR_WAKE_FIFOCON); ++ ++} ++ ++/* 3. */ ++static void w83667hg_ir_recv_init(struct ir_recv_t *ir_recv) ++{ ++ ir_recv->buf_count = 0; ++ spin_lock_init(&ir_recv->lock); ++ ir_recv->wake_state = ST_WAKE_NONE; ++ init_waitqueue_head(&ir_recv->queue); ++ ir_recv->recv_state = ST_RECV_WAIT_7F; ++} ++ ++static void w83667hg_ir_send_init(struct ir_send_t *ir_send) ++{ ++ ir_send->buf_count = 0; ++ spin_lock_init(&ir_send->lock); ++ ir_send->send_state = ST_SEND_NONE; ++ init_waitqueue_head(&ir_send->queue); ++} ++ ++ ++/* lirc_fops ++ * ++ * 1) it's LIRC's fops, so NOT allow add owner in it ++ * 2) define lirc functions at here will replace the lirc original fops functions, so lirc_write() in lirc_dev will not work ++ * 3) lirc has its own ioctl, lirc_ioctl() in current file not register in lirc_fops, so it only work for lirc_wb667 ++ * lirc_ioctl() in current file register in w83667hg_irctl_init() as lirc_plugin's ioctl while initial driver, and it does not effect on lirc_dev ++ */ ++static struct file_operations lirc_fops = { ++ write: lirc_write, ++ ioctl : lirc_ioctl, ++}; ++ ++ ++/* init lirc buffer, register, irctl */ ++static int w83667hg_irctl_init(struct irctl *ir) ++{ ++ int err = 0, minor = -1; ++ ++ w83667hg_lirc_buffer = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); ++ if (!w83667hg_lirc_buffer) { ++ err = -ENOMEM; ++ goto out_lirc_buffer; ++ } ++ memset(w83667hg_lirc_buffer, 0, sizeof(struct lirc_buffer)); ++ ++ if (lirc_buffer_init(w83667hg_lirc_buffer, sizeof(int), LIRCBUF_SIZE)) { ++ err = -ENOMEM; ++ goto out_lirc_buffer; ++ } ++ ++ w83667hg_lirc_plugin = kmalloc(sizeof(struct lirc_driver), GFP_KERNEL); ++ if (!w83667hg_lirc_plugin) { ++ err = -ENOMEM; ++ goto out_lirc_plugin; ++ } ++ memset(w83667hg_lirc_plugin, 0, sizeof(struct lirc_driver)); ++ ++ ir->lirc_plugin = w83667hg_lirc_plugin; ++ ++ strcpy(w83667hg_lirc_plugin->name, DRVNAME); ++ w83667hg_lirc_plugin->minor = -1; ++ w83667hg_lirc_plugin->features = LIRC_CAN_SEND_PULSE | ++ LIRC_CAN_SET_TRANSMITTER_MASK | ++ LIRC_CAN_REC_MODE2; ++ /*// LIRC_CAN_SET_SEND_DUTY_CYCLE | ++ // LIRC_CAN_SET_SEND_CARRIER;*/ ++ w83667hg_lirc_plugin->data = &w83667hg_irctl; ++ w83667hg_lirc_plugin->rbuf = w83667hg_lirc_buffer; ++ w83667hg_lirc_plugin->set_use_inc = &lirc_set_use_inc; ++ w83667hg_lirc_plugin->set_use_dec = &lirc_set_use_dec; ++ w83667hg_lirc_plugin->code_length = sizeof(int) * 8; ++/*// w83667hg_lirc_plugin->ioctl = lirc_ioctl;*/ ++ w83667hg_lirc_plugin->fops = &lirc_fops; ++ w83667hg_lirc_plugin->dev = NULL; ++ w83667hg_lirc_plugin->owner = THIS_MODULE; ++ ++ minor = lirc_register_driver(w83667hg_lirc_plugin); ++ if (minor < 0) { ++ err = -ENOMEM; ++ goto out_lirc_plugin_register; ++ } ++#ifdef IR_667_DEBUG ++ printk("%s register lirc minor: %d\n", DRVNAME, minor); ++#endif ++ ++ w83667hg_lirc_plugin->minor = minor; ++ ir->lirc_plugin = w83667hg_lirc_plugin; ++ ++ /* init irctl */ ++ ir->pressed_keycode = 0; ++ ir->pressed_shiftmask = 0; ++ ir->buf_count = 0; ++ ir->ctrl_fix_head = 1; ++ spin_lock_init(&ir->lock); ++ ir->study_state = ST_STUDY_NONE; ++ init_waitqueue_head(&ir->queue); ++ ++ goto out; ++ ++ out_lirc_plugin_register: ++ kfree(w83667hg_lirc_plugin); ++ out_lirc_plugin: ++ lirc_buffer_free(w83667hg_lirc_buffer); ++ out_lirc_buffer: ++ kfree(w83667hg_lirc_buffer); ++ out: ++ return err; ++} ++ ++static void w83667hg_irctl_uninit(struct irctl *ir) ++{ ++ /*//lirc_unregister_plugin(w83667hg_lirc_plugin->minor);*/ ++ lirc_unregister_driver(w83667hg_lirc_plugin->minor); ++ kfree(w83667hg_lirc_plugin); ++ ir->lirc_plugin = NULL; ++ lirc_buffer_free(w83667hg_lirc_buffer); ++ kfree(w83667hg_lirc_buffer); ++ ir->lirc_buffer = NULL; ++} ++ ++#ifdef ALLOW_DEBUG_PRINT_PULSE ++void debug_print_pulse(void) ++{ ++ u8 count, i; ++ ++ count = cir_read(CIR_RXFCONT); ++ for (i = 0; i < count; i++) { ++ printk("%s current cir pluse: 0x%x\n", DRVNAME, cir_read(CIR_SRXFIFO)); ++ } ++} ++ ++void debug_print_wake_pulse(void) ++{ ++ u8 count, i; ++ ++ count = cir_wake_read(CIR_WAKE_FIFO_COUNT); ++ for (i = 0; i < count; i++) { ++ printk("%s current cir wake pluse: 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_SRXFSTS)); ++ } ++} ++#endif ++ ++static void w83667hg_study_recv(struct ir_recv_t *ir_recv, struct irctl *ir) ++{ ++ unsigned int i = 0; ++ unsigned int packet_on_dur = 0; ++ ++ spin_lock(&ir_recv->lock); ++ ir_recv->buf[ir_recv->buf_count] = cir_read(CIR_SRXFIFO); ++ if (ir_recv->buf[ir_recv->buf_count] == 0x80) { ++ /* close interrupt now */ ++ /*//cir_wake_update(0, CIR_WAKE_IREN);*/ ++ ++ spin_lock(&ir->lock); ++ ++ /* 1. get carrier */ ++ ir->carrier = cir_read(CIR_FCCL); ++ ir->carrier |= cir_read(CIR_FCCH) << 8; ++ ++ if (ir->carrier == 0) { ++ printk("%s: get carrier error!\n", DRVNAME); ++ } ++ ++ i = 0; ++ for (; i < ir_recv->buf_count; i++) { ++ if (ir_recv->buf[i] & BIT_PULSE_MASK) { ++ packet_on_dur += ir_recv->buf[i] & BIT_LEN; ++ } ++ } ++ packet_on_dur *= MCE_TIME_UNIT; ++ ++#ifdef ALLOW_DEBUG_STUDY ++ printk("%s: carrier count: 0x%x\n", DRVNAME, ir->carrier); ++ printk("%s: packet on duration: %u\n", DRVNAME, packet_on_dur); ++#endif ++ ir->carrier *= 1000000; ++ ir->carrier /= packet_on_dur; ++#ifdef ALLOW_DEBUG_STUDY ++ printk("%s: final carrier frequency: %u\n", DRVNAME, ir->carrier); ++#endif ++ if ((ir->carrier > MAX_CARRIER) || (ir->carrier < MIN_CARRIER)) { ++ /* carrier is too large or too small */ ++#ifdef ALLOW_DEBUG_STUDY ++ printk("%s: current received carrier is too large or too small\n", DRVNAME); ++#endif ++ ir_recv->buf_count = 0; ++ spin_unlock(&ir_recv->lock); ++ ++ ir->buf_count = 0; ++ ir->study_state = ST_STUDY_ALL_RECV; ++ wake_up(&ir->queue); ++ spin_unlock(&ir->lock); ++ return; ++ } ++ ++ /* 2. get pulse */ ++ i = 0; ++ /* 1) find sync head */ ++ while (!((ir_recv->buf[i] & BIT_PULSE_MASK) & 0x80)) { ++ i++; ++ } ++ /* 2) find 0x7f */ ++ /* FIXME, the silent part of infrared signal may change by protocol or sample period. but current value fits MCE RC-6*/ ++ while ((ir_recv->buf[i] != 0x7f) || ++ (ir_recv->buf[i + 1] != 0x7f) || ++ (ir_recv->buf[i + 2] != 0x7f)) { ++ i++; ++ } ++ /* 3) find next head */ ++ while (!((ir_recv->buf[i] & BIT_PULSE_MASK) & 0x80)) { ++ i++; ++ } ++ /*//ir->buf_count = --i;*/ ++ /* now buf_count direct to next pulse sync head */ ++ ir->buf_count = i; ++ /* 4) copy pluse from recv to ir */ ++ i = 0; ++ for (; i <= ir->buf_count; i++) { ++ ir->buf[i] = ir_recv->buf[i]; ++ } ++ ++ ++ ir_recv->buf_count = 0; ++ spin_unlock(&ir_recv->lock); ++ ++ ir->study_state = ST_STUDY_ALL_RECV; ++ wake_up(&ir->queue); ++ spin_unlock(&ir->lock); ++ } else { ++ ir_recv->buf_count++; ++ spin_unlock(&ir_recv->lock); ++ } ++} ++ ++ ++static void w83667hg_recv(struct ir_recv_t *ir_recv, struct irctl *ir) ++{ ++ u8 buf; ++ unsigned int i = 0, rlc = 0; ++ ++ spin_lock(&ir_recv->lock); ++ ++ ir_recv->buf[ir_recv->buf_count] = cir_read(CIR_SRXFIFO); ++ if (ir_recv->buf[ir_recv->buf_count] == 0x7f) { ++ if (ir_recv->recv_state & ST_RECV_WAIT_7F) { ++ ir_recv->recv_state = ST_RECV_WAIT_HEAD; ++ ir_recv->buf_count++; ++ { /* decode begin*/ ++ spin_lock(&ir->lock); ++ ++ ir->buf_count = ir_recv->buf_count; ++ for (; i < ir->buf_count; i++) { ++ ir->buf[i] = ir_recv->buf[i]; ++ } ++ ir->cur_buf_num = 0; ++ ++ /*//ir_recv->buf_count++;*/ ++ spin_unlock(&ir_recv->lock); ++ ++ i = 0; ++ while (i < ir->buf_count) { ++ rlc += ir->buf[i] & BIT_LEN; ++ i++; ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("\n%s cur rlc len: %d\n", DRVNAME, rlc); ++#endif ++ ++#ifdef DECODE_KEYBOARD_MOUSE ++ if (rlc >= CONTROLLER_BUF_LEN_MIN) { ++#endif ++ /* lirc controller*/ ++ w83667hg_submit_controller(ir); ++ ++#ifdef DECODE_KEYBOARD_MOUSE ++ } else if ((rlc >= KEYBOARD_BUF_LEN_MIN) && ++ (rlc < KEYBOARD_BUF_LEN_MAX)) { ++ w83667hg_submit_key(ir); ++ input_sync(ir->input_dev); ++ } else if ((rlc >= MOUSE_BUF_LEN_MIN) && ++ (rlc < KEYBOARD_BUF_LEN_MIN)) { ++ w83667hg_submit_mouse(ir); ++ input_sync(ir->input_dev); ++ } ++#endif ++ ++ ir->buf_count = 0; ++ spin_unlock(&ir->lock); ++ } /* decode end*/ ++ } else { ++ ir_recv->buf_count++; ++ spin_unlock(&ir_recv->lock); ++ } ++ } else { /* normal recv*/ ++ if (ir_recv->recv_state & ST_RECV_WAIT_HEAD) { ++ if (ir_recv->buf[ir_recv->buf_count] & BIT_PULSE_MASK) { ++ ir_recv->recv_state = ST_RECV_WAIT_7F; ++ buf = ir_recv->buf[ir_recv->buf_count]; ++ ir_recv->buf_count = 0; ++ ir_recv->buf[0] = buf; ++ } ++ } ++ ir_recv->buf_count++; ++ spin_unlock(&ir_recv->lock); ++ } ++} ++ ++ ++ ++static void w83667hg_send_packet_to_lirc_1(struct irctl *ir, int *val) ++{ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: send data to lirc : 0x%x\n", DRVNAME, (*val)); ++#endif ++/*// lirc_buffer_write_1(ir->lirc_plugin->rbuf, (char *)val);*/ ++ lirc_buffer_write(ir->lirc_plugin->rbuf, (char *)val); ++ wake_up(&ir->lirc_plugin->rbuf->wait_poll); ++} ++ ++ ++static void w83667hg_submit_controller(struct irctl *ir) ++{ ++ unsigned int buf_num; ++ u8 bit; ++ ++ static struct timeval last_time; ++ static bool is_not_initialed_yet = true; /* lirc group does not allow to initialize static variable to false(0) */ ++ struct timeval curr_time; ++ long duration; ++ ++ /* silence time */ ++ ++ ir->lircdata = 0; ++ ++ if (is_not_initialed_yet == true) { ++ duration = MAX_SILENCE_TIME; ++ is_not_initialed_yet = false; ++ } else{ ++ do_gettimeofday(&curr_time); ++ duration = (curr_time.tv_usec - last_time.tv_usec) + ++ (curr_time.tv_sec - last_time.tv_sec) * 1000000; ++ } ++ ++ if (duration >= MAX_SILENCE_TIME) { ++ ir->lircdata = MAX_SILENCE_TIME; ++ } else{ ++ ir->lircdata = duration; ++ } ++ w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata); ++ ++ ++ /* fix controller head not sync problem */ ++ /* lirc doesn't response DK MCE controller signal until press several times, not find same problem on M$ MCE controller keyboard */ ++ /* for lirc group's suggestion, we need not add these code to prevent from this problem. ++ Just make it as comment. If we do not get any problem report from our customer, we will remove it at next some version. ++ if (ir->ctrl_fix_head) { ++ ir->lircdata = 50000; ++ w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata); ++ ir->ctrl_fix_head = 0; ++ } ++ */ ++ ++ ++ buf_num = 0; ++ bit = BIT_PULSE_MASK; ++ ir->lircdata = 0; ++ for (; buf_num < ir->buf_count; buf_num++) { ++ if (bit == (ir->buf[buf_num] & BIT_PULSE_MASK)) { ++ ir->lircdata += (ir->buf[buf_num] & BIT_LEN) * MCE_TIME_UNIT; ++ } else { ++ if (bit) { ++ ir->lircdata |= PULSE_BIT; ++ } ++ w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata); ++ bit = ir->buf[buf_num] & BIT_PULSE_MASK; ++ ir->lircdata = (ir->buf[buf_num] & BIT_LEN) * MCE_TIME_UNIT; ++ } ++ } ++ ++ /* update last_time for measure silence time*/ ++ do_gettimeofday(&last_time); ++ ++ /* for final silent pulse */ ++ /*ir->lircdata = 50000; ++ w83667hg_send_packet_to_lirc_1(ir, &ir->lircdata);*/ ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("\n"); ++#endif ++} ++ ++static irqreturn_t w83667hg_interrupt_handler(int irq, void *dev) ++{ ++ u8 tmp = 0; ++ struct irctl *ir = (struct irctl *)dev; ++ struct ir_send_t *ir_send = &w83667hg_ir_send; ++ ++ ++ /*Because interrupt is shared, check IREN first. */ ++ tmp = cir_read(CIR_IREN); ++ if (!tmp) { ++ return IRQ_RETVAL(IRQ_NONE); ++ } ++ tmp = cir_read(CIR_IRSTS); ++ cir_update(0xff, CIR_IRSTS); ++ if (!tmp) { ++ return IRQ_NONE; ++ } ++ if (tmp & CIR_IRSTS_RDR) { ++ ++ ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_RDR\n"); ++#endif ++#ifdef ALLOW_DEBUG_PRINT_PULSE ++ debug_print_pulse(); ++#else ++ spin_lock(&ir_send->lock); ++ if (ir_send->send_state == ST_SEND_NONE) { ++ spin_unlock(&ir_send->lock); ++ if (ir->study_state & ST_STUDY_START) { ++ w83667hg_study_recv(&w83667hg_ir_recv, &w83667hg_irctl); ++ } else { ++ w83667hg_recv(&w83667hg_ir_recv, &w83667hg_irctl); ++ } ++ } else { ++ spin_unlock(&ir_send->lock); ++ } ++#endif ++ } ++ if (tmp & CIR_IRSTS_RTR) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_RTR\n"); ++#endif ++ } ++ if (tmp & CIR_IRSTS_PE) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_PE\n"); ++#endif ++#ifdef ALLOW_DEBUG_PRINT_PULSE ++ printk("\n now get interrupt PE\n\n"); ++ debug_print_pulse(); ++#else ++ if (ir->study_state == ST_STUDY_NONE) { ++ w83667hg_clean_data(&w83667hg_ir_recv, &w83667hg_irctl); ++ } ++#endif ++ } ++ if (tmp & CIR_IRSTS_RFO) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_RFO\n"); ++#endif ++ } ++ if (tmp & CIR_IRSTS_TE) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_TE\n"); ++#endif ++ } ++ if (tmp & CIR_IRSTS_TTR) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_TTR\n"); ++#endif ++ ++ spin_lock(&ir_send->lock); ++ if (ir_send->cur_buf_num < ir_send->buf_count) { ++ cir_update(ir_send->buf[ir_send->cur_buf_num++], CIR_STXFIFO); ++ } else { ++ cir_update(cir_read(CIR_IREN) & (~CIR_IREN_TTR), CIR_IREN); ++ } ++ spin_unlock(&ir_send->lock); ++ ++ } ++ if (tmp & CIR_IRSTS_TFU) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_TFU\n"); ++#endif ++ spin_lock(&ir_send->lock); ++ if (ST_SEND_REPLY == ir_send->send_state) { ++ ir_send->send_state = ST_SEND_REQUEST; ++ wake_up(&ir_send->queue); ++ } ++ spin_unlock(&ir_send->lock); ++ } ++ if (tmp & CIR_IRSTS_GH) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_IRSTS_GH\n"); ++#endif ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t w83667hg_wake_interrupt_handler(int irq, void *dev) ++{ ++ u8 tmp; ++ struct ir_recv_t *ir_recv = (struct ir_recv_t *)dev; ++ ++ ++ /*Because interrupt is shared, check IREN first. */ ++ tmp = cir_wake_read(CIR_WAKE_IREN); ++ if (!tmp) { ++ return IRQ_RETVAL(IRQ_NONE); ++ } ++ ++ tmp = cir_wake_read(CIR_WAKE_IRSTS); ++ if (!tmp) { ++ return IRQ_NONE; ++ } ++ cir_wake_update(0xff, CIR_WAKE_IRSTS); ++ ++ if (tmp & CIR_WAKE_IRSTS_RDR) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_WAKE_IRSTS_RDR\n"); ++#endif ++#ifdef ALLOW_DEBUG_PRINT_PULSE ++ debug_print_wake_pulse(); ++#endif ++ } ++ if (tmp & CIR_WAKE_IRSTS_RTR) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_WAKE_IRSTS_RTR\n"); ++#endif ++ } ++ if ((tmp & CIR_WAKE_IRSTS_PE) && ++ (ST_WAKE_START == ir_recv->wake_state)) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_WAKE_IRSTS_PE\n"); ++#endif ++#ifdef ALLOW_DEBUG_PRINT_PULSE ++ printk("\n now get interrupt PE\n\n"); ++ debug_print_wake_pulse(); ++#else ++ while ((cir_wake_read(CIR_WAKE_RD_FIFO_ONLY_IDX)) != 0) { ++#ifdef ALLOW_DEBUG_WAKE ++ printk("%s setting wake up key: 0x%x\n", DRVNAME, cir_wake_read(CIR_WAKE_RD_FIFO_ONLY)); ++#else ++ cir_wake_read(CIR_WAKE_RD_FIFO_ONLY); ++#endif ++ } ++ ++ cir_wake_update(0, CIR_WAKE_IREN); ++ spin_lock(&ir_recv->lock); ++ ir_recv->wake_state = ST_WAKE_FINISH; ++ wake_up(&ir_recv->queue); ++ spin_unlock(&ir_recv->lock); ++#endif ++ } ++ if (tmp & CIR_WAKE_IRSTS_RFO) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_WAKE_IRSTS_RFO\n"); ++#endif ++ } ++ if (tmp & CIR_WAKE_IRSTS_GH) { ++#ifdef ALLOW_DEBUG_INTERRUPT ++ printk("get CIR_WAKE_IRSTS_GH\n"); ++#endif ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++/* 4. */ ++/* init 667 cir dev, req_region, req_irq */ ++static int w83667hg_cir_probe(void) ++{ ++ int err = 0; ++ ++ if (!request_region(cir_address, CIR_IOREG_LENGTH, DRVNAME)) { ++ err = -EBUSY; ++#ifdef IR_667_DEBUG ++ printk("%s request 667 cir io port error! \n", DRVNAME); ++#endif ++ goto exit; ++ } ++ ++ cir_update(CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ cir_update(0xFF, CIR_IRSTS); ++ cir_update(CIR_RX_LIMIT_COUNT >> 8, CIR_SLCH); ++ cir_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_SLCL); ++ cir_update(CIR_FIFOCON_TXFIFOCLR | CIR_FIFOCON_TX_TRIGGER_LEV_24 | CIR_FIFOCON_RXFIFOCLR, CIR_FIFOCON); ++ cir_update(CIR_IRCON_RECV | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ cir_update(CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ ++ if (0 != request_irq(CIR_IRQ_NUM, w83667hg_interrupt_handler, IRQF_SHARED, ++ DRVNAME, &w83667hg_irctl)) { ++ err = -EINTR; ++#ifdef IR_667_DEBUG ++ printk("%s : request cir irq error\n", DRVNAME); ++#endif ++ goto rel_irq_exit; ++ } ++ /* open interrupt */ ++ cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); ++ ++ if (!request_region(cir_wake_address, CIR_IOREG_LENGTH, DRVNAME)) { ++ err = -EBUSY; ++#ifdef IR_667_DEBUG ++ printk("%s request 667 cir wake io port error! \n", DRVNAME); ++#endif ++ goto rel_wake_exit; ++ } ++ ++ cir_wake_update(0xff, CIR_WAKE_IRSTS); ++ /* Modify it as more safe values: CIR_WAKE_FIFO_CMP_DEEP reg:0x41, ++ CIR_WAKE_FIFO_CMP_TOL reg: 0x05. 20091224 ++ */ ++ cir_wake_update(0x41, CIR_WAKE_FIFO_CMP_DEEP); /* 0x41 = 65 */ ++ cir_wake_update(0x05, CIR_WAKE_FIFO_CMP_TOL); ++ cir_wake_update(CIR_RX_LIMIT_COUNT >> 8, CIR_WAKE_SLCH); ++ cir_wake_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_WAKE_SLCL); ++ cir_wake_update(0xff, CIR_WAKE_FIFOCON); ++ cir_wake_update(0, CIR_WAKE_FIFOCON); ++ cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); ++ ++ /* cir wake has irq_handler, open interrupt after received ioctl IR_IOLEARNWAKE */ ++ if (0 != request_irq(CIR_WAKE_IRQ_NUM, w83667hg_wake_interrupt_handler, IRQF_SHARED, ++ DRVNAME, &w83667hg_ir_recv)) { ++ err = -EINTR; ++#ifdef IR_667_DEBUG ++ printk("%s : request cir wake irq error\n", DRVNAME); ++#endif ++ goto rel_wake_irq_exit; ++ } ++ ++#ifdef IR_667_DEBUG ++ printk("%s : init cir success\n", DRVNAME); ++#endif ++ goto exit; ++ ++ /* error exit */ ++ rel_wake_irq_exit: ++ release_region(cir_wake_address, CIR_IOREG_LENGTH); ++ rel_wake_exit: ++ cir_update(0, CIR_IREN); ++ free_irq(CIR_IRQ_NUM, &w83667hg_irctl); ++ rel_irq_exit: ++ release_region(cir_address, CIR_IOREG_LENGTH); ++ ++ /* final exit */ ++ exit: ++ return err; ++} ++ ++static void w83667hg_cir_remove(void) ++{ ++ /* Don't clean CIR_WAKE_IRCON. When wake-up at power-on, it needs the function. 20091224 ++ cir_wake_update(0, CIR_WAKE_IRCON); ++ */ ++ free_irq(CIR_WAKE_IRQ_NUM, &w83667hg_ir_recv); ++ release_region(cir_wake_address, CIR_IOREG_LENGTH); ++ cir_update(0, CIR_IRCON); ++ free_irq(CIR_IRQ_NUM, &w83667hg_irctl); ++ release_region(cir_address, CIR_IOREG_LENGTH); ++} ++ ++static int lirc_wb667_init(void) ++{ ++ int err = 0; ++ ++ /* Initialise global static variables here instead of at declaration becuase of ++ lirc group does not allow it.*/ ++#ifdef CONFIG_PNP ++ nopnp = 0; ++#else ++ nopnp = 1; ++#endif ++ w83667hg_input_dev = NULL; ++ w83667hg_lirc_plugin = NULL; ++ w83667hg_lirc_buffer = NULL; ++ ++ /* 1. init cr */ ++ if (w83667hg_cr_init()) { ++ printk("%s: Unable to init device.\n", DRVNAME); ++ err = -ENODEV; ++ goto out; ++ } ++ ++ /* 2. init input */ ++ w83667hg_input_dev = w83667hg_input_init(); ++ if (!w83667hg_input_dev) { ++ printk("%s: Unable to register input device.\n", DRVNAME); ++ err = -ENODEV; ++ goto out_input; ++ } ++ w83667hg_irctl.input_dev = w83667hg_input_dev; ++ ++ /* 3. init lirc buffer, register, irctl */ ++ w83667hg_ir_recv_init(&w83667hg_ir_recv); ++ w83667hg_ir_send_init(&w83667hg_ir_send); ++ err = w83667hg_irctl_init(&w83667hg_irctl); ++ if (err) { ++ printk("%s: Unable to register lirc.\n", DRVNAME); ++ goto out_irctl; ++ } ++ ++ ++ /* 4. init 667 cir dev, req_region, req_irq */ ++ err = w83667hg_cir_probe(); ++ if (err) { ++ printk("%s: Unable to probe cir device.\n", DRVNAME); ++ goto out_cir_probe; ++ } ++ ++ goto out; ++ ++ /* error exit */ ++ out_cir_probe: ++ w83667hg_irctl_uninit(&w83667hg_irctl); ++ w83667hg_irctl.input_dev = NULL; ++ out_irctl: ++ w83667hg_input_uninit(w83667hg_input_dev); ++ out_input: ++ w83667hg_cr_uninit(); ++ ++ /* final exit */ ++ out: ++ return err; ++} ++ ++void lirc_wb667_uninit(void) ++{ ++ w83667hg_cir_remove(); ++ w83667hg_irctl_uninit(&w83667hg_irctl); ++ w83667hg_irctl.input_dev = NULL; ++ w83667hg_input_uninit(w83667hg_input_dev); ++ w83667hg_cr_uninit(); ++ ++} ++ ++ ++ ++/* For resume function use only. 20100119*/ ++static void w83667hg_irctl_resume_reset(struct irctl *ir) ++{ ++ /* init irctl */ ++ ir->pressed_keycode = 0; ++ ir->pressed_shiftmask = 0; ++ ir->buf_count = 0; ++ ir->ctrl_fix_head = 1; ++ spin_lock_init(&ir->lock); ++ ir->study_state = ST_STUDY_NONE; ++ init_waitqueue_head(&ir->queue); ++} ++ ++ ++/* For resume function use only. 20100119*/ ++static int w83667hg_cir_resume_reset(void) ++{ ++ int err = 0; ++ ++ cir_update(CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ cir_update(0xFF, CIR_IRSTS); ++ cir_update(CIR_RX_LIMIT_COUNT >> 8, CIR_SLCH); ++ cir_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_SLCL); ++ cir_update(CIR_FIFOCON_TXFIFOCLR | CIR_FIFOCON_TX_TRIGGER_LEV_24 | CIR_FIFOCON_RXFIFOCLR, CIR_FIFOCON); ++ cir_update(CIR_IRCON_RECV | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ cir_update(CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON); ++ ++ /* open interrupt */ ++ cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); ++ ++ ++ cir_wake_update(0xff, CIR_WAKE_IRSTS); ++ ++ cir_wake_update(0x41, CIR_WAKE_FIFO_CMP_DEEP); /* 0x41 = 65 */ ++ cir_wake_update(0x05, CIR_WAKE_FIFO_CMP_TOL); ++ cir_wake_update(CIR_RX_LIMIT_COUNT >> 8, CIR_WAKE_SLCH); ++ cir_wake_update(CIR_RX_LIMIT_COUNT & 0xff, CIR_WAKE_SLCL); ++ cir_wake_update(0xff, CIR_WAKE_FIFOCON); ++ cir_wake_update(0, CIR_WAKE_FIFOCON); ++ cir_wake_update(CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN | CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV | CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON); ++ ++ ++#ifdef IR_667_DEBUG ++ printk("%s : cir_resume_reset finish\n", DRVNAME); ++#endif ++ ++ return err; ++} ++ ++ ++/* For resume function use only. 20100119*/ ++static int lirc_wb667_resume_init(void) ++{ ++ int err = 0; ++ ++ /* init lirc buffer */ ++ w83667hg_ir_recv_init(&w83667hg_ir_recv); ++ w83667hg_ir_send_init(&w83667hg_ir_send); ++ ++ /* reset variables in irctl, but no re-locate and no re-register 20100119*/ ++ w83667hg_irctl_resume_reset(&w83667hg_irctl); ++ ++ ++ /* init 667 cir dev */ ++ ++ w83667hg_cir_resume_reset(); ++ ++ ++ return err; ++} ++ ++ ++ ++#ifdef CONFIG_PNP ++ ++/* CIR and CIR WAKE */ ++ ++static struct pnp_driver lirc_wb667_pnp_driver = { ++ .name = PLATNAME, ++ .id_table = pnp_dev_table, ++ .probe = lirc_wb667_pnp_probe, ++ .remove = __devexit_p(lirc_wb667_pnp_remove), ++ .suspend = lirc_wb667_pnp_suspend, ++ .resume = lirc_wb667_pnp_resume, ++}; ++ ++static int __devinit lirc_wb667_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ++{ ++ /* CIR */ ++ ++ #ifdef IR_667_DEBUG ++ printk("%s receive probe\n", DRVNAME); ++ #endif ++ ++ if (!pnp_port_valid(dev, 0)) ++ return -ENODEV; ++ ++ ++ CIR_BASE = (unsigned int)pnp_port_start(dev, 0); ++ CIR_IRQ_NUM = (unsigned short)pnp_irq(dev, 0); ++ ++ ++ /* CIR WAKE*/ ++ if (!pnp_port_valid(dev, 1)) ++ return -ENODEV; ++ CIR_WAKE_BASE = (unsigned int)pnp_port_start(dev, 1); ++ CIR_WAKE_IRQ_NUM = (unsigned short)pnp_irq(dev, 0); /* share the same irq with CIR device.*/ ++ ++ return 0; ++} ++ ++static void __devexit lirc_wb667_pnp_remove(struct pnp_dev *dev) ++{ ++} ++ ++ ++ ++static int lirc_wb667_pnp_suspend(struct pnp_dev *dev, pm_message_t state) ++{ ++ struct irctl *ir = &w83667hg_irctl; ++ struct ir_recv_t *ir_recv = &w83667hg_ir_recv; ++ struct ir_send_t *ir_send = &w83667hg_ir_send; ++ ++#ifdef IR_667_DEBUG ++ printk("%s receive suspend\n", DRVNAME); ++#endif ++ ++ /* 1. */ ++ spin_lock(&ir->lock); ++ ir->study_state = ST_STUDY_NONE; ++ spin_unlock(&ir->lock); ++ ++ spin_lock(&ir_recv->lock); ++ ir_recv->wake_state = ST_WAKE_NONE; ++ spin_unlock(&ir_recv->lock); ++ ++ spin_lock(&ir_send->lock); ++ ir_send->send_state = ST_SEND_NONE; ++ spin_unlock(&ir_send->lock); ++ ++ /* 2. */ ++ cir_update(0, CIR_IREN); ++ cir_wake_update(0, CIR_WAKE_IREN); ++ ++ ++ /* 3. */ ++ cr_enter_ext(); ++ cr_select_log_dev(CIR_LOG_DEV); ++ cr_update(DEACTIVE_LOG_DEV, 0x30); ++ ++ /*Don't close CIR Wake. When wake-up at power-on, it needs the function. 20091224 ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ cr_update(DEACTIVE_LOG_DEV, 0x30); ++ */ ++ ++ cr_exit_ext(); ++ ++ ++ return 0; ++} ++ ++static int lirc_wb667_pnp_resume(struct pnp_dev *dev) ++{ ++ int ret = 0; ++ ++#ifdef IR_667_DEBUG ++ printk("%s receive resume\n", DRVNAME); ++#endif ++ ++ ++ /* open interrupt */ ++ cir_update(CIR_IREN_RDR | CIR_IREN_PE, CIR_IREN); ++ ++ ++ /* Enable CIR logical device */ ++ cr_enter_ext(); ++ cr_select_log_dev(CIR_LOG_DEV); ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ ++ ++ /*Don't close CIR Wake. When wake-up at power-on, it needs the function. 20091224 ++ cr_select_log_dev(CIR_WAKE_LOG_DEV); ++ cr_update(ACTIVE_LOG_DEV, 0x30); ++ */ ++ cr_exit_ext(); ++ ++ /* special uninit function for resume only. 20100119 */ ++ lirc_wb667_resume_init(); ++ ++ return ret; ++} ++ ++ ++ ++ ++ ++ ++#endif ++ ++ ++/*//int init_module(void)*/ ++int init_module_wb667(void) ++{ ++ int ret; ++ ++ if (nopnp) { ++ printk("%s does not support Non-PNP kernel now.\n", DRVNAME); ++ } ++ ++#ifdef CONFIG_PNP ++ if (!nopnp) { ++ ++ ret = pnp_register_driver(&lirc_wb667_pnp_driver); ++ if (ret < 0) ++ return ret; ++ ++ ++ ++ } ++#endif /* CONFIG_PNP */ ++ ++ ++ ++ ++ ret = lirc_wb667_init(); ++ if (ret) { ++ return ret; ++ } ++ ++ return 0; ++} ++ ++/*//void cleanup_module(void)*/ ++void cleanup_module_wb667(void) ++{ ++ ++#ifdef CONFIG_PNP ++ if (!nopnp) { ++ pnp_unregister_driver(&lirc_wb667_pnp_driver); ++ ++ } ++#endif /* CONFIG_PNP */ ++ ++ ++ lirc_wb667_uninit(); ++} ++ ++module_init(init_module_wb667); ++module_exit(cleanup_module_wb667); ++ ++ +diff -Naur linux-2.6.33.2/drivers/input/lirc/lirc_wb677_mouse_kbd.c linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_mouse_kbd.c +--- linux-2.6.33.2/drivers/input/lirc/lirc_wb677_mouse_kbd.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_mouse_kbd.c 2010-04-03 18:42:04.214701792 +0200 +@@ -0,0 +1,881 @@ ++/* Notice: ++ Do NOT merge this file with other file. ++ According to lirc group's suggestion, they hope that ++ we should put keyboard/mouse decoding into a separate file if we want to preserve it. ++*/ ++ ++#include ++#include "lirc_wb677_common_extern.h" ++#include "lirc_wb677_mouse_kbd.h" ++ ++ ++void w83667hg_set_key(u8 *set_frame, u8 val, u8 *keycode, u8 *shiftmask) ++{ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set key: %d\n", DRVNAME, val); ++#endif ++ ++ if (*set_frame <= KEY_SUBMIT_KEYCODE_FRAME_NUM + 1) { ++ *keycode <<= 1; ++ *keycode |= val; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set key keycode:0x%x\n", DRVNAME, *keycode); ++ printk("set frame: %d\n", *set_frame); ++#endif ++ } else { ++ *shiftmask <<= 1; ++ *shiftmask |= val; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set key mask:0x%x\n", DRVNAME, *shiftmask); ++ printk("set frame: %d\n", *set_frame); ++#endif ++ } ++ (*set_frame)++; ++} ++ ++ ++int w83667hg_jump_frame(struct irctl *ir, u8 frame_num, unsigned int *buf_num, u8 *out_bit, u8 *decode_status) ++{ ++ unsigned int rlc = 0, cur_buf_num = *buf_num; ++ u8 bit = *out_bit, buf; ++ u8 cur_decode_status = *decode_status; ++ u8 cur_frame_num; ++ ++ cur_frame_num = 1; ++ for (; cur_frame_num <= frame_num; cur_buf_num++) { ++ buf = ir->buf[cur_buf_num]; ++ if (cur_buf_num > ir->buf_count) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: jump frame error\n", DRVNAME); ++ printk("current buf num: %d\n", cur_buf_num); ++ printk("current jumped frame: %d\n", cur_frame_num); ++ printk("current frame length: %d\n", rlc); ++ printk("total cir signal:\n"); ++ for (cur_buf_num = 0; cur_buf_num < ir->buf_count; cur_buf_num++) { ++ printk("0x%x ", ir->buf[cur_buf_num]); ++ if (cur_buf_num % 6 == 5) { ++ printk("\n"); ++ } ++ } ++#endif ++ return -1; ++ } ++ if (bit == (buf & BIT_PULSE_MASK)) { ++ rlc += buf & BIT_LEN; ++ } else { ++ ++ /* decode*/ ++ switch (cur_decode_status) { ++ case ST_DECODE_NEW: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ cur_decode_status = ST_DECODE_ONE; ++ } else { ++ cur_decode_status = ST_DECODE_ZERO; ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ /* error occur, just ignore */ ++ cur_decode_status = ST_DECODE_NEW; ++ cur_frame_num++; ++ } ++ break; ++ case ST_DECODE_ZERO: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ cur_decode_status = ST_DECODE_NEW; ++ cur_frame_num++; ++ } else { ++ /* error */ ++ cur_decode_status = ST_DECODE_NEW; ++ cur_frame_num++; ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ cur_decode_status = ST_DECODE_ONE; ++ cur_frame_num++; ++ } else { ++ /* error */ ++ cur_decode_status = ST_DECODE_ZERO; ++ cur_frame_num++; ++ } ++ } ++ break; ++ case ST_DECODE_ONE: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ cur_decode_status = ST_DECODE_NEW; ++ cur_frame_num++; ++ } else { ++ /* "10" => 1 */ ++ cur_decode_status = ST_DECODE_NEW; ++ cur_frame_num++; ++ } ++ } else if (rlc > TWO_PULSE_LEN_LOW) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ cur_decode_status = ST_DECODE_ONE; ++ cur_frame_num++; ++ } else { ++ /* "10" => 1 */ ++ cur_decode_status = ST_DECODE_ZERO; ++ cur_frame_num++; ++ } ++ } ++ break; ++ } /* switch*/ ++ ++ bit = buf & BIT_PULSE_MASK; ++ rlc = buf & BIT_LEN; ++ } ++ } /* for decode*/ ++ ++/* ++ bit = ir->buf[cur_buf_num] & BIT_PULSE_MASK; ++ if (cur_decode_status & ST_DECODE_NEW) { ++ if (bit) { ++ *decode_status = ST_DECODE_ONE; ++ } else { ++ *decode_status = ST_DECODE_ZERO; ++ } ++ } else { ++ *decode_status = ST_DECODE_NEW; ++ } ++ *out_bit = bit; ++*/ ++ ++ /* Fix problem 1 */ ++ if ((ir->buf[cur_buf_num] & BIT_LEN) > TWO_PULSE_LEN_LOW) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: fix problem 1 in jump_frame()\n", DRVNAME); ++#endif ++#ifdef ALLOW_DEBUG_DECODE ++ if (cur_frame_num > frame_num + 1) { ++ printk("%s error: jump_frame() get a too long frame\n", DRVNAME); ++ } ++#endif ++ cur_buf_num--; ++ } ++ ++ /* copy from jump_iden */ ++ if (cur_decode_status & ST_DECODE_NEW) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("hey man, it's NEW in jump_frame\n"); ++printk("cur buf: 0x%x\n", ir->buf[cur_buf_num]); ++printk("cur state: 0x%x\n", cur_decode_status); ++#endif ++ *buf_num = --cur_buf_num; ++ /*//cur_buf_num--;*/ ++ *out_bit = ir->buf[cur_buf_num] & BIT_PULSE_MASK; ++ if (*out_bit) { ++ *decode_status = ST_DECODE_ONE; ++ } else { ++ *decode_status = ST_DECODE_ZERO; ++ } ++ } else { ++#ifdef ALLOW_DEBUG_DECODE ++printk("cur buf: 0x%x\n", ir->buf[cur_buf_num]); ++printk("cur state: 0x%x\n", cur_decode_status); ++#endif ++ *buf_num = cur_buf_num; ++ *out_bit = ir->buf[cur_buf_num] & BIT_PULSE_MASK; ++ *decode_status = ST_DECODE_NEW; ++/* ++ if (*out_bit) { ++ *decode_status = ST_DECODE_ONE; ++ } else { ++ *decode_status = ST_DECODE_ZERO; ++ } ++*/ ++ } ++ ++ return 0; ++} ++ ++int w83667hg_jump_head(struct irctl *ir, unsigned int *buf_num) ++{ ++ unsigned int i, rlc = 0, max_buf_count = ir->buf_count; ++ u8 bit = BIT_PULSE_MASK, buf; ++ ++ for (i = 0; i < max_buf_count; i++) { ++ buf = ir->buf[i]; ++ if (bit == (buf & BIT_PULSE_MASK)) { ++ rlc += buf & BIT_LEN; ++ } else { ++ if ((rlc > HEAD_SYNC_LEN_LOW) && ++ (rlc < HEAD_SYNC_LEN_HIGH) && ++ (bit & BIT_PULSE_MASK)) { ++ break; ++ } ++ bit = buf & BIT_PULSE_MASK; ++ rlc = buf & BIT_LEN; ++ } ++ } /* for decode*/ ++ ++ if (i >= max_buf_count) { ++/*//#ifdef ALLOW_DEBUG_DECODE*/ ++#if 0 ++ printk("%s jump pulse error\n", DRVNAME); ++ printk("current buf num: %d\n", *buf_num); ++ printk("current jumped pulse: %d\n", i); ++ printk("current pulse length: %d\n", rlc); ++ printk("total cir signal:\n"); ++ for (i = 0; i < max_buf_count; i++) { ++ printk("0x%x ", ir->buf[i]); ++ if (i % 6 == 5) { ++ printk("\n"); ++ } ++ } ++#endif ++ return -1; ++ } ++ ++ *buf_num = i; ++ ++ return 0; ++} ++ ++ ++int w83667hg_check_identification(u8 val, u8 identification, u8 *cur_iden) ++{ ++ *cur_iden <<= 1; ++ *cur_iden |= val ; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s current check iden recv: %d\n", DRVNAME, val); ++ printk("%s current iden value: 0x%x\n", DRVNAME, *cur_iden); ++#endif ++ ++ if (identification == (*cur_iden & IDENTIFICATION_CHECK_BIT)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s find identification\n\n", DRVNAME); ++#endif ++ return 0; ++ } else { ++ return -1; ++ } ++} ++ ++int w83667hg_jump_identification(struct irctl *ir, u8 identification, unsigned int *buf_num, u8 *out_bit, u8 *decode_status) ++{ ++ unsigned int rlc = 0, i = 1; ++ u8 bit = *out_bit, buf; ++ u8 cur_iden = 0; ++ u8 cur_decode_status = *decode_status; ++ ++ bit = BIT_PULSE_MASK; ++ cur_decode_status = ST_DECODE_NEW; ++ ++ for (; i < ir->buf_count; i++) { ++ buf = ir->buf[i]; ++#ifdef ALLOW_DEBUG_DECODE ++printk("buf: 0x%x\n", buf); ++#endif ++ if (bit == (buf & BIT_PULSE_MASK)) { ++ rlc += buf & BIT_LEN; ++ } else { ++ /* decode*/ ++ switch (cur_decode_status) { ++ case ST_DECODE_NEW: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ cur_decode_status = ST_DECODE_ONE; ++ } else { ++ cur_decode_status = ST_DECODE_ZERO; ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ /* error occur, just ignore */ ++ cur_decode_status = ST_DECODE_NEW; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } ++ break; ++ case ST_DECODE_ZERO: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ cur_decode_status = ST_DECODE_NEW; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } else { ++ /* error */ ++ cur_decode_status = ST_DECODE_NEW; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ cur_decode_status = ST_DECODE_ONE; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } else { ++ /* error */ ++ cur_decode_status = ST_DECODE_ZERO; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } ++ } ++ break; ++ case ST_DECODE_ONE: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ cur_decode_status = ST_DECODE_NEW; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } else { ++ /* "10" => 1 */ ++ cur_decode_status = ST_DECODE_NEW; ++ if (!w83667hg_check_identification(1, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } ++ } else if (rlc > TWO_PULSE_LEN_LOW) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ cur_decode_status = ST_DECODE_ONE; ++ if (!w83667hg_check_identification(0, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } else { ++ /* "10" => 1 */ ++ cur_decode_status = ST_DECODE_ZERO; ++ if (!w83667hg_check_identification(1, identification, &cur_iden)) { ++ goto find_iden; ++ } ++ } ++ } ++ break; ++ } /* switch*/ ++ bit = buf & BIT_PULSE_MASK; ++ rlc = buf & BIT_LEN; ++ } ++ } ++ ++ if (i >= ir->buf_count) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s jump iden error\n", DRVNAME); ++ printk("current buf num: %d\n", i); ++ printk("current pulse length: %d\n", rlc); ++ printk("total cir signal:\n"); ++ for (i = 0; i < ir->buf_count; i++) { ++ printk("0x%x ", ir->buf[i]); ++ if (i % 6 == 5) { ++ printk("\n"); ++ } ++ } ++#endif ++ return -1; ++ } ++ ++ find_iden: ++#ifdef ALLOW_DEBUG_DECODE ++ printk("current buf num after iden: %d\n", i); ++ printk("current pulse length: %d\n", rlc); ++#endif ++ /* try fix problem 1 */ ++ if ((rlc & BIT_LEN) >= TWO_PULSE_LEN_LOW) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s fix problem 1 in jump iden\n", DRVNAME); ++ printk("cur pulse len: %d\n", ir->buf[i] & BIT_LEN); ++#endif ++ *buf_num = i + 1; ++ *out_bit = ir->buf[i] & BIT_PULSE_MASK; ++ if (*out_bit) { ++ *decode_status = ST_DECODE_ZERO; ++ } else { ++ *decode_status = ST_DECODE_ONE; ++ } ++ ++ return 0; ++ } ++ ++ /* now find identification successful! */ ++ { ++ *buf_num = i; ++ i--; ++ *out_bit = ir->buf[i] & BIT_PULSE_MASK; ++ if (bit) { ++ *decode_status = ST_DECODE_ONE; ++ } else { ++ *decode_status = ST_DECODE_ZERO; ++ } ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("total cir signal:\n"); ++ for (i = 0; i < ir->buf_count; i++) { ++ printk("0x%x ", ir->buf[i]); ++ if (i % 7 == 6) { ++ printk("\n"); ++ } ++ } ++ printk("\n"); ++#endif ++ ++ return 0; ++} ++ ++void w83667hg_submit_key(struct irctl *ir) ++{ ++ unsigned int rlc = 0, buf_num = 0, i; ++ /* current usb keyboard key code setting, usb_kbd_keycode[keycode] */ ++ unsigned int input_code; ++ u8 bit, buf; ++ /* keycode and shiftmask parts in mce keyboard protocol*/ ++ u8 keycode = 0, shiftmask = 0; ++ u8 decode_status; ++ u8 frame_num, set_frame; ++ ++ /* 1) jump head */ ++ if (w83667hg_jump_head(ir, &buf_num)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode key jump head error\n", DRVNAME); ++#endif ++ return; ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s buf_num after jump head: %d\n", DRVNAME, buf_num); ++#endif ++ ++ /* 2) jump identification */ ++ if (w83667hg_jump_identification(ir, KEY_IDENTIFICATION, &buf_num, &bit, &decode_status)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode key jump identification error\n", DRVNAME); ++#endif ++ return; ++ } ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s jump iden success\n\n", DRVNAME); ++ printk("%s buf_num after jump iden: %d\n", DRVNAME, buf_num); ++ printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); ++#endif ++ ++ /* 3) jump "unknown", "C" and "CodeSet" parts in mce keyboard signal */ ++ if (w83667hg_jump_frame(ir, KEY_KEYCODE_FRAME_AFTER_I_START, &buf_num, &bit, &decode_status)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode key jump pulse error\n", DRVNAME); ++#endif ++ return; ++ } ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s buf_num after jump pulse: %d\n", DRVNAME, buf_num); ++ printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); ++ frame_num = buf_num; ++ for (; frame_num < ir->buf_count; frame_num++) { ++ printk("0x%x\t", ir->buf[frame_num]); ++ if (frame_num % 7 == 6) { ++ printk("\n"); ++ } ++ } ++ printk("\n"); ++#endif ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode status before check key: %x\n", DRVNAME, decode_status); ++#endif ++ ++ ++ /* 4) deocde "KeyCode" and "ShiftMask" parts in mce key signal */ ++ frame_num = 1, set_frame = 1; ++ for (; frame_num < KEY_FRAME_AFTER_JUMP + 2; buf_num++) { ++ if (bit != (ir->buf[buf_num] & BIT_PULSE_MASK)) { ++ /* decode*/ ++ if (rlc > PULSE_SILENT_LEN_LOW) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s error: cir signal end before received all key pulses\n", DRVNAME); ++ printk("bit: %d ", bit); ++ printk("rlc: %d\n", rlc); ++ printk("current pulse number: %d\n", frame_num); ++#endif ++ if (decode_status == ST_DECODE_ONE) { ++ /* must set the last one */ ++ w83667hg_set_key(&set_frame, 1, &keycode, &shiftmask); ++ } ++ break; ++ } ++ switch (decode_status) { ++ case ST_DECODE_NEW: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ decode_status = ST_DECODE_ONE; ++ } else { ++ decode_status = ST_DECODE_ZERO; ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ /* error occur, just ignore */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ frame_num += 1; ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s cur state: %x\n", DRVNAME, decode_status); ++#endif ++ break; ++ case ST_DECODE_ZERO: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ frame_num += 1; ++ } else { ++ /* error */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ decode_status = ST_DECODE_ONE; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ frame_num += 1; ++ } else { ++ /* error */ ++ decode_status = ST_DECODE_ZERO; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ } ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s cur state: %x\n", DRVNAME, decode_status); ++#endif ++ break; ++ case ST_DECODE_ONE: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ } else { ++ /* "10" => 1 */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_key(&set_frame, 1, &keycode, &shiftmask); ++ frame_num += 1; ++ } ++ } else if (rlc > TWO_PULSE_LEN_LOW) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ decode_status = ST_DECODE_ONE; ++ w83667hg_set_key(&set_frame, 0, &keycode, &shiftmask); ++ } else { ++ /* "10" => 1 */ ++ decode_status = ST_DECODE_ZERO; ++ w83667hg_set_key(&set_frame, 1, &keycode, &shiftmask); ++ frame_num += 1; ++ } ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s cur state %x\n", DRVNAME, decode_status); ++#endif ++ break; ++ } /* switch*/ ++ bit = ir->buf[buf_num] & BIT_PULSE_MASK; ++ rlc = ir->buf[buf_num] & BIT_LEN; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode keyboard buf: 0x%x\n", DRVNAME, ir->buf[buf_num]); ++#endif ++ ++ } else { ++ /* continue last pulse*/ ++ rlc += ir->buf[buf_num] & BIT_LEN; ++ } ++ ++ } /* for*/ ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: after decode keyboard:\n", DRVNAME); ++ printk("keycode: 0x%x ", keycode); ++ printk("shiftmask: 0x%x\n\n", shiftmask); ++#endif ++ ++ /* 5) submit keycode to input */ ++ if (keycode != ir->pressed_keycode) { ++ if (ir->pressed_keycode) { ++ input_code = (unsigned int)usb_kbd_keycode[ir->pressed_keycode]; ++ input_report_key(ir->input_dev, input_code, 0); ++ } ++ ir->pressed_keycode = keycode; ++ if (keycode) { ++ input_code = (unsigned int)usb_kbd_keycode[keycode]; ++ input_report_key(ir->input_dev, input_code, 1); ++ } ++ } ++ ++ /* 6) submit shiftmask to input */ ++ ++ if (shiftmask != ir->pressed_shiftmask) { ++ for (i = 0; i < 7; i++) { ++ buf = 1<pressed_shiftmask) && (!(buf & shiftmask))) { ++ input_code = (unsigned int)usb_kbd_keycode[0xE0 + i]; ++ input_report_key(ir->input_dev, input_code, 0); ++ } else if (!(buf & ir->pressed_shiftmask) && (buf & shiftmask)) { ++ input_code = (unsigned int)usb_kbd_keycode[0xE0 + i]; ++ input_report_key(ir->input_dev, input_code, 1); ++ } ++ } /* for*/ ++ ir->pressed_shiftmask = shiftmask; ++ } ++} ++ ++void w83667hg_set_mouse(u8 *set_frame, u8 val, u8 *deltay, u8 *deltax, u8 *clickrl) ++{ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set mouse val:%d\n", DRVNAME, val); ++#endif ++ if (*set_frame <= MOUSE_SUBMIT_DELTAY_FRAME_NUM + 1) { ++ *deltay <<= 1; ++ *deltay |= val; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set mouse delta y:0x%x\n", DRVNAME, *deltay); ++#endif ++ } else if (*set_frame <= MOUSE_SUBMIT_DELTAX_FRAME_NUM) { ++ *deltax <<= 1; ++ *deltax |= val; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set mouse delta x:0x%x\n", DRVNAME, *deltax); ++#endif ++ } else if (*set_frame <= MOUSE_SUBMIT_L_FRAME_NUM) { ++ /* move right key, then set left key */ ++ *clickrl <<= 1; ++ *clickrl |= val; ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s set mouse l:0x%x\n", DRVNAME, *clickrl); ++ printk("set pulse: %d\n", *set_frame); ++#endif ++ } ++ (*set_frame)++; ++} ++ ++void w83667hg_submit_mouse(struct irctl *ir) ++{ ++ unsigned int rlc = 0, buf_num = 0; ++ u8 bit; ++ /* deltax, deltay and clickrl parts in mce mouse protocol*/ ++ u8 deltax = 0, deltay = 0, clickrl = 0; ++ signed char x, y; ++ u8 decode_status; ++ u8 frame_num, set_frame; ++ ++ /* 1) jump head */ ++ if (w83667hg_jump_head(ir, &buf_num)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode mouse jump head error\n", DRVNAME); ++#endif ++ return; ++ } ++ ++ /* 2) jump identification */ ++ if (w83667hg_jump_identification(ir, MOUSE_IDENTIFICATION, &buf_num, &bit, &decode_status)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode mouse jump identification error\n", DRVNAME); ++#endif ++ return; ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: after iden mouse:\n", DRVNAME); ++ printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); ++ frame_num = buf_num; ++ for (; frame_num < ir->buf_count; frame_num++) { ++ printk("0x%x ", ir->buf[frame_num]); ++ if (frame_num % 7 == 6) { ++ printk("\n"); ++ } ++ } ++ printk("\n"); ++#endif ++ ++ /* 3) jump "unknown" part in mce mouse signal */ ++ if (w83667hg_jump_frame(ir, MOUSE_DELTAY_PULSE_AFTER_I_START, &buf_num, &bit, &decode_status)) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: decode mouse jump pulse error\n", DRVNAME); ++#endif ++ return; ++ } ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: after jump pulse buf num: %d\n", DRVNAME, buf_num); ++ printk("decode status: 0x%x, bit: 0x%x\n", decode_status, bit); ++ frame_num = buf_num; ++ for (; frame_num < ir->buf_count; frame_num++) { ++ printk("0x%x ", ir->buf[frame_num]); ++ if (frame_num % 7 == 6) { ++ printk("\n"); ++ } ++ } ++ printk("\n"); ++#endif ++ ++ /* 4) deocde "deltay", "deltax", "r" and "l" parts in mce mouse signal */ ++ frame_num = 1, set_frame = 1; ++ for (; frame_num < MOUSE_CHECKSUM_FRAME_AFTER_JUMP + 1; buf_num++) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: cur buf: 0x%x, pulse num: %d\n", DRVNAME, ir->buf[buf_num], frame_num); ++ printk("decode status: 0x%x\n", decode_status); ++#endif ++ if (bit != (ir->buf[buf_num] & BIT_PULSE_MASK)) { ++ /* decode*/ ++ if (rlc > PULSE_SILENT_LEN_LOW) { ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s error: cir signal end before received all mouse pulses\n", DRVNAME); ++ printk("bit: %d ", bit); ++ printk("rlc: %d\n", rlc); ++#endif ++ break; ++ } ++ switch (decode_status) { ++ case ST_DECODE_NEW: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ decode_status = ST_DECODE_ONE; ++ } else { ++ decode_status = ST_DECODE_ZERO; ++ } ++ } else ++ if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ /* error occur, just ignore */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ frame_num += 1; ++ } ++ break; ++ case ST_DECODE_ZERO: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ frame_num += 1; ++ } else { ++ /* error */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ } ++ } else if ((rlc > TWO_PULSE_LEN_LOW) && ++ (rlc < TWO_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "01" => 0 */ ++ decode_status = ST_DECODE_ONE; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ frame_num += 1; ++ } else { ++ /* error */ ++ decode_status = ST_DECODE_ZERO; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ } ++ } ++ break; ++ case ST_DECODE_ONE: ++ if ((rlc > ONE_PULSE_LEN_LOW) && ++ (rlc < ONE_PULSE_LEN_HIGH)) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ } else { ++ /* "10" => 1 */ ++ decode_status = ST_DECODE_NEW; ++ w83667hg_set_mouse(&set_frame, 1, &deltay, &deltax, &clickrl); ++ frame_num += 1; ++ } ++ } else if (rlc > TWO_PULSE_LEN_LOW) { ++ if (bit & BIT_PULSE_MASK) { ++ /* "11" => error */ ++ decode_status = ST_DECODE_ONE; ++ w83667hg_set_mouse(&set_frame, 0, &deltay, &deltax, &clickrl); ++ frame_num += 1; ++ } else { ++ /* "10" => 1 */ ++ decode_status = ST_DECODE_ZERO; ++ w83667hg_set_mouse(&set_frame, 1, &deltay, &deltax, &clickrl); ++ frame_num += 1; ++ } ++ } ++ break; ++ } /* switch*/ ++ bit = ir->buf[buf_num] & BIT_PULSE_MASK; ++ rlc = ir->buf[buf_num] & BIT_LEN; ++ } else { ++ /* continue last pulse*/ ++ rlc += ir->buf[buf_num] & BIT_LEN; ++ } ++ ++ } /* for*/ ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: after decode mouse:\n", DRVNAME); ++ frame_num = buf_num; ++ for (; frame_num < ir->buf_count; frame_num++) { ++ printk("0x%x ", ir->buf[frame_num]); ++ if (frame_num % 7 == 6) { ++ printk("\n"); ++ } ++ } ++ printk("\n"); ++#endif ++ ++ /* fix deltax lost problem */ ++ if (deltax) { ++ deltax <<= 1; ++ deltax |= 1; ++ } ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: after decode mouse:\n", DRVNAME); ++ printk("deltay: 0x%x ", deltay); ++ printk("deltax: 0x%x ", deltax); ++ printk("click rl: 0x%x \n\n", clickrl); ++#endif ++ if (deltay & 0x40) { ++ y = -((~deltay & 0x7f) + 1); ++ } else { ++ y = deltay; ++ } ++ if (deltax & 0x40) { ++ x = -((~deltax & 0x7f) + 1); ++ } else { ++ x = deltax; ++ } ++ ++ /* 5) send to input */ ++ ++#ifdef ALLOW_DEBUG_DECODE ++ printk("%s: after decode mouse and rebuild:\n", DRVNAME); ++ printk("y: %d ", y); ++ printk("x: %d ", x); ++ printk("click rl: 0x%x \n\n", clickrl); ++#endif ++ ++ input_report_rel(ir->input_dev, REL_X, x); ++ input_report_rel(ir->input_dev, REL_Y, y); ++ ++ input_report_key(ir->input_dev, BTN_LEFT, clickrl & 1); ++ input_report_key(ir->input_dev, BTN_RIGHT, (clickrl >> 1) & 1); ++} ++ ++ +diff -Naur linux-2.6.33.2/drivers/input/lirc/lirc_wb677_mouse_kbd.h linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_mouse_kbd.h +--- linux-2.6.33.2/drivers/input/lirc/lirc_wb677_mouse_kbd.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.33.2.patch/drivers/input/lirc/lirc_wb677_mouse_kbd.h 2010-04-03 18:42:04.216701266 +0200 +@@ -0,0 +1,190 @@ ++#ifndef __LIRC_WB677_MOUSE_KBD_HEADER__ ++#define __LIRC_WB677_MOUSE_KBD_HEADER__ ++ ++ ++ ++ ++/* jump asked frame number, can use on key, mouse and controller signals ++ * ++ * after jump frame_num, current frame number = frame_num + 1 ++ * record current buf number of irctl buf ++ * record current pulse's bit and decode_status ++ * ++ * problem 1: ++ * When jump_frame() stops on a two_width_len pulse, the buf_num will be the ++ * second pulse of the double_width_len pulse. ++ * So jump_frame() must increase buf_num 1 on problem 1. ++ * For sample period is 50us, a 444us piulse's minimal sample value is 7, and ++ * two piulses' minimal sample value is 15. So just increase buf_num 1 works ++ * fine. If sample period changes, this solution also need change. ++ * ++ * one_width_len pulse: ++ * _ _ ++ * .| |_| |_. (1010) ++ * ^ ++ * | ++ * stop: jumped frame_num ++ * ++ * ++ * problem 1: double_width_len pulse: ++ * __ _ ++ * .| |__| |. (11001) ++ * ^ ++ * | ++ * stop: jumped frame_num + 1, buf_num + 1 ++ * ++ * so if cur buf len > TWO_PULSE_LEN_LOW, buf_num -- ++ * and recheck polar bit and decode_status ++ * decode_status go back 1 buf, ++ * NEW -> ONE/ZERO; ONE/ZERO -> NEW ++ * ++ * jump out of buf limit, return < 0 ++ */ ++int w83667hg_jump_frame(struct irctl *ir, u8 frame_num, unsigned int *buf_num, u8 *out_bit, u8 *decode_status); ++ ++/* jump MCE head sync signal (1111 11) ++ * ++ * after jump signal head, current pulse number = 7 ++ * record current buf number of irctl buf ++ * record current pulse's bit and decode_status ++ * ++ * jump out of buf limit, return < 0 ++ */ ++int w83667hg_jump_head(struct irctl *ir, unsigned int *buf_num); ++ ++#define KEY_IDENTIFICATION 0x04 ++#define MOUSE_IDENTIFICATION 0x01 ++#define IDENTIFICATION_CHECK_BIT 0xF ++ ++/* check mce identification ++ * ++ * compare identification and cur_iden ++ * same return 0 ++ * else return < 0, need continue check ++ */ ++int w83667hg_check_identification(u8 val, u8 identification, u8 *cur_iden); ++ ++/* jump mce identification ++ * can use on key, mouse and controller signals ++ * ++ * jump and search identification parts ++ * record current buf number of irctl buf ++ * ++ * jump all pulse until find identification ++ * ++ * ++ * ++ * problem 1: ++ * When jump_identification() stops on a double_width_len pulse, the buf_num will be the ++ * second pulse of the doule_width_len frame. ++ * ++ * one_width_len pulse: ++ * _ _ ++ * .| |_| |_. (1010) ++ * ^ ++ * | ++ * stop: jumped frame_num ++ * ++ * ++ * problem 1: double_width_len pulse: ++ * __ _ ++ * .| |__| |. (11001) ++ * ^ ++ * | ++ * stop: jumped frame_num + 1, buf_num + 2 ++ * ++ * solution: ++ * Now buf_num is the next double-pulse-width buf. ++ * Just decrease buf_num by one can fix this problem. ++ * ++ * ++ * After jump iden, output may diff by decode status: ++ * 1) ++ * For status ONE and ZERO, all decode work is done. ++ * Set status as NEW and inverse out_bit ++ * in fact, bit is not important, for a buf can indicate one frame, whether its ++ * length is one or two, the bit can be ignored ++ * ++ * after jump frame, all status is NEW! reset them as inverse polar bit ++ * ++ * ++ * ++ * ++ * can not find identification, return < 0 ++ */ ++int w83667hg_jump_identification(struct irctl *ir, u8 identification, unsigned int *buf_num, u8 *out_bit, u8 *decode_status); ++ ++ ++/* the frame number between identification and code */ ++#define KEY_KEYCODE_FRAME_AFTER_I_START 16 /*//32*/ ++#define KEY_FRAME_AFTER_JUMP 16 /*//64*/ ++#define KEY_SUBMIT_KEYCODE_FRAME_NUM 8 ++ ++ ++#define MOUSE_DELTAY_PULSE_AFTER_I_START 8 ++#define MOUSE_CHECKSUM_FRAME_AFTER_JUMP 16 ++#define MOUSE_SUBMIT_DELTAY_FRAME_NUM 7 ++#define MOUSE_SUBMIT_DELTAX_FRAME_NUM 14 ++#define MOUSE_SUBMIT_R_FRAME_NUM 15 ++#define MOUSE_SUBMIT_L_FRAME_NUM 16 ++ ++ ++/* FIXME, not sure this value, select a large number*/ ++#define PULSE_SILENT_LEN_LOW 90 ++ ++ ++/* set keycode and shiftmask for keyboard */ ++void w83667hg_set_key(u8 *set_frame, u8 val, u8 *keycode, u8 *shiftmask); ++ ++/* decode mce keyboard signal and send data to input ++ * ++ * 1) jump mce keyboard signal sync head (1111 11) ++ * 2) jump identification (0100) ++ * pulse number before identification is not sure ++ * 3) jump "unknown", "C" and "CodeSet" parts in mce keyboard signal ++ * 4) deocde "KeyCode" and "ShiftMask" parts in mce key signal ++ * 5) send keycode to input by array usb_kbd_keycode ++ * 6) send shiftmask to input by array usb_kbd_keycode ++ */ ++void w83667hg_submit_key(struct irctl *ir); ++ ++/* set deltax, deltay, x, y for mce mouse */ ++void w83667hg_set_mouse(u8 *set_frame, u8 val, u8 *deltay, u8 *deltax, u8 *clickrl); ++ ++/* decode mce mouse signal and send data to input ++ * ++ * 1) jump mce mouse signal sync head (1111 11) ++ * 2) jump identification (0001) ++ * pulse number before identification is not sure ++ * 3) jump "unknown" part in mce mouse signal ++ * 4) deocde "deltay", "deltax", "r" and "l" parts in mce mouse signal ++ * 5) send these parts to input ++ */ ++void w83667hg_submit_mouse(struct irctl *ir); ++ ++ ++ ++#define BIT_PULSE_MASK 0x80 ++#define BIT_LEN 0x7f ++ ++ ++ ++/* "10"=>1 (+2), "01"=>0 (+2) */ ++#define ST_DECODE_NEW 0x01 ++#define ST_DECODE_ZERO 0x02 ++#define ST_DECODE_ONE 0x04 ++ ++/* RC6 sync head: 1111 11 ++ * 6 * 444us / 50us (sample period) * 0.85 (inaccuracy) ++ */ ++#define HEAD_SYNC_LEN_LOW 45 ++/* 7 pulses long, for inaccuracy */ ++#define HEAD_SYNC_LEN_HIGH 71 ++ ++#define ONE_PULSE_LEN_LOW 2 ++#define ONE_PULSE_LEN_HIGH 10 ++#define TWO_PULSE_LEN_LOW 10 ++#define TWO_PULSE_LEN_HIGH 15 ++ ++ ++#endif +diff -Naur linux-2.6.33.2/drivers/input/lirc/Makefile linux-2.6.33.2.patch/drivers/input/lirc/Makefile +--- linux-2.6.33.2/drivers/input/lirc/Makefile 2010-04-03 18:40:52.422576074 +0200 ++++ linux-2.6.33.2.patch/drivers/input/lirc/Makefile 2010-04-03 18:42:04.217701457 +0200 +@@ -1,6 +1,9 @@ + # Makefile for the lirc drivers. + # + ++# Multipart objects. ++lirc_wb677-objs := lirc_wb677_main.o lirc_wb677_mouse_kbd.o ++ + # Each configuration option enables a list of files. + + obj-$(CONFIG_INPUT_LIRC) += lirc_dev.o +@@ -12,6 +15,7 @@ + obj-$(CONFIG_LIRC_IT87) += lirc_it87.o + obj-$(CONFIG_LIRC_ITE8709) += lirc_ite8709.o + obj-$(CONFIG_LIRC_MCEUSB) += lirc_mceusb.o ++obj-$(CONFIG_LIRC_NCT667X) += lirc_wb677.o + obj-$(CONFIG_LIRC_PARALLEL) += lirc_parallel.o + obj-$(CONFIG_LIRC_SASEM) += lirc_sasem.o + obj-$(CONFIG_LIRC_SERIAL) += lirc_serial.o +diff -Naur linux-2.6.33.2/drivers/input/lirc/wb83677hg_ir.h linux-2.6.33.2.patch/drivers/input/lirc/wb83677hg_ir.h +--- linux-2.6.33.2/drivers/input/lirc/wb83677hg_ir.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.33.2.patch/drivers/input/lirc/wb83677hg_ir.h 2010-04-03 18:42:04.218701439 +0200 +@@ -0,0 +1,44 @@ ++#define IR_IOC_MAGIC 'i' ++ ++/* output chip registers for debug */ ++#define IR_DUMPCIRREG _IO(IR_IOC_MAGIC, 0x80) ++#define IR_DUMPWAKEREG _IO(IR_IOC_MAGIC, 0x81) ++ ++ ++/* study wake key on MCE CIR controller */ ++#define IR_IOLEARNWAKE _IO(IR_IOC_MAGIC, 0x82) ++ ++/* disable cir wake */ ++#define IR_IOUNSETWAKE _IO(IR_IOC_MAGIC, 0x83) ++ ++/* enable cir wake */ ++#define IR_IOSETWAKE _IO(IR_IOC_MAGIC, 0x84) ++ ++ ++/* get carrier for study ir signal */ ++#define IR_IOGETCARRIER _IOR(IR_IOC_MAGIC, 0x85, unsigned int) ++ ++/* set carrier for send ir signal */ ++#define IR_IOSETCARRIER _IOW(IR_IOC_MAGIC, 0x86, unsigned int) ++ ++/* start/stop study key */ ++#define IR_IOSTARTSTUDY _IO(IR_IOC_MAGIC, 0x88) ++#define IR_IOSTOPSTUDY _IO(IR_IOC_MAGIC, 0x89) ++ ++/* study key buf len */ ++#define IR_IOSTUDYLEN _IOR(IR_IOC_MAGIC, 0x8A, unsigned int) ++ ++/* study key buf data */ ++#define IR_IOSTUDYBUF _IOR(IR_IOC_MAGIC, 0x8B, unsigned char) ++ ++/* restudy key buf data */ ++#define IR_IORESTUDYBUF _IO(IR_IOC_MAGIC, 0x8C) ++ ++ ++/* clean data */ ++#define IR_IOCLEANDATA _IO(IR_IOC_MAGIC, 0x8E) ++ ++ ++/* check chip identification for the applications which are related to hardware */ ++#define IR_CHECKCHIP _IOR(IR_IOC_MAGIC, 0x8F, unsigned long long) ++ diff --git a/packages/mediacenter/xbmc-theme-Confluence/url b/packages/mediacenter/xbmc-theme-Confluence/url index fade2f3c6f..bb8258f751 100644 --- a/packages/mediacenter/xbmc-theme-Confluence/url +++ b/packages/mediacenter/xbmc-theme-Confluence/url @@ -1 +1 @@ -http://sources.openelec.tv/svn/xbmc-theme-Confluence-29890.tar.bz2 +http://sources.openelec.tv/svn/xbmc-theme-Confluence-29914.tar.bz2 diff --git a/packages/mediacenter/xbmc-theme-PM3-HD/url b/packages/mediacenter/xbmc-theme-PM3-HD/url index d9c23c30c2..75ccaeea51 100644 --- a/packages/mediacenter/xbmc-theme-PM3-HD/url +++ b/packages/mediacenter/xbmc-theme-PM3-HD/url @@ -1 +1 @@ -http://sources.openelec.tv/svn/xbmc-theme-PM3-HD-29890.tar.bz2 +http://sources.openelec.tv/svn/xbmc-theme-PM3-HD-29914.tar.bz2 diff --git a/packages/mediacenter/xbmc/init.d/09_cache_xbmc b/packages/mediacenter/xbmc/init.d/09_cache_xbmc deleted file mode 100755 index 38b6217b4c..0000000000 --- a/packages/mediacenter/xbmc/init.d/09_cache_xbmc +++ /dev/null @@ -1,12 +0,0 @@ -# -# caching xbmc -# -# runlevels: openelec, textmode - -if [ "$XBMC_CACHING" = "yes" ]; then - - progress "caching XBMC" - - cache_xbmc - -fi \ No newline at end of file diff --git a/packages/mediacenter/xbmc/init.d/60_xbmc b/packages/mediacenter/xbmc/init.d/60_xbmc new file mode 100644 index 0000000000..21abe13f02 --- /dev/null +++ b/packages/mediacenter/xbmc/init.d/60_xbmc @@ -0,0 +1,24 @@ +# starting XBMC +# +# runlevels: openelec + +. /etc/profile + +progress "starting XBMC" + + XBMC_ARGS="--standalone -fs --lircdev /dev/lircd" + + [ -f /usr/bin/autoupdate ] && /usr/bin/autoupdate & + + while true; do + + DISPLAY=:0.0 xbmc $XBMC_ARGS > /dev/null 2>&1 + RET=$? + echo "Exited with code $RET" + + [ "$RET" == 0 ] && sync && poweroff + [ "$RET" == 64 ] && sync && poweroff + [ "$RET" == 66 ] && sync && reboot + + usleep 250000 + done diff --git a/packages/mediacenter/xbmc/install b/packages/mediacenter/xbmc/install index 5ecda158c7..c1b171057f 100755 --- a/packages/mediacenter/xbmc/install +++ b/packages/mediacenter/xbmc/install @@ -68,11 +68,11 @@ PKG_DIR=`find $PACKAGES -type d -name $1` PYTHON_LIBDIR="`ls -d $INSTALL/usr/lib/python*`" mkdir -p $INSTALL/usr/bin - cp -P $PKG_DIR/scripts/xbmc-session $INSTALL/usr/bin + cp -P $PKG_BUILD/xbmc.bin $INSTALL/usr/bin/xbmc +# cp -P $PKG_DIR/scripts/xbmc-session $INSTALL/usr/bin cp -P $PKG_BUILD/tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send mkdir -p $INSTALL/usr/share/xbmc - cp -P $PKG_BUILD/xbmc.bin $INSTALL/usr/share/xbmc cp -P $PKG_BUILD/xbmc-xrandr $INSTALL/usr/share/xbmc mkdir -p $INSTALL/usr/share/xbmc/language diff --git a/packages/mediacenter/xbmc/scripts/xbmc-session b/packages/mediacenter/xbmc/scripts/xbmc-session deleted file mode 100755 index 88005e00d1..0000000000 --- a/packages/mediacenter/xbmc/scripts/xbmc-session +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -. /etc/profile - -XBMC_ARGS="--standalone -fs --lircdev /dev/lircd" - -if test "$XBMC_CACHING" = "yes" ; then - wait_for_xbmc_cache - XBMC_BIN="/var/cache/bin/xbmc.bin" -else - XBMC_BIN="/usr/share/xbmc/xbmc.bin" -fi - -[ -f /usr/bin/autoupdate ] && /usr/bin/autoupdate & - -while true; do - - $IONICE $XBMC_BIN $XBMC_ARGS $@ > /dev/null 2>&1 - RET=$? - echo "Exited with code $RET" - - [ "$RET" == 0 ] && sync && poweroff - [ "$RET" == 64 ] && sync && poweroff - [ "$RET" == 66 ] && sync && reboot - -done diff --git a/packages/mediacenter/xbmc/url b/packages/mediacenter/xbmc/url index 2051c6e482..e4d83fad7a 100644 --- a/packages/mediacenter/xbmc/url +++ b/packages/mediacenter/xbmc/url @@ -1 +1 @@ -http://sources.openelec.tv/svn/xbmc-29890.tar.bz2 +http://sources.openelec.tv/svn/xbmc-29914.tar.bz2 diff --git a/packages/network/transmission/init.d/43_transmission b/packages/network/transmission/init.d/43_transmission index aa02d5def5..268fd56685 100644 --- a/packages/network/transmission/init.d/43_transmission +++ b/packages/network/transmission/init.d/43_transmission @@ -40,4 +40,4 @@ transmission-daemon $TRANSMISSION_ARG fi -)& \ No newline at end of file +)& diff --git a/packages/network/transmission/install b/packages/network/transmission/install index 8be2bf7b95..9b2949dc61 100755 --- a/packages/network/transmission/install +++ b/packages/network/transmission/install @@ -17,4 +17,4 @@ mkdir -p $INSTALL/usr/share/transmission/web rm -rf $INSTALL/usr/share/transmission/web/LICENSE mkdir -p $INSTALL/usr/config - cp $PKG_DIR/config/transmission.conf $INSTALL/usr/config \ No newline at end of file + cp $PKG_DIR/config/transmission.conf $INSTALL/usr/config diff --git a/packages/sysutils/bash/build b/packages/sysutils/bash/build new file mode 100755 index 0000000000..c31b207c45 --- /dev/null +++ b/packages/sysutils/bash/build @@ -0,0 +1,15 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain + +cd $PKG_BUILD +./configure --host=$TARGET_NAME \ + --build=$HOST_NAME \ + --prefix=/usr \ + --bindir=/bin \ + --without-bash-malloc \ + --without-installed-readline \ + +make diff --git a/packages/sysutils/bash/install b/packages/sysutils/bash/install new file mode 100755 index 0000000000..715e5b88ef --- /dev/null +++ b/packages/sysutils/bash/install @@ -0,0 +1,7 @@ +#!/bin/sh + +. config/options + +mkdir -p $INSTALL/bin + cp $PKG_BUILD/bash $INSTALL/bin + ln -sf bash $INSTALL/bin/sh diff --git a/packages/sysutils/bash/patches/bash-4.1-fixes-1.diff b/packages/sysutils/bash/patches/bash-4.1-fixes-1.diff new file mode 100644 index 0000000000..15f98be9bd --- /dev/null +++ b/packages/sysutils/bash/patches/bash-4.1-fixes-1.diff @@ -0,0 +1,99 @@ +Submitted By: Matt Burgess +Date: 2010-04-14 +Initial Package Version: 4.1 +Upstream Status: Already in upstream patch repo +Origin: Upstream +Description: This patch contains upstream patch numbers 1 thru 5. + +diff -Naur bash-4.1.orig/bashline.c bash-4.1/bashline.c +--- bash-4.1.orig/bashline.c 2009-10-24 19:10:19.000000000 +0100 ++++ bash-4.1/bashline.c 2010-04-14 20:15:22.075440836 +0100 +@@ -1680,7 +1680,7 @@ + a single match (multiple matches that end up reducing the number of + characters in the common prefix are bad) will ever be returned on + regular completion. */ +- if (glob_pattern_p (hint)) ++ if (globpat) + { + if (state == 0) + { +diff -Naur bash-4.1.orig/builtins/printf.def bash-4.1/builtins/printf.def +--- bash-4.1.orig/builtins/printf.def 2009-11-20 20:31:23.000000000 +0000 ++++ bash-4.1/builtins/printf.def 2010-04-14 20:15:22.055434803 +0100 +@@ -172,7 +172,7 @@ + #endif + + #if !HAVE_VSNPRINTF +-extern int vsnprintf __P((char *, size_t, const char *, ...)) __attribute__((__format__ (printf, 3, 4))); ++extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0))); + #endif + + static void printf_erange __P((char *)); +diff -Naur bash-4.1.orig/builtins/read.def bash-4.1/builtins/read.def +--- bash-4.1.orig/builtins/read.def 2009-10-08 16:35:46.000000000 +0100 ++++ bash-4.1/builtins/read.def 2010-04-14 20:15:22.095436083 +0100 +@@ -615,14 +615,15 @@ + if (unbuffered_read == 0) + zsyncfd (fd); + +- interrupt_immediately--; +- terminate_immediately--; + discard_unwind_frame ("read_builtin"); + + retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + + assign_vars: + ++ interrupt_immediately--; ++ terminate_immediately--; ++ + #if defined (ARRAY_VARS) + /* If -a was given, take the string read, break it into a list of words, + an assign them to `arrayname' in turn. */ +diff -Naur bash-4.1.orig/lib/readline/complete.c bash-4.1/lib/readline/complete.c +--- bash-4.1.orig/lib/readline/complete.c 2009-11-29 23:39:30.000000000 +0000 ++++ bash-4.1/lib/readline/complete.c 2010-04-14 20:15:22.064194346 +0100 +@@ -2138,7 +2138,7 @@ + All other entries except "." and ".." match. */ + if (filename_len == 0) + { +- if (_rl_match_hidden_files == 0 && HIDDEN_FILE (entry->d_name)) ++ if (_rl_match_hidden_files == 0 && HIDDEN_FILE (convfn)) + continue; + + if (convfn[0] != '.' || +@@ -2219,7 +2219,7 @@ + temp[dirlen++] = '/'; + } + +- strcpy (temp + dirlen, entry->d_name); ++ strcpy (temp + dirlen, convfn); + } + else + temp = savestring (convfn); +diff -Naur bash-4.1.orig/patchlevel.h bash-4.1/patchlevel.h +--- bash-4.1.orig/patchlevel.h 2009-10-01 21:39:22.000000000 +0100 ++++ bash-4.1/patchlevel.h 2010-04-14 20:15:22.099440845 +0100 +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 0 ++#define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ +diff -Naur bash-4.1.orig/variables.c bash-4.1/variables.c +--- bash-4.1.orig/variables.c 2009-11-03 19:13:58.000000000 +0000 ++++ bash-4.1/variables.c 2010-04-14 20:15:22.088697241 +0100 +@@ -3808,6 +3808,11 @@ + + if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate))) + { ++ /* Make sure we have a hash table to store the variable in while it is ++ being propagated down to the global variables table. Create one if ++ we have to */ ++ if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0) ++ shell_variables->table = hash_create (0); + /* XXX - should we set v->context here? */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) diff --git a/packages/sysutils/bash/url b/packages/sysutils/bash/url new file mode 100644 index 0000000000..6163a2cf70 --- /dev/null +++ b/packages/sysutils/bash/url @@ -0,0 +1 @@ +http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz \ No newline at end of file diff --git a/packages/sysutils/busybox/config/busybox.conf b/packages/sysutils/busybox/config/busybox.conf index e4b7c98d9d..2a4a310fac 100644 --- a/packages/sysutils/busybox/config/busybox.conf +++ b/packages/sysutils/busybox/config/busybox.conf @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.16.1 -# Sun May 2 15:07:06 2010 +# Sat May 8 08:10:16 2010 # CONFIG_HAVE_DOT_CONFIG=y @@ -214,8 +214,8 @@ CONFIG_NICE=y CONFIG_PRINTENV=y CONFIG_PRINTF=y # CONFIG_PWD is not set -# CONFIG_READLINK is not set -# CONFIG_FEATURE_READLINK_FOLLOW is not set +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y # CONFIG_REALPATH is not set CONFIG_RM=y CONFIG_RMDIR=y @@ -252,7 +252,7 @@ CONFIG_FEATURE_TR_EQUIV=y CONFIG_UNAME=y # CONFIG_UNEXPAND is not set # CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set -# CONFIG_UNIQ is not set +CONFIG_UNIQ=y CONFIG_USLEEP=y # CONFIG_UUDECODE is not set # CONFIG_UUENCODE is not set @@ -281,7 +281,7 @@ CONFIG_FEATURE_HUMAN_READABLE=y # # Console Utilities # -CONFIG_CHVT=y +# CONFIG_CHVT is not set CONFIG_CLEAR=y # CONFIG_DEALLOCVT is not set # CONFIG_DUMPKMAP is not set @@ -814,7 +814,7 @@ CONFIG_FEATURE_PS_WIDE=y # CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set # CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set # CONFIG_RENICE is not set -# CONFIG_BB_SYSCTL is not set +CONFIG_BB_SYSCTL=y CONFIG_TOP=y CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y @@ -859,11 +859,11 @@ CONFIG_SV_DEFAULT_SERVICE_DIR="" # # Shells # -CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_ASH is not set # CONFIG_FEATURE_SH_IS_HUSH is not set -# CONFIG_FEATURE_SH_IS_NONE is not set -CONFIG_ASH=y -CONFIG_ASH_BASH_COMPAT=y +CONFIG_FEATURE_SH_IS_NONE=y +# CONFIG_ASH is not set +# CONFIG_ASH_BASH_COMPAT is not set # CONFIG_ASH_JOB_CONTROL is not set # CONFIG_ASH_ALIAS is not set # CONFIG_ASH_GETOPTS is not set @@ -873,8 +873,8 @@ CONFIG_ASH_BASH_COMPAT=y # CONFIG_ASH_CMDCMD is not set # CONFIG_ASH_MAIL is not set # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set -CONFIG_ASH_RANDOM_SUPPORT=y -CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_ASH_EXPAND_PRMT is not set # CONFIG_HUSH is not set # CONFIG_HUSH_BASH_COMPAT is not set # CONFIG_HUSH_HELP is not set @@ -890,9 +890,9 @@ CONFIG_ASH_EXPAND_PRMT=y # CONFIG_HUSH_RANDOM_SUPPORT is not set # CONFIG_LASH is not set # CONFIG_MSH is not set -CONFIG_SH_MATH_SUPPORT=y +# CONFIG_SH_MATH_SUPPORT is not set # CONFIG_SH_MATH_SUPPORT_64 is not set -CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_EXTRA_QUIET is not set # CONFIG_FEATURE_SH_STANDALONE is not set # CONFIG_FEATURE_SH_NOFORK is not set # CONFIG_CTTYHACK is not set diff --git a/packages/sysutils/busybox/install b/packages/sysutils/busybox/install index c625bf2074..d9417e21e8 100755 --- a/packages/sysutils/busybox/install +++ b/packages/sysutils/busybox/install @@ -21,7 +21,6 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`" echo "chmod 4755 $INSTALL/bin/busybox" >> $FAKEROOT_SCRIPT mkdir -p $INSTALL/bin - ln -sf /bin/sh $INSTALL/bin/bash cp $PKG_DIR/scripts/lsb-release $INSTALL/bin/ mkdir -p $INSTALL/sbin @@ -56,5 +55,6 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`" mkdir -p $INSTALL/etc/network cp $PKG_DIR/config/interfaces $INSTALL/etc/network -# we need an full-featured grep for pm-utils, so we install this :-( +# we need an full-featured grep and bash for pm-utils, so we install this :-( $SCRIPTS/install grep + $SCRIPTS/install bash diff --git a/packages/sysutils/busybox/profile.d/home.conf b/packages/sysutils/busybox/profile.d/home.conf new file mode 100644 index 0000000000..f0192e8cf2 --- /dev/null +++ b/packages/sysutils/busybox/profile.d/home.conf @@ -0,0 +1,10 @@ +################################################################################ +# Core (PATH) environment variables. +# +# This file contains non-OpenELEC evironment variables as well as OpenELEC +# evironment variables that are not user defined. +################################################################################ + +HOME="/storage" + +export HOME diff --git a/packages/sysutils/dmidecode/build b/packages/sysutils/dmidecode/build new file mode 100755 index 0000000000..07184b006a --- /dev/null +++ b/packages/sysutils/dmidecode/build @@ -0,0 +1,9 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain + +cd $PKG_BUILD + +make CC=$TARGET_CC dmidecode diff --git a/packages/sysutils/dmidecode/install b/packages/sysutils/dmidecode/install new file mode 100755 index 0000000000..18609d431d --- /dev/null +++ b/packages/sysutils/dmidecode/install @@ -0,0 +1,6 @@ +#!/bin/sh + +. config/options + +mkdir -p $INSTALL/usr/sbin + cp -P $PKG_BUILD/dmidecode $INSTALL/usr/sbin diff --git a/packages/sysutils/dmidecode/url b/packages/sysutils/dmidecode/url new file mode 100644 index 0000000000..5c7364bdbd --- /dev/null +++ b/packages/sysutils/dmidecode/url @@ -0,0 +1 @@ +http://www.very-clever.com/download/nongnu/dmidecode/dmidecode-2.10.tar.bz2 \ No newline at end of file diff --git a/packages/sysutils/hal/init.d/13_hal b/packages/sysutils/hal/init.d/13_hal deleted file mode 100755 index 2fea190991..0000000000 --- a/packages/sysutils/hal/init.d/13_hal +++ /dev/null @@ -1,12 +0,0 @@ -# -# starting HAL -# -# runlevels: openelec, textmode - -progress "Starting Hardware Abstraction Layer" - - $IONICE mkdir -p /var/cache/hald \ - /var/run/dbus/hald-local \ - /var/run/dbus/hald-runner - - hald --verbose=no --daemon=yes --use-syslog & diff --git a/packages/sysutils/hal/install b/packages/sysutils/hal/install index ad17e14996..37152c3c88 100755 --- a/packages/sysutils/hal/install +++ b/packages/sysutils/hal/install @@ -9,60 +9,7 @@ $SCRIPTS/install dbus $SCRIPTS/install dbus-glib $SCRIPTS/install util-linux-ng -add_user haldaemon x 68 68 "HAL daemon" "/" "/bin/sh" -add_group haldaemon 68 - -mkdir -p $INSTALL/usr/sbin - cp $PKG_BUILD/hald/hald $INSTALL/usr/sbin/ - -mkdir -p $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/lshal $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-device $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-disable-polling $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-find-by-capability $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-find-by-property $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-get-property $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-is-caller-locked-out $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-lock $INSTALL/usr/bin - cp $PKG_BUILD/tools/.libs/hal-set-property $INSTALL/usr/bin - -mkdir -p $INSTALL/usr/libexec - cp $PKG_BUILD/tools/.libs/hal-storage-mount $INSTALL/usr/libexec - cp $PKG_BUILD/tools/.libs/hal-storage-unmount $INSTALL/usr/libexec - cp $PKG_BUILD/tools/.libs/hal-storage-eject $INSTALL/usr/libexec - cp $PKG_BUILD/tools/.libs/hal-storage-closetray $INSTALL/usr/libexec - cp $PKG_BUILD/tools/.libs/hal-storage-cleanup-mountpoint $INSTALL/usr/libexec - cp $PKG_BUILD/tools/.libs/hal-storage-cleanup-all-mountpoints $INSTALL/usr/libexec - cp $PKG_BUILD/hald/linux/addons/.libs/hald-addon-* $INSTALL/usr/libexec - cp $PKG_BUILD/hald/linux/probing/.libs/hald-probe-* $INSTALL/usr/libexec - cp $PKG_BUILD/hald/hald-generate-fdi-cache $INSTALL/usr/libexec - cp $PKG_BUILD/hald-runner/hald-runner $INSTALL/usr/libexec - -mkdir -p $INSTALL/usr/lib/hal/scripts - cp $PKG_BUILD/tools/hal-functions $INSTALL/usr/lib/hal/scripts - cp $PKG_BUILD/tools/hal-dockstation-undock $INSTALL/usr/lib/hal/scripts - mkdir -p $INSTALL/usr/lib cp -PR $PKG_BUILD/libhal/.libs/libhal.so* $INSTALL/usr/lib cp -PR $PKG_BUILD/libhal-storage/.libs/libhal-storage.so* $INSTALL/usr/lib rm -rf $INSTALL/usr/lib/libhal-storage.so*T - -mkdir -p $INSTALL/lib/udev/rules.d - cp $PKG_BUILD/tools/linux/90-hal.rules $INSTALL/lib/udev/rules.d - -mkdir -p $INSTALL/etc/dbus-1/system.d - cp $PKG_BUILD/hal.conf $INSTALL/etc/dbus-1/system.d - -mkdir -p $INSTALL/etc/hal/fdi/preprobe -mkdir -p $INSTALL/etc/hal/fdi/information -mkdir -p $INSTALL/etc/hal/fdi/policy -mkdir -p $INSTALL/usr/share/hal/fdi/preprobe -mkdir -p $INSTALL/usr/share/hal/fdi/information/10freedesktop - -mkdir -p $INSTALL/usr/share/hal/fdi/policy/10osvendor -cp \ - $PKG_BUILD/fdi/policy/10osvendor/10-input-policy.fdi \ - $PKG_BUILD/fdi/policy/10osvendor/10-keymap.fdi \ - $PKG_BUILD/fdi/policy/10osvendor/20-storage-methods.fdi \ - $PKG_BUILD/fdi/policy/10osvendor/20-acl-management.fdi \ - $INSTALL/usr/share/hal/fdi/policy/10osvendor diff --git a/packages/sysutils/hal/patches/hal-Linux-should-use-evdev-xkb-rule.diff b/packages/sysutils/hal/patches/hal-Linux-should-use-evdev-xkb-rule.diff deleted file mode 100644 index 8893286468..0000000000 --- a/packages/sysutils/hal/patches/hal-Linux-should-use-evdev-xkb-rule.diff +++ /dev/null @@ -1,26 +0,0 @@ -From a81c0756c48621fadd18597bb337e08c4c3529d0 Mon Sep 17 00:00:00 2001 -From: Yan Li -Date: Mon, 5 Jan 2009 17:16:03 +0800 -Subject: [PATCH] Linux should use evdev xkb rule - - -Signed-off-by: Yan Li ---- - fdi/policy/10osvendor/10-keymap.fdi | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/fdi/policy/10osvendor/10-keymap.fdi b/fdi/policy/10osvendor/10-keymap.fdi -index c9ad87c..1971e8b 100644 ---- a/fdi/policy/10osvendor/10-keymap.fdi -+++ b/fdi/policy/10osvendor/10-keymap.fdi -@@ -13,6 +13,7 @@ - keyboard - -+ evdev - evdev - - --- -1.5.6.5 - diff --git a/packages/sysutils/kbd/build b/packages/sysutils/kbd/build new file mode 100755 index 0000000000..1733fbe5bd --- /dev/null +++ b/packages/sysutils/kbd/build @@ -0,0 +1,15 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain + +cd $PKG_BUILD +./configure --host=$TARGET_NAME \ + --build=$HOST_NAME \ + --prefix=/usr \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --localstatedir=/var \ + +make diff --git a/packages/sysutils/kbd/install b/packages/sysutils/kbd/install new file mode 100755 index 0000000000..3fafaafbef --- /dev/null +++ b/packages/sysutils/kbd/install @@ -0,0 +1,8 @@ +#!/bin/sh + +. config/options + +mkdir -p $INSTALL/usr/bin + cp $PKG_BUILD/src/chvt $INSTALL/usr/bin + cp $PKG_BUILD/src/deallocvt $INSTALL/usr/bin + cp $PKG_BUILD/src/fgconsole $INSTALL/usr/bin diff --git a/packages/sysutils/kbd/url b/packages/sysutils/kbd/url new file mode 100644 index 0000000000..363dd719c0 --- /dev/null +++ b/packages/sysutils/kbd/url @@ -0,0 +1 @@ +http://www.kernel.org/pub/linux/utils/kbd/kbd-1.15.2.tar.bz2 \ No newline at end of file diff --git a/packages/sysutils/pm-utils/install b/packages/sysutils/pm-utils/install index c5b626e3ab..4bc20930d3 100755 --- a/packages/sysutils/pm-utils/install +++ b/packages/sysutils/pm-utils/install @@ -3,6 +3,10 @@ . config/options $SCRIPTS/install grep +$SCRIPTS/install dmidecode +$SCRIPTS/install kbd + +PKG_DIR=`find $PACKAGES -type d -name $1` mkdir -p $INSTALL/etc/pm/config.d mkdir -p $INSTALL/etc/pm/power.d @@ -23,19 +27,25 @@ mkdir -p $INSTALL/usr/lib/pm-utils/ cp -P $PKG_BUILD/pm/$file $INSTALL/usr/lib/pm-utils done +mkdir -p $INSTALL/usr/lib/pm-utils/video-quirks/ + cp $PKG_DIR/quirks/*.quirkdb $INSTALL/usr/lib/pm-utils/video-quirks/ + mkdir -p $INSTALL/usr/lib/pm-utils/module.d - for file in kernel tuxonice uswsusp; do +# tuxonice + for file in kernel uswsusp; do cp -P $PKG_BUILD/pm/module.d/$file $INSTALL/usr/lib/pm-utils/module.d done mkdir -p $INSTALL/usr/lib/pm-utils/power.d - for file in sched-powersave; do - cp -P $PKG_BUILD/pm/power.d/$file $INSTALL/usr/lib/pm-utils/power.d - chmod +x $INSTALL/usr/lib/pm-utils/power.d/$file - done +# disabled, because not needed +# for file in sched-powersave; do +# cp -P $PKG_BUILD/pm/power.d/$file $INSTALL/usr/lib/pm-utils/power.d +# chmod +x $INSTALL/usr/lib/pm-utils/power.d/$file +# done mkdir -p $INSTALL/usr/lib/pm-utils/sleep.d - for file in 00logging 00powersave 01grub 49bluetooth 55NetworkManager 75modules 90clock 94cpufreq 95led 98video-quirk-db-handler 99video; do +# 01grub 49bluetooth 55NetworkManager 90clock 95led + for file in 00logging 00powersave 75modules 94cpufreq 98video-quirk-db-handler 99video; do cp -P $PKG_BUILD/pm/sleep.d/$file $INSTALL/usr/lib/pm-utils/sleep.d chmod +x $INSTALL/usr/lib/pm-utils/sleep.d/$file done diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-acer.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-acer.quirkdb new file mode 100644 index 0000000000..f42701212c --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-acer.quirkdb @@ -0,0 +1,158 @@ +# + match system.hardware.vendor regex_ncase ^Acer + match system.hardware.product regex ^TravelMate + match system.hardware.product regex C300 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex 2350|2410|2420|2490|3220|4000|4650|5320 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex 3000|4100 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex 2300|2310|3010|3020|6291 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex 3260 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + addquirk --quirk-pci-save + endmatch + match system.hardware.product regex 7520|8000 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex C100|6460 + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex C200|2450|4400|6492 + addquirk --quirk-none + endmatch + # + match system.hardware.product regex 4000 + match system.hardware.primary_video.product numeric_compare_eq 20048 + match system.hardware.primary_video.vendor numeric_compare_eq 4098 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + addquirk --quirk-dpms-on + endmatch + endmatch + endmatch + # + match system.hardware.product regex ^(TravelMate 240|TravelMate 250|TravelMate 650)$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^TravelMate 380$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.product regex ^(TravelMate 630|TravelMate 230)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^TravelMate 660$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^TravelMate 800$ + addquirk --quirk-vbe-post + endmatch + endmatch + match system.hardware.product regex ^Aspire + match system.hardware.product regex 5050 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex 1670|3610|3620|3690|5630 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex 5610 + # + match system.hardware.product regex 5610Z + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex_inverse 5610Z + addquirk --quirk-vbe-post + endmatch + endmatch + match system.hardware.product regex 5000|5020|5500 + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex 1640 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex 1500|3000 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex 1520|1650|5100|5110|5570|5920 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex 1690|1694 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex 1350$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex 2010|2920|3100|4520|5500Z|5580|5920G + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^Extensa + match system.hardware.product regex 6220 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex 2900|3000|4150|5620 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex 5220 + addquirk --quirk-s3-bios + addquirk --quirk-vbe-post + endmatch + endmatch + match system.hardware.product regex ^Ferrari + match system.hardware.product regex 4000 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex 1000 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.product regex 5000 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex ^Xspire + match system.hardware.product regex 1650 + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^AcerPower + match system.hardware.product regex 2000 + addquirk --quirk-none + endmatch + endmatch + # + match system.hardware.product regex ^(AOA110|AOA150) + addquirk --quirk-none + endmatch + endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-apple.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-apple.quirkdb new file mode 100644 index 0000000000..e33bdf8a64 --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-apple.quirkdb @@ -0,0 +1,25 @@ +# + match system.hardware.vendor regex ^Apple + match system.hardware.product regex ^MacBook2,1$ + match system.hardware.vendor regex ^Apple Inc\. + match system.hardware.version regex ^1\.0$ + # + addquirk --quirk-none + endmatch + endmatch + match system.hardware.vendor regex Computer, Inc\. + addquirk --quirk-vbe-post + endmatch + endmatch + match system.hardware.product regex ^(MacBook1,1|MacBook3,1)$ + # + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^MacBookPro1,1$ + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex ^MacBookPro2,2$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-asus.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-asus.quirkdb new file mode 100644 index 0000000000..7378a0063c --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-asus.quirkdb @@ -0,0 +1,114 @@ +# + match system.hardware.vendor regex ^ASUS + match system.hardware.product regex ^(U5F |M2000E|F2J ) + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex ^(K8N-E-Deluxe|L2000D|M6Ne|M51Sr |U6S|A8N) + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.product regex ^(M6VA|M6N |M5N|M7A|S6F|S5N |W3A|W5A |M2N |A2D |F3F |V6V|A8He|A6Kt |F3JC |F3Sc) + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^Z35FM + addquirk --quirk-s3-bios + addquirk --quirk-pci-save + endmatch + match system.hardware.product regex ^(A6M|Z84F) + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex ^W7J + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^(L3000D|M3N |U3S |X51RL ) + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^F3Ka + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex ^V1J + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + addquirk --quirk-no-fb + endmatch + # + match system.hardware.product regex ^(A6J |A6U|A3E|F3JP) + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + # + match system.hardware.product regex ^(701|900)$ + addquirk --quirk-s3-bios + addquirk --quirk-dpms-on + endmatch + match system.hardware.product regex ^901$ + addquirk --quirk-vbe-post + endmatch + # + match system.hardware.product regex ^(A2H/L|A6Km|A6JC |A6K |A6T|A6G|A6VA|A8JS |F3Sg|F3T|F9E |G1S|K8V-MX|1000H|F2JE) + addquirk --quirk-none + endmatch + endmatch +# + match system.hardware.vendor regex ^ERGOUK + match system.hardware.product regex ^M2N + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch +# + match system.hardware.vendor regex ^System manufacturer$ + match system.hardware.product regex ^P5Q DELUXE$ + match system.firmware.version regex ^System Version + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.version regex ^P5KR + match system.hardware.product regex ^System Version + addquirk --quirk-none + endmatch + endmatch + endmatch +# + match system.board.product regex ^P5LD2 + addquirk --quirk-s3-bios + endmatch +# + match system.firmware.version regex ^ASUS A7V600 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +# + match system.firmware.version regex ^(ASUS M2N32-SLI DELUXE ACPI BIOS Revision 1201|ASUS M2N32-SLI DELUXE ACPI BIOS Revision 1101|ASUS M2A-VM HDMI ACPI BIOS Revision 1603|ASUS A7V8X-X ACPI BIOS Revision) + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.firmware.version regex ^ASUS M2A-VM ACPI BIOS Revision + match system.firmware.version regex 1101 + addquirk --quirk-s3-bios + addquirk --quirk-vbemode-restore + endmatch + match system.firmware.version regex_inverse 1101 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.firmware.version regex ^ASUS P4B266 ACPI BIOS Revision + match system.firmware.version regex 1010 + match system.hardware.primary_video.vendor numeric_compare_eq 0x1002 + match system.hardware.primary_video.product numeric_compare_eq 0x4966 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + endmatch + endmatch +# + match system.firmware.version regex ^(ASUS M2N-E ACPI BIOS Revision|ASUS Striker ACPI BIOS Revision|ASUS A7V ACPI BIOS Revision) + addquirk --quirk-none + endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-dell.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-dell.quirkdb new file mode 100644 index 0000000000..7402716148 --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-dell.quirkdb @@ -0,0 +1,169 @@ +# + match system.hardware.vendor regex ^Dell + # + match system.hardware.product regex ^Latitude + match system.hardware.product regex C500 + addquirk --quirk-dpms-suspend + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex C600 + addquirk --quirk-radeon-off + endmatch + match system.hardware.product regex C800 + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex X300|D820 + # + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex CPx J800GT|D400|D410|D420|D430|D520|D530|C610|D620|D830 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex C400|C840|D500|D505|D800|X200 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex D600|D610 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex D630 + match system.firmware.version compare_lt A12 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.firmware.version compare_ge A12 + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex X1$ + addquirk --quirk-vbe-post + endmatch + # + match system.hardware.product regex CPx J650GT|LS |D810 + addquirk --quirk-none + endmatch + endmatch + # + match system.hardware.product regex ^Inspiron + match system.hardware.product regex 1501|8600 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex 9300 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex 510m + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex 5100 + match system.firmware.version regex ^Revision A0$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-pci-save + endmatch + match system.firmware.version regex_inverse Revision A0 + addquirk --quirk-no-fb + endmatch + endmatch + match system.hardware.product regex 5150|8000|8500 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex 500m|600m|1100|1420|1525|2200|5160 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex 700m + # + addquirk --quirk-none + endmatch + # + match system.hardware.product regex 1011| 1150| 1520| 1720 + addquirk --quirk-none + endmatch + endmatch + # + match system.hardware.product regex ^Precision + match system.hardware.product regex M20 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex M6300 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex M60 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex M65 + addquirk --quirk-dpms-on + addquirk --quirk-vbe-post + endmatch + # + match system.hardware.product regex M90 |WorkStation 360| M4300 + addquirk --quirk-none + endmatch + endmatch + # + match system.hardware.product regex ^Dimension + match system.hardware.product regex 2400|3000|9100 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + # + match system.hardware.product regex ^Vostro + match system.hardware.product regex 1000 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex 1500 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex 1710 + addquirk --quirk-none + endmatch + endmatch + # + match system.hardware.product regex_ncase ^OptiPlex + match system.hardware.product regex GX520|GX260 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex 755 + addquirk --quirk-vbe-post + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex_ncase fx160 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex 170L|GX620 + addquirk --quirk-none + endmatch + endmatch + # + match system.hardware.product regex MXC061|MXC062 + addquirk --quirk-vbe-post + endmatch + # + match system.hardware.product regex XPS M1330|MM061 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + # + match system.hardware.product regex DM061 |DXP051|ME051|MP061|MXC051|MXG061|XPS M1530 + addquirk --quirk-none + endmatch + endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-fujitsu.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-fujitsu.quirkdb new file mode 100644 index 0000000000..4d78e7a203 --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-fujitsu.quirkdb @@ -0,0 +1,107 @@ +# + match system.hardware.vendor regex ^FUJITSU + match system.hardware.product regex_ncase amilo + match system.hardware.product regex A1667G Serie|Pa 1510|Li 1718|M1425 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex Pro V3205|Pro Edition V3405|Pro Edition V3505|Xi 1546|Si 1520|A7640|Pi 1505|A1645 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex A1650G + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^M Series$ + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex Amilo D Series|PRO V2030|PRO V2035|PRO V8010|Pi 1536|Pi 2515| L Series + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex AMILO M|A Series + match system.hardware.version regex -1 |0\.01 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + match system.firmware.version regex ^R01-S0N + addquirk --quirk-pci-save + endmatch + endmatch + endmatch + match system.hardware.product regex A7645 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex Pro V2040|Pro Series V3525 + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex_ncase lifebook + match system.hardware.product regex P7010D|S2110 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex E8410|T4010|S2210|P8010 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.product regex S7020 + addquirk --quirk-vbe-post + addquirk --quirk-reset-brightness + endmatch + match system.hardware.product regex E4010|P7120 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex E8020|S6410 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex T2010 + match system.hardware.product regex ^FUJITSU SIEMENS$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-pci-save + endmatch + match system.hardware.product regex ^FUJITSU$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.product regex T4210|P7230 + addquirk --quirk-pci-save + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex B Series|T Series|S7010|S7110|E8110|T301|T3010 + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^SCENIC + match system.hardware.product regex N300/N600|W300/W600|P / SCENICO P + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex W$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex ^(ESPRIMO P|ESPRIMO Mobile M9400|ESPRIMO Mobile D9500) + addquirk --quirk-none + endmatch + match system.hardware.product regex ^Stylistic ST5000$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^P6VAP-AP$ + addquirk --quirk-none + endmatch + endmatch +# + match system.hardware.vendor regex ^FUJITSO + match system.hardware.product regex ^FMVLT70R$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + addquirk --quirk-pci-save + endmatch + endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-hp.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-hp.quirkdb new file mode 100644 index 0000000000..392ff8ff81 --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-hp.quirkdb @@ -0,0 +1,309 @@ +# +# + match system.hardware.vendor regex ^Compaq + # + match system.hardware.product regex ^Armada + match system.hardware.product regex E500 | M70 | M700 + addquirk --quirk-none + endmatch + # + match system.hardware.product regex + match system.firmware.version regex ^1\.35$ + addquirk --quirk-none + endmatch + endmatch + endmatch + match system.hardware.product regex ^Evo + match system.hardware.product regex N600c + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex N800w + addquirk --quirk-vbe-post + # + match system.hardware.version regex ^F\.05$ + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.version regex_inverse F\.05 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex D510 USDT| N400c + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^Presario + match system.hardware.product regex 2701EA + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex V3000 \(EZ674UA#|V3700 Notebook PC + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex X1000 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex V2000 + addquirk --quirk-dpms-on + endmatch + match system.hardware.product regex V3000 \(EZ755UA#|V5000 \(ET826UA#|2100 \(DP835E\)|F500 \(GF596UA#|2200 \(PR309UA#|C700 \(GV681LA# + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^N620c  + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.vendor regex ^Hewlett Packard$ + match system.hardware.version regex ^HP OmniBook XE3 GF + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + endmatch + match system.hardware.vendor regex ^Hewlett-Packard + match system.hardware.product regex V2000 \(EP381UA#|X1000 \(DK454AV\)| 6715s|6820s + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex 8510w + match system.hardware.primary_video.vendor numeric_compare_eq 0x1002 + addquirk --quirk-s3-bios + endmatch + endmatch + match system.hardware.product regex HP OmniBook XT1000 + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex V3000 \(RL377PA#|EW434AVABA|R3000|R4100|nc6000 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex nx6125|nc6230|nx8220 + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex OmniBook XE3 G|R3200|nx5000|nx7000|nc6120|nx6325|2510p + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.version regex ^HP OmniBook 6100 EB$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.product regex nc2400|nx6110|nc6120|nc6320|nx7300|6720s|2710p|8510p|PY507ET#|6715b + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex 4410s + # + match system.hardware.primary_video.vendor numeric_compare_eq 0x1002 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex M2000 \(EQ547PA + addquirk --quirk-s3-bios + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex tc4400|nc4400|tc4200|nx6120|nc4200|HP 530 Notebook PC + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex HP Compaq nc6400 + match system.hardware.version regex ^68YCU + match system.hardware.product regex \(EH522AV\)|\(EY582ES|\(RH560EA + addquirk --quirk-vbemode-restore + addquirk --quirk-vbe-post + endmatch + endmatch + endmatch + match system.hardware.product regex nx 7010 + addquirk --quirk-s3-bios + match system.hardware.product regex DU394T# + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.product regex nx7400 + addquirk --quirk-vbe-post + match system.firmware.version regex_inverse 68YGU + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex HP Compaq dc5800 Small Form Factor|HP d330 uT| nw9440|nw8440 + addquirk --quirk-none + endmatch + match system.hardware.product regex HP Compaq 2133|HP 2133 + match system.firmware.version regex 68VGU + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + # + match system.hardware.product regex 6510b + match system.hardware.product regex KE134EA + addquirk --quirk-none + endmatch + match system.hardware.product regex_inverse KE134EA + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + endmatch + match system.hardware.product regex 6710b + match system.hardware.product regex KE123EA + addquirk --quirk-none + endmatch + match system.hardware.product regex KE124EA + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex 6710s + match system.firmware.version regex 68DDU + match system.hardware.product regex GC014ET + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex_inverse GC014ET + addquirk --quirk-vbe-post + addquirk --quirk-dpms-on + endmatch + endmatch + endmatch + match system.hardware.product regex 6715b + match system.hardware.product regex GB835EA|RK156AV + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex GB834EA + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex RM174UT + addquirk --quirk-s3-bios + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex 6910p + match system.firmware.version regex 68MCD + match system.hardware.product regex GB951EA + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^HP Compaq 6910p$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + match system.firmware.version regex_inverse 68MCD + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex nc4400 + match system.firmware.version regex ^68YHV + addquirk --quirk-vbe-post + match system.firmware.version regex F\.08 + addquirk --quirk-vbestate-restore + endmatch + match system.firmware.version regex_inverse F\.08 + addquirk --quirk-vbemode-restore + endmatch + endmatch + endmatch + match system.hardware.product regex nx6310 + match system.firmware.version regex ^68YDU + addquirk --quirk-none + endmatch + match system.firmware.version regex_inverse 68YDU + addquirk --quirk-vbe-post + endmatch + endmatch + match system.hardware.product regex_ncase Pavilion + match system.hardware.product regex dv4000 \(ES973EA# + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex dv4000 \(EB911EA#| dv2600| dv6500 + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex dv4000 \(PX306UA#| dv6700 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex zd8000 \(EL030EA# + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex ze2000 + match system.hardware.product regex \(EK791EA# + addquirk --quirk-none + endmatch + match system.hardware.product regex_inverse \(EK791EA# + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.product regex zt3300 + match system.firmware.version regex 68BAL + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex PF083UA# + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex dv6000 + match system.hardware.version regex \(GA378UA#|\(GH907EA# + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.version regex \(EW434AV#|\(RP153UA# + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.version regex \(EY798AV#|\(GF688EA|\(RM469EA|\(RP980EA# + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^HP Pavilion Notebook PC$ + match system.hardware.version regex ^HP Pavilion Notebook$ + match system.firmware.vendor regex ^Insyde Software$ + # + match system.firmware.version regex ^ IC\.M1\.04$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + addquirk --quirk-vbemode-restore + endmatch + # + match system.firmware.version regex ^ IC\.M1\.02$ + addquirk --quirk-none + endmatch + endmatch + endmatch + endmatch + match system.hardware.product regex 8710p|dv2000|dv2500|tx1000|dv5000 \(EZ535UA#|HP d530 SFF|ze4900| dv9700 + addquirk --quirk-none + endmatch + endmatch + endmatch +# + match system.hardware.vendor regex ^HP Pavilion + match system.hardware.product regex M7330N + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^(D7223K-ABA A650E|EJ192AA-ABS t3250\.se|EP198AA-UUZ t3335\.ch|ES061AA-ABD t3320|PC098A-ABA M1070N)$ + addquirk --quirk-none + endmatch + endmatch + match system.hardware.vendor regex ^HP-Pavilion + match system.hardware.product regex RZ418AA-ABH s3020 + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^RP829AV-ABA d4790y$ + addquirk --quirk-none + endmatch + endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-ibm.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-ibm.quirkdb new file mode 100644 index 0000000000..a125b93e28 --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-ibm.quirkdb @@ -0,0 +1,120 @@ +# + match system.hardware.vendor regex ^IBM$ + match system.hardware.version regex ^ThinkPad R50e$ + addquirk --quirk-save-pci + addquirk --quirk-dpms-on + endmatch + match system.hardware.version regex ^ThinkPad R51$ + addquirk --quirk-none + endmatch + match system.hardware.version regex ^ThinkPad R51e$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.product regex ^2645 + match system.firmware.version regex ^INET17WW$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.firmware.version regex_inverse INET17WW + addquirk --quirk-vbestate-restore + endmatch + endmatch + # + match system.hardware.product regex ^2652 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + # + addquirk --quirk-dpms-suspend + endmatch + # + match system.hardware.product regex ^(2366|2367|2653) + addquirk --quirk-radeon-off + endmatch + # + match system.hardware.product regex ^(2662|2672|2673) + addquirk --quirk-radeon-off + match system.hardware.version regex_inverse X31 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + # + match system.hardware.product regex ^(2672|2673|2884|2885|2890|2891) + match system.hardware.version regex X31 + addquirk --quirk-dpms-suspend + addquirk --quirk-radeon-off + endmatch + match system.hardware.version regex X32 + addquirk --quirk-dpms-suspend + endmatch + endmatch + # + match system.hardware.product regex ^2647 + addquirk --quirk-vbe-post + endmatch + # + match system.hardware.product regex ^(1832|1860|1869|2371|2373|2374|2376|2382|2386|2511|2513|2525|2526|2529|2530) + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.product regex ^(1846|1847|2886) + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + # + match system.hardware.version regex ^ThinkPad T41$ + addquirk --quirk-s3-bios + endmatch + # + match system.hardware.product regex ^(2378|2379) + match system.hardware.version regex ^ThinkPad T42 + addquirk --quirk-s3-bios + endmatch + endmatch + # + match system.hardware.version regex ^ThinkPad T43$ + # + match system.hardware.primary_video.vendor numeric_compare_eq 0x1002 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + # + match system.hardware.primary_video.vendor numeric_compare_eq 0x8086 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + # + match system.hardware.product regex ^2388 + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.product regex ^(2628|2629|2658|2681|2722) + addquirk --quirk-none + endmatch + # + match system.hardware.version regex ^ThinkPad X40$ + match system.firmware.version regex ^1UETD2WW + # + addquirk --quirk-none + endmatch + endmatch + endmatch + match system.hardware.version regex ^ThinkPad T40 $ + match system.firmware.version regex ^1RETDRWW + addquirk --quirk-none + endmatch + endmatch +endmatch +match system.hardware.vendor regex ^IBM CORPORATION$ + match system.hardware.product regex ^(4800723|4800743|4800783|4800C43)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-lenovo.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-lenovo.quirkdb new file mode 100644 index 0000000000..ffa794ae0c --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-lenovo.quirkdb @@ -0,0 +1,100 @@ +# +match system.hardware.vendor regex ^LENOVO$ +# +# +# + match system.hardware.product regex ^(1702|1704|1706|1709|2007|2478|2479|4108|4141|4143|6088|6363|6364|6365|6378|6379|6480|6458|6463|6464|6465|6466|6467|6468|6471|6476|6477|6478|7642|7643|7644|7645|7646|7647|7648|7649|7650|7657|7658|7659|7660|7661|7666|7667|7668|7673|7732|7733|7734|7735|7736|7737|7738|7762|7763|7764|7767|7768|7669|7670|7671|7673|7674|7675|7676|7678|7679|8808|8895|8896|8897|8898|8899|8900|8919|8930|8932|8933|8934|8935|8936|8937|8938|8939|8942|8943|8944|8945|8946|8947|8948|9452) + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^(63664DU|1705CTO) + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex ^6457 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch +# + match system.hardware.version regex_ncase ^ThinkPad R60 + addquirk --quirk-s3-bios + # + match system.hardware.product regex ^0657 + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex_inverse 0657 + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.version regex ^ThinkPad + # + match system.hardware.version regex T60$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.version regex T60p|Z61m|Z61t|Z60m|Z61p|R61e + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.version regex W500$ + addquirk --quirk-vbe-post + endmatch + endmatch +# + match system.hardware.product regex ^7663 + addquirk --quirk-s3-mode + endmatch +# + match system.hardware.product regex ^(6460|6465) + addquirk --quirk-s3-bios + addquirk --quirk-vbemode-restore + endmatch +# + match system.hardware.product regex ^2242CTO$ + match system.hardware.version regex ^ThinkPad T500$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + endmatch +# + match system.hardware.product regex ^(6459|7664|8918) + addquirk --quirk-none + endmatch +# + match system.hardware.version regex_ncase ^3000 C100 + match system.hardware.product regex ^0761 + addquirk --quirk-none + endmatch + endmatch + match system.hardware.version regex_ncase ^3000 N100 + match system.hardware.product regex ^(068928U|07686VG|076831G|076835U|0768BYG) + addquirk --quirk-none + endmatch + match system.hardware.product regex ^07687MM + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^076804U$ + addquirk --quirk-s3-bios + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.version regex_ncase ^3000 N200 + match system.hardware.product regex ^(0769BBG|0769AC6)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^(0769B9G|0769BEG|0769AH9)$ + addquirk --quirk-none + endmatch + endmatch + match system.hardware.version regex ^LENOVO3000 V100$ + match system.hardware.product regex ^0763 + addquirk --quirk-none + endmatch + endmatch + match system.hardware.product regex ^Soleil E660P + addquirk --quirk-none + endmatch +endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-misc.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-misc.quirkdb new file mode 100644 index 0000000000..26cda34887 --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-misc.quirkdb @@ -0,0 +1,389 @@ +# +match system.hardware.vendor regex ^AIRIS$ + match system.hardware.version regex ^VT6413A$ + addquirk --quirk-s3-bios + endmatch +endmatch +match system.hardware.vendor regex ^AnabelleB$ +# + match system.hardware.version regex ^Claro TW7M$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^COMPAL + match system.hardware.product regex HEL80C|HEL80I|HEL81I + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex DIXONSXP + match system.hardware.product regex To be filled by O\.E\.M\. + match system.firmware.version regex ^Ver\.001$ + addquirk --quirk-none + endmatch + endmatch +endmatch +match system.hardware.vendor regex ERGOUK + match system.hardware.product regex M2N + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^JVC$ + match system.hardware.product regex ^J2N $ + addquirk --quirk-vbestate-restore + endmatch +endmatch +match system.hardware.vendor regex ^LG + match system.hardware.product regex ^(M1-3DGBG|W1-JDGBG|LM50-DGHE|LW75-SGGV1)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^R500-U\.CPCBG$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex MAXDATA + match system.hardware.product regex ^PRO600IW$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex Pro 6100X + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex IMPERIO4045A + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^Matsushita + match system.hardware.product regex ^CF-Y + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex CF-51E|CF-R3E|CF-R2C|CF-R6A|CF-R6M + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^CF-W4G + addquirk --quirk-none + endmatch +endmatch +# +match system.hardware.vendor regex ^VIA + match system.hardware.product regex ^VT8623-8235$ + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^K8N800$ + match system.firmware.version regex ^VT8204B $ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + endmatch + match system.hardware.product regex ^K8T400$ + match system.hardware.version regex ^VT8204B $ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch + match system.hardware.product regex ^(KT400-8235|KT400A-8235)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^AVERATEC$ + match system.hardware.product regex ^(3700 Series|1000 Series)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^3200$ + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^5500 Series$ + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^BenQ + match system.hardware.product regex ^Joybook R42$ + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex ^(Joybook R22|Joybook R23|JoyBook 7000)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^(Joybook S52|Joybook S32)$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch +endmatch +match system.hardware.vendor regex ^Elonex PLC + match system.hardware.product regex M5A + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^GERICOM + match system.hardware.product regex HUMMER + match system.firmware.version regex ^1\.03 $ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch + match system.hardware.product regex 259IA1 + addquirk --quirk-none + endmatch +# + match system.hardware.product regex ^Montara-GML $ + match system.hardware.version regex ^FAB-2$ + addquirk --quirk-none + endmatch + endmatch +endmatch +match system.hardware.vendor regex ^MTC + match system.hardware.product regex ^Montara-GML$ + addquirk --quirk-s3-bios + endmatch +endmatch +match system.hardware.vendor regex_ncase ^micro-star + match system.hardware.product regex ^(MS-1012|MS-1013)$ + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex ^(MS-1057|U-100)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^PR210$ + match system.hardware.version regex ^MS-1222X$ + addquirk --quirk-vbe-post + endmatch + endmatch + match system.hardware.product regex ^EX610$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^MS-1412$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex ^MS-1003$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^MSI + match system.hardware.product regex ^(MS-7350|MS-7207PV|MS-6417|MS-6702)$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^MiTAC$ +# + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode +endmatch +match system.hardware.vendor regex ^MEDION + match system.hardware.product regex WID2010 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex MS-6714 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^(MS-7012|M295M|WIM 2000 |WIM 2140)$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^NEC + match system.hardware.product regex B7 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^VC2$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^NEC Versa Premium$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex_ncase ^packard bell +# + match system.hardware.vendor regex NEC + match system.hardware.product regex ^00000000000000000000000$ + match system.hardware.version regex ^P820008416$ + addquirk --quirk-none + endmatch + match system.firmware.version regex ^A03 $ + addquirk --quirk-none + endmatch + endmatch + endmatch + match system.hardware.product regex ^EasyNote_SJ51$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^4MBOL + match system.hardware.product regex ^7521 + match system.hardware.version regex ^REV\. A0$ + addquirk --quirk-none + endmatch + endmatch +endmatch +match system.hardware.vendor regex ^CLEVO$ + match system.hardware.product regex ^D500P$ + addquirk --quirk-vbe-post + addquirk --quirk-no-fb + endmatch + match system.hardware.product regex ^M5X0JE$ + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex ^M720SR$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^TN120R$ + addquirk --quirk-none + endmatch +endmatch +# +match system.hardware.vendor regex ^VIA$ + match system.hardware.product regex ^K8N800$ + match system.hardware.version regex ^VT8204B$ + match system.firmware.version regex ^4\.06CJ15$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + endmatch + endmatch +endmatch +match system.hardware.vendor regex ^ECS$ + match system.hardware.product regex ^536$ + addquirk --quirk-vbe-post + addquirk --quirk-no-fb + endmatch +endmatch +match system.hardware.vendor regex ^Elitegroup$ + match system.hardware.product regex ^ECS G320$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch +endmatch +match system.hardware.vendor regex ^Gigabyte Technology + match system.hardware.product regex ^(945GCMX-S2|P35-DS4)$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^(945GZM-S2|945GCM-S2L)$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^Infomash$ + match system.hardware.product regex ^RoverBook$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch +endmatch +match system.hardware.vendor regex ^Gateway + match system.hardware.product regex MT6707 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^MT6920 + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex MX6922B + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^MaxSelect$ + match system.hardware.product regex ^Mission_A330$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch +endmatch +# +match system.hardware.vendor regex ^NOTEBOOK$ + match system.hardware.product regex ^SAM2000$ + match system.hardware.version regex ^0131$ + addquirk --quirk-none + endmatch + endmatch +# + match system.hardware.product regex ^MIM2080$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^NCA_GROUP_LTD$ + match system.hardware.product regex ^iRU_Notebook$ + match system.hardware.version regex ^0106$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + endmatch +endmatch +match system.hardware.vendor regex ^transtec AG + match system.hardware.product regex ^(MS-1057|MS-1034)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch +endmatch +match system.hardware.vendor regex ^To Be Filled By O\.E\.M\.$ + match system.hardware.product regex ^259IA1$ + match system.hardware.version regex ^To Be Filled By O\.E\.M\.$ + match system.firmware.version regex ^080010 $ + addquirk --quirk-s3-mode + endmatch + endmatch + endmatch + match system.hardware.product regex ^MS-7210$ + match system.hardware.version regex ^100$ + addquirk --quirk-none + endmatch + endmatch +endmatch +match system.hardware.vendor regex ^OEM$ +# + match system.hardware.product regex ^P53IN4$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^OQO$ + match system.hardware.product regex ^ZEPTO$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch +endmatch +match system.hardware.vendor regex ^SHARP$ + match system.hardware.product regex ^PC-AR10 + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^Shuttle Inc$ + match system.hardware.product regex ^SD11V10$ + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex ^SD30V10$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^SN41UV10$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^SN85V10$ + addquirk --quirk-none + endmatch +endmatch +match system.hardware.vendor regex ^ZEPTO$ + match system.hardware.product regex ^ZNOTE + match system.hardware.version regex ^3215W + addquirk --quirk-none + endmatch + endmatch +endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-samsung.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-samsung.quirkdb new file mode 100644 index 0000000000..0fee8fb81a --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-samsung.quirkdb @@ -0,0 +1,26 @@ +# +match system.hardware.vendor regex_ncase ^Samsung + match system.hardware.product regex ^(Q35/Q36|SM40S|SQ45S70S)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^(SQ30|SQ35S|SX50S)$ + addquirk --quirk-vbe-post + endmatch +# + match system.hardware.product regex ^(R40/R41|CoronaR|SX22S)$ + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex ^(SX20S|SENS V25|NX05S)$ + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex ^SQ10$ + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch +# + match system.hardware.product regex R50/R51|R55S|SR700 + addquirk --quirk-none + endmatch +endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-sony.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-sony.quirkdb new file mode 100644 index 0000000000..0ce980be7d --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-sony.quirkdb @@ -0,0 +1,54 @@ +# +match system.hardware.vendor regex ^Sony Corporation$ + match system.hardware.product regex ^VGN-FS115Z$ + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex VGN-FS730|PCG-FX405|VGN-C2S_G|VGN-B1XP|VGN-FE21B|VGN-B100B||VGN-B1VP + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex ^(VGN-FS115B|VGN-C140G|VGN-TX3XP_L|VGN-T250P|VGN-AR31S|PCV-RX612|VGN-FS485B|VGN-SZ61XN_C|VGN-TZ37|VGN-TZ170N|VGN-FS920|VGN-C240E|PCG-FX601|VGN-SR11M)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^VGN-NR120E$ + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex ^(VGN-TX5MN_W|PCG-TR2A\(UC\)|VGN-UX50)$ + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex PCG-FX340 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex PCG-FX802 + addquirk --quirk-vbestate-restore + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex PCG-Z1MP + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex PCG-Z1RMP|VGN-TX770P|VGN-FW11|VGN-TX670P|PCG-V505ECP + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex PCG-FX805 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex PCG-FX905 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + addquirk --quirk-dpms-on + endmatch +# +# + match system.hardware.product regex ^(VGN-TX3HP|VGN-B55G\(I\)|VGN-FE31M|VGN-FS215B|VGN-FS660_W|VGN-SZ5XN_C|VGN-TZ21XN_B|PCG-FR215E|VGN-SZ340P|VGN-FE11M|VGN-TZ91HS|PCG-Z505HSK\(UC\)|VGN-FZ39VN|VGN-A115B|VGN-FE890E|VGN-N320E|VGN-C2S_H|VGN-FS215M|VGN-Z90S)$ + addquirk --quirk-none + endmatch + match system.hardware.product regex VGN-TZ11|PCG-F430\(UC\)|PCG-GRT916Z|PCG-GRT995MP|PCG-GR7_K\(J\) + addquirk --quirk-none + endmatch +endmatch diff --git a/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-toshiba.quirkdb b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-toshiba.quirkdb new file mode 100644 index 0000000000..6922c6ddef --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/20-video-quirk-pm-toshiba.quirkdb @@ -0,0 +1,130 @@ +# +match system.hardware.vendor regex ^TOSHIBA$ +# + match system.hardware.product regex ^Satellite + match system.hardware.product regex M30X + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex Pro A120|M35X|P100|P200| P205D| A100| A105| A135| A200| A205| A210| L30| M105|M70|P30 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex A215 + addquirk --quirk-pci-save + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + # + match system.hardware.product regex ^Satellite Pro M30$ + addquirk --quirk-dpms-on + endmatch + # + match system.hardware.product regex ^(Satellite P10|Satellite A10)$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex P105 + addquirk --quirk-vbe-post + endmatch + match system.hardware.product regex L10|U305|M55 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex A300D + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex A30| 1130 + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex Pro 6100 + addquirk --quirk-dpms-on + endmatch + # + match system.hardware.product regex A80|Pro4600| U200|Pro U300| U300 + addquirk --quirk-none + endmatch + endmatch +# + match system.hardware.product regex ^TECRA + match system.hardware.product regex 8100|8200| M9 + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex ^T9000$ + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex M4 + addquirk --quirk-vbe-post + addquirk --quirk-vbemode-restore + endmatch + match system.hardware.product regex S2 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.product regex A8| A9| S3| S1 + addquirk --quirk-none + endmatch + endmatch +# + match system.hardware.product regex ^PORTEGE + match system.hardware.product regex R200|R205|R500 + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex M300 + addquirk --quirk-s3-mode + endmatch + match system.hardware.product regex A100 + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch + match system.hardware.product regex R100 + addquirk --quirk-vbestate-restore + endmatch + # + match system.hardware.product regex M400|4000 + addquirk --quirk-none + endmatch + endmatch +# + match system.hardware.product regex ^EQUIUM + match system.hardware.product regex A100$ + addquirk --quirk-s3-bios + addquirk --quirk-s3-mode + endmatch + endmatch +# + match system.hardware.product regex ^P3490$ + addquirk --quirk-vbestate-restore + endmatch +# + match system.hardware.product regex ^S1110$ + addquirk --quirk-s3-bios + endmatch + match system.hardware.product regex ^Portable PC$ + match system.hardware.version regex ^Version 1\.0$ + # + match system.firmware.version regex ^(Version 1\.60|Version 7\.80)$ + addquirk --quirk-s3-mode + endmatch + # + match system.firmware.version regex ^Version 1\.20$ + addquirk --quirk-none + endmatch + endmatch + endmatch + match system.hardware.product regex ^(P2000|P4000) + addquirk --quirk-vbe-post + addquirk --quirk-vbestate-restore + endmatch +# + match system.hardware.product regex Libretto L5/TNK + addquirk --quirk-none + endmatch + match system.hardware.product regex ^SP4600$ + match system.hardware.version regex ^Version 1\.0$ + addquirk --quirk-none + endmatch + endmatch +endmatch diff --git a/packages/sysutils/pm-utils/quirks/url b/packages/sysutils/pm-utils/quirks/url new file mode 100644 index 0000000000..f6f0f489db --- /dev/null +++ b/packages/sysutils/pm-utils/quirks/url @@ -0,0 +1 @@ +http://pm-utils.freedesktop.org/releases/pm-quirks-20100316.tar.gz \ No newline at end of file diff --git a/packages/sysutils/upower/install b/packages/sysutils/upower/install index 0d4fad0654..fede24d7b1 100755 --- a/packages/sysutils/upower/install +++ b/packages/sysutils/upower/install @@ -7,6 +7,10 @@ $SCRIPTS/install glib $SCRIPTS/install dbus $SCRIPTS/install dbus-glib $SCRIPTS/install polkit +$SCRIPTS/install pm-utils + +#mkdir -p $INSTALL/etc +# cp -P $PKG_BUILD/etc/UPower.conf $INSTALL/etc mkdir -p $INSTALL/etc/dbus-1/system.d cp -P $PKG_BUILD/src/org.freedesktop.UPower.conf $INSTALL/etc/dbus-1/system.d diff --git a/packages/x11/driver/xf86-input-evdev/config/10-x11-evdev.fdi b/packages/x11/driver/xf86-input-evdev/config/10-x11-evdev.fdi deleted file mode 100644 index a7fe8ccb42..0000000000 --- a/packages/x11/driver/xf86-input-evdev/config/10-x11-evdev.fdi +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - evdev - - - - - - evdev - - - - diff --git a/packages/x11/driver/xf86-input-evdev/install b/packages/x11/driver/xf86-input-evdev/install index feb114d0d6..08c12c682c 100755 --- a/packages/x11/driver/xf86-input-evdev/install +++ b/packages/x11/driver/xf86-input-evdev/install @@ -2,11 +2,5 @@ . config/options -PKG_DIR=`find $PACKAGES -type d -name $1` - mkdir -p $INSTALL/$XORG_PATH_MODULES/input cp -P $PKG_BUILD/src/.libs/evdev_drv.so $INSTALL/$XORG_PATH_MODULES/input - -mkdir -p $INSTALL/usr/share/hal/fdi/policy/20thirdparty - cp -P $PKG_DIR/config/10-x11-evdev.fdi \ - $INSTALL/usr/share/hal/fdi/policy/20thirdparty diff --git a/packages/x11/driver/xf86-input-synaptics/install b/packages/x11/driver/xf86-input-synaptics/install index 6cd60cdb6f..b70b8b3f4f 100755 --- a/packages/x11/driver/xf86-input-synaptics/install +++ b/packages/x11/driver/xf86-input-synaptics/install @@ -6,6 +6,3 @@ $SCRIPTS/install libXi mkdir -p $INSTALL/$XORG_PATH_MODULES/input cp -P $PKG_BUILD/src/.libs/synaptics_drv.so $INSTALL/$XORG_PATH_MODULES/input - -mkdir -p $INSTALL/usr/share/hal/fdi/policy/20thirdparty/ - cp -P $PKG_BUILD/fdi/*.fdi $INSTALL/usr/share/hal/fdi/policy/20thirdparty/ diff --git a/packages/x11/driver/xf86-input-wacom/config/11-wacom.conf b/packages/x11/driver/xf86-input-wacom/config/11-wacom.conf new file mode 100644 index 0000000000..dd486eef48 --- /dev/null +++ b/packages/x11/driver/xf86-input-wacom/config/11-wacom.conf @@ -0,0 +1,20 @@ +Section "InputClass" + Identifier "Wacom class" + MatchProduct "Wacom|WALTOP|WACOM" + Driver "wacom" +EndSection + +Section "InputClass" + Identifier "Wacom serial class" + MatchProduct "WACf|FUJ02e5|FUJ02e7" + Driver "wacom" + Option "ForceDevice" "ISDV4" +EndSection + +# N-Trig Duosense Electromagnetic Digitizer +Section "InputClass" + Identifier "Wacom N-Trig class" + MatchProduct "HID 1b96:0001" + MatchDevicePath "/dev/input/event*" + Driver "wacom" +EndSection diff --git a/packages/x11/driver/xf86-input-wacom/config/69-xorg-wacom.rules b/packages/x11/driver/xf86-input-wacom/config/69-xorg-wacom.rules new file mode 100644 index 0000000000..b7da7c1b1f --- /dev/null +++ b/packages/x11/driver/xf86-input-wacom/config/69-xorg-wacom.rules @@ -0,0 +1,2 @@ +ACTION=="add|change", SUBSYSTEM=="pnp", ATTR{id}=="WACf*", ENV{NAME}="Serial Wacom Tablet" +ACTION=="add|change", SUBSYSTEMS=="pnp", ATTRS{id}=="WACf*", ENV{x11_driver}="wacom", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1" diff --git a/packages/x11/driver/xf86-input-wacom/install b/packages/x11/driver/xf86-input-wacom/install index 04d2ac7e04..686dd7b685 100755 --- a/packages/x11/driver/xf86-input-wacom/install +++ b/packages/x11/driver/xf86-input-wacom/install @@ -2,11 +2,16 @@ . config/options +PKG_DIR=`find $PACKAGES -type d -name $1` + mkdir -p $INSTALL/$XORG_PATH_MODULES/input cp -P $PKG_BUILD/src/.libs/wacom_drv.so $INSTALL/$XORG_PATH_MODULES/input -mkdir -p $INSTALL/usr/share/hal/fdi/policy/20thirdparty/ - cp -P $PKG_BUILD/fdi/*.fdi $INSTALL/usr/share/hal/fdi/policy/20thirdparty/ +mkdir -p $INSTALL/usr/share/X11/xorg.conf.d + cp -P $PKG_DIR/config/*.conf $INSTALL/usr/share/X11/xorg.conf.d + +mkdir -p $INSTALL/lib/udev/rules.d + cp -P $PKG_DIR/config/*.rules $INSTALL/lib/udev/rules.d mkdir -p $INSTALL/usr/bin cp -P $PKG_BUILD/tools/xsetwacom $INSTALL/usr/bin diff --git a/packages/x11/lib/libXmu/build b/packages/x11/lib/libXmu/build index a1c27ea6a9..f5a91dac93 100755 --- a/packages/x11/lib/libXmu/build +++ b/packages/x11/lib/libXmu/build @@ -17,7 +17,6 @@ cd $PKG_BUILD --disable-static \ --enable-shared \ --with-gnu-ld \ - --enable-malloc0returnsnull \ make diff --git a/packages/x11/other/evilwm/build b/packages/x11/other/evilwm/build deleted file mode 100755 index bda8ff3a15..0000000000 --- a/packages/x11/other/evilwm/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -. config/options - -$SCRIPTS/build toolchain -$SCRIPTS/build libX11 -$SCRIPTS/build libXrandr -$SCRIPTS/build libXext - -cd $PKG_BUILD - -make CC=$TARGET_CC - diff --git a/packages/x11/other/evilwm/install b/packages/x11/other/evilwm/install deleted file mode 100755 index 083422cc35..0000000000 --- a/packages/x11/other/evilwm/install +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -. config/options - -$SCRIPTS/install libX11 -$SCRIPTS/install libXrandr -$SCRIPTS/install libXext - -PKG_DIR=`find $PACKAGES -type d -name $1` - -mkdir -p $INSTALL/usr/bin - cp -PR $PKG_BUILD/$1 $INSTALL/usr/bin - -# other usefull packages -$SCRIPTS/install xwd \ No newline at end of file diff --git a/packages/x11/other/evilwm/profile.d/evilwm.conf b/packages/x11/other/evilwm/profile.d/evilwm.conf deleted file mode 100644 index d3ab664706..0000000000 --- a/packages/x11/other/evilwm/profile.d/evilwm.conf +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Windowmanager environment variables. -# -# This file contains non-OpenELEC evironment variables as well as OpenELEC -# evironment variables that are not user defined. -################################################################################ - -# [-display display] [-term termprog] [-fn fontname] -# [-fg foreground] [-fc fixed] [-bg background] [-bw borderwidth] -# [-mask1 modifiers] [-mask2 modifiers] [-altmask modifiers] -# [-snap num] [-app name/class] [-g geometry] [-dock] -# [-v vdesk] [-s] [-nosoliddrag] [-V] - -if [ "$DEBUG" = "yes" ]; then - EVILWM_ARG="$EVILWM_ARG -fg red -bw 3" -else - EVILWM_ARG="$EVILWM_ARG -fg black -bw 0" -fi - -EVILWM_ARG="-fn fixed $EVILWM_ARG" - -WINDOWMANAGER="evilwm $EVILWM_ARG" - -export WINDOWMANAGER diff --git a/packages/x11/other/evilwm/url b/packages/x11/other/evilwm/url deleted file mode 100644 index 6ed55c91ce..0000000000 --- a/packages/x11/other/evilwm/url +++ /dev/null @@ -1 +0,0 @@ -http://www.6809.org.uk/evilwm/evilwm-1.1.0pre8.tar.gz \ No newline at end of file diff --git a/packages/x11/other/mrxvt/build b/packages/x11/other/mrxvt/build deleted file mode 100755 index ca0be43536..0000000000 --- a/packages/x11/other/mrxvt/build +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -. config/options - -$SCRIPTS/build toolchain -$SCRIPTS/build libX11 -$SCRIPTS/build libXrender - -cd $PKG_BUILD -ac_cv_func_setpgrp_void=no \ -./configure --host=$TARGET_NAME \ - --build=$HOST_NAME \ - --prefix=/usr \ - --sysconfdir=/etc \ - --disable-static \ - --enable-shared \ - --x-includes=$SYSROOT_PREFIX/usr/include \ - --x-libraries=$SYSROOT_PREFIX/usr/lib \ - --enable-minimal \ - --disable-frills \ - --enable-keepscrolling \ - --disable-selectionscrolling \ - --enable-mousewheel \ - --disable-mouseslipwheel \ - --enable-rxvt-scroll \ - --disable-half-shadow \ - --enable-lastlog \ - --enable-sessionmgr \ - --enable-linespace \ - --enable-24bits \ - --enable-256colors \ - --enable-cursor-blink \ - --enable-pointer-blank \ - --disable-text-shadow \ - --enable-menubar \ - --disable-transparency \ - --disable-fading \ - --disable-tinting \ - --enable-xrender \ - --disable-xpm \ - --disable-jpeg \ - --disable-png \ - --disable-xft \ - --enable-ttygid \ - --enable-backspace-key \ - --enable-delete-key \ - --disable-resources \ - --disable-swapscreen - -make - -$STRIP src/$1 diff --git a/packages/x11/other/mrxvt/install b/packages/x11/other/mrxvt/install deleted file mode 100755 index 6680b84377..0000000000 --- a/packages/x11/other/mrxvt/install +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -. config/options - -$SCRIPTS/install libX11 - -PKG_DIR=`find $PACKAGES -type d -name $1` - -mkdir -p $INSTALL/usr/bin - cp -P $PKG_DIR/scripts/$1-session $INSTALL/usr/bin - cp -P $PKG_BUILD/src/$1 $INSTALL/usr/bin - diff --git a/packages/x11/other/mrxvt/scripts/mrxvt-session b/packages/x11/other/mrxvt/scripts/mrxvt-session deleted file mode 100755 index 51e940fba2..0000000000 --- a/packages/x11/other/mrxvt/scripts/mrxvt-session +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -. /etc/profile - -# start Windowmanager by default - $WINDOWMANAGER -term mrxvt & - -# start terminal - mrxvt diff --git a/packages/x11/other/mrxvt/url b/packages/x11/other/mrxvt/url deleted file mode 100644 index f9c9d4d45c..0000000000 --- a/packages/x11/other/mrxvt/url +++ /dev/null @@ -1 +0,0 @@ -http://kent.dl.sourceforge.net/sourceforge/materm/mrxvt-0.5.4.tar.gz diff --git a/packages/x11/other/uxlaunch/build b/packages/x11/other/uxlaunch/build deleted file mode 100755 index c6c5b886d3..0000000000 --- a/packages/x11/other/uxlaunch/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -. config/options - -$SCRIPTS/build toolchain -$SCRIPTS/build glib -$SCRIPTS/build dbus -$SCRIPTS/build ConsoleKit - -cd $PKG_BUILD - -make CC=$TARGET_CC diff --git a/packages/x11/other/uxlaunch/init.d/60_uxlaunch b/packages/x11/other/uxlaunch/init.d/60_uxlaunch deleted file mode 100644 index 316fb8e125..0000000000 --- a/packages/x11/other/uxlaunch/init.d/60_uxlaunch +++ /dev/null @@ -1,44 +0,0 @@ -# starting uxlaunch -# -# runlevels: openelec - -progress "starting uxlaunch" - - UX_USER="root" - UX_TTY="1" - XORG_DEFAULT_CONF="/etc/X11/xorg.conf" - XORG_NVIDIA_CONF="/etc/X11/xorg-nvidia.conf" - XORG_USER_CONF="/storage/.config/xorg.conf" - - if [ "$START_MRXVT" = "yes" -a -f /usr/bin/mrxvt-session ]; then - UX_SESSION="/usr/bin/mrxvt-session" - else - UX_SESSION="/usr/bin/xbmc-session" - fi - - UX_ARG="-u $UX_USER -t $UX_TTY -s $UX_SESSION" - [ "$DEBUG" = "yes" ] && UX_ARG="$UX_ARG -v" - -progress "creating directories needed for Xorg" - - $IONICE mkdir -p /var/cache/xkb - $IONICE mkdir -p /var/lib - $IONICE mkdir -m 1777 -p /tmp/.ICE-unix - $IONICE chown root:root /tmp/.ICE-unix - - if lspci -n | grep 0300 | grep -q 10de; then - $IONICE ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so - $IONICE ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so - XORG_CONF="$XORG_NVIDIA_CONF" - else - $IONICE ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so - $IONICE ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so - XORG_CONF="$XORG_DEFAULT_CONF" - fi - - [ -f $XORG_USER_CONF ] && XORG_CONF="$XORG_USER_CONF" - UX_ARG="$UX_ARG -c $XORG_CONF" - -progress "starting xsession" - - uxlaunch $UX_ARG > /dev/null 2>&1 \ No newline at end of file diff --git a/packages/x11/other/uxlaunch/install b/packages/x11/other/uxlaunch/install deleted file mode 100755 index bf7a00fdf5..0000000000 --- a/packages/x11/other/uxlaunch/install +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -. config/options - -$SCRIPTS/install glib -$SCRIPTS/install dbus -$SCRIPTS/install ConsoleKit - -mkdir -p $INSTALL/usr/sbin - cp -P $PKG_BUILD/uxlaunch $INSTALL/usr/sbin diff --git a/packages/x11/other/uxlaunch/patches/uxlaunch-add_xconfig_option-0.1.diff b/packages/x11/other/uxlaunch/patches/uxlaunch-add_xconfig_option-0.1.diff deleted file mode 100644 index 95cabd1f74..0000000000 --- a/packages/x11/other/uxlaunch/patches/uxlaunch-add_xconfig_option-0.1.diff +++ /dev/null @@ -1,93 +0,0 @@ -diff -Naur uxlaunch-0.50/options.c uxlaunch-0.50.patch/options.c ---- uxlaunch-0.50/options.c 2010-04-07 20:32:53.000000000 +0200 -+++ uxlaunch-0.50.patch/options.c 2010-04-10 14:20:36.408482887 +0200 -@@ -27,6 +27,7 @@ - int tty = 2; - char session[256] = "/usr/bin/mutter --sm-disable"; - char username[256] = "meego"; -+char xconfig[256] = "/etc/X11/xorg.conf"; - - int verbose = 0; - -@@ -34,6 +35,7 @@ - { "user", 1, NULL, 'u' }, - { "tty", 1, NULL, 't' }, - { "session", 1, NULL, 's' }, -+ { "xconfig", 1, NULL, 'c' }, - { "help", 0, NULL, 'h' }, - { "verbose", 0, NULL, 'v' }, - { 0, 0, NULL, 0} -@@ -46,6 +48,7 @@ - printf(" -u, --user Start session as specific username\n"); - printf(" -t, --tty Start session on alternative tty number\n"); - printf(" -s, --session Start a non-default session\n"); -+ printf(" -c, --xconfig Xorg config file\n"); - printf(" -v, --verbose Display lots of output to the console\n"); - printf(" -h, --help Display this help message\n"); - } -@@ -126,13 +129,15 @@ - tty = atoi(val); - if (!strcmp(key, "session")) - strncpy(session, val, 256); -+ if (!strcmp(key, "xconfig")) -+ strncpy(xconfig, val, 256); - } - fclose(f); - } - - /* parse cmdline - overrides */ - while (1) { -- c = getopt_long(argc, argv, "u:t:s:hv", opts, &i); -+ c = getopt_long(argc, argv, "u:t:s:c:hv", opts, &i); - if (c == -1) - break; - -@@ -146,6 +151,9 @@ - case 's': - strncpy(session, optarg, 256); - break; -+ case 'c': -+ strncpy(xconfig, optarg, 256); -+ break; - case 'h': - usage(argv[0]); - exit (EXIT_SUCCESS); -@@ -171,7 +179,7 @@ - } - - lprintf("uxlaunch v%s started.", VERSION); -- lprintf("user \"%s\", tty #%d, session \"%s\"", username, tty, session); -+ lprintf("user \"%s\", tty #%d, session \"%s\", xconfig \"%s\"", username, tty, session, xconfig); - - pass = getpwnam(username); - if (!pass) -diff -Naur uxlaunch-0.50/uxlaunch.h uxlaunch-0.50.patch/uxlaunch.h ---- uxlaunch-0.50/uxlaunch.h 2010-04-07 20:32:53.000000000 +0200 -+++ uxlaunch-0.50.patch/uxlaunch.h 2010-04-10 14:18:29.327483352 +0200 -@@ -19,6 +19,7 @@ - extern int tty; - extern char session[]; - extern char username[]; -+extern char xconfig[]; - - extern int session_pid; - extern int xpid; -diff -Naur uxlaunch-0.50/xserver.c uxlaunch-0.50.patch/xserver.c ---- uxlaunch-0.50/xserver.c 2010-04-07 20:32:53.000000000 +0200 -+++ uxlaunch-0.50.patch/xserver.c 2010-04-10 14:18:29.334358167 +0200 -@@ -231,13 +231,13 @@ - execl(xserver, xserver, displayname, - "-nolisten", "tcp", "-dpi", "120", "-noreset", - "-auth", xauth_cookie_file, -- vt, NULL); -+ vt, "-config", xconfig, NULL); - } else { - execl(xserver, xserver, displayname, - "-nolisten", "tcp", "-dpi", "120", "-noreset", - "-auth", user_xauth_path, - "-logfile", xorg_log, -- vt, NULL); -+ vt, "-config", xconfig, NULL); - } - exit(0); - } diff --git a/packages/x11/other/uxlaunch/url b/packages/x11/other/uxlaunch/url deleted file mode 100644 index b4d84fd19d..0000000000 --- a/packages/x11/other/uxlaunch/url +++ /dev/null @@ -1 +0,0 @@ -http://sources.openelec.tv/svn/uxlaunch-0.50.tar.gz \ No newline at end of file diff --git a/packages/x11/xserver/xorg-server/build b/packages/x11/xserver/xorg-server/build index d247aaaccd..d00363f539 100755 --- a/packages/x11/xserver/xorg-server/build +++ b/packages/x11/xserver/xorg-server/build @@ -27,8 +27,8 @@ $SCRIPTS/build Mesa $SCRIPTS/build openssl $SCRIPTS/build freetype $SCRIPTS/build pixman -$SCRIPTS/build dbus -$SCRIPTS/build hal +$SCRIPTS/build fontsproto +$SCRIPTS/build udev if [ "$XINERAMA_SUPPORT" = "yes" ]; then $SCRIPTS/build libXinerama @@ -58,7 +58,6 @@ autoconf --enable-registry \ --disable-composite \ $XORG_XINERAMA \ - --enable-null-root-cursor \ --enable-mitshm \ --disable-xres \ --disable-record \ @@ -80,8 +79,9 @@ autoconf --enable-dbe \ --disable-xf86bigfont \ --enable-dpms \ - --enable-config-dbus \ - --enable-config-hal \ + --enable-config-udev \ + --disable-config-dbus \ + --disable-config-hal \ --enable-xfree86-utils \ --enable-xorg \ --disable-dmx \ @@ -92,7 +92,6 @@ autoconf --disable-xwin \ --disable-kdrive \ --disable-xephyr \ - --disable-xsdl \ --disable-xfake \ --enable-xfbdev \ --disable-install-setuid \ @@ -100,14 +99,15 @@ autoconf --with-int10=x86emu \ --disable-ipv6 \ --with-gnu-ld \ + --with-sha1=libcrypto \ --with-os-vendor="OpenELEC" \ --with-module-dir=$XORG_PATH_MODULES \ --with-xkb-path=$XORG_PATH_XKB \ --with-xkb-output=/var/cache/xkb \ --with-log-dir=/var/log \ --with-dri-driver-path=$XORG_PATH_DRI \ - --with-fontdir=$XORG_PATH_FONTS \ - --with-default-font-path="$XORG_PATH_FONTS/liberation,$XORG_PATH_FONTS/misc,built-ins" \ + --with-fontrootdir=$XORG_PATH_FONTS \ + --with-default-font-path="$XORG_PATH_FONTS/misc,built-ins" make diff --git a/packages/x11/xserver/xorg-server/init.d/15_xorg b/packages/x11/xserver/xorg-server/init.d/15_xorg new file mode 100644 index 0000000000..512c5e1bf1 --- /dev/null +++ b/packages/x11/xserver/xorg-server/init.d/15_xorg @@ -0,0 +1,43 @@ +# starting xorg +# +# runlevels: openelec + +. /etc/profile + + XORG_DEFAULT_CONF="/etc/X11/xorg.conf" + XORG_NVIDIA_CONF="/etc/X11/xorg-nvidia.conf" + XORG_USER_CONF="/storage/.config/xorg.conf" + XORG_ARGS="-s 0 -nr -noreset -allowMouseOpenFail -nocursor -nolisten tcp" + + [ "$DEBUG" = yes ] && XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6" + +( + progress "creating directories needed for Xorg" + + mkdir -p /var/cache/xkb + mkdir -p /var/lib + mkdir -m 1777 -p /tmp/.ICE-unix + chown root:root /tmp/.ICE-unix + + if lspci -n | grep 0300 | grep -q 10de; then + + ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so + ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so + XORG_ARGS="$XORG_ARGS -ignoreABI" + XORG_CONF="$XORG_NVIDIA_CONF" + + else + + ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so + ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so + XORG_CONF="$XORG_DEFAULT_CONF" + + fi + + [ -f $XORG_USER_CONF ] && XORG_CONF="$XORG_USER_CONF" + + progress "starting xorg" + + XORG_ARGS="$XORG_ARGS -config $XORG_CONF" + Xorg $DISPLAY vt01 $XORG_ARGS > /dev/null 2>&1 +)& \ No newline at end of file diff --git a/packages/x11/xserver/xorg-server/install b/packages/x11/xserver/xorg-server/install index 9b1c80a07b..db1d0c3b1c 100755 --- a/packages/x11/xserver/xorg-server/install +++ b/packages/x11/xserver/xorg-server/install @@ -12,8 +12,7 @@ $SCRIPTS/install libXfont $SCRIPTS/install libdrm $SCRIPTS/install Mesa $SCRIPTS/install pixman -$SCRIPTS/install dbus -$SCRIPTS/install hal +$SCRIPTS/install udev [ "$XINERAMA_SUPPORT" = "yes" ] && $SCRIPTS/install libXinerama @@ -53,18 +52,14 @@ mkdir -p $XORG_DST/multimedia mkdir -p $INSTALL/usr/lib/xorg cp -P $PKG_BUILD/dix/protocol.txt $INSTALL/usr/lib/xorg -mkdir -p $INSTALL/etc/dbus-1/system.d - cp -P $PKG_BUILD/config/xorg-server.conf $INSTALL/etc/dbus-1/system.d - -mkdir -p $INSTALL/usr/share/hal/fdi/policy/10osvendor/ - cp -P $PKG_BUILD/config/x11-input.fdi $INSTALL/usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi +mkdir -p $INSTALL/usr/share/X11/xorg.conf.d + cp -P $PKG_BUILD/config/10-evdev.conf $INSTALL/usr/share/X11/xorg.conf.d #Fonts $SCRIPTS/install encodings $SCRIPTS/install font-xfree86-type1 $SCRIPTS/install font-bitstream-type1 $SCRIPTS/install font-misc-misc - $SCRIPTS/install liberation-fonts #Server $SCRIPTS/install xkeyboard-config @@ -73,12 +68,11 @@ mkdir -p $INSTALL/usr/share/hal/fdi/policy/10osvendor/ #Drivers $SCRIPTS/install xf86-input-evdev $SCRIPTS/install xf86-input-synaptics -# $SCRIPTS/install xf86-input-wacom + $SCRIPTS/install xf86-input-wacom for drv in $XORG_DRIVERS; do $SCRIPTS/install xf86-video-$drv done -#Tools +# Tools $SCRIPTS/install pciutils - $SCRIPTS/install uxlaunch diff --git a/packages/x11/xserver/xorg-server/patches/03_fedora_glx_versioning.diff b/packages/x11/xserver/xorg-server/patches/03_fedora_glx_versioning.diff deleted file mode 100644 index c8a1c30954..0000000000 --- a/packages/x11/xserver/xorg-server/patches/03_fedora_glx_versioning.diff +++ /dev/null @@ -1,233 +0,0 @@ -From 3ef4be8129f78afd5566a9e5d0fb901449dcb771 Mon Sep 17 00:00:00 2001 -From: Ian Romanick -Date: Tue, 29 Sep 2009 16:43:43 -0700 -Subject: [PATCH] GLX: Enable GLX 1.4 on DRI2 - -this squashes 4 commits -(cherry picked from commit ad5c0d9efa47476ed5cf75c82265c73919e468b4) -(cherry picked from commit cb54cf1b3e8c4109541cfb698542c00f2473e731) -(cherry picked from commit 4c6bfa2c09ae2b0cffdf9211a6dfbcaefe0366b5) -(cherry picked from commit 9bf2ff4faf730913de3073f346646a8727be41d4) ---- - glx/glxcmds.c | 12 ++++++++---- - glx/glxdri2.c | 12 ++++++++++++ - glx/glxext.c | 8 +++++++- - glx/glxscreens.c | 15 ++++++++++++--- - glx/glxscreens.h | 11 +++++++++++ - glx/glxserver.h | 3 +++ - glx/indirect_texture_compression.c | 4 ++-- - include/protocol-versions.h | 2 +- - 8 files changed, 56 insertions(+), 11 deletions(-) - -diff --git a/glx/glxcmds.c b/glx/glxcmds.c -index b1061a8..ba4c123 100644 ---- a/glx/glxcmds.c -+++ b/glx/glxcmds.c -@@ -50,7 +50,6 @@ - #include "indirect_dispatch.h" - #include "indirect_table.h" - #include "indirect_util.h" --#include "protocol-versions.h" - - static int - validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) -@@ -739,8 +738,8 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc) - ** client if it wants to work with older clients; however, in this - ** implementation the server just returns its version number. - */ -- reply.majorVersion = SERVER_GLX_MAJOR_VERSION; -- reply.minorVersion = SERVER_GLX_MINOR_VERSION; -+ reply.majorVersion = glxMajorVersion; -+ reply.minorVersion = glxMinorVersion; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; -@@ -2360,6 +2359,7 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc) - char *buf; - __GLXscreen *pGlxScreen; - int err; -+ char ver_str[16]; - - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) - return err; -@@ -2369,7 +2369,11 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc) - ptr = pGlxScreen->GLXvendor; - break; - case GLX_VERSION: -- ptr = pGlxScreen->GLXversion; -+ /* Return to the server version rather than the screen version -+ * to prevent confusion when they do not match. -+ */ -+ snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion); -+ ptr = ver_str; - break; - case GLX_EXTENSIONS: - ptr = pGlxScreen->GLXextensions; -diff --git a/glx/glxdri2.c b/glx/glxdri2.c -index ed7fb4c..ed7dc80 100644 ---- a/glx/glxdri2.c -+++ b/glx/glxdri2.c -@@ -685,6 +685,18 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - screen->base.GLXextensions); - } - -+ /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled -+ * drivers support the required extensions for GLX 1.4. The extensions -+ * we're assuming are: -+ * -+ * - GLX_SGI_make_current_read (1.3) -+ * - GLX_SGIX_fbconfig (1.3) -+ * - GLX_SGIX_pbuffer (1.3) -+ * - GLX_ARB_multisample (1.4) -+ */ -+ screen->base.GLXmajor = 1; -+ screen->base.GLXminor = 4; -+ - screen->enterVT = pScrn->EnterVT; - pScrn->EnterVT = glxDRIEnterVT; - screen->leaveVT = pScrn->LeaveVT; -diff --git a/glx/glxext.c b/glx/glxext.c -index 19d70d4..9f9c0ed 100644 ---- a/glx/glxext.c -+++ b/glx/glxext.c -@@ -360,12 +360,18 @@ void GlxExtensionInit(void) - pScreen = screenInfo.screens[i]; - - for (p = __glXProviderStack; p != NULL; p = p->next) { -- if (p->screenProbe(pScreen) != NULL) { -+ __GLXscreen *glxScreen; -+ -+ glxScreen = p->screenProbe(pScreen); -+ if (glxScreen != NULL) { -+ if (glxScreen->GLXminor < glxMinorVersion) -+ glxMinorVersion = glxScreen->GLXminor; - LogMessage(X_INFO, - "GLX: Initialized %s GL provider for screen %d\n", - p->name, i); - break; - } -+ - } - - if (!p) -diff --git a/glx/glxscreens.c b/glx/glxscreens.c -index 7d29d31..674e2c6 100644 ---- a/glx/glxscreens.c -+++ b/glx/glxscreens.c -@@ -42,6 +42,7 @@ - #include "glxserver.h" - #include "glxutil.h" - #include "glxext.h" -+#include "protocol-versions.h" - - static int glxScreenPrivateKeyIndex; - static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex; -@@ -162,7 +163,8 @@ static const char GLServerExtensions[] = - ** supported across all screens in a multi-screen system. - */ - static char GLXServerVendorName[] = "SGI"; --static char GLXServerVersion[] = "1.2"; -+unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; -+unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; - static char GLXServerExtensions[] = - "GLX_ARB_multisample " - "GLX_EXT_visual_info " -@@ -378,9 +380,17 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) - pGlxScreen->pScreen = pScreen; - pGlxScreen->GLextensions = xstrdup(GLServerExtensions); - pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName); -- pGlxScreen->GLXversion = xstrdup(GLXServerVersion); - pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions); - -+ /* All GLX providers must support all of the functionality required for at -+ * least GLX 1.2. If the provider supports a higher version, the GLXminor -+ * version can be changed in the provider's screen-probe routine. For -+ * most providers, the screen-probe routine is the caller of this -+ * function. -+ */ -+ pGlxScreen->GLXmajor = 1; -+ pGlxScreen->GLXminor = 2; -+ - pGlxScreen->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = glxCloseScreen; - pGlxScreen->DestroyWindow = pScreen->DestroyWindow; -@@ -454,7 +464,6 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) - void __glXScreenDestroy(__GLXscreen *screen) - { - xfree(screen->GLXvendor); -- xfree(screen->GLXversion); - xfree(screen->GLXextensions); - xfree(screen->GLextensions); - } -diff --git a/glx/glxscreens.h b/glx/glxscreens.h -index 3c1bdd4..bff4363 100644 ---- a/glx/glxscreens.h -+++ b/glx/glxscreens.h -@@ -161,6 +161,17 @@ struct __GLXscreen { - char *GLXversion; - char *GLXextensions; - -+ /** -+ * \name GLX version supported by this screen. -+ * -+ * Since the GLX version advertised by the server is for the whole server, -+ * the GLX protocol code uses the minimum version supported on all screens. -+ */ -+ /*@{*/ -+ unsigned GLXmajor; -+ unsigned GLXminor; -+ /*@}*/ -+ - Bool (*CloseScreen)(int index, ScreenPtr pScreen); - Bool (*DestroyWindow)(WindowPtr pWindow); - }; -diff --git a/glx/glxserver.h b/glx/glxserver.h -index 4aa8c2e..80f1b28 100644 ---- a/glx/glxserver.h -+++ b/glx/glxserver.h -@@ -248,4 +248,7 @@ extern int __glXImageSize(GLenum format, GLenum type, - GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows, - GLint alignment); - -+extern unsigned glxMajorVersion; -+extern unsigned glxMinorVersion; -+ - #endif /* !__GLX_server_h__ */ -diff --git a/glx/indirect_texture_compression.c b/glx/indirect_texture_compression.c -index 25c6eb3..5f44d7b 100644 ---- a/glx/indirect_texture_compression.c -+++ b/glx/indirect_texture_compression.c -@@ -52,7 +52,7 @@ int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *p - const GLenum target = *(GLenum *)(pc + 0); - const GLint level = *(GLint *)(pc + 4); - GLint compsize = 0; -- char *answer, answerBuffer[200]; -+ char *answer = NULL, answerBuffer[200]; - - CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize)); - -@@ -92,7 +92,7 @@ int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyt - const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) ); - const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) ); - GLint compsize = 0; -- char *answer, answerBuffer[200]; -+ char *answer = NULL, answerBuffer[200]; - - CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize)); - -diff --git a/include/protocol-versions.h b/include/protocol-versions.h -index da9770c..d688c66 100644 ---- a/include/protocol-versions.h -+++ b/include/protocol-versions.h -@@ -61,7 +61,7 @@ - - /* GLX */ - #define SERVER_GLX_MAJOR_VERSION 1 --#define SERVER_GLX_MINOR_VERSION 2 -+#define SERVER_GLX_MINOR_VERSION 4 - - /* Xinerama */ - #define SERVER_PANORAMIX_MAJOR_VERSION 1 --- -1.6.5.rc2 - diff --git a/packages/x11/xserver/xorg-server/patches/04_fedora_glx14-swrast.diff b/packages/x11/xserver/xorg-server/patches/04_fedora_glx14-swrast.diff deleted file mode 100644 index 2c51802535..0000000000 --- a/packages/x11/xserver/xorg-server/patches/04_fedora_glx14-swrast.diff +++ /dev/null @@ -1,26 +0,0 @@ -From 25a0107768c9f25e8edc5e423ca8b1d0813f2d04 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Tue, 24 Nov 2009 13:38:46 -0500 -Subject: [PATCH] Enable GLX 1.4 for swrast - ---- - glx/glxdriswrast.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c -index 44f658f..20f9f90 100644 ---- a/glx/glxdriswrast.c -+++ b/glx/glxdriswrast.c -@@ -510,6 +510,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - - __glXScreenInit(&screen->base, pScreen); - -+ screen->base.GLXmajor = 1; -+ screen->base.GLXminor = 4; -+ - LogMessage(X_INFO, - "AIGLX: Loaded and initialized %s\n", filename); - --- -1.6.5.2 - diff --git a/packages/x11/xserver/xorg-server/patches/05_only_call_gamma_set_if_nonnull.diff b/packages/x11/xserver/xorg-server/patches/05_only_call_gamma_set_if_nonnull.diff deleted file mode 100644 index b1d00ba6d0..0000000000 --- a/packages/x11/xserver/xorg-server/patches/05_only_call_gamma_set_if_nonnull.diff +++ /dev/null @@ -1,25 +0,0 @@ -Bug#564203 - -From 8ca4233017e9f441303088e7054b6a7c4f171d80 Mon Sep 17 00:00:00 2001 -From: Michael Vogt -Date: Wed, 6 Jan 2010 14:40:34 +0100 -Subject: [PATCH] * hw/xfree86/modes/xf86Crtc.c: - - only call gamma_set if its non NULL - ---- - hw/xfree86/modes/xf86Crtc.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index d015c6a..573fe96 100644 ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -354,7 +354,7 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati - } - - /* Only upload when needed, to avoid unneeded delays. */ -- if (!crtc->active) -+ if (!crtc->active && crtc->funcs->gamma_set) - crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, - crtc->gamma_blue, crtc->gamma_size); - diff --git a/packages/x11/xserver/xorg-server/patches/06_dont_trap_access_to_timer_and_keyboard.diff b/packages/x11/xserver/xorg-server/patches/06_dont_trap_access_to_timer_and_keyboard.diff deleted file mode 100644 index 23d8dc79ad..0000000000 --- a/packages/x11/xserver/xorg-server/patches/06_dont_trap_access_to_timer_and_keyboard.diff +++ /dev/null @@ -1,22 +0,0 @@ -[PATCH] Do not trap access to timer and keyboard - -Some VESA BIOSes need to access to them. - -Signed-off-by: Samuel Thibault ---- - hw/xfree86/os-support/hurd/hurd_video.c | 2 -- - 1 files changed, 0 insertions(+), 2 deletions(-) - -diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c -index 4a99db3..e049ceb 100644 ---- a/hw/xfree86/os-support/hurd/hurd_video.c -+++ b/hw/xfree86/os-support/hurd/hurd_video.c -@@ -124,8 +124,6 @@ xf86EnableIO() - FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno)); - return FALSE; - } -- ioperm(0x40,4,0); /* trap access to the timer chip */ -- ioperm(0x60,4,0); /* trap access to the keyboard controller */ - return TRUE; - } - diff --git a/packages/x11/xserver/xorg-server/patches/11-Move-config_init-after-CreateWellKnownSockets-and-In.diff b/packages/x11/xserver/xorg-server/patches/11-Move-config_init-after-CreateWellKnownSockets-and-In.diff deleted file mode 100644 index 38d8d8dfdf..0000000000 --- a/packages/x11/xserver/xorg-server/patches/11-Move-config_init-after-CreateWellKnownSockets-and-In.diff +++ /dev/null @@ -1,34 +0,0 @@ -From 4ae407a5a308febf63de27a62f8c301c73b37d3e Mon Sep 17 00:00:00 2001 -From: Julien Cristau -Date: Tue, 6 Oct 2009 17:44:33 +0200 -Subject: [PATCH 1/5] Move config_init() after CreateWellKnownSockets() and InitCoreDevices() - -config_init() can now add devices directly instead of scheduling a -timer. - -Signed-off-by: Julien Cristau -Tested-by: Peter Hutterer ---- - dix/main.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -Index: xorg-server/dix/main.c -=================================================================== ---- xorg-server.orig/dix/main.c -+++ xorg-server/dix/main.c -@@ -168,7 +168,6 @@ - InitBlockAndWakeupHandlers(); - /* Perform any operating system dependent initializations you'd like */ - OsInit(); -- config_init(); - if(serverGeneration == 1) - { - CreateWellKnownSockets(); -@@ -256,6 +255,7 @@ - InitCoreDevices(); - InitInput(argc, argv); - InitAndStartDevices(); -+ config_init(); - - dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); - diff --git a/packages/x11/xserver/xorg-server/patches/16-xfree86-fix-build-with-xv-disabled.diff b/packages/x11/xserver/xorg-server/patches/16-xfree86-fix-build-with-xv-disabled.diff deleted file mode 100644 index 184301f913..0000000000 --- a/packages/x11/xserver/xorg-server/patches/16-xfree86-fix-build-with-xv-disabled.diff +++ /dev/null @@ -1,53 +0,0 @@ -From fe7575e929d65e8c798104ec2f72b879051694d3 Mon Sep 17 00:00:00 2001 -From: Julien Cristau -Date: Mon, 8 Feb 2010 02:04:33 +0100 -Subject: [PATCH] xfree86: fix build with xv disabled - ---- - hw/xfree86/modes/xf86Crtc.c | 2 ++ - hw/xfree86/modes/xf86Crtc.h | 2 ++ - 2 files changed, 4 insertions(+), 0 deletions(-) - -diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index 30b49af..62f8737 100644 ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -3009,6 +3009,7 @@ xf86_crtc_box_area(BoxPtr box) - return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); - } - -+#ifdef XV - /* - * Return the crtc covering 'box'. If two crtcs cover a portion of - * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc -@@ -3097,6 +3098,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, - - return ret; - } -+#endif - - xf86_crtc_notify_proc_ptr - xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new) -diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h -index 9baa956..2fb32c1 100644 ---- a/hw/xfree86/modes/xf86Crtc.h -+++ b/hw/xfree86/modes/xf86Crtc.h -@@ -908,6 +908,7 @@ xf86_hide_cursors (ScrnInfoPtr scrn); - extern _X_EXPORT void - xf86_cursors_fini (ScreenPtr screen); - -+#ifdef XV - /* - * For overlay video, compute the relevant CRTC and - * clip video to that. -@@ -926,6 +927,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, - RegionPtr reg, - INT32 width, - INT32 height); -+#endif - - extern _X_EXPORT xf86_crtc_notify_proc_ptr - xf86_wrap_crtc_notify (ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new); --- -1.6.6.1 - diff --git a/packages/x11/xserver/xorg-server/patches/001_fedora_extramodes.diff b/packages/x11/xserver/xorg-server/patches/20_extra_modelines_fromxorg.diff similarity index 100% rename from packages/x11/xserver/xorg-server/patches/001_fedora_extramodes.diff rename to packages/x11/xserver/xorg-server/patches/20_extra_modelines_fromxorg.diff diff --git a/packages/x11/xserver/xorg-server/patches/cache-xkbcomp-output-for-fast-start-up.diff b/packages/x11/xserver/xorg-server/patches/cache-xkbcomp-output-for-fast-start-up.diff new file mode 100644 index 0000000000..20ba82f0fd --- /dev/null +++ b/packages/x11/xserver/xorg-server/patches/cache-xkbcomp-output-for-fast-start-up.diff @@ -0,0 +1,358 @@ +From d2d3bcc9e23b9a4bea9f67a06cd23aa3ce7f4b59 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Yan Li +Date: Wed, 10 Mar 2010 14:06:17 +0800 +Subject: [PATCH] XKB: cache xkbcomp output for fast start-up v6 for 1.7.99.901 + +xkbcomp outputs will be cached in files with hashed keymap as +names. This saves boot time for around 1s on commodity netbooks. + +v6: rebased to v1.7.99.901 + +v5: now using a much bigger xkbKeyMapBuf (100k) since the XKB to be + complied may be very large (as seen with + gnome-keyboard-properties), rebased to v1.6.1 + +Signed-off-by: Yan Li +--- + configure.ac | 6 +- + xkb/README.compiled | 8 +- + xkb/ddxLoad.c | 187 +++++++++++++++++++++++++++++++++++++++++---------- + 3 files changed, 159 insertions(+), 42 deletions(-) + +diff --git a/configure.ac b/configure.ac +index de252f3..54a0327 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -527,9 +527,9 @@ AC_MSG_RESULT([$FONTPATH]) + AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), + [ XKBPATH="$withval" ], + [ XKBPATH="${datadir}/X11/xkb" ]) +-AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), ++AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]), + [ XKBOUTPUT="$withval" ], +- [ XKBOUTPUT="compiled" ]) ++ [ XKBOUTPUT="${localstatedir}/cache/xkb" ]) + AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES], + [Keyboard ruleset (default: base/evdev)]), + [ XKB_DFLT_RULES="$withval" ], +@@ -1148,7 +1148,7 @@ AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir]) + dnl Make sure XKM_OUTPUT_DIR is an absolute path + XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` + if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then +- XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" ++ AC_MSG_ERROR([xkb-output must be an absolute path.]) + fi + + dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed +diff --git a/xkb/README.compiled b/xkb/README.compiled +index 71caa2f..a4a2ae0 100644 +--- a/xkb/README.compiled ++++ b/xkb/README.compiled +@@ -4,10 +4,10 @@ current keymap and/or any scratch keymaps used by clients. The X server + or some other tool might destroy or replace the files in this directory, + so it is not a safe place to store compiled keymaps for long periods of + time. The default keymap for any server is usually stored in: +- X-default.xkm +-where is the display number of the server in question, which makes +-it possible for several servers *on the same host* to share the same +-directory. ++ server-.xkm ++ ++where is the SHA1 hash of keymap source, so that compiled ++keymap of different keymap sources are stored in different files. + + Unless the X server is modified, sharing this directory between servers on + different hosts could cause problems. +diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c +index 4ccddda..63b9f97 100644 +--- a/xkb/ddxLoad.c ++++ b/xkb/ddxLoad.c +@@ -30,6 +30,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. + + #include + ++#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ ++# include ++#else /* Use OpenSSL's libcrypto */ ++# include /* buggy openssl/sha.h wants size_t */ ++# include ++#endif + #include + #include + #include +@@ -43,24 +49,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. + #define XKBSRV_NEED_FILE_FUNCS + #include + #include ++#include + #include "xkb.h" + + #if defined(CSRG_BASED) || defined(linux) || defined(__GNU__) + #include + #endif + +- /* +- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is +- * relative to the top-level XKB configuration directory. +- * Making the server write to a subdirectory of that directory +- * requires some work in the general case (install procedure +- * has to create links to /var or somesuch on many machines), +- * so we just compile into /usr/tmp for now. +- */ +-#ifndef XKM_OUTPUT_DIR +-#define XKM_OUTPUT_DIR "compiled/" +-#endif +- + #define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" + #define ERROR_PREFIX "\"> \"" + #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" +@@ -175,6 +170,45 @@ OutputDirectory( + } + + static Bool ++Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH*2+1], const char * input) ++{ ++ int i; ++ unsigned char sha1[SHA_DIGEST_LENGTH]; ++ ++#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ ++ SHA1_CTX ctx; ++ ++ SHA1Init (&ctx); ++ SHA1Update (&ctx, input, strlen(input)); ++ SHA1Final (sha1, &ctx); ++#else /* Use OpenSSL's libcrypto */ ++ SHA_CTX ctx; ++ int success; ++ ++ success = SHA1_Init (&ctx); ++ if (! success) ++ return BadAlloc; ++ ++ success = SHA1_Update (&ctx, input, strlen(input)); ++ if (! success) ++ return BadAlloc; ++ ++ success = SHA1_Final (sha1, &ctx); ++ if (! success) ++ return BadAlloc; ++#endif ++ ++ /* convert sha1 to sha1_asc */ ++ for(i=0; i nameRtrnLen) && nameRtrn) { ++ ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n"); ++ return FALSE; ++ } ++ strncpy(nameRtrn, xkmfile, nameRtrnLen); ++ ++ /* if the xkm file already exists, reuse it */ ++ canonicalXkmFileName = Xprintf("%s%s.xkm", xkm_output_dir, xkmfile); ++ if (access(canonicalXkmFileName, R_OK) == 0) { ++ /* yes, we can reuse the old xkm file */ ++ LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName); ++ result = TRUE; ++ goto _ret; ++ } ++ LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName); ++ ++ /* continue to call xkbcomp to compile the keymap. to avoid race ++ condition, we compile it to a tmpfile then rename it to ++ xkmfile */ ++ + #ifdef WIN32 + strcpy(tmpname, Win32TempDir()); + strcat(tmpname, "\\xkb_XXXXXX"); +@@ -225,19 +315,30 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + } + } + ++ if ( (tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL ) { ++ ErrorF("[xkb] Can't generate temp xkm file name"); ++ result = FALSE; ++ goto _ret; ++ } ++ + buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " +- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", ++ "-em1 %s -emp %s -eml %s \"%s\"", + xkbbindir, xkbbindirsep, + ( (xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ), +- xkbbasedirflag, xkmfile, ++ xkbbasedirflag, xkbfile, + PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, +- xkm_output_dir, keymap); ++ tmpXkmFile); + + if (xkbbasedirflag != emptystring) { + xfree(xkbbasedirflag); + } + ++ /* there's a potential race condition between calling tempnam() ++ and invoking xkbcomp to write the result file (potential temp ++ file name conflicts), but since xkbcomp is a standalone ++ program, we have to live with this */ ++ + #ifndef WIN32 + out= Popen(buf,"w"); + #else +@@ -245,31 +346,41 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + #endif + + if (out!=NULL) { +-#ifdef DEBUG +- if (xkbDebugFlags) { +- ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n"); +- XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need); +- } +-#endif +- XkbWriteXKBKeymapForNames(out,names,xkb,want,need); ++ /* write XKBKeyMapBuf to xkbcomp */ ++ if (EOF==fputs(xkbKeyMapBuf, out)) ++ { ++ ErrorF("[xkb] Sending keymap to xkbcomp failed\n"); ++ result = FALSE; ++ goto _ret; ++ } + #ifndef WIN32 + if (Pclose(out)==0) + #else + if (fclose(out)==0 && System(buf) >= 0) + #endif + { ++ /* xkbcomp success */ + if (xkbDebugFlags) + DebugF("[xkb] xkb executes: %s\n",buf); +- if (nameRtrn) { +- strncpy(nameRtrn,keymap,nameRtrnLen); +- nameRtrn[nameRtrnLen-1]= '\0'; ++ /* if canonicalXkmFileName already exists now, we simply ++ overwrite it, this is OK */ ++ ret = rename(tmpXkmFile, canonicalXkmFileName); ++ if (0 != ret) { ++ ErrorF("[xkb] Can't rename %s to %s, error: %s\n", ++ tmpXkmFile, canonicalXkmFileName, ++ strerror(errno)); ++ ++ /* in case of error, don't unlink tmpXkmFile, leave it ++ for debugging */ ++ ++ result = FALSE; ++ goto _ret; + } +- if (buf != NULL) +- xfree (buf); +- return TRUE; ++ result = TRUE; ++ goto _ret; + } + else +- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); ++ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkbfile); + #ifdef WIN32 + /* remove the temporary file */ + unlink(tmpname); +@@ -284,9 +395,16 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + } + if (nameRtrn) + nameRtrn[0]= '\0'; ++ result = FALSE; ++ ++_ret: ++ if (tmpXkmFile) ++ free(tmpXkmFile); ++ if (canonicalXkmFileName) ++ xfree(canonicalXkmFileName); + if (buf != NULL) + xfree (buf); +- return FALSE; ++ return result; + } + + static FILE * +@@ -370,7 +488,6 @@ unsigned missing; + DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined); + } + fclose(file); +- (void) unlink (fileName); + return (need|want)&(~missing); + } + +-- +1.5.6.5 + diff --git a/packages/x11/xserver/xorg-server/patches/xorg-x11-nonroot-vesa.diff b/packages/x11/xserver/xorg-server/patches/xorg-x11-nonroot-vesa.diff new file mode 100644 index 0000000000..76c0a38aa4 --- /dev/null +++ b/packages/x11/xserver/xorg-server/patches/xorg-x11-nonroot-vesa.diff @@ -0,0 +1,12 @@ +--- xorg-server-1.6.1.901/hw/xfree86/common/xf86AutoConfig.c~ 2009-07-03 11:59:30.000000000 -0700 ++++ xorg-server-1.6.1.901/hw/xfree86/common/xf86AutoConfig.c 2009-07-03 11:59:30.000000000 -0700 +@@ -516,7 +516,8 @@ + /* Fallback to platform default hardware */ + if (i < (nmatches - 1)) { + #if defined(__i386__) || defined(__amd64__) || defined(__hurd__) +- matches[i++] = xnfstrdup("vesa"); ++ if (geteuid() == 0) ++ matches[i++] = xnfstrdup("vesa"); + #elif defined(__sparc__) && !defined(sun) + matches[i++] = xnfstrdup("sunffb"); + #endif diff --git a/packages/x11/xserver/xorg-server/patches/xserver-1.5.0-bg-none-root.diff b/packages/x11/xserver/xorg-server/patches/xserver-1.5.0-bg-none-root.diff index 097b085a32..78a8c84df4 100644 --- a/packages/x11/xserver/xorg-server/patches/xserver-1.5.0-bg-none-root.diff +++ b/packages/x11/xserver/xorg-server/patches/xserver-1.5.0-bg-none-root.diff @@ -1,17 +1,3 @@ -From b4e4b980663692a3af5787eeaf2d48eb6c0188ed Mon Sep 17 00:00:00 2001 -From: Fedora X Ninjas -Date: Tue, 4 Aug 2009 14:45:58 +1000 -Subject: [PATCH] Add nr for background=none root - ---- - dix/globals.c | 1 + - dix/window.c | 12 +++++++----- - hw/xfree86/common/xf86Init.c | 11 +++++++++++ - hw/xfree86/common/xf86str.h | 5 ++++- - include/opaque.h | 1 + - os/utils.c | 3 +++ - 6 files changed, 27 insertions(+), 6 deletions(-) - diff --git a/dix/globals.c b/dix/globals.c index c24a94f..907a5e8 100644 --- a/dix/globals.c @@ -25,10 +11,10 @@ index c24a94f..907a5e8 100644 int cursorScreenDevPriv[MAXSCREENS]; diff --git a/dix/window.c b/dix/window.c -index 32e26d9..0bf1d52 100644 +index caff1cb..f343d25 100644 --- a/dix/window.c +++ b/dix/window.c -@@ -466,22 +466,24 @@ InitRootWindow(WindowPtr pWin) +@@ -466,23 +466,24 @@ InitRootWindow(WindowPtr pWin) pWin->optional->cursor = rootCursor; rootCursor->refcnt++; @@ -38,28 +24,28 @@ index 32e26d9..0bf1d52 100644 if (party_like_its_1989) { MakeRootTile(pWin); backFlag |= CWBackPixmap; -+ pScreen->ChangeWindowAttributes(pWin, backFlag); ++ (*pScreen->ChangeWindowAttributes)(pWin, backFlag); + } else if (bgNoneRoot) { -+ /* nothing, handled in xf86CreateRootWindow */ ++ /* nothing, handled in xf86CreateRootWindow */ } else { if (whiteRoot) pWin->background.pixel = pScreen->whitePixel; else pWin->background.pixel = pScreen->blackPixel; backFlag |= CWBackPixel; -- } ++ (*pScreen->ChangeWindowAttributes)(pWin, backFlag); + } - pWin->backingStore = defaultBackingStore; - pWin->forcedBS = (defaultBackingStore != NotUseful); - /* We SHOULD check for an error value here XXX */ - (*pScreen->ChangeWindowAttributes)(pWin, backFlag); -+ pScreen->ChangeWindowAttributes(pWin, backFlag); -+ } - +- MapWindow(pWin, serverClient); } + diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c -index e84da4e..2a0f47a 100644 +index c9baff3..81c62f2 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -77,6 +77,7 @@ @@ -70,7 +56,7 @@ index e84da4e..2a0f47a 100644 #include "xf86VGAarbiter.h" #include "globals.h" -@@ -234,6 +235,7 @@ xf86CreateRootWindow(WindowPtr pWin) +@@ -249,6 +250,7 @@ xf86CreateRootWindow(WindowPtr pWin) int ret = TRUE; int err = Success; ScreenPtr pScreen = pWin->drawable.pScreen; @@ -78,24 +64,24 @@ index e84da4e..2a0f47a 100644 RootWinPropPtr pProp; CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); -@@ -285,6 +287,15 @@ xf86CreateRootWindow(WindowPtr pWin) +@@ -300,6 +302,15 @@ xf86CreateRootWindow(WindowPtr pWin) } } -+ if (bgNoneRoot && pScrn->canDoBGNoneRoot) { -+ pWin->backgroundState = XaceBackgroundNoneState(pWin); -+ pWin->background.pixel = pScreen->whitePixel; -+ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore); ++ if (bgNoneRoot && pScrn->canDoBGNoneRoot || 1) { ++ pWin->backgroundState = XaceBackgroundNoneState(pWin); ++ pWin->background.pixel = pScreen->whitePixel; ++ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore); + } else { -+ pWin->background.pixel = pScreen->blackPixel; -+ pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore); ++ pWin->background.pixel = pScreen->blackPixel; ++ pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore); + } + DebugF("xf86CreateRootWindow() returns %d\n", ret); return (ret); } diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h -index 5c3ee44..e3c7841 100644 +index b9a2e06..fd28664 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -516,7 +516,7 @@ typedef struct _confdrirec { @@ -107,12 +93,12 @@ index 5c3ee44..e3c7841 100644 #define NUM_RESERVED_POINTERS 14 #define NUM_RESERVED_FUNCS 11 -@@ -800,6 +800,9 @@ typedef struct _ScrnInfoRec { +@@ -788,6 +788,9 @@ typedef struct _ScrnInfoRec { ClockRangesPtr clockRanges; int adjustFlags; + /* -nr support */ -+ int canDoBGNoneRoot; ++ int canDoBGNoneRoot; + /* * These can be used when the minor ABI version is incremented. @@ -130,10 +116,10 @@ index b3c7c70..fcc8c95 100644 extern _X_EXPORT Bool CoreDump; diff --git a/os/utils.c b/os/utils.c -index 00abd63..7bfdf8b 100644 +index 3718b17..52e30d3 100644 --- a/os/utils.c +++ b/os/utils.c -@@ -514,6 +514,7 @@ void UseMsg(void) +@@ -513,6 +513,7 @@ void UseMsg(void) #endif ErrorF("-nolisten string don't listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); @@ -141,7 +127,7 @@ index 00abd63..7bfdf8b 100644 ErrorF("-reset reset after last client exists\n"); ErrorF("-p # screen-saver pattern duration (minutes)\n"); ErrorF("-pn accept failure to listen on all ports\n"); -@@ -861,6 +862,8 @@ ProcessCommandLine(int argc, char *argv[]) +@@ -856,6 +857,8 @@ ProcessCommandLine(int argc, char *argv[]) defaultBackingStore = WhenMapped; else if ( strcmp( argv[i], "-wr") == 0) whiteRoot = TRUE; @@ -150,6 +136,3 @@ index 00abd63..7bfdf8b 100644 else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { if(++i < argc) { long reqSizeArg = atol(argv[i]); --- -1.6.0.6 - diff --git a/packages/x11/xserver/xorg-server/patches/xserver-boottime.diff b/packages/x11/xserver/xorg-server/patches/xserver-boottime.diff deleted file mode 100644 index efc85a42ab..0000000000 --- a/packages/x11/xserver/xorg-server/patches/xserver-boottime.diff +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/os/log.c b/os/log.c -index 0860847..2c46f1a 100644 ---- a/os/log.c -+++ b/os/log.c -@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args) - static char tmpBuffer[1024]; - int len = 0; - -+ struct timeval time; -+ time_t tv_sec; -+ suseconds_t tv_usec; -+ static Bool first = TRUE; -+ static time_t start_tv_sec; -+ static suseconds_t start_usec; -+ int diff_sec, diff_usec; -+ -+ gettimeofday(&time, NULL); -+ tv_sec = time.tv_sec; -+ tv_usec = time.tv_usec; -+ if (first == TRUE) { -+ start_tv_sec = tv_sec; -+ start_usec = tv_usec; -+ first = FALSE; -+ } -+ diff_sec = (int)difftime(tv_sec, start_tv_sec); -+ diff_usec = (tv_usec - start_usec); -+ if (diff_usec < 0) { -+ diff_sec--; -+ diff_usec += 1000000; -+ } -+ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec); -+ len = strlen(tmpBuffer); -+ if (logFile) -+ fwrite(tmpBuffer, len, 1, logFile); -+ - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output diff --git a/packages/x11/xserver/xorg-server/profile.d/display.conf b/packages/x11/xserver/xorg-server/profile.d/display.conf new file mode 100644 index 0000000000..447ecc7d02 --- /dev/null +++ b/packages/x11/xserver/xorg-server/profile.d/display.conf @@ -0,0 +1,10 @@ +################################################################################ +# Xorg environment variables. +# +# This file contains non-OpenELEC evironment variables as well as OpenELEC +# evironment variables that are not user defined. +################################################################################ + +DISPLAY=":0.0" + +export DISPLAY diff --git a/packages/x11/xserver/xorg-server/url b/packages/x11/xserver/xorg-server/url index f25610e0d0..5d8056a05d 100644 --- a/packages/x11/xserver/xorg-server/url +++ b/packages/x11/xserver/xorg-server/url @@ -1 +1 @@ -http://xorg.freedesktop.org/archive/individual/xserver/xorg-server-1.7.7.tar.bz2 \ No newline at end of file +http://xorg.freedesktop.org/archive/individual/xserver/xorg-server-1.8.0.902.tar.bz2 diff --git a/projects/ION/linux/linux.i386.conf b/projects/ION/linux/linux.i386.conf index ab12dee30b..455a3ceda3 100644 --- a/projects/ION/linux/linux.i386.conf +++ b/projects/ION/linux/linux.i386.conf @@ -1831,7 +1831,7 @@ CONFIG_RTC_DRV_CMOS=y CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set -# CONFIG_DMIID is not set +CONFIG_DMIID=y # CONFIG_ISCSI_IBFT_FIND is not set # diff --git a/projects/ION/linux/linux.x86_64.conf b/projects/ION/linux/linux.x86_64.conf index f80bab3937..eb29a911a2 100644 --- a/projects/ION/linux/linux.x86_64.conf +++ b/projects/ION/linux/linux.x86_64.conf @@ -1786,7 +1786,7 @@ CONFIG_RTC_DRV_CMOS=y CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set -# CONFIG_DMIID is not set +CONFIG_DMIID=y # CONFIG_ISCSI_IBFT_FIND is not set # diff --git a/projects/generic/linux/linux.i386.conf b/projects/generic/linux/linux.i386.conf index 700f9125a2..6730beaf24 100644 --- a/projects/generic/linux/linux.i386.conf +++ b/projects/generic/linux/linux.i386.conf @@ -2070,7 +2070,7 @@ CONFIG_CRYSTALHD=m CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set -# CONFIG_DMIID is not set +CONFIG_DMIID=y # CONFIG_ISCSI_IBFT_FIND is not set # diff --git a/projects/intel/linux/linux.i386.conf b/projects/intel/linux/linux.i386.conf index cfb468d977..887f0e9ff1 100644 --- a/projects/intel/linux/linux.i386.conf +++ b/projects/intel/linux/linux.i386.conf @@ -2013,7 +2013,7 @@ CONFIG_CRYSTALHD=m CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set -# CONFIG_DMIID is not set +CONFIG_DMIID=y # CONFIG_ISCSI_IBFT_FIND is not set # diff --git a/projects/intel/linux/linux.x86_64.conf b/projects/intel/linux/linux.x86_64.conf index da6ec3e2cf..fb15e01985 100644 --- a/projects/intel/linux/linux.x86_64.conf +++ b/projects/intel/linux/linux.x86_64.conf @@ -1971,7 +1971,7 @@ CONFIG_CRYSTALHD=m CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set -# CONFIG_DMIID is not set +CONFIG_DMIID=y # CONFIG_ISCSI_IBFT_FIND is not set #