# Serial port problems [SOLVED (mostly)]

## U A 9 6 4

Hi,

I recently (about 2 months ago) bought a new Toshiba R25-S3503 Tablet PC and I'm having a hard time getting the tablet (Wacom) to work in Linux.  I'm dual booting with Windows so I know the tablet works fine.  I've been running Gentoo on this laptop since I got it and the only thing I haven't been able to get working is the tablet.

I've followed all the setup instructions at linuxwacom's web page numerous times and I can't get the tablet working.  I know from Windows that the tablet is connected to I/O port 0x0338 and it uses IRQ 4.  Port 0x0338 isn't mapped to any /dev/ttyS? device by default, but I can use setserial to map a /dev/ttyS? device to port 0x0338.  In fact, I've found some kernel patches to add the tablet to drivers/serial/8250_pnp.c so a serial device automatically gets mapped to the tablet by the kernel 8250's serial driver (using the PNPACPI information from the device).  Basically, this just consists of adding the following line somewhere in the pnp_dev_table[] struct at drivers/serial/8250_pnp.c in the kernel source:

```
{       "WACF004",                0       },
```

So, when I boot, /dev/ttyS0 gets mapped to the tablet automatically.  Here's the output of setserial -a /dev/ttyS0 after booting:

```
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x0338, IRQ: 4

        Baud_base: 115200, close_delay: 50, divisor: 0

        closing_wait: 3000

        Flags: spd_normal skip_test
```

This all looks fine to me.  But, when I try to read data from the serial port (cat /dev/ttyS0, xxd /dev/ttyS0, wacdump -f c100 /dev/ttyS0, etc.), I get absolutely no output.  It's like no device is connected to the serial port.

My first instinct was to try an Ubuntu LiveCD since I know Ubuntu's support for Wacom tablets is very good out of the box.  The tablet worked perfectly in Ubuntu (as /dev/ttyS0).  I get the same output from setserial in Ubuntu when the tablet's working, so I really don't see what the difference is.

The next step for me was to try starting over with a clean kernel configuration and seeing if I could get the tablet working in Gentoo.  Again, I got the same thing (no output).  So, I decided to try a genkernel (using the stable 2.6.18 gentoo-sources with full hardware detection and automatic module loading) with my Gentoo installation.  Surprisingly, this worked perfectly for me.  The tablet works exactly as expected (at /dev/ttyS0).  Again, same output from setserial.

So, my question is, what is so different about my kernel that I can't seem to get any output from the tablet device?  I'd really prefer not to use genkernel if I don't have to.  I just can't seem to figure out what the difference is between what genkernel is doing and what I'm doing.  I've tried just about everything I could think of including changing every kernel configuration option with SERIAL in the name, running coldplug after boot, manually mapping I/O port 0x0338 to different /dev/ttyS? devices, using different IRQs, enabling/disabling ACPI, and using 8250 and  8250_pnp as modules instead of building them into the kernel.  No matter what I do, it seems, I can't seem to get any output from the tablet device when I'm using my kernel.  I'm using linux-2.6.17.13 (vanilla-sources stable).  Please find my .config at http://tmp.ua964.com/config-linux-2.6.17.3 if you'd like to take a look at it.

Please, if you have any suggestions or ideas, let me know!  I've completely run out of ideas as far as fixing this problem goes but I'm relatively sure it's kernel-related.  I really appreciate your time.  If you need any more information, just let me know and I'll post it for you.

Thanks,

BrianLast edited by U A 9 6 4 on Wed Nov 22, 2006 5:22 am; edited 1 time in total

----------

## blu3bird

Try enabling CONFIG_SERIAL_8250_FOURPORT(Support Fourport cards), CONFIG_SERIAL_8250_ACCENT(Support Accent cards), CONFIG_SERIAL_8250_BOCA(Support Boca cards) and/or CONFIG_SERIAL_8250_HUB6(Support Hub6 cards) (placed in Device Drivers  --->  Character devices  --->  Serial drivers).

My guess is that you have one of these chips and it allmost works with the generic driver but needs some special activation code.

----------

## U A 9 6 4

It was a good try but no such luck.  I get the exact same result.  The laptop uses pretty standard Intel-based chipsets.  You can find my lspci -vv at http://tmp.ua964.com/lspci if it helps (the one from when the tablet won't work).  Interestingly, the results from lspci -vv are slightly different when the tablet is working and when it's not:

```
--- lspci.good   2006-11-21 17:50:01.000000000 -0700

+++ lspci.bad   2006-11-21 17:44:40.000000000 -0700

@@ -153,5 +153,5 @@

    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

    Latency: 0

-   Bus: primary=00, secondary=03, subordinate=07, sec-latency=32

+   Bus: primary=00, secondary=03, subordinate=04, sec-latency=32

    I/O behind bridge: 0000b000-0000bfff

    Memory behind bridge: ffa00000-ffafffff

@@ -188,5 +188,5 @@

    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

    Latency: 0, Cache Line Size 08

-   Interrupt: pin A routed to IRQ 11

+   Interrupt: pin A routed to IRQ 16

    Region 0: Memory at ffcff000 (32-bit, non-prefetchable) [size=4K]

    Capabilities: [c8] Power Management version 2
```

Perhaps this has something to do with the problem.  Do you have any more suggestions?

----------

## U A 9 6 4

OK, I've managed to get this mostly solved.  Using genkernel's default .config for 2.6 kernels and compiling in support for my hardware (SATA, etc., so I don't have to use an initrd) seems to make the tablet work as expected.  Now it's just a matter of disabling kernel options I don't want/need until I find the one that breaks my tablet support.

----------

## Ramblurr

Have you had an luck finding which kernel option is breaking your touchscreen? I am having the same issue.

----------

