From patchwork Mon Jul 22 16:00:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Caron X-Patchwork-Id: 13738922 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 19515C3DA5D for ; Mon, 22 Jul 2024 16:03:57 +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=+JVnZ5RexfRvHDFJf6ZIGovlJ2rC2GSlwR/nIH1b+/c=; b=wXltbpPgZ6u6Uh1u79YebG8x8y 30KxlB10FVg6+iV+J21U6QKeiGS/RgV983UPiUSON0GoRPWOy7rqdiZV+D3k0Zv1Jc9VNMpD0PALw rJIJi5r6HfTmcPZWwu5g9xPhqlsTnS91Xc0FLc9Tnhx7Y5OPcrZ+aehboi+j1pFq4o5LWBPeDH5pm bO7+3VAPaU2uknX+t+yxgne7snwb4XIFQJfLbPe71oWqJgfR2hyDDIz2+Pm54T2rAzRVCxzilr2wT d2uHSYk0yZa25T+H8adgb3KZX8yRVTAgWSOkl+vP6H4dSNJqPWXl+mUsWwapj5x65cZB/eimCZqq+ mmZy0MbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVvVm-0000000A1t2-38q2; Mon, 22 Jul 2024 16:03:42 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVvU5-0000000A1La-0IH3 for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2024 16:01:59 +0000 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46MB0jav014214; Mon, 22 Jul 2024 18:01:41 +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=+JVnZ5RexfRvHDFJf6ZIGo vlJ2rC2GSlwR/nIH1b+/c=; b=nKd4dsDyLHAKcqL/uR5HihqAgcBFZD/jUOMMIo Cmea+nInlLxEAYMRwu6Mx0dHpDJZJO3jsoYsAYwJU9GPh0mSAPaSa5IW3h9pJq49 XN+ltpJepaRPzFkrNhwRkpXb1/wSIARv8798BARmNTaTC3P60+v8rkypagknG3WX xAXr/1A+mkhzCpNcGs9ntUm4FEAgB2K9gKHBtJn0WC/bWsITlL+euPLR+NXyD3th rjtwPB3AjbszLJTWLCa4p3N0O91s7prVY838Fkfxk/csHty5BIwo6aP+WXpzqzSt AEIW44seGgYy7hT0TJUV4nhtzI68BXS4x2i6wivdMJxdDKxg== 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 40g2ngxpxb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Jul 2024 18:01:41 +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 9A8C340044; Mon, 22 Jul 2024 18:01:35 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 79D442786EA; Mon, 22 Jul 2024 18:00:58 +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; Mon, 22 Jul 2024 18:00:58 +0200 From: Valentin Caron To: Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Torgue CC: , , , , , Amelie Delaunay , Valentin Caron Subject: [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Date: Mon, 22 Jul 2024 18:00:18 +0200 Message-ID: <20240722160022.454226-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: SHFCAS1NODE2.st.com (10.75.129.73) 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-22_10,2024-07-22_01,2024-05-17_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240722_090157_457073_EDD046C3 X-CRM114-Status: GOOD ( 11.07 ) 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 v2: - Modify Kconfig after (a lot of) robots alert: + https://lore.kernel.org/oe-kbuild-all/202407190654.I3RI7WfP-lkp@intel.com/ + https://lore.kernel.org/oe-kbuild-all/202407191258.1oitwwMV-lkp@intel.com/ + https://lore.kernel.org/oe-kbuild-all/202407200400.NnW2fJ0q-lkp@intel.com/ + https://lore.kernel.org/oe-kbuild-all/202407181525.BRNKqmNf-lkp@intel.com/ + https://lore.kernel.org/oe-kbuild-all/202407191830.8bh5dJ09-lkp@intel.com/ Make RTC_DRV_STM32 depends on OF, PINCTRL and COMMON_CLK as they are menuconfig entry. Make RTC_DRV_STM32 select PINCONF, PINCONF_GENERIC and PINMUX as they config entry. 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 | 6 + drivers/rtc/rtc-stm32.c | 281 ++++++++++++++++++ 3 files changed, 315 insertions(+)