Re: SERIAL_IMX shutdown in RS485 mode

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

 



Hi,

In general it's to late to setup pinmuxing only when probe is done. Look
at pinctrl_bind_pins(). That's the function that is called before probe.
It might be possible to hack something with an "init" pinctrl state.
This doesn't help though if the CTS function is already the default
being selected at powerup.
Pinmuxing while probing, if available at all, should be an option activated in the device tree. Since I'm green here, I can't suggest a good way to have it done. Then, pinctrl_bind_pins could check if this option is enabled, if yes, it would skip the muxing or whole initialization of pin / pingroup.

In this case it would solve the problem, because CTS_B is muxed with GPIO1_IO09, which is the default after power on or reset. With no further config a GPIO in i.MX6 is an input, so that should not activate the transmitter.

Is there a decent mechanism for a driver to tell
- what pins are assigned fir this driver, and
- that a pin is reserved or used by something else in Linux?
I guess you don't want to explore that to determine if it's safe to
disable the UART. IMHO that's too much.

Actually, yes, I was considering something like that (with checking for pin reserved or used by something else), but I agree, it may be not a good idea. One way or another it falls back to just "hidden" re-muxing to GPIO.

If able to check the assigned pins, the driver could check if it has CTS_B, or GPIO, and, depending on that, could use UCR2 or regular gpio for controlling the "driver enable" line. The prerequisite is the ability of the driver to check what pins it has available.

Best regards,
Adam



[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