From: Craig H. <cr...@gu...> - 2006-07-03 23:35:15
|
On Jul 2, 2006, at 12:35 PM, Dave Hylands wrote: > Hi Darren, > >> The thing I've been confused about from the gitgo, is what exactly >> serial_pxa_verify_port() is supposed to be verifying. pxa.c is not >> exactly bursting with comments. In the upatched version, >> serial_pxa_verify_port() always returns -EINVAL which was causing my >> custom_divisor to be rejected. I had originally changed it to always >> return 0. Craig patched it to do the baud rate checks, but that >> broke the custom_divisor again. Should I go back to just returning >> zero? > > So I poked around a few other drivers to see what they're verify_port > routines do, and basically, it just seems to be doing a few basic > validity checks. > > These checks are typically: > - Verify that the port type has been filled in properly > - Verify that the IRQ is valid > - Verify that baud base is valid > - Verify that the port is setup as memory mapped, if only memory > mapped support is available > > I think that the reason for verify_port is when a platform can have > multuple types of serial ports, or variable multiples of the same > serial port. > > So, I think that returning -EINVAL is wrong, and I think trying to > check baud rates is wrong. Checking uartclk/16 == baud_base seems > fine. > > I'll ask on the arm-linux list. My intention was precisely to deal with the difference between FFUART/ STUART vs BTUART/HWUART which are subtly different on the PXA -- I wanted to check that if you are setting the baud rate on a UART, that it's in range for that UART. C |