From patchwork Tue Sep 4 11:13:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radu Pirea X-Patchwork-Id: 965862 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=upb.ro Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=upb.ro header.i=@upb.ro header.b="GKdfUA+/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 424PXV2mVWz9s7T for ; Tue, 4 Sep 2018 21:20:58 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727278AbeIDPo7 (ORCPT ); Tue, 4 Sep 2018 11:44:59 -0400 Received: from mail-sender200.upb.ro ([141.85.13.200]:56696 "EHLO mx.upb.ro" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727155AbeIDPo7 (ORCPT ); Tue, 4 Sep 2018 11:44:59 -0400 Received: from mx.upb.ro (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTPS id E4C44B56005F; Tue, 4 Sep 2018 14:13:20 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id C1510B560059; Tue, 4 Sep 2018 14:13:20 +0300 (EEST) DKIM-Filter: OpenDKIM Filter v2.10.3 mx.upb.ro C1510B560059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=upb.ro; s=96342B8A-77E4-11E5-BA93-D93D0963A2DF; t=1536059600; bh=NfYSqIC3dfvapR78ZuUvvZ5sCJ4qdpBOtWXkY7msMxY=; h=From:To:Date:Message-Id; b=GKdfUA+/7YaDX2R+JDD+YUqOI7hhn+7BEBZNOvmdKgMQmqtA9ukdM/0AEPEoIboI7 eDUuVmykjHxmP7uUvPZpHRgopnTb0fT/HYUxEbRkZ8zAoiZ668R10oWd/YZMDuu9bT FrvuYclhT52b0cB8aOOWVEvkuZTbEVGzoVcTxBjM= Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id puJh2dql3P6j; Tue, 4 Sep 2018 14:13:20 +0300 (EEST) Received: from asus-rog.localdomain (arh.pub.ro [141.85.160.17]) by mx.upb.ro (Postfix) with ESMTPSA id 92C4AB56005F; Tue, 4 Sep 2018 14:13:20 +0300 (EEST) From: Radu Pirea To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, gregkh@linuxfoundation.org, broonie@kernel.org, jslaby@suse.com, richard.genoud@gmail.com, davem@davemloft.net, mchehab+samsung@kernel.org, akpm@linux-foundation.org, arnd@arndb.de Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-spi@vger.kernel.org, Radu Pirea Subject: [PATCH v12 2/6] dt-bindings: add binding for atmel-usart in SPI mode Date: Tue, 4 Sep 2018 14:13:06 +0300 Message-Id: <20180904111310.4049-3-radu_nicolae.pirea@upb.ro> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180904111310.4049-1-radu_nicolae.pirea@upb.ro> References: <20180904111310.4049-1-radu_nicolae.pirea@upb.ro> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Radu Pirea This patch moves the bindings for serial from serial/atmel-usart.txt to mfd/atmel-usart.txt and adds bindings for USART in SPI mode. Signed-off-by: Radu Pirea Reviewed-by: Rob Herring Acked-for-MFD-by: Lee Jones Acked-by: Nicolas Ferre --- .../bindings/{serial => mfd}/atmel-usart.txt | 25 +++++++++++++++++-- include/dt-bindings/mfd/at91-usart.h | 17 +++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) rename Documentation/devicetree/bindings/{serial => mfd}/atmel-usart.txt (76%) create mode 100644 include/dt-bindings/mfd/at91-usart.h diff --git a/Documentation/devicetree/bindings/serial/atmel-usart.txt b/Documentation/devicetree/bindings/mfd/atmel-usart.txt similarity index 76% rename from Documentation/devicetree/bindings/serial/atmel-usart.txt rename to Documentation/devicetree/bindings/mfd/atmel-usart.txt index 7c0d6b2f53e4..7f0cd72f47d2 100644 --- a/Documentation/devicetree/bindings/serial/atmel-usart.txt +++ b/Documentation/devicetree/bindings/mfd/atmel-usart.txt @@ -1,6 +1,6 @@ * Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART) -Required properties: +Required properties for USART: - compatible: Should be "atmel,-usart" or "atmel,-dbgu" The compatible indicated will be the first SoC to support an additional mode or an USART new feature. @@ -11,7 +11,13 @@ Required properties: Required elements: "usart" - clocks: phandles to input clocks. -Optional properties: +Required properties for USART in SPI mode: +- #size-cells : Must be <0> +- #address-cells : Must be <1> +- cs-gpios: chipselects (internal cs not supported) +- atmel,usart-mode : Must be (found in dt-bindings/mfd/at91-usart.h) + +Optional properties in serial mode: - atmel,use-dma-rx: use of PDC or DMA for receiving data - atmel,use-dma-tx: use of PDC or DMA for transmitting data - {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD line respectively. @@ -62,3 +68,18 @@ Example: dma-names = "tx", "rx"; atmel,fifo-size = <32>; }; + +- SPI mode: + #include + + spi0: spi@f001c000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "atmel,at91rm9200-usart", "atmel,at91sam9260-usart"; + atmel,usart-mode = ; + reg = <0xf001c000 0x100>; + interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>; + clocks = <&usart0_clk>; + clock-names = "usart"; + cs-gpios = <&pioB 3 0>; + }; diff --git a/include/dt-bindings/mfd/at91-usart.h b/include/dt-bindings/mfd/at91-usart.h new file mode 100644 index 000000000000..2de5bc312e1e --- /dev/null +++ b/include/dt-bindings/mfd/at91-usart.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * This header provides macros for AT91 USART DT bindings. + * + * Copyright (C) 2018 Microchip Technology + * + * Author: Radu Pirea + * + */ + +#ifndef __DT_BINDINGS_AT91_USART_H__ +#define __DT_BINDINGS_AT91_USART_H__ + +#define AT91_USART_MODE_SERIAL 0 +#define AT91_USART_MODE_SPI 1 + +#endif /* __DT_BINDINGS_AT91_USART_H__ */