Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3600475ybv; Tue, 25 Feb 2020 04:09:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzhk2GlPZUWePexYVXiO+oGNWubmtA0Bgra+CJtMEkndEjzt2AmFm2vnDDezcweDe28pQbD X-Received: by 2002:a9d:6b84:: with SMTP id b4mr44850397otq.190.1582632569509; Tue, 25 Feb 2020 04:09:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582632569; cv=none; d=google.com; s=arc-20160816; b=k2hfVTYK3EPMcLAY53LDesiWhjQtjbtoCtByitISQ6qAsY5BEduRRalfMdCaK1HR9q OqwI0wteEDlZDCRVQ0gVwLa7qSwDMbTo5q8a+woYZFFy3hcpbUm7xG33kJTxZShuMEh4 PhRBfksIYXJ9ISnX3V8UUtozCV6zp1uusOL7uaSDtl33M5qWi1FiyQUXZJvNkBzVxA2J zTXWZkfodOf4n86Dj6rtVkont59cwhCpnx8nGDnHKCqDDUhMQrY1uaC5gxFRo0vg/IY/ rIukNHBprEmjwBLLJKU5zZj5aRGIiSp/qF7YH0e9jAsb81wdo05CDij2lmXNZ7xS5Awc I7jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=6veU3zcurqB+x87LSW0HY63Q2hg6fVyMJOo0byrm8sg=; b=BKvHKhxRsYKamG5+AdqJKV2ULMdM2BhnyvwtqLJsvr2fUhUTSiIQpK0Kz73SgCqqvz Twuw9c25cKJ366maP8DlTb95tuN8uCuCSKc6a7lm52s9TCUV2mlrfuiLulJFf7XWoWqd lj9GqM9F8zVtaiz6+CcMSWhDDMaT2dxm7eFqJ0Z+etWab+2LbXDakJ70FpYBKLlS9C0F 1xakhrUIIKOVFqUm2cFVI+LkHROYU4B6HLAko/P8l0rCNhsvN3WaK53AUbLhryjwvZFN BXFEATQ4pN+1lKhEL9CH0l6KuooHUBlEoGtQZAolzPjRhZSIn2t2+m0P4QZJcmcmkFOd gnfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f190si7190211oig.229.2020.02.25.04.09.17; Tue, 25 Feb 2020 04:09:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730428AbgBYLNj (ORCPT + 99 others); Tue, 25 Feb 2020 06:13:39 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33922 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbgBYLNj (ORCPT ); Tue, 25 Feb 2020 06:13:39 -0500 Received: by mail-lj1-f193.google.com with SMTP id x7so13584382ljc.1; Tue, 25 Feb 2020 03:13:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6veU3zcurqB+x87LSW0HY63Q2hg6fVyMJOo0byrm8sg=; b=ZmZFtszWqzFPoZiFWlaULNwsTdJXaqUwvRMSH/on5mfPkUvO7KPKBei7E4r0HVNigJ UpKdwsXkez9Shs48ruAvHD2AnfD2Yy1tatPLPXfkUSsvCdEFpSEuaVeLsvbXqsSDuUgz 3i0THu5/kby4ByJD8xhxv0wQtZandVhyGSv1M+vAgpG24ZtQwU1nbiaAeySZ+BkHLevV 77/MIKngPipiFuNBYwBXkFKWjmJVrZ5xGt5mu5be4mK4OvZIxox6cCIY3I/GtDtasG2f QEKmbRmwqCYkoYKh5d8Ky2DeW+kBjizmxRvqFgqIaeKKR187h4wCzRuB/ry8XAtRLHFz +15Q== X-Gm-Message-State: APjAAAW7lLF0FTjuIHJzC7rr2zAvtbNs6/E4OQHNaggwloaNwCuMby+X xSvF1hPupyhFh35GE5NTxGQ= X-Received: by 2002:a2e:3e10:: with SMTP id l16mr32689721lja.286.1582629217302; Tue, 25 Feb 2020 03:13:37 -0800 (PST) Received: from xi.terra (c-12aae455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.170.18]) by smtp.gmail.com with ESMTPSA id q17sm7584872ljg.23.2020.02.25.03.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 03:13:36 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1j6Y9c-0004aG-Lw; Tue, 25 Feb 2020 12:13:32 +0100 Date: Tue, 25 Feb 2020 12:13:32 +0100 From: Johan Hovold To: "Ji-Ze Hong (Peter Hong)" Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter_hong@fintek.com.tw, "Ji-Ze Hong (Peter Hong)" Subject: Re: [PATCH V3 4/6] USB: serial: f81232: Add F81534A support Message-ID: <20200225111332.GS32540@localhost> References: <20200130054752.9368-1-hpeter+linux_kernel@gmail.com> <20200130054752.9368-5-hpeter+linux_kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200130054752.9368-5-hpeter+linux_kernel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 30, 2020 at 01:47:50PM +0800, Ji-Ze Hong (Peter Hong) wrote: > The Fintek F81532A/534A/535/536 is USB-to-2/4/8/12 serial ports device > and the serial port is default disabled when plugin computer. > > The IC is contains devices as following: > 1. HUB (all devices is connected with this hub) > 2. GPIO/Control device. (enable serial port and control GPIOs) > 3. serial port 1 to x (2/4/8/12) > > It's most same with F81232, the UART device is difference as follow: > 1. TX/RX bulk size is 128/512bytes > 2. RX bulk layout change: > F81232: [LSR(1Byte)+DATA(1Byte)][LSR(1Byte)+DATA(1Byte)]... > F81534A:[LEN][Data.....][LSR] > > Signed-off-by: Ji-Ze Hong (Peter Hong) > +static void f81534a_process_read_urb(struct urb *urb) > +{ > + struct usb_serial_port *port = urb->context; > + unsigned char *data = urb->transfer_buffer; > + char tty_flag; > + unsigned int i; > + u8 lsr; > + u8 len; > + > + if (urb->actual_length < 3) { > + dev_err(&port->dev, "short message received: %d\n", > + urb->actual_length); > + return; > + } > + > + len = data[0]; > + if (len != urb->actual_length) { > + dev_err(&port->dev, "unexpected length: %d %d\n", len, > + urb->actual_length); > + return; I rephrased this as dev_err(&port->dev, "malformed message received: %d (%d)\n", urb->actual_length, len); before applying. Johan