Hi,
I'm working on a linux kernel 2.6.32.25 for a board that has a PCI UART device that handles both serial ports and GPIO. For now, the device driver that handles this device contains the code to drive serial ports and GPIO, so through the same device node.
I want to split this driver into two drivers: one handling the serial port part (ttySERIALx) and one handling the GPIO part (ttyGPIOx), is it possible to do such a thing?
Until now I've tested to duplicate the code of the driver and change only the major and minor numbers, the dev_name s(ttyGPIO...) and driver_names to differentiate them. What happens at boot time (the two drivers are built-in) is that one driver is initialized and probed, everything goes well, the ttyXRSERIALx exist, but the second driver is registered (add driver appears in dmesg), but the probe function is not called.
From what I've read in the kernel source document pci.txt this normal as the probe function won't be called if a matching device is already owned by another driver.
So I thought may be it would work if the second driver is of class gpio and not serial, but I don't think this will solve the problem, cause the problem seems to be at the pci level as a driver has been already matched to the device I want to bind the second driver to. So, it seems not to be the solution to my problem. am I wrong?
Is there a way to access the same device through two drivers at the same time?
Thanks a lot for your help in advance, I'm really out of idea, here! and kind of newbie in kernel programming