Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbdFLR0d (ORCPT ); Mon, 12 Jun 2017 13:26:33 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34587 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbdFLR0b (ORCPT ); Mon, 12 Jun 2017 13:26:31 -0400 From: Tal Shorer To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, balbi@kernel.org, corbet@lwn.net Cc: Tal Shorer Subject: [PATCH 0/8] Allow f_acm gadgets to notify the user about SetLineCoding requests Date: Mon, 12 Jun 2017 20:26:07 +0300 Message-Id: <1497288375-3559-1-git-send-email-tal.shorer@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2013 Lines: 44 I'm currently working on a project where I'd like to have an omap board running linux be a usb-to-uart converter (using f_acm), and I've ran into an issue: there's no way for the application to know if the host has issued a SetLineCoding requests (after which parity/baudrate should be changed to match the host's request). This series adds the support necessary to achieve that: - Allowing tty drivers to supply a poll() function to notify the user of driver-specific events. - Propagating poll() and ioctl() from u_serial to the next layer (f_acm) in this case. - Let the user read the current line coding set by the host (via an ioctl() call). - Notify the user when there's a pending SetLineCoding request they haven't read yet The last patch also removes up the port_line_config field from struct gserial. It made no sense to have there (and had a REVISIT comment at every turn), it was never used and it was initialized with invalid values. Tal Shorer (8): tty: add a poll() callback in struct tty_operations usb: gadget: u_serial: propagate poll() to the next layer usb: gadget: f_acm: validate set_line_coding requests usb: gadget: u_serial: propagate ioctl() to the next layer usb: gadget: f_acm: initialize port_line_coding when creating an instance usb: gadget: f_acm: add an ioctl to get the current line coding usb: gadget: f_acm: notify the user on SetLineCoding usb: gadget: u_serial: remove port_line_config from struct gserial Documentation/ioctl/ioctl-number.txt | 1 + drivers/tty/n_tty.c | 2 ++ drivers/usb/gadget/function/f_acm.c | 66 +++++++++++++++++++++++++++++----- drivers/usb/gadget/function/u_serial.c | 53 ++++++++++++++++----------- drivers/usb/gadget/function/u_serial.h | 7 ++-- include/linux/tty_driver.h | 3 ++ include/uapi/linux/usb/f_acm.h | 12 +++++++ 7 files changed, 113 insertions(+), 31 deletions(-) create mode 100644 include/uapi/linux/usb/f_acm.h -- 2.7.4