Re: [PATCH 3/3] serial: sh-sci: Add calculation recive margin for HSCIF

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

 



Hi Iwamatsu-san,

On Mon, Jul 14, 2014 at 9:10 AM, Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.yj@xxxxxxxxxxx> wrote:
> When the error of the same bit rate is detected, we will need to select
> the recive margin is large. Current code holds the minimum error, it does
> not have to check the recive margin. This adds this calculation.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@xxxxxxxxxxx>

I know this patch was applied a while ago.

> ---
>  drivers/tty/serial/sh-sci.c | 77 ++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 7f571a8..d879c0c 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -1783,13 +1783,30 @@ static unsigned int sci_scbrr_calc(struct sci_port *s, unsigned int bps,
>         return ((freq + 16 * bps) / (32 * bps) - 1);
>  }
>
> +/* calculate frame length from SMR */
> +static int sci_baud_calc_frame_len(unsigned int smr_val)
> +{
> +       int len = 10;
> +
> +       if (smr_val & SCSMR_CHR)
> +               len--;
> +       if (smr_val & SCSMR_PE)
> +               len++;
> +       if (smr_val & SCSMR_STOP)
> +               len++;
> +
> +       return len;
> +}

The above function isn't needed...

>  /* calculate sample rate, BRR, and clock select for HSCIF */
>  static void sci_baud_calc_hscif(unsigned int bps, unsigned long freq,
>                                 int *brr, unsigned int *srr,
> -                               unsigned int *cks)
> +                               unsigned int *cks, int frame_len)

... because the new "frame_len" parameter is unused...

> @@ -1858,8 +1907,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
>         baud = uart_get_baud_rate(port, termios, old, 0, max_baud);
>         if (likely(baud && port->uartclk)) {
>                 if (s->cfg->type == PORT_HSCIF) {
> +                       int frame_len = sci_baud_calc_frame_len(smr_val);

... hence calculating this isn't needed.

>                         sci_baud_calc_hscif(baud, port->uartclk, &t, &srr,
> -                                           &cks);
> +                                           &cks, frame_len);
>                 } else {
>                         t = sci_scbrr_calc(s, baud, port->uartclk);
>                         for (cks = 0; t >= 256 && cks <= 3; cks++)

Is there some follow-up patch missing?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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