From patchwork Wed Sep 26 12:58:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic Desroches X-Patchwork-Id: 10615923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDE0D913 for ; Wed, 26 Sep 2018 13:03:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABA482AE52 for ; Wed, 26 Sep 2018 13:03:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A81672AEDA; Wed, 26 Sep 2018 13:03:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B51412A672 for ; Wed, 26 Sep 2018 13:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+EPSnCm1G/wgh4CsnklCJn1MMXgOdRsZ//GRMm6CSJ8=; b=KZh4VZvk6i8QJc 2vlIpzp3i1Ztcfo+/jr9FqOWPMvv588D92UzTCTg5q4caydnmpk/30KsHA8iKHWSajcu4eFTeNcUc gwf3izJbAkIe6MoYtdCJ/9L/ZcbZaHIsANhOS3SAMzyP+l//6pOBi+k4jcDog6LdHkXQo+bBYNaXx zuetn0XwhBOuLqYzwUAxKBenew+PTUsuaLjbWM8WQNTk8Bqlh30hedGLeiQfzpZUl5RPrnW46KdRl l3935DAyqzNxUCsjeJAYgko+gtqAlCbbhuSUSQYij77Cn516CW0nDKsstyIktosCL9Vl++rVN4syK KFeZXHY+8Rs3M0lDK2ZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g59TV-0003A4-Gt; Wed, 26 Sep 2018 13:03:29 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g59T6-00034I-8N for linux-arm-kernel@lists.infradead.org; Wed, 26 Sep 2018 13:03:06 +0000 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="17805710" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Sep 2018 06:02:39 -0700 Received: from ibiza.corp.atmel.com (10.10.76.4) by chn-sv-exch06.mchp-main.com (10.10.76.107) with Microsoft SMTP Server id 14.3.352.0; Wed, 26 Sep 2018 06:02:38 -0700 From: Ludovic Desroches To: , , Subject: [PATCH v5 0/2] add ISO7816 support Date: Wed, 26 Sep 2018 14:58:46 +0200 Message-ID: <20180926125848.31032-1-ludovic.desroches@microchip.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180926_060304_372189_DD4824E1 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, arnd@arndb.de, richard.genoud@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Ludovic Desroches Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This patchset adds support for the ISO7816 standard. The USART devices in Microchip SoCs have an ISO7816 mode. It allows to let the USART managing the CLK and I/O signals of a smart card. Changes: - v5 - rebase on tty-next. - add documentation for the new ioctls (mimic rs485 one). - fix a switch/case identation - v4 - use the IP version number instead of the compatible string to set min and max values for fidi. - remove a useless macro for fidi. - v3 - add IOCTLs to parisc arch. - rework atmel_config_iso7816 according to the comments by Richard. - keep max iteration hard coded. Will see later if the user need to set this value. It may also concern the normal/inverse mode. - improve the checking of the value from the user space. - v2 - uart_get_iso7816_config: check there is an iso7816_config function. - use IOCTL macros to generate the IOCTL number. - check that reserved field is not used. - remove debug logs. - check that the iso7816_config is right before doing any action. - change the error from nack and max iteration status to a debug message. - remove patch 3 as it concerns both rs485 and iso7816 to think more about the need of adding a lock or not. Nicolas Ferre (2): tty/serial_core: add ISO7816 infrastructure tty/serial: atmel: add ISO7816 support Documentation/serial/serial-iso7816.txt | 83 ++++++++++++++ arch/alpha/include/uapi/asm/ioctls.h | 2 + arch/mips/include/uapi/asm/ioctls.h | 2 + arch/parisc/include/uapi/asm/ioctls.h | 2 + arch/powerpc/include/uapi/asm/ioctls.h | 2 + arch/sh/include/uapi/asm/ioctls.h | 2 + arch/sparc/include/uapi/asm/ioctls.h | 2 + arch/xtensa/include/uapi/asm/ioctls.h | 2 + drivers/tty/serial/atmel_serial.c | 190 ++++++++++++++++++++++++++++++-- drivers/tty/serial/atmel_serial.h | 3 +- drivers/tty/serial/serial_core.c | 60 ++++++++++ include/linux/serial_core.h | 3 + include/uapi/asm-generic/ioctls.h | 2 + include/uapi/linux/serial.h | 17 +++ 14 files changed, 360 insertions(+), 12 deletions(-) create mode 100644 Documentation/serial/serial-iso7816.txt