linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* kernel driver for rs232 serial peripheral
@ 2011-08-25 21:28 Joey Oravec
  2011-08-25 21:38 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Joey Oravec @ 2011-08-25 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

Fellow ARM developers,

We make a multi-function chip (rtc, gpio, nvram, etc) for embedded 
applications that has an rs232 serial interface. My goal is to write an 
MFD kernel driver that speaks serial to this device and implements 
interfaces. Other busses like spi and i2c are pretty straightforward in 
the kernel but serial feels a lot more complicated. To talk to this 
device from the kernel it seems like I need to:

- Call tty_register_ldisc to create a line discipline
- Call tty_register_driver and setup a driver
- Require userspace to call setserial and change the line discipline

This might work, but the documentation implies that a line discipline is 
for a protocol, not for connecting a device driver to a serial port. Is 
there any kind of easier-to-use serial class similar to i2c or spi where 
I can just setup a platform device/driver on a specific serial port? Am 
I missing an easier solution?

-joey

^ permalink raw reply	[flat|nested] 2+ messages in thread

* kernel driver for rs232 serial peripheral
  2011-08-25 21:28 kernel driver for rs232 serial peripheral Joey Oravec
@ 2011-08-25 21:38 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2011-08-25 21:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 25 August 2011 17:28:25 Joey Oravec wrote:
> We make a multi-function chip (rtc, gpio, nvram, etc) for embedded 
> applications that has an rs232 serial interface. My goal is to write an 
> MFD kernel driver that speaks serial to this device and implements 
> interfaces. Other busses like spi and i2c are pretty straightforward in 
> the kernel but serial feels a lot more complicated. To talk to this 
> device from the kernel it seems like I need to:
> 
> - Call tty_register_ldisc to create a line discipline
> - Call tty_register_driver and setup a driver
> - Require userspace to call setserial and change the line discipline
> 
> This might work, but the documentation implies that a line discipline is 
> for a protocol, not for connecting a device driver to a serial port. Is 
> there any kind of easier-to-use serial class similar to i2c or spi where 
> I can just setup a platform device/driver on a specific serial port? Am 
> I missing an easier solution?

I don't think you need to call tty_register_driver, if it's a standard
serial port, it should already work.
Also, I believe that there is a way to set the line discipline from
inside the kernel if you know what is connected. I forgot the details
but there should be a number of examples in the kernel source.

	Arnd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-25 21:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 21:28 kernel driver for rs232 serial peripheral Joey Oravec
2011-08-25 21:38 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).