From patchwork Wed Jul 17 07:48:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Caron X-Patchwork-Id: 13735190 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 8F76DC3DA42 for ; Wed, 17 Jul 2024 07:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version: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:In-Reply-To:References:List-Owner; bh=3JW+RJzaUTLqS+5yBddkQvdwaulOuTRwn9Bo3mqMZBs=; b=b425LnUrXmfS402CZ2Yxx4Tl1T QqPzd47FCSe2D/7IA9ewoWYwGSgmnDhgnZdxMQ8C92f0OOLvt4O9vRyBZJHLuDviscjh0hYVKSArH 8GctTgBUutdc4J3QZdCZXk2lX5k2heRLwxc/d/g12f7zf7IitRQV0f3bvN2imxLkc9NLLMlk7+a5O /tziPzh9nbnCyY9EFz6fNl74mtK+BRZ6wTEmNDhfsE5cpMNd/Da50O6IsNwE/zvF4KX5tXPhoQ3tn PPegWijOGDtFRDxXFES4P92nANcY/Mk22N3R0ZBvSXjo5v1+UtBGddSu/zUfIKUaIR3GmGbechXnO M47J8Rlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTzRM-0000000D1qr-0UcQ; Wed, 17 Jul 2024 07:51:08 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTzQB-0000000D1XG-3N6C for linux-arm-kernel@lists.infradead.org; Wed, 17 Jul 2024 07:50:13 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46H5ldVH017884; Wed, 17 Jul 2024 09:49:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=selector1; bh=3JW+RJzaUTLqS+5yBddkQv dwaulOuTRwn9Bo3mqMZBs=; b=5+qPQU9qlXJdtMjN/vnLR+5IKNH2vnwKCRNKdK lg9G3ug/BCu5HqcCy5Ga+wEuScrOtD1Mxkv2dIoZ3nGba5vMpp4owdjxf+OV5kqQ cRXOR9vBSKPDIlSLZ3i0GsmFAzWYCvPxLriX2fKt/mzP6vr/1hqXG5XWh1nmq+qA Iv9ojmxNtcqbcJ9llRFWc52vs+kwWqwyqtEt0seObE90Jav1pnmJm21pSbhqYly4 lCIC8vwLqdB/98j39syPXAmomJmED2lC2X3EEUAqiCdXcxcqJuPZoGD9Pi6QBQFa 9LJEQpkDo/YXk8s55m8k1eoTjvLLZW8l75bbcr0fWJky39JA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 40dwfma6cd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2024 09:49:37 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7BB9140044; Wed, 17 Jul 2024 09:49:32 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3FCD6241489; Wed, 17 Jul 2024 09:48:54 +0200 (CEST) Received: from localhost (10.48.86.111) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Wed, 17 Jul 2024 09:48:53 +0200 From: Valentin Caron To: Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Torgue CC: , , , , , Amelie Delaunay , Valentin Caron Subject: [PATCH v2 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Date: Wed, 17 Jul 2024 09:48:31 +0200 Message-ID: <20240717074835.2210411-1-valentin.caron@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.48.86.111] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-17_04,2024-07-16_02,2024-05-17_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240717_004956_388336_72E5A066 X-CRM114-Status: GOOD ( 10.72 ) 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 This series adds a pinctrl/pinmux interface to control STM32 RTC outputs. Theses two signals output are possible: - LSCO (Low Speed Clock Output) that allow to output LSE clock on a pin. On STM32MPU Discovery boards, this feature is used to generate a clock to Wifi/Bluetooth module. - Alarm out that allow to send a pulse on a pin when alarm A of the RTC expires. First attempt [1] was based on 'st,' vendor properties, this one is based on pinctrl and pinmux framework. As device-trees will be upstreamed separately, here is an example: stm32-pinctrl { rtc_rsvd_pins_a: rtc-rsvd-0 { pins { pinmux = , /* OUT2 */ ; /* OUT2_RMP */ }; }; }; stm32-rtc { pinctrl-0 = <&rtc_rsvd_pins_a &rtc_alarma_pins_a>; /* Enable by foo-device */ rtc_lsco_pins_a: rtc-lsco-0 { pins = "out2_rmp"; function = "lsco"; }; /* Enable by stm32-rtc hog */ rtc_alarma_pins_a: rtc-alarma-0 { pins = "out2"; function = "alarm-a"; }; }; foo-device { pinctrl-0 = <&rtc_lsco_pins_a>; }; [1] https://lore.kernel.org/linux-arm-kernel/20220504130617.331290-5-valentin.caron@foss.st.com/t/#m37935e92315e22bbe085775096175afc05b7ff09 Since v1: - Select PINMUX and PINCONF_GENERIC to solve: https://lore.kernel.org/oe-kbuild-all/202407130943.ie6n2Orh-lkp@intel.com/ - Make stm32_rtc_pinctrl_pins as static to solve: https://lore.kernel.org/oe-kbuild-all/202407130612.OEicZbNE-lkp@intel.com/ - Change "depends on" to "select" COMMON_CLK config - Modify regex in dt-binding to avoid properties like "rtc--123" as valid ones. Valentin Caron (4): dt-bindings: rtc: stm32: describe pinmux nodes rtc: stm32: add pinctrl and pinmux interfaces rtc: stm32: add Low Speed Clock Output (LSCO) support rtc: stm32: add alarm A out feature .../devicetree/bindings/rtc/st,stm32-rtc.yaml | 28 ++ drivers/rtc/Kconfig | 3 + drivers/rtc/rtc-stm32.c | 281 ++++++++++++++++++ 3 files changed, 312 insertions(+)