Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3840735imm; Wed, 5 Sep 2018 06:54:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZIPpPsH6GrzB0ex2Oxbm3IHSyHLy4PCQpr+dBc7iqq6n2FPv4iApCR+vLqas3/qL0PPBMb X-Received: by 2002:a65:5284:: with SMTP id y4-v6mr36342875pgp.283.1536155696419; Wed, 05 Sep 2018 06:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536155696; cv=none; d=google.com; s=arc-20160816; b=fOt7V0eCSTkvXA3yriQTdrwD2UNTnNhmG4P+At1jGdyn8LSMDuZO1H37Qk70iOLdra z9t3qpFp2Tll0o0Ps0tbdqxKBz6U1q26aUQkkUvYuFNuq9+v3ZO6q3YVA2bEIrquRoLP p7zptmw2iRsZrSQqxKZCJXngKbppH+CzOI/3v3mCR2yEBvwbwZLmU7Ze02HLeMcY9DkS yjLgkvLjrnAI/9R8mP5c1wYuHlEUYdcpN1nvk5TiWP6FNwf7nho6Yj94K5fyzCWqLc/Q yP2oglAoiI2RLULzI+7NfAmu9jNasdvwPgVylHTYxYw+maJKbJj/m93G46MyQOW9GRLj /UbA== 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:cc:from:references:to:subject; bh=Da4YUxhBpIfPfjlpSkwpoDsNDa24R4m4JPqhYY+xXOo=; b=YqE+oHftccHWezCeIOlZm9eJF4bEwUr7lc7pdoWOlW0SEUVhuqxiztFzUmR3MmCYVl DkQhE/OlP8o1wgMzCD77zURsId0OL0R05bnjJsOx/0K4qH7zSWgHOVb4x6xtwPL+CaYl 7fIbt+Gqg9iX++kHBapd7SYlmLsDXVuOZzHZsy47PWgYR0hc5H6Z0/eoyUcZxJd4Ew4d YQYfR1IIJ443ck/2fvxx2gh+50AML31Mf5NP3Y6XY8Lb89khbzhL8jU65D/+X95XidHv FXCKsfmdHJUA3PXhbYIrc28ry0kAahokA6yvSnkK/sj53g8MVbFYxT+TK0MHQG2cqxOq mp6Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 198-v6si2143568pfz.119.2018.09.05.06.54.40; Wed, 05 Sep 2018 06:54:56 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727749AbeIESX3 (ORCPT + 99 others); Wed, 5 Sep 2018 14:23:29 -0400 Received: from mout02.posteo.de ([185.67.36.142]:60007 "EHLO mout02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbeIESX3 (ORCPT ); Wed, 5 Sep 2018 14:23:29 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 180CA2106E for ; Wed, 5 Sep 2018 15:53:07 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4254sW66K2z9rxZ; Wed, 5 Sep 2018 15:53:03 +0200 (CEST) Subject: Re: [PATCH v3 2/2] tty/serial: atmel: add ISO7816 support To: Ludovic Desroches References: <20180807130049.5957-1-ludovic.desroches@microchip.com> <20180807130049.5957-3-ludovic.desroches@microchip.com> <20180809113035.kftvdalca7zsf4ly@M43218.corp.atmel.com> <20180905124341.5n4gadgd5luza7fd@M43218.corp.atmel.com> From: Richard Genoud Cc: linux-serial@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alexandre.belloni@bootlin.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, jslaby@suse.com, Nicolas Ferre Message-ID: <211528d5-81b6-46f2-4191-66023d928ae3@sorico.fr> Date: Wed, 5 Sep 2018 15:53:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180905124341.5n4gadgd5luza7fd@M43218.corp.atmel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [added Nicolas back in the thread, he was removed somehow] Hi Ludovic ! On 05/09/2018 14:43, Ludovic Desroches wrote: > Hi Richard, > > On Thu, Aug 09, 2018 at 01:30:35PM +0200, Ludovic Desroches wrote: >> Hi Richard, >> >> On Thu, Aug 09, 2018 at 10:47:17AM +0200, Richard Genoud wrote: >>> Hi ! >>> >>> On 07/08/2018 15:00, Ludovic Desroches wrote: >>>> From: Nicolas Ferre >>>> >>>> When mode is set in atmel_config_iso7816() we backup last RS232 mode >>>> for coming back to this mode if requested. >>>> Also allow setup of T=0 and T=1 parameter and basic support in set_termios >>>> function as well. >>>> >>>> Signed-off-by: Nicolas Ferre >>>> [ludovic.desroches@microchip.com: rebase, add check on fidi ratio, checkpatch fixes] >>>> Signed-off-by: Ludovic Desroches >>>> --- >>>> drivers/tty/serial/atmel_serial.c | 211 +++++++++++++++++++++++++++++++++++--- >>>> drivers/tty/serial/atmel_serial.h | 6 +- >>>> 2 files changed, 201 insertions(+), 16 deletions(-) >>>> >>>> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c >>>> index 8e4428725848..4a7ec44b0ace 100644 >>>> --- a/drivers/tty/serial/atmel_serial.c >>>> +++ b/drivers/tty/serial/atmel_serial.c >> >> [...] >> >>>> #if defined(CONFIG_OF) >>>> +static struct atmel_uart_pdata at91rm9200_pdata = { >>>> + .fidi_min = 1, >>>> + .fidi_max = 2047, >>>> +}; >>>> + >>>> +static struct atmel_uart_pdata at91sam9260_pdata = { >>>> + .fidi_min = 1, >>>> + .fidi_max = 2047, >>>> +}; >>>> + >>>> +static struct atmel_uart_pdata sama5d3_pdata = { >>>> + .fidi_min = 3, >>>> + .fidi_max = 65535, >>> Are you sure this is for sama5d3 ? >>> From the datasheets I have, 65535 is for sama5d4/sama5d2 >> >> I checked it and I missed it. What a pity... In fact, it's a bit more >> tricky since the min value for d3 is 3 and no longer 1. >> >>> And also, you'll have to s/atmel,at91sam9260-usart/atmel,sama5d2-usart/g >>> in sama5d{2,4}.dtsi >>> >> >> Yes, I planed to send it later but I can add those patches within this >> set of patches. >> >>> But I wonder if it could be detected via ATMEL_US_VERSION instead ? >>> >> >> I have not checked, I tend to prefer the compatible string for this kind >> of thing. But as we already use the version number, I can investigate >> this solution if it's the one you prefer. >> > > ping about this question still in suspend in order to prepare a new version. Well, if we use the compatible string for this, we will have to add : - atmel,sama5d2-usart - atmel,sama5d3-usart - (maybe others ?) to the already existing : - atmel,at91sam9260-usart - atmel,at91rm9200-usart just for setting different limits on the fidi register. IMHO, it seems a bit overkill. Moreover, the ATMEL_US_VERSION has already been read, so... But if you think adding compatible strings is a better/cleaner solution, just convince me ! :)