Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp217070imm; Wed, 29 Aug 2018 18:57:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdamFStfNJ+rPfdw4Nf372ZfNs/PctYmIt2cRj+JQT09CMCUtP8MdmilnASuKq/bPSUxkatO X-Received: by 2002:a17:902:bf0b:: with SMTP id bi11-v6mr8262566plb.76.1535594261595; Wed, 29 Aug 2018 18:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535594261; cv=none; d=google.com; s=arc-20160816; b=HIjYaHwe8VY72ypMqPXYLfVdmgdWWMkGjuE+OPVKcpHmg88eHXQsbcJljhsnx3C2VR IGB/wIHAWZjMkVpo2+yqjco1ZzBOeJGFP1RuDG2HnZ6Xx7JdQpo8lu6QS37vHc+ltQ11 iC7l6LLI3Xu7IJEq/aNiFr5N5/kS5Fa9U6nYoeE2lD3T83Lb+boxZNuFgGYaaKWWoiQf 5wFS8Np4unNH/Tiubrogdfitxlr5X9Ljpe7JLm6TGL+nso8+AiOzHEqtc7r33huXG1Ov DjfHc6UWTqIUh3BElZDCMfsNOmrfr9ZI3dMKmGoMdU2X6gvmqAHvzV7E2HYZoRJPdtEm CJZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=+cBkw1eH4L5nXn84Hsq69myaOod6+b7O8aUNTieI4RM=; b=iL4Su3retlmocyq1XCpP1bHhlzCxzTgQlamKV7rbiN9pB3JTxJ5t8yXPDrkJBcFIWX LwJUt0G/SB93p0FFwNTs/lO7ZMWG24cKL3drch70y6cE7DvFnEbKkoHq47zGpzgdJaSy WARbEICPtKkW3k+bV3VGs35liKLuPk472W25+DWBIY36GyIsVJ6p/+juLUHEdvV6g8o1 IAGGqib1sx2WxAo/fiaMglPLLkGFngcKWt/wKhm74c5y4Uls9FwtkwjyMcFm1O/5EHlg 7iUpCcbBicwtRHZAorp4l96PrjUjSTfZj9AlWEG+tqG3B8fJXmeKr4LF+9gwYxO2En/X 48LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XDnmbdSV; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24-v6si5187582pls.477.2018.08.29.18.57.26; Wed, 29 Aug 2018 18:57:41 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XDnmbdSV; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727288AbeH3Fza (ORCPT + 99 others); Thu, 30 Aug 2018 01:55:30 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43589 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbeH3Fz3 (ORCPT ); Thu, 30 Aug 2018 01:55:29 -0400 Received: by mail-pf1-f195.google.com with SMTP id j26-v6so3111236pfi.10; Wed, 29 Aug 2018 18:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=+cBkw1eH4L5nXn84Hsq69myaOod6+b7O8aUNTieI4RM=; b=XDnmbdSVImRHUxU4XLpaCxtTXnkraxxyHvsrkb+0fh7ibDBG2IUuIASD7c5S/ULfMn j40uFYTZWgywsl5S5t1QL85dlL99KZpKUviul0b9YMj7fumxIpYkWBc4unFpz/AjrFhM BVrZTn7Gr23r4WIJBW/KXAwoUsU+l4vrPnOkM36/CfiSytZr+A48Gsp/ieje0pkmahJm cfl/1HVuwr7ZrJ7rNC5X5YVGLrTdp0NVk5LwGwYlnWrnIvEkjpiSI7K09CyaNjDZUt/a 1LneJ8U0WicJzD9c65c+LudVg+NgfRrGBfEgP8GL38wbDGLQShbKA8tlp+VsK9F5kPk6 +Dfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+cBkw1eH4L5nXn84Hsq69myaOod6+b7O8aUNTieI4RM=; b=WhF9P797mZH4Ir3srWDvFtCJRpBSQWjG4UwcDFOiTqhLo5ApYEASQWaV4Y8zGbgkP5 L17Vv3MRE0KmMv+H17dAxg9Rczb3YITn44KkeOIt7uB5CJzYjvL/+mbujhJEU1C5jPNS l70MXR4p3Z5aQrmCi/LnmSV519Rog8wnHnzE4TMHtRcQ68SsDPLprwBeff0Eh3LXe/55 cnoRWJEgHThn7Ebr5LSsDDnfE8twx9hgJIOgZH6mpB4Trt1vU7M/MMASB94lB5cjTR5o Wjrl4Y4o126+sUYuhCsWYT/yIZn9q+hMzS9QzFGsSZ+rwTN44VhC7JT9d2qK3m81Moyw clOQ== X-Gm-Message-State: APzg51Akf8MydtPUe9/pYH8cuf7md1/NhSz1RjRp9B/GSsjTV3BfyjpE RCcLb0ZQw5KszqghzpKkbHs= X-Received: by 2002:a63:d806:: with SMTP id b6-v6mr5530173pgh.347.1535594146859; Wed, 29 Aug 2018 18:55:46 -0700 (PDT) Received: from [192.168.1.54] (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id e14-v6sm7354180pff.128.2018.08.29.18.55.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Aug 2018 18:55:46 -0700 (PDT) Subject: Re: [PATCH V2 3/4] serial: f81232: implement break control From: "Ji-Ze Hong (Peter Hong)" To: johan@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter_hong@fintek.com.tw, hpeter+linux_kernel@gmail.com References: <1535593634-22004-1-git-send-email-hpeter+linux_kernel@gmail.com> <1535593634-22004-4-git-send-email-hpeter+linux_kernel@gmail.com> Message-ID: <3f4bc3ff-1e72-54ee-1047-c69a0ff45771@gmail.com> Date: Thu, 30 Aug 2018 09:55:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1535593634-22004-4-git-send-email-hpeter+linux_kernel@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Johan, This article is duplication with [PATCH V2 3/4] USB: serial: f81232: implement break control [PATCH V2 3/4] serial: f81232: implement break control (Title not start with USB token) Should I discard this PATCH_V2 series and re-send PATCH_V3 ? or could you discard the patch - serial: f81232: implement break control only ? Thanks Ji-Ze Hong (Peter Hong) 於 2018/8/30 上午 09:47 寫道: > Implement Fintek F81232 break on/off with LCR register. > It's the same with 16550A LCR register layout. > > Signed-off-by: Ji-Ze Hong (Peter Hong) > --- > v2: > 1: Fix f81232_break_ctl() for mis-operated set_mask_register(). > 2: Add set break control bit in f81232_set_termios(). > > drivers/usb/serial/f81232.c | 32 ++++++++++++++++++++++++++------ > 1 file changed, 26 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c > index 56adae8a9ee0..863430d7535f 100644 > --- a/drivers/usb/serial/f81232.c > +++ b/drivers/usb/serial/f81232.c > @@ -65,6 +65,7 @@ struct f81232_private { > struct mutex lock; > u8 modem_control; > u8 modem_status; > + bool is_break; > speed_t baud_base; > struct work_struct lsr_work; > struct work_struct interrupt_work; > @@ -377,13 +378,24 @@ static void f81232_process_read_urb(struct urb *urb) > > static void f81232_break_ctl(struct tty_struct *tty, int break_state) > { > - /* FIXME - Stubbed out for now */ > + struct usb_serial_port *port = tty->driver_data; > + struct f81232_private *priv = usb_get_serial_port_data(port); > + int status; > + u8 tmp = 0; > > - /* > - * break_state = -1 to turn on break, and 0 to turn off break > - * see drivers/char/tty_io.c to see it used. > - * last_set_data_urb_value NEVER has the break bit set in it. > - */ > + mutex_lock(&priv->lock); > + > + if (break_state) { > + priv->is_break = !!break_state; > + tmp = UART_LCR_SBC; > + } > + > + status = f81232_set_mask_register(port, LINE_CONTROL_REGISTER, > + UART_LCR_SBC, tmp); > + if (status) > + dev_err(&port->dev, "set break failed: %d\n", status); > + > + mutex_unlock(&priv->lock); > } > > static int f81232_find_clk(speed_t baudrate) > @@ -519,6 +531,7 @@ static int f81232_port_disable(struct usb_serial_port *port) > static void f81232_set_termios(struct tty_struct *tty, > struct usb_serial_port *port, struct ktermios *old_termios) > { > + struct f81232_private *priv = usb_get_serial_port_data(port); > u8 new_lcr = 0; > int status = 0; > speed_t baudrate; > @@ -572,11 +585,18 @@ static void f81232_set_termios(struct tty_struct *tty, > break; > } > > + mutex_lock(&priv->lock); > + > + if (priv->is_break) > + new_lcr |= UART_LCR_SBC; > + > status = f81232_set_register(port, LINE_CONTROL_REGISTER, new_lcr); > if (status) { > dev_err(&port->dev, "%s failed to set LCR: %d\n", > __func__, status); > } > + > + mutex_unlock(&priv->lock); > } > > static int f81232_tiocmget(struct tty_struct *tty) > -- With Best Regards, Peter Hong