continua (next page) main index Note: apanel is not needed (this page is now obsolete and is here only for reference); read here how I solved the problem.

My pages on Fujitsu-Siemens Stylistic ST5022 are here!


This work was inspired by apanel, in particular by its year 2000 versions.

Since I had news that those versions worked - at least for the four application keys - up to 2.6.11 kernel, I still hope to get something working on the latest kernel releases.

First, I inspected the Stylistic ST5022D BIOS for the FJKEYDRV data block, executing this Ruby program:
#!/usr/bin/env ruby

TMP="/tmp/last64kinfirstmeg"

system "dd if=/proc/kcore of=#{TMP} bs=64k skip=15 count=1"
system "echo '' >>#{TMP}"  # get rid of warnings...

x = `cat #{TMP}`
fail "can't find FJKEYINF table"  unless x =~ /FJKEYINF/
ftable=$'
tlen=65529-ftable.length
cnt=0

while true
  blk = ftable.unpack("H2H2H2H2")  # get 4-bytes block
  break if blk.first == "00"

  printf("---table (at 0xf%x)---\n", tlen)  if cnt==0
  cnt = cnt+1 
  ftable = ftable[4..-1]

  case blk.first
    when "01":  print "application buttons  "
    when "02":  print "CD buttons           "
    when "03":  print "LCD with chip=2      "
    when "04":  print "LED with chip=1      "
    when "06":  print "LED with chip=4      "
    when "07":  print "three app-buttons    "
    else        print "unknown ($#{blk.first})        "
  end

  case blk[1]
    when "00":  print "non-SMBUS access      "
    when "01":  print "SMBUS method 1        "
    when "02":  print "SMBUS method 2        "
    when "04":  print "SMBUS method 4        "
    else        print "unknown access ($#{blk[1]})  "
  end

  case blk[2]
    when "01":  print "OZ992C  "
    when "02":  print "OZ163T  "
    when "03":  print "OZ...?  "
    else        print "        "
  end

  print "slave=$"+blk[3]    if blk[1]!="00"
  puts
end

Its output was:
---table (at 0xf6f30)---
application buttons  SMBUS method 4                slave=$32
LED with chip=4      SMBUS method 4                slave=$32

The actual BIOS FKEYINF table for Stylistic ST5022D was:
000f6f30  46 4a 4b 45 59 49 4e 46 01 04 04 32 06 04 04 32
000f6f40  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Well, the buttons are reachable via SMBUS method 4 on slave device "0x32". I won't care about LED panel, because there is only one useable LED (the fifth one, the one with the keylock icon).

The "0x00" 16-bit register should contain a bitmapped status of the keys.


The interrupt version

SMBUS programming can be quite hard. So you may have a look at Jan Rychter's fjbtndrv driver, built for FMV Stylistic tablets and Lifebook T42xx, but it's working also on my Stylistic ST502x series (and maybe other ST5xxx also) without any modification.

Its version 1.0 compiles and works with 2.6.13.5 Linux kernel (I personally tested it): just make and then insmod fjbtndrv.ko and you will see the buttons producing "keyboard" (HID) events even in text-mode.

Its version 1.1 is good for 2.6.15.6 kernels, but doesn't work with 2.6.22 and later Linux kernel versions.

The driver requires the kernel to hook the interrupt 5, which gets called whenever an application key is pressed or released, giving out on some weird I/O ports (around $fd70) the correct values.

The author of fjbtndrv does not support anymore the driver.

As of January 2008, a version 1.2 was released by another software developer.


Gradara

home page - send e-mail - continua (next page)