Re: [PATCH v1 1/3] serial: 8250: introduce helper to configure prescaler

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

 



Hi Andy,

On Wed, Mar 11, 2015 at 05:45:40PM -0400, Peter Hurley wrote:
> > +/**
> > + * serial8250_get_ps - calculates prescaler, nominator, and denominator values
> > + * @port:	pointer to struct uart_port object
> > + * @baud:	baud rate
> > + * @fref:	reference frequency in Hz
> > + * @width:	maximum width of @m and @n in bits
> > + * @m:		nominator of fractional divider
> > + * @n:		denominator of fractional divider
> > + *
> > + * The fractional divider is used to provide different frequencies from one
> > + * source. The following formulas are used to show the relations between Fref,
> > + * Fuart, prescaler, nominator, and denominator values:
> > + *
> > + *	Fuart = Fref * m / n, where m <= n
> > + *
> > + *	baud = Fuart / (prescaler * DLAB)
> > + *
> > + * Return:
> > + * Prescaler value from 16 to 1, and sets port UART clock to the corresponding
> > + * value. Since serial core considers base Fuart = baud * 16, the given value
> > + * of Fuart will be in proportion to that:
> > + *
> > + *	Port UART clock = Fuart * 16 / prescaler
> > + */
> > +unsigned short serial8250_get_ps(struct uart_port *port, unsigned int baud,
> > +				 unsigned int fref, unsigned short width,
> > +				 unsigned int *m, unsigned int *n)
> 
> I don't think this belongs in the 8250 core; this should be a static helper
> function to those 2 Intel parts.

I agree with Peter. Let's not put this kind of stuff straight into
8250_core.c.


Cheers,

-- 
heikki
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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