Received: by 10.223.176.46 with SMTP id f43csp2608779wra; Sun, 21 Jan 2018 23:59:37 -0800 (PST) X-Google-Smtp-Source: AH8x225xEX2cElfLzxw+LANX5bA4xqQbj7sKZi+LAuBAA6iYyuE0PDumZUxKtzOpA7tbQqlAk3e6 X-Received: by 10.99.147.70 with SMTP id w6mr6934931pgm.410.1516607977669; Sun, 21 Jan 2018 23:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516607977; cv=none; d=google.com; s=arc-20160816; b=paIRqBKDpI/MYXIPQwNSg9piKblPyJVHd4hbdqb1JkhPN51xemN0F5HjFW8VXRMazj +Dn7qozTWyLaraloJaTSb2uhFj2GR8jzsVFAMhdYaJbt4ZCaV+drrdGMZ9Af0oLygHR1 RevimZw3hk68bJBia+Wa9SvC+p7v8SJSjg7g2msjqeg9v5AF4u1Z5kXs13aBFztd/L7Z fb/UgKeOxqC7XgzEaLQnqJ7Ey5hbi8qWRbWL29wM1GlJ8UsOeUQBEGyzHTriDLqWTOPT iT7tsO8aIeoN5Lo4Msj2czqlHlXP36fTAoUjqv7K5okaq/aOTc7ypBtxBVhmQgSOhYM2 xCgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VpWfYiLj/R/YYZEpjjipMx1TC0KQMp0ALtd5E5OjsSg=; b=dem6f4El3i22QtHLXKX43BlccT5+cOiDmkei6TaF2YEDW2VhyQnK1a7CDHfCAjdBm3 fQLePooN5z48movpqwY/MTPWAwKPn1Q9/YwaRYb31oEut9F3S9WPPPBtWyrg1h11EDiA m2MG8Nhsw7O/WBmDJI45Xb7VQXI2JUvc5vjNQzBaY+KgLw4sKcwqSLespk75o1Zc5DIl mGXWjy/zu0F+za45/LyUJXVj0rAuGu4GdIULXOS/HHIciDNSJoFJZAHUYDfaRMNpGy+p 6H6zwNo2zJ83QyYJo2PF2c2m09jQZoSF1fMQMwNdyHFIbcqhA97awzsA0wxKWUYt7GVt w92w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iCxJJsog; 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=NONE 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 b25si13509879pgn.721.2018.01.21.23.59.23; Sun, 21 Jan 2018 23:59:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iCxJJsog; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbeAVH7A (ORCPT + 99 others); Mon, 22 Jan 2018 02:59:00 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35351 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbeAVH64 (ORCPT ); Mon, 22 Jan 2018 02:58:56 -0500 Received: by mail-pg0-f68.google.com with SMTP id o13so1354899pgs.2; Sun, 21 Jan 2018 23:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VpWfYiLj/R/YYZEpjjipMx1TC0KQMp0ALtd5E5OjsSg=; b=iCxJJsog9/4c0lfNNZS4XcBG8z3twIpy+AqrL7X+E5vjViXP5xaNbP4SywZnAwS99N MifhST8z8OA8Z5ZQLfT42S3zA0dmfRRRB5Xog3e7vBL4opI1AvWoiBwXGhpKua5lwno5 3XdTktod/c1eOlQkwyTcmvimRrP8Y1IJLMtPReFmKVzcGjKguqVUPsVaGtpQ1YIp1WUr RjBYzuU7ImAYVo8NGkpXY1zaLvf8XDmufYTIjRwigcHxDXVTLn1Bh7yNWdfWOYmyAEAg jwRshH8IscZ/ip/wRwulGc6zl72z8TtW+6V/ou72ij7YAL9XfTi4N5Kxn4y/zjsHYBEO ntqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VpWfYiLj/R/YYZEpjjipMx1TC0KQMp0ALtd5E5OjsSg=; b=bc/T8NaB3jbAOw/BeC2PlzWTweexImHGyC5L6j6k9ApBxkJPXI8v/qs6rtbz3AISRM YvQqhpzkssJQnlnmwQlbDZqFLJoTaE7aGl61TsbpsModDFjxO8fojpiGF8WrjwedgTex vdlys9pa0Ciq58AMp//Lls6kOeYojz5Wma/Fmz1DzQD4qrzzE94VFy8Ni7Czjh5bBBel 52VpDhlep0fm6k+rINlno4xuL6bpuzqtksXgvQ/vPGXSLSzYJyK4OGWJcmG13Y3OfKP3 +6xZi3enIC6PWnQCs2tjofZ9cy9M3IlX5VJJIda+iD38GFm3HN7K4qOUz6bXx2j41Xib Gr7Q== X-Gm-Message-State: AKwxytf/URlh4nAWoSUYvXWtb1obaz+V2jrgBJPG79l1e8m9woHN1mvg M8co53+PNPvKz9J3xBb3YsQ= X-Received: by 2002:a17:902:20e8:: with SMTP id v37-v6mr2947333plg.66.1516607936222; Sun, 21 Jan 2018 23:58:56 -0800 (PST) Received: from localhost (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id x26sm6050577pfi.96.2018.01.21.23.58.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jan 2018 23:58:55 -0800 (PST) From: "Ji-Ze Hong (Peter Hong)" X-Google-Original-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, "Ji-Ze Hong (Peter Hong)" Subject: [PATCH 4/5] USB: serial: f81232: implement break control Date: Mon, 22 Jan 2018 15:58:46 +0800 Message-Id: <1516607927-8887-4-git-send-email-hpeter+linux_kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516607927-8887-1-git-send-email-hpeter+linux_kernel@gmail.com> References: <1516607927-8887-1-git-send-email-hpeter+linux_kernel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) --- drivers/usb/serial/f81232.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index dadf024ae494..a054f69446fd 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c @@ -377,13 +377,18 @@ 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; - /* - * 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); + + status = f81232_set_mask_register(port, LINE_CONTROL_REGISTER, + UART_LCR_SBC, !!break_state); + if (status) + dev_err(&port->dev, "set break failed: %d\n", status); + + mutex_unlock(&priv->lock); } static int f81232_find_clk(speed_t baudrate) -- 2.7.4