public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu OTHACEHE <m.othacehe@gmail.com>
To: johan@kernel.org
Cc: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support
Date: Mon, 2 May 2016 20:37:15 +0200	[thread overview]
Message-ID: <20160502183715.GA4453@gmail.com> (raw)
In-Reply-To: <20160502180407.GA4330@gmail.com>

Hi Johan,

Thanks for your review.

> Looks like this code could use a few vid/pid temporaries.

> I'm not sure it makes sense to try to load a "ti_usb-v110a-p1150.fw"
> firmware before requesting the moxa firmware. Avoids a confusing:

> usb 1-2.2: Direct firmware load for ti_usb-v110a-p1150.fw failed with error -2

> message too.

I'm not sure to get your point here, shall I rename moxa firmwares in linux-firmware repo
to be compliant with ti_usb-v%04x-p%04x.fw format ?

> I did a quick test of the patch using a Moxa 1150-device. Works at
> 115200, but communication appeared broken at 9600. Looks like the baud
> rate calculations are similar but not identical to what the Moxa driver
> does. Is this something you have looked into?

Well, on my moxa 1110 communication is working at 9600, 115200 and other baud rates.
However, I think baud rate calculation may be wrong for TI3410 chips.

According to table 5-13 in datasheet http://www.ti.com/lit/ds/symlink/tusb3410.pdf
the baud rate calculation formula, is :

baud_rate = 923077 / (desired_baud_rate)

So, we get :

desired_baud = 9600   -> baud_rate = 923077 / 9600 = 96
desired_baud = 115200 -> baud_rate = 923077 / 115200 = 8
...

In ti_usb_3410_5052 driver, the formula used for 3410 is :

baud_rate = (923077 + desired_baud_rate/2) / desired_baud_rate

so,

desired_baud = 9600   -> baud_rate = (923077 + 9600/2) / 9600 = 97 (!= 96)
desired_baud = 115200 -> baud_rate = (923077 + 115200/2) / 115200 = 9 (!= 8)

It seems the formula is wrong but some firmware deal with it anyway.
Should I correct the formula or use a quirk for moxa devices ?

Thank you,

Mathieu

       reply	other threads:[~2016-05-02 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160502180407.GA4330@gmail.com>
2016-05-02 18:37 ` Mathieu OTHACEHE [this message]
2016-05-03  8:14   ` [PATCH] usb: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support Johan Hovold
2016-05-03 11:46     ` Mathieu OTHACEHE
2016-05-04  7:40       ` Johan Hovold
2016-03-02  9:46 Mathieu OTHACEHE
2016-04-24 15:59 ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160502183715.GA4453@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox