From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 627FCC4332E for ; Mon, 8 Mar 2021 19:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3805C6529E for ; Mon, 8 Mar 2021 19:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231226AbhCHTU4 (ORCPT ); Mon, 8 Mar 2021 14:20:56 -0500 Received: from mail-il1-f182.google.com ([209.85.166.182]:39342 "EHLO mail-il1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbhCHTUn (ORCPT ); Mon, 8 Mar 2021 14:20:43 -0500 Received: by mail-il1-f182.google.com with SMTP id d5so9893383iln.6; Mon, 08 Mar 2021 11:20:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1L6btlnZFWT2wUztSO9tevXV6NJv+ZeIlELKczZZaFw=; b=fiBkEUwIBB2ZVI4HgXNGwSh5aYF0eU2WpWUEtsMn9N2qAwIZ+/k3qfXi9n5RoZr3Q7 SQHMmOsyIhdoNxEayvuoSas6YiH57naDQ6CoW6Af8UOHDFw3rDn0jJ1TvmXV7XraiksP 5A1yp5VlZNAprxBvmJOoqcN5dW5n7KzqIp06Jgd99k+DvCnO5x8d4iY0/szF/3v6tuUN 2sMRQTnL6kHo/qIz7dZjQVblqq3HySJQGM4tG6bxkIBXpULEAcvs/b7mW7+hKTPBsE4M O6CguMWDa9N+JKFewtcjvIo2W86GULccvbr4LXaJ9BRdkpznfrWQ1lGEpIKC5xCpSQee yXAQ== X-Gm-Message-State: AOAM532MXfbcSBj13rFIOpBhChWztK8iyvFD/EGEntVjQfQgqkZnu6/r dcXaN6Orp8+7bje4Nwfk0l3nIS+HHw== X-Google-Smtp-Source: ABdhPJxNZi/akTGS5KF27FuIlkC3rfNJTzbmnPnH89Rfz7vgq18ujwtUCYa7gJdG40A1z3VSgdqRRA== X-Received: by 2002:a92:c102:: with SMTP id p2mr21010388ile.227.1615231242427; Mon, 08 Mar 2021 11:20:42 -0800 (PST) Received: from robh.at.kernel.org ([64.188.179.253]) by smtp.gmail.com with ESMTPSA id a4sm3426705iow.55.2021.03.08.11.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 11:20:41 -0800 (PST) Received: (nullmailer pid 2816246 invoked by uid 1000); Mon, 08 Mar 2021 19:20:40 -0000 Date: Mon, 8 Mar 2021 12:20:40 -0700 From: Rob Herring To: Martin Devera Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Maxime Coquelin , Alexandre Torgue , Jiri Slaby , Le Ray , fabrice.gasnier@foss.st.com, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 1/2] dt-bindings: serial: Add rx-tx-swap to stm32-usart Message-ID: <20210308192040.GA2807217@robh.at.kernel.org> References: <20210302190303.28630-1-devik@eaxlabs.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210302190303.28630-1-devik@eaxlabs.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 08:03:02PM +0100, Martin Devera wrote: > Add new rx-tx-swap property to allow for RX & TX pin swapping. > > Signed-off-by: Martin Devera > --- > .../devicetree/bindings/serial/st,stm32-uart.yaml | 32 +++++++++++++++------- > 1 file changed, 22 insertions(+), 10 deletions(-) > > diff --git a/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml b/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml > index 8631678283f9..6eab2debebb5 100644 > --- a/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml > +++ b/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml > @@ -9,9 +9,6 @@ maintainers: > > title: STMicroelectronics STM32 USART bindings > > -allOf: > - - $ref: rs485.yaml > - > properties: > compatible: > enum: > @@ -40,6 +37,10 @@ properties: > > uart-has-rtscts: true > > + rx-tx-swap: > + type: boolean > + maxItems: 1 Type is boolean, but 'maxItems' applies to arrays. In any case, this is already defined in serial.yaml, so just 'rx-tx-swap: true' here. > + > dmas: > minItems: 1 > maxItems: 2 > @@ -66,13 +67,24 @@ properties: > linux,rs485-enabled-at-boot-time: true > rs485-rx-during-tx: true > > -if: > - required: > - - st,hw-flow-ctrl > -then: > - properties: > - cts-gpios: false > - rts-gpios: false > +allOf: And add '- $ref: serial.yaml#' here. > + - $ref: rs485.yaml > + - if: > + required: > + - st,hw-flow-ctrl > + then: > + properties: > + cts-gpios: false > + rts-gpios: false > + - if: > + required: > + - rx-tx-swap > + then: > + properties: > + compatible: > + enum: > + - st,stm32f7-uart > + - st,stm32h7-uart The normal pattern is the 'if' has compatible. You can put the other compatible strings in the if, and then 'then' is: then: properties: rx-tx-swap: false Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3118C433E0 for ; Mon, 8 Mar 2021 19:22:15 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51A246529E for ; Mon, 8 Mar 2021 19:22:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51A246529E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V4fAooOU4H3icpvMCQcG7VnoltFqey8Ks1tkIIEIMeY=; b=E8Em3lpDcWaKTmA2FySAxXl5D Vs/hr1yOG7xcjvz6ThhbZtBcG+UKlymMGxss0F2KCnbAV/2Krgr915c3wyTKm1rX4uqBY39GaNpaD hwYO17Y8SbA/EszZXHc+bvpONytuwUY7ow8iQDOzr1+WPNmCTv4eKSIyQ5rXPi8SwSk/cI7iudCSP gkc7smL5zg0xEQzkiTkMTk/DM/jgiTXfNGLSJfSIdFXu94GQ5Ofd9W3nRYnW/v+J2H6d4DYPTo1v2 EFl53xBbuYXNjsf5LbVvi63Elc2x8P/7PSb46RtDaWyzIevGKefG1CC3HhyME7+uoRdBHn6TswppH U62T+vXjA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJLQx-00236q-C5; Mon, 08 Mar 2021 19:20:51 +0000 Received: from mail-il1-f170.google.com ([209.85.166.170]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJLQq-002336-2g for linux-arm-kernel@lists.infradead.org; Mon, 08 Mar 2021 19:20:46 +0000 Received: by mail-il1-f170.google.com with SMTP id p10so9871846ils.9 for ; Mon, 08 Mar 2021 11:20:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1L6btlnZFWT2wUztSO9tevXV6NJv+ZeIlELKczZZaFw=; b=SDQjvIt0Fimi1GIb+u+0fsHbiLBfa9T44WXYlfwXTG7T01DoNHRWeyaegTG1kdVrB8 YaiaIZ149EzrxNxfB8l2dbcuNn5gPZ+uglXAWtT5G3/PzmsrsObbrKCbES+VE/VZHL2y zdcLrzqz/Y2BgJuwCYABKdKDcseydzdKz/8YwwmIL9q+Hq9CrRQplQZRAuDm1XI9DlBu Qi0agwucsMr5oFcm1meI6BKDIUouRRH3yoUVFyjdDABTmAP6n7B6TfPDS5UyTkh7eQ+B C9SE1hvixtjoT1g/b0nwOy6A6qTo6l0eRNNm6wqAXcKIf7oRfAr0d51ndmptEBXuYOiQ QlqA== X-Gm-Message-State: AOAM5328nXMZnKidoDLJ5eOo6xqKuclXm7CRoldIo6mViDMBQAGSFUwT jlcc+UMYcIaI4htX1T+tFA== X-Google-Smtp-Source: ABdhPJxNZi/akTGS5KF27FuIlkC3rfNJTzbmnPnH89Rfz7vgq18ujwtUCYa7gJdG40A1z3VSgdqRRA== X-Received: by 2002:a92:c102:: with SMTP id p2mr21010388ile.227.1615231242427; Mon, 08 Mar 2021 11:20:42 -0800 (PST) Received: from robh.at.kernel.org ([64.188.179.253]) by smtp.gmail.com with ESMTPSA id a4sm3426705iow.55.2021.03.08.11.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 11:20:41 -0800 (PST) Received: (nullmailer pid 2816246 invoked by uid 1000); Mon, 08 Mar 2021 19:20:40 -0000 Date: Mon, 8 Mar 2021 12:20:40 -0700 From: Rob Herring To: Martin Devera Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Maxime Coquelin , Alexandre Torgue , Jiri Slaby , Le Ray , fabrice.gasnier@foss.st.com, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 1/2] dt-bindings: serial: Add rx-tx-swap to stm32-usart Message-ID: <20210308192040.GA2807217@robh.at.kernel.org> References: <20210302190303.28630-1-devik@eaxlabs.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210302190303.28630-1-devik@eaxlabs.cz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_192044_483882_25C3F613 X-CRM114-Status: GOOD ( 16.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 02, 2021 at 08:03:02PM +0100, Martin Devera wrote: > Add new rx-tx-swap property to allow for RX & TX pin swapping. > > Signed-off-by: Martin Devera > --- > .../devicetree/bindings/serial/st,stm32-uart.yaml | 32 +++++++++++++++------- > 1 file changed, 22 insertions(+), 10 deletions(-) > > diff --git a/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml b/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml > index 8631678283f9..6eab2debebb5 100644 > --- a/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml > +++ b/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml > @@ -9,9 +9,6 @@ maintainers: > > title: STMicroelectronics STM32 USART bindings > > -allOf: > - - $ref: rs485.yaml > - > properties: > compatible: > enum: > @@ -40,6 +37,10 @@ properties: > > uart-has-rtscts: true > > + rx-tx-swap: > + type: boolean > + maxItems: 1 Type is boolean, but 'maxItems' applies to arrays. In any case, this is already defined in serial.yaml, so just 'rx-tx-swap: true' here. > + > dmas: > minItems: 1 > maxItems: 2 > @@ -66,13 +67,24 @@ properties: > linux,rs485-enabled-at-boot-time: true > rs485-rx-during-tx: true > > -if: > - required: > - - st,hw-flow-ctrl > -then: > - properties: > - cts-gpios: false > - rts-gpios: false > +allOf: And add '- $ref: serial.yaml#' here. > + - $ref: rs485.yaml > + - if: > + required: > + - st,hw-flow-ctrl > + then: > + properties: > + cts-gpios: false > + rts-gpios: false > + - if: > + required: > + - rx-tx-swap > + then: > + properties: > + compatible: > + enum: > + - st,stm32f7-uart > + - st,stm32h7-uart The normal pattern is the 'if' has compatible. You can put the other compatible strings in the if, and then 'then' is: then: properties: rx-tx-swap: false Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel