Problem accessing IO port

bluscape
I'm using a Mini2440 with PTXdist. I have an application that's been
running fine on my Mini2440 for the past year. The application uses quite a
lot of the IO ports on the Mini2440. I recently compiled a new PTX version
(2012.12.0) and is busy getting all the drivers working. I tested the IO
ports and found that I can't use IO port 199. I've been using this IO port
with the previous PTXdist version but now I get an error:

root@mini2440:~ echo 199 > /sys/class/gpio/export
sh: write error: Device or resource busy

I'm sure its not related to PTXdist itself but rather a driver clash.
Somewhere some driver is already using that IO port.

1.) How can I determine what process is currently using the IO port?
2) How can I resolve this problem?

Thank you

Juergen Beisert
When you talk about "IO port 199" it mostly means an IO address you want to
access. But what you really want is to control a "GPIO" (which means a
physical pin, aka "general purpose IO").

To get an idea, who is using the GPIO 199 you can take a look into "cat
/sys/kernel/debug/gpio". If this file doesn't exist, mount the so called
"debugfs" into the "/sys/kernel/debug" directory, first.

Please note: There is no fixed correlation between a number and the
physical GPIO pin in Linux. It depends on the order the drivers register
their GPIOs.

bluscape
Great! Thanks. The moment I executed "cat
/sys/kernel/debug/gpio" and read the result (gpio-199 Button5) I knew what
I did wrong. I remember enabling some button feature in the kernel!!

Keyboards -> GPIO Buttons

Thanks