tty: serial: imx: Add SW emulation for mark and space parity
Integrate software implementation for mark and space from guf mdb driver. Rewrite most of the code: Use controller_parity from the uart register Use available flags instead of new enum. Resort some code to remove dupplicated code snippets. Rewrite logic, more readable. Move mark and space parity to inline functions Disable DMA when CMSPAR is set, still port DMA needs to be disable to always work, as disable DMA after open (when setting CMSPAR via ioctl) is not implemented. Close and reopen after setting the bit does work.
Also cleanup the reconfiguration of ODD/EVEN during TX, as RX lost bytes in the mdb driver variant. Now the rx_interrupt routine is called until all buffers are empty before disalbe RX and change ODD/EVEN parity. This way the received bytes could be mapped to the parity config used during rx. Still a short moment RX is disabled which could lead to missed bits.
Theres also a busy wait until TX queues are empty, which could probably lead to high system load on slow datarates, as this might wait one byte long.
BCS 746-000322