Re: Using Serdev is it Possible to Pull RX Low

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18/05/2022 09:48, Greg KH wrote:> On Tue, May 17, 2022 at 07:42:46PM +0100, linuxkernel wrote:
>> hello I, looking at writing a kernel driver for the Texas instruments
>> TPS92662A/TPS92663A which uses a "UART bus" e.g
>> |-----------|    |-----------|    |-----------|     |-----------|
>> |           |    | TPS92662A |    | TPS92662A |     | TPS92663A |
>> |   UART    |    | -Q1       |    | -Q1       |     | -Q1 	   |
>> |           |    |           |    |           |     |           |
>> |-----------|    |-----------|    |-----------|     |-----------|
>>       |                |                |                 |
>>       |                |                |                 |
>>       |                |                |                 |
>>       -----------------------------------------------------
>> and control communications by specific sequencing. configuring this
>> appears to require being able to pull RX Low
>>> The MCU unit can reset the device UART and protocol state machine at
>>> any time by holding the RX input low for a period of at least 12 bit
>>> times (16 × 12 CLK periods).
>> practically i can always pull RX low via other means, but if the UART
>> can do this it would be better and be more generic.
> How can your UART do that in a generic way? thanks, greg k-h sorry

im not sure i explained that clearly

i also appear to have, not got the previous diagram right, (corrected in this reply for clarity) Im still getting used to plain text emails.

im not that familiar with UARTs in practice, and after re-reading i think i could have phrased that better, as had issue with MCU/IC UART TX/RX perspectives

e.g

|-----------|           |-----------|
|         TX|-----------|RX         |
| MCU UART  |           |    IC     |
|         RX|-----------|TX         |
|-----------|           |-----------|

from the mcu perspective its the TX pin, while from the RX pin from the ICs perspective.

from that perspective i need to pull the ICs RX pin low which means pull the MCU UART TX pin Low.

now this seems conceptually similar to a "break condition"

which some tty functions can produce
e.g
static int send_break(struct tty_struct *tty, unsigned int duration) [https://elixir.bootlin.com/linux/latest/source/drivers tty/tty_io.c#L2461]

with which i might me half way to answering my own question

i can't see call to that via serdev, or equivalent


however the serdev code sits on top of the tty code (http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf#Outline0.11)

it appears i would have to somehow get to the underlying send_break() function without breaking anything

which needs a vaild tty_struct which appears to be part of tty_port and can get via

struct tty_struct *tty_port_tty_get(struct tty_port *port);

and it appears that you can get that via

struct serport *serport = serdev_controller_get_drvdata(ctrl);

and can get struct serdev_controller *ctrl from struct serdev_device


but doing that cleanly is another thing.


i could either try and write something like that into the driver or could try and write a patch for serdev that effectively calls that function in tty so a serdev device can request a break from itself

unless there is a alternative im not seeing.

if there is any advice you can give that would be helpful


kind regards

christopher tyerman




































[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux