From patchwork Wed May 4 13:02:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Caron X-Patchwork-Id: 12837880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB796C433F5 for ; Wed, 4 May 2022 13:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/lKhN8iY6FoXYBREjRGZoFTOY3PhJSZyKE7CtwMBo28=; b=PlFoQAAmFjSAQW T25u2D+7LOCOmD6iF73CL0FebnPFml/mxWPrc4MPILB6puVdDjhNvezcRhp0+pSE2QTtQVPLyc/cO 90YoYJkzEdLk3Mm21/OGCMmbCO9iUrL1QQtvI+MEErWASIXcMhfvbm9Ns/61FBJ9KcHRWBlQenXyH /oGubuDPlDs3oBrUfmDEI+iplpDz+Sb1/f89H71aKI3AU5i0/z0Z5Tms5puCyYrLkvFrbUu91B+kA TPqUMV00rn3q1hSQA2wFKPrcfe7XMOBahnpiMShE2wlCoICgcqEHZF7jk3U0NZVIVckiOcIOkbndm QQDRqtvQ1G9qx1P/5j7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmEes-00Atgx-Lk; Wed, 04 May 2022 13:03:10 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmEef-00Ataa-ER for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 13:03:00 +0000 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 244ALwRe018222; Wed, 4 May 2022 15:02:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=xzVNZjTzmtBSIdVv6DBe++9eoUDnPj2RYYfZVOlqvaM=; b=samI+CtMvgD52A39gBqPpHXB+YG/3V36i7MpWEKQIKJaGJZooqnayV7FMkCE0zBVttQh OhQToxKdr7bvp2ZT5bgf6vgRueFifaxTTdAd434H4NjD40nPLdDGKqq2F/kFr4X5eSow wFQ7jqF6Sw/cSgsP8rTRKxijqDuiRQVXircx8anMfwkQLDyxULRNmVhwj7BDt+pRSj1d 5yPet6ZLC/WttKulqMbba2ZLGWOJP8iNlSQKMNT+pX3pdG0QDDcN+EVsenFw8I8xnF1S lHe0qDsp2z2MWRkt/22pZGI+LVuaYQweBf2sBEX+UlNdVCXDlmxmzuObprK7Ui89mcjF +A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3frthjvemr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 May 2022 15:02:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 12435100034; Wed, 4 May 2022 15:02:41 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 0A43121FE9E; Wed, 4 May 2022 15:02:41 +0200 (CEST) Received: from localhost (10.75.127.46) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Wed, 4 May 2022 15:02:40 +0200 From: Valentin Caron To: Alessandro Zummo , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Alexandre Torgue CC: Gabriel Fernandez , Amelie Delaunay , Valentin Caron , , , , , Subject: [PATCH 1/6] dt-bindings: rtc: stm32: add st, lsco optional property to select output Date: Wed, 4 May 2022 15:02:28 +0200 Message-ID: <20220504130233.330983-2-valentin.caron@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504130233.330983-1-valentin.caron@foss.st.com> References: <20220504130233.330983-1-valentin.caron@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-04_04,2022-05-04_01,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_060258_417526_FDAF0F3E X-CRM114-Status: GOOD ( 21.97 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Amelie Delaunay STM32 RTC has three output pins: RTC_OUT1, RTC_OUT2 or RTC_OUT2_RMP. RTC Low-Speed Clock Output (LSCO) can be output on RTC_OUT1 or RTC_OUT2_RMP. This patch adds constants for RTC output bindings and adds st,lsco optional property for stm32 rtc driver, to select and enable LSCO. A pinctrl state is also optional to reserve pin for RTC output. Signed-off-by: Amelie Delaunay Signed-off-by: Valentin Caron --- .../devicetree/bindings/rtc/st,stm32-rtc.yaml | 20 +++++++++++++++++++ include/dt-bindings/rtc/rtc-stm32.h | 14 +++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 include/dt-bindings/rtc/rtc-stm32.h diff --git a/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml b/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml index 764717ce1873..56d46ea35c5d 100644 --- a/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml @@ -52,6 +52,13 @@ properties: override default rtc_ck parent clock phandle of the new parent clock of rtc_ck maxItems: 1 + st,lsco: + $ref: "/schemas/types.yaml#/definitions/uint32" + description: | + To select and enable RTC Low Speed Clock Output. + Refer to for the supported values. + Pinctrl state named "default" may be defined to reserve pin for RTC output. + allOf: - if: properties: @@ -65,6 +72,9 @@ allOf: minItems: 1 maxItems: 1 + st,lsco: + maxItems: 0 + clock-names: false required: @@ -82,6 +92,9 @@ allOf: minItems: 2 maxItems: 2 + st,lsco: + maxItems: 0 + required: - clock-names - st,syscfg @@ -101,6 +114,9 @@ allOf: assigned-clocks: false assigned-clock-parents: false + st,lsco: + maxItems: 1 + required: - clock-names @@ -130,12 +146,16 @@ examples: - | #include #include + #include rtc@5c004000 { compatible = "st,stm32mp1-rtc"; reg = <0x5c004000 0x400>; clocks = <&rcc RTCAPB>, <&rcc RTC>; clock-names = "pclk", "rtc_ck"; interrupts = ; + st,lsco = ; + pinctrl-0 = <&rtc_out2_rmp_pins_a>; + pinctrl-names = "default"; }; ... diff --git a/include/dt-bindings/rtc/rtc-stm32.h b/include/dt-bindings/rtc/rtc-stm32.h new file mode 100644 index 000000000000..2fd78c2e62d4 --- /dev/null +++ b/include/dt-bindings/rtc/rtc-stm32.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * This header provides constants for STM32_RTC bindings. + */ + +#ifndef _DT_BINDINGS_RTC_RTC_STM32_H +#define _DT_BINDINGS_RTC_RTC_STM32_H + +#define RTC_NO_OUT 0 +#define RTC_OUT1 1 +#define RTC_OUT2 2 +#define RTC_OUT2_RMP 3 + +#endif