LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Touchscreen input device not appearing in /dev/input (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/touchscreen-input-device-not-appearing-in-dev-input-747279/)

rohshall 08-13-2009 09:36 AM

How to make udev create /dev/input/event0 for a touchscreen
 
Hi,


I am trying to integrate my TSC2046 device on AT91RM9200 based board.
I enabled ADS7846 touchscreen driver because these two are essentially the same device. My device gets recognized too, but I don't see the device under /dev/input/event0 though the device information appears under sysfs.

I am using buildroot and my understanding is Linux kernel 2.6.28 uses udev under which I don't have to create /dev/input/event0 device files in my root file system, but just let udev create it when a device is detected.
However, in my root file system I do not see any /etc/udev/rules.d/10-local.rules file. I am assuming these udev rules are optional. Is this correct? If they are not, where should I create these rules file? I also checked that there is no udev daemon running on my machine. However, there is one events daemon running. Is it related with udev?

# cat /proc/sys/kernel/hotplug
/sbin/hotplug
# ps -e
PID USER COMMAND
1 root init
2 root [kthreadd]
3 root [ksoftirqd/0]
4 root [watchdog/0]
5 root [events/0]
6 root [khelper]
48 root [kblockd/0]
73 root [pdflush]
74 root [pdflush]
75 root [kswapd0]
119 root [aio/0]
747 root -sh
748 root /sbin/syslogd -n -m 0
749 root /sbin/klogd -n
750 root /usr/bin/tail -f /var/log/messages
769 root ps -e


# cd /sys/class/input/
# ls
event0 input0 mice mouse0
# cd event0
# ls
dev device subsystem uevent
# ls -l
-r--r--r-- 1 root root 4096 Dec 31 17:19 dev
lrwxrwxrwx 1 root root 0 Dec 31 17:19 device -> ../../../../d3
lrwxrwxrwx 1 root root 0 Dec 31 17:19 subsystem -> ../../../it
-rw-r--r-- 1 root root 4096 Dec 31 17:19 uevent
# cat dev
13:64
# cat uevent
MAJOR=13
MINOR=64
PHYSDEVPATH=/devices/platform/atmel_spi.0/spi0.3
PHYSDEVBUS=spi
PHYSDEVDRIVER=ads7846
#

The booup messages I get are:

Uncompressing Linux.............................................................
Linux version 2.6.28 (salil@salil-laptop) (gcc version 4.3.2 (GCC) ) #117 Thu A9
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91RM9200-DK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 179 MHz, master 59 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: mem=32M console=tty0
AT91: 128 gpio irqs in 4 banks
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
console [tty0] enabled
console [ttyS0] enabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 29676KB available (1780K code, 149K data, 832K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 89.79 BogoMIPS (lpj=350208)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 288 bytes
NET: Registered protocol family 16
at91: disabling SPI chip select 1
at91: disabling SPI chip select 2
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
msgmni has been set to 57
io scheduler noop registered
io scheduler anticipatory registered (default)
Console: switching to colour frame buffer device 80x30
fb0: S1D13513 frame buffer device
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffc4000 (irq = 7) is a ATMEL_SERIAL
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffe0000 (irq 13)
mice: PS/2 mouse device common for all mice
ads7846 spi0.3: touchscreen, irq 93
input: ADS784x Touchscreen as /class/input/input0
at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0
AT91 Real Time Clock driver.
TCP cubic registered
NET: Registered protocol family 17
at91_rtc at91_rtc: setting system clock to 1998-01-01 00:01:32 UTC (883612892)
Freeing init memory: 832K
Initializing random number generator... done.
Starting network...
ip: RTNETLINK answers: File exists


So, the driver's probe function runs and creates appropriate sysfs entries and I have verified that it does call the device creation code (udev code). But I don't see any devices being created.

Can somebody help me please?

sunr2007 08-17-2009 05:54 AM

have u enabled the event interface in the kernel? drivers/input/event interface? and u av tslib suport in your kernel?

rohshall 08-17-2009 06:18 AM

Quote:

Originally Posted by sunr2007 (Post 3646292)
have u enabled the event interface in the kernel? drivers/input/event interface? and u av tslib suport in your kernel?

Many thanks for replying.
My event interface is enabled (device drivers - input drivers).
What I found out was mdev should manage the /dev interface, but when I check whether mdev is managing the /dev using tempfs using mount, it does not show it.
However, when I did "mdev -s", I can see event0 interface popping up.
So, it looks like I should make it a part of the startup script. But the doubt I have is by default this should have been done. So, it would be great if you guys can share some insights.

sunr2007 08-21-2009 05:57 AM

what does ur cat /dev/input/event0 gives? and can u let us know what parameters u are passing?
warm regards,
Ravi Kulkarni.

rohshall 08-21-2009 10:39 AM

mdev -s not initiated
 
Hi Ravi,

Thanks for your comment. There was no /dev/input/event0 being created.
What I found out was 'mdev -s' needs to be part of the init script. This will make mdev (simpler cousin of its counterpart on desktops - udev) will do device discovery and create the appropriate /dev nodes like event0
So, problem solved. :)


All times are GMT -5. The time now is 04:06 AM.