[prev in list] [next in list] [prev in thread] [next in thread] 

List:       suse-laptop
Subject:    Re: [suse-laptop] Asus A3N Fn-Tasten und Powersave
From:       Johannes Engel <j-engel () gmx ! de>
Date:       2006-03-23 0:16:02
Message-ID: 4421E8C2.6040507 () gmx ! de
[Download RAW message or body]

Sorry, da habe ich mich vertippt, ich meinte das A3N, das wird von dem
Modul bis jetzt noch nicht nativ unterstützt. Ich habe einen kleinen
Patch gebastelt, der die Unterstützung für das A3N und das V6V
hinzufügt. Bitte testet das einmal.
Außerdem habe ich ein Skript für das Handling der Events im V6V
angehängt als Beispiel, das für das A3N entsprechend anzupassen ist.
Mein Dank geht hier an Manfred Tremmel, dessen Original mir als Vorlage
diente.

Gruß, Johannes

["acpi4asus-0.30-A3N_V6V.patch" (text/x-patch)]

--- asus_core.c.orig	2006-01-17 20:56:43.000000000 +0100
+++ asus_core.c	2006-03-23 01:11:19.000000000 +0100
@@ -127,6 +127,7 @@ struct asus_hotk {
 		A1x = 0,  //A1340D, A1300F
 		A2x,      //A2500H
 		A4G,      //A4759GUH
+		A3N,	  //A3N
 		D1x,      //D1
 		L2D,      //L2000D
 		L3C,      //L3800C
@@ -142,6 +143,7 @@ struct asus_hotk {
 		P30,	  //Samsung P30
 		S1x,      //S1300A, but also L1400B and M2400A (L84F)
 		S2x,      //S200 (J1 reported), Victor MP-XP7210
+		V6V,      //V6V
 		W1N,      //W1000N
 		W5A,      //W5A
 		xxN,      //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N
@@ -201,6 +203,18 @@ static struct model_data model_conf[END_
 	},
 
 	{
+		.name		   = "A3N",
+		.mt_mled	   = "MLED",
+		.mt_bt_switch	   = "BLED",
+		.mt_wled	   = "WLED",
+		.mt_lcd_switch	   = xxN_PREFIX "_Q10",
+		.brightness_set	   = "SPLV",
+		.brightness_get	   = "GPLV",
+		.display_set	   = "SDSP",
+		.display_get	   = "\\_SB.PCI0.P0P3.VGA.GETD"
+	}
+
+	{
 		.name              = "D1x",
 		.mt_mled           = "MLED",
 		.mt_lcd_switch     = "\\Q0D",
@@ -377,6 +391,20 @@ static struct model_data model_conf[END_
 	},
 
 	{
+		.name              = "V6V",
+		.mt_bt_switch      = "BLED",
+		.mt_wled           = "WLED",
+		.mt_tled           = "TLED",
+		.mt_lcd_switch	   = xxN_PREFIX "_Q10",
+		.bt_status         = "\\_SB.PCI0.SBRG.BLTS",
+		.display_get       = "\\_SB.PCI0.POP1.VGA.GETD",
+		.display_set	   = "SDSP",
+		.brightness_set	   = "SPLV",
+		.brightness_get	   = "GPLV",
+		.lcd_status	   = "\\BKLT"
+	},
+
+	{
 		.name              = "W1N",
 		.mt_mled           = "MLED",
 		.mt_wled           = "WLED",
@@ -1109,6 +1137,10 @@ static int __init asus_model_match(char 
 		return L5x;
 	else if (strncmp(model, "A4G", 3) == 0)
 		return A4G;
+	else if (strncmp(model, "A3N", 3) == 0)
+		return A3N;
+	else if (strncmp(model, "V6V", 3) == 0)
+		return V6V;
  	else if (strncmp(model, "W1N", 3) == 0)
  		return W1N;
  	else if (strncmp(model, "W5A", 3) == 0)

["acpi_hotkeys_ASUS_V6V" (text/plain)]

#!/bin/bash
# acpi_hotkeys_ASUS_V6V
# Manfred Tremmel, based on the script of Stefan Seyfried
# modified for the use on ASUS V6V by Johannes Engel
#

PATH=/bin:/usr/bin # be paranoid, we're running as root.
# first get helper functions (e.g. DEBUG, load_scheme, ...), extend $PATH,
# set variables etc. We get $SCRIPT_RETURN from here
. "/usr/lib/powersave/scripts/helper_functions"
# get_x_user comes from here...
. "/usr/lib/powersave/scripts/x_helper_functions"
export PATH

MYNAME=${0##*/} # basename $0
#
# look into the example_event_script for an explanation. We need this for
# $SCRIPT_RETURN
NUM=$4

# previously, we checked for $# <= 3. This is not very future-proof ;-)
if [ -z "$NUM" ]; then
    logger -t $MYNAME 'Sorry, not enough arguments: $4 is empty.'
    $SCRIPT_RETURN "$NUM|1|$MYNAME finished unsuccessful."
    exit 1
fi

run_on_xserver() {
  get_x_user
  su $X_USER -c "DISPLAY=$DISP $1"
}

TYPE=$1
set $3 # powersaved gives us "other '<content of /proc/acpi/event>'" so we must split it.
EVENT=$1   # "hotkey"
ACPI=$2    # "HOTK"
WHAT=$3    # "00000052"
SERIAL=$4  # "0000001c"

# it is easier to deal with numerical values (for me :-)
declare -i VAL
VAL=0x$WHAT # hex -> decimal
ret=0

if [ "$EVENT" != "hotkey" ]; then
  logger -t $MYNAME "non-hotkey-event: $TYPE $EVENT $ACPI $WHAT $SERIAL"
  # do not exit here, we need to execute SCRIPT_RETURN_HELPER
elif [ $VAL -gt 16 -a $VAL -lt 48 ]; then # brightness up/down
  : # do nothing
elif [ $VAL -eq 51 -o $VAL -eq 52 ]; then # LCD on/off
  : # do nothing
elif [ $VAL -ge 97 -a $VAL -le 99 ]; then # internal/external/both
  echo $VAL > /proc/acpi/asus/disp
  : # do nothing
elif [ $VAL -eq 50 ]; then # Fn-F10 -> mute
  if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix | grep -c -m 1 kmix'`" = "1" ] ; then
    if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix Mixer0 mute 0'`" = "false" ] ; then
      run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 setMute 0 true" &
    else
      run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 setMute 0 false" &
    fi
  else
    mute &             # from the aumix package
  fi
  : # set loudness to 0
elif [ $VAL -eq 49 ]; then # Fn-F11 -> volume down
  if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix | grep -c -m 1 kmix'`" = "1" ] ; then
    run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 decreaseVolume 0" &
  else
    aumix -w -3 &            # needs aumix, does "pcm"
  fi
  : # reduce loudness
elif [ $VAL -eq 48 ]; then # Fn-F12 -> volume up
  if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix | grep -c -m 1 kmix'`" = "1" ] ; then
    run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 increaseVolume 0" &
  else
    aumix -w +3 &            # needs aumix, does "pcm"
  fi
  : # increase loudness
elif [ $VAL -eq 81 ]; then # Start Browser
  run_on_xserver "/opt/kde3/bin/kfmclient openProfile webbrowsing" &
  : # do something
elif [ $VAL -eq 93 ]; then # Wireles LAN
  RF_KILL=`find /sys/bus/pci/drivers/ipw2200/0*/rf_kill`
  if [ "x${RF_KILL}" != "x" ] ; then # only when driver is available
    WLAN_STATE=`cat "$RF_KILL"`
    #DCOP_KINTERNET=`run_on_xserver '/opt/kde3/bin/dcop | grep kinternet'`
    if [ "${WLAN_STATE}" = "0" ] ; then # wlan is enabled
      # disable wlan
      echo 1 > "${RF_KILL}"
      # switch off wlan LED
      echo 0 > /proc/acpi/asus/wled
    else
      # enable wlan
      echo 0 > "${RF_KILL}"
      # turn on wlan LED
      echo 1 > /proc/acpi/asus/wled
    fi
  fi
  : # togle wlan state activated/deactivated
elif [ $VAL -eq 92 ]; then # Power4 Gear +
  POWERSAVESTATE=`/usr/bin/powersave -x | grep active | awk -F " " '{print $1}'`
  case "$POWERSAVESTATE" in
    Performance)
      NEWPOWERSAVESTATE="Acoustic"
      ;;
    Acoustic)
      NEWPOWERSAVESTATE="Presentation"
      ;;
    Presentation)
      NEWPOWERSAVESTATE="Powersave"
      ;;
    *)
      NEWPOWERSAVESTATE="Performance"
      ;;
  esac
  /usr/bin/powersave -e ${NEWPOWERSAVESTATE}
  run_on_xserver "/opt/kde3/bin/kdialog --passivepopup \"New Powersave state ${NEWPOWERSAVESTATE}\" 2" &
  : # switching powersave states
elif [ $VAL -eq 106 ]; then # touchpad on/off
  if [ -x /usr/local/bin/synclient ]; then
    /usr/local/bin/synclient TouchpadOff=0
    echo 1 > /proc/acpi/asus/tled
  fi
  : # turn touchpad on
elif [ $VAL -eq 107 ]; then # touchpad on/off
  if [ -x /usr/local/bin/synclient ] ; then
    /usr/local/bin/synclient TouchpadOff=1
    echo 0 > /proc/acpi/asus/tled
  fi
  : # turn touchpad off
elif [ $VAL -eq 109 ]; then # suspend2disk
  /usr/bin/powersave -U
  : # abused for suspend2ram
else
  DEBUG "undefined hotkey: $VAL $TYPE $EVENT $ACPI $WHAT $SERIAL" DIAG
  ret=1
fi
#
# see example_event_script for an explanation.
$SCRIPT_RETURN "$RET|0|acpi_hotkeys_ASUS_V6V"
#



-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    suse-laptop-unsubscribe@suse.com
Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken
Sie eine Mail an: suse-laptop-help@suse.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic