From patchwork Fri Jun 2 12:46:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 688687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EC9FC7EE24 for ; Fri, 2 Jun 2023 12:46:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235465AbjFBMqv (ORCPT ); Fri, 2 Jun 2023 08:46:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235145AbjFBMqu (ORCPT ); Fri, 2 Jun 2023 08:46:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E7A118C; Fri, 2 Jun 2023 05:46:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DCD706501F; Fri, 2 Jun 2023 12:46:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 488E9C433EF; Fri, 2 Jun 2023 12:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685710008; bh=Ja8wGgMtSQRHBWHquX+EUjKNR8wzL800/eoXUfWWbuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dywXsl6gXdpD7AZoMXIdBbji/kK6yXWUwuYG2uL6Pa9n82LO9p/c2rYcSNTExMAyr KFdnxT1M+Bev4jtmHKGOpNpBDAcNYTesAgIxq6te6wu8gNokgQgci/Yve0XLMxOoIG +G3oL7mSPK5of78lXtBmSJyI1nQv1nS8SGCm+irKwvLD/s2x0QIYsQbYcdNLqSgmJw SNEs+wEA8ABJ4CSoXf+iF0s8hg+xwJw0sJJ4EBAM6rJhODh9eEF0kbHLdDrgiaA57F T/C8UDnGcmc6zFLxr7f7tJ6lHnAYmiDZ9b92Q2pkTe/Rc2g8grBdMJkL7W8uuLA99D WtkVloIS4DTRQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1q54BG-0004y1-3C; Fri, 02 Jun 2023 14:46:58 +0200 From: Johan Hovold To: Johan Hovold Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Corey Minyard Subject: [PATCH 2/3] USB: serial: cp210x: disable break signalling on CP2105 SCI Date: Fri, 2 Jun 2023 14:46:41 +0200 Message-Id: <20230602124642.19076-3-johan@kernel.org> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230602124642.19076-1-johan@kernel.org> References: <20230602124642.19076-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Only the first UART interface (ECI) on CP2105 supports break signalling. Return an error on requests for break state changes for the second interface (SCI) to avoid transmitting a garbage character and waiting when break is not supported. Signed-off-by: Johan Hovold --- drivers/usb/serial/cp210x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 81e49ed9d147..1e61fe043171 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1437,8 +1437,14 @@ static int cp210x_tiocmget(struct tty_struct *tty) static int cp210x_break_ctl(struct tty_struct *tty, int break_state) { struct usb_serial_port *port = tty->driver_data; + struct cp210x_serial_private *priv = usb_get_serial_data(port->serial); u16 state; + if (priv->partnum == CP210X_PARTNUM_CP2105) { + if (cp210x_interface_num(port->serial) == 1) + return -ENOTTY; + } + if (break_state == 0) state = BREAK_OFF; else