* Writing a Line discpline driver to talk to a stm32 controller
@ 2018-03-23 8:18 Oliver Graute
2018-03-26 21:20 ` Stefan Wahren
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Graute @ 2018-03-23 8:18 UTC (permalink / raw)
To: kernelnewbies
Hello list,
I have a imx6ul connected to a stm32 controller via a serial interface. I need
to implement a little protocol to talk towards the stm32 controller for send
and receive ontop of the serial line. I found out that I have to write my own
line discpline driver for doing this. After digging around in drivers/tty/n_*
I have a little idea what to do here. I already attached my demo ldisc to a
/dev/ttymxc7 via the ldattach command in userspace. This looks fine so far.
Here my first Questions:
Is there a way to permanent attach the ldisc to an serial interface in the
Kernel?
I have a reset GPIO to reset the stm32 controller. I would like to toggle this
GPIO on opening the device. But the open() method in the ldisc driver seems
the wrong place to do this. But in which open() should I do this? the
underlying serial imx.c driver do not have any open() and I'am using this
driver also for other serial lines?
useful links to the ldisc topic:
https://www.kernel.org/doc/Documentation/serial/tty.txt
http://www.embeddedlinux.org.cn/essentiallinuxdevicedrivers/
Best Regards,
Oliver
^ permalink raw reply [flat|nested] 2+ messages in thread
* Writing a Line discpline driver to talk to a stm32 controller
2018-03-23 8:18 Writing a Line discpline driver to talk to a stm32 controller Oliver Graute
@ 2018-03-26 21:20 ` Stefan Wahren
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Wahren @ 2018-03-26 21:20 UTC (permalink / raw)
To: kernelnewbies
Hello Oliver,
Am 23.03.2018 um 09:18 schrieb Oliver Graute:
> Hello list,
>
> I have a imx6ul connected to a stm32 controller via a serial interface. I need
> to implement a little protocol to talk towards the stm32 controller for send
> and receive ontop of the serial line. I found out that I have to write my own
> line discpline driver for doing this. After digging around in drivers/tty/n_*
> I have a little idea what to do here. I already attached my demo ldisc to a
> /dev/ttymxc7 via the ldattach command in userspace. This looks fine so far.
>
> Here my first Questions:
>
> Is there a way to permanent attach the ldisc to an serial interface in the
> Kernel?
take a look at the serial device bus as an alternative for ldisc [1]
Stefan
[1] - https://elinux.org/images/0/0e/Serdev-elce-2017-2.pdf
>
> I have a reset GPIO to reset the stm32 controller. I would like to toggle this
> GPIO on opening the device. But the open() method in the ldisc driver seems
> the wrong place to do this. But in which open() should I do this? the
> underlying serial imx.c driver do not have any open() and I'am using this
> driver also for other serial lines?
>
> useful links to the ldisc topic:
>
> https://www.kernel.org/doc/Documentation/serial/tty.txt
> http://www.embeddedlinux.org.cn/essentiallinuxdevicedrivers/
>
> Best Regards,
>
> Oliver
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-26 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 8:18 Writing a Line discpline driver to talk to a stm32 controller Oliver Graute
2018-03-26 21:20 ` Stefan Wahren
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).