[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <570A540C.5090706@ladisch.de>
Date: Sun, 10 Apr 2016 15:24:28 +0200
From: Clemens Ladisch <clemens@...isch.de>
To: Grigori Goronzy <greg@...wn.ath.cx>
Cc: Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 06/14] USB: ch341: reinitialize chip on reconfiguration
Grigori Goronzy wrote:
> Changing the LCR register after initialization does not seem to be
> reliable on all chips (particularly not on CH341A). Restructure
> initialization and configuration to always reinit the chip on
> configuration changes instead and pass the LCR register value directly
> to the initialization command.
> +++ b/drivers/usb/serial/ch341.c
> @@ -155,9 +157,7 @@ static int ch341_set_baudrate(struct usb_device *dev,
> a = (factor & 0xff00) | divisor;
> b = factor & 0xff;
>
> - r = ch341_control_out(dev, 0x9a, 0x1312, a);
> - if (!r)
> - r = ch341_control_out(dev, 0x9a, 0x0f2c, b);
> + r = ch341_control_out(dev, CH341_SERIAL_INIT, 0x9c | (ctrl << 8) , a | 0x80);
The variable b is no longer used, so it is no longer necessary to
compute the lower eight bits of the factor.
Regards,
Clemens
Powered by blists - more mailing lists