* [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs
@ 2024-07-22 16:00 Valentin Caron
2024-07-22 16:00 ` [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes Valentin Caron
` (5 more replies)
0 siblings, 6 replies; 13+ messages in thread
From: Valentin Caron @ 2024-07-22 16:00 UTC (permalink / raw)
To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay, Valentin Caron
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 = <STM32_PINMUX('B', 2, AF1)>, /* OUT2 */
<STM32_PINMUX('I', 8, ANALOG)>; /* 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(+)
--
2.25.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
@ 2024-07-22 16:00 ` Valentin Caron
2024-07-23 8:48 ` Krzysztof Kozlowski
2024-07-26 20:38 ` Linus Walleij
2024-07-22 16:00 ` [PATCH v3 2/4] rtc: stm32: add pinctrl and pinmux interfaces Valentin Caron
` (4 subsequent siblings)
5 siblings, 2 replies; 13+ messages in thread
From: Valentin Caron @ 2024-07-22 16:00 UTC (permalink / raw)
To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay, Valentin Caron
STM32 RTC is capable to handle 3 specific pins of the soc (out1, out2,
out2_rmp) and to outputs 2 signals (LSCO, alarm-a).
This feature is configured thanks to pinmux nodes and pinctrl framework.
This feature is available with compatible st,stm32mp1-rtc and
st,stm32mp25-rtc only.
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
---
.../devicetree/bindings/rtc/st,stm32-rtc.yaml | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml b/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml
index 7a0fab721cf1..aae06e570c22 100644
--- a/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml
@@ -53,6 +53,28 @@ properties:
override default rtc_ck parent clock phandle of the new parent clock of rtc_ck
maxItems: 1
+patternProperties:
+ "^rtc-[a-z]+-[0-9]+$":
+ type: object
+ $ref: /schemas/pinctrl/pinmux-node.yaml
+ description: |
+ Configuration of STM32 RTC pins description. STM32 RTC is able to output
+ some signals on specific pins:
+ - LSCO (Low Speed Clock Output) that allow to output LSE clock on a pin.
+ - Alarm out that allow to send a pulse on a pin when alarm A of the RTC
+ expires.
+ additionalProperties: false
+ properties:
+ function:
+ enum:
+ - lsco
+ - alarm-a
+ pins:
+ enum:
+ - out1
+ - out2
+ - out2_rmp
+
allOf:
- if:
properties:
@@ -68,6 +90,9 @@ allOf:
clock-names: false
+ patternProperties:
+ "^rtc-[a-z]+-[0-9]+$": false
+
required:
- st,syscfg
@@ -83,6 +108,9 @@ allOf:
minItems: 2
maxItems: 2
+ patternProperties:
+ "^rtc-[a-z]+-[0-9]+$": false
+
required:
- clock-names
- st,syscfg
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 2/4] rtc: stm32: add pinctrl and pinmux interfaces
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
2024-07-22 16:00 ` [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes Valentin Caron
@ 2024-07-22 16:00 ` Valentin Caron
2024-07-26 20:46 ` Linus Walleij
2024-07-22 16:00 ` [PATCH v3 3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support Valentin Caron
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Valentin Caron @ 2024-07-22 16:00 UTC (permalink / raw)
To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay, Valentin Caron
STM32 RTC is capable to handle 3 specific pins of the soc.
"out1, out2 and out2_rmp". To handle this, we use pinctrl framework.
There is a single pin per group.
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
---
drivers/rtc/Kconfig | 5 ++
drivers/rtc/rtc-stm32.c | 120 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+)
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 2a95b05982ad..4b1a87027a3d 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1923,6 +1923,11 @@ config RTC_DRV_STM32
tristate "STM32 RTC"
select REGMAP_MMIO
depends on ARCH_STM32 || COMPILE_TEST
+ depends on OF
+ depends on PINCTRL
+ select PINMUX
+ select PINCONF
+ select GENERIC_PINCONF
help
If you say yes here you get support for the STM32 On-Chip
Real Time Clock.
diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index 98b07969609d..6dfd9dc07e2e 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -13,6 +13,9 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/pinctrl/pinctrl.h>
+#include <linux/pinctrl/pinconf-generic.h>
+#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
@@ -107,6 +110,14 @@
/* STM32 RTC driver time helpers */
#define SEC_PER_DAY (24 * 60 * 60)
+/* STM32 RTC pinctrl helpers */
+#define STM32_RTC_PINMUX(_name, _action, ...) { \
+ .name = (_name), \
+ .action = (_action), \
+ .groups = ((const char *[]){ __VA_ARGS__ }), \
+ .num_groups = ARRAY_SIZE(((const char *[]){ __VA_ARGS__ })), \
+}
+
struct stm32_rtc;
struct stm32_rtc_registers {
@@ -171,6 +182,106 @@ static void stm32_rtc_wpr_lock(struct stm32_rtc *rtc)
writel_relaxed(RTC_WPR_WRONG_KEY, rtc->base + regs->wpr);
}
+enum stm32_rtc_pin_name {
+ NONE,
+ OUT1,
+ OUT2,
+ OUT2_RMP
+};
+
+static const struct pinctrl_pin_desc stm32_rtc_pinctrl_pins[] = {
+ PINCTRL_PIN(OUT1, "out1"),
+ PINCTRL_PIN(OUT2, "out2"),
+ PINCTRL_PIN(OUT2_RMP, "out2_rmp"),
+};
+
+static int stm32_rtc_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
+{
+ return ARRAY_SIZE(stm32_rtc_pinctrl_pins);
+}
+
+static const char *stm32_rtc_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
+ unsigned int selector)
+{
+ return stm32_rtc_pinctrl_pins[selector].name;
+}
+
+static int stm32_rtc_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
+ unsigned int selector,
+ const unsigned int **pins,
+ unsigned int *num_pins)
+{
+ *pins = &stm32_rtc_pinctrl_pins[selector].number;
+ *num_pins = 1;
+ return 0;
+}
+
+static const struct pinctrl_ops stm32_rtc_pinctrl_ops = {
+ .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
+ .dt_free_map = pinconf_generic_dt_free_map,
+ .get_groups_count = stm32_rtc_pinctrl_get_groups_count,
+ .get_group_name = stm32_rtc_pinctrl_get_group_name,
+ .get_group_pins = stm32_rtc_pinctrl_get_group_pins,
+};
+
+struct stm32_rtc_pinmux_func {
+ const char *name;
+ const char * const *groups;
+ const unsigned int num_groups;
+ int (*action)(struct pinctrl_dev *pctl_dev, unsigned int pin);
+};
+
+static const struct stm32_rtc_pinmux_func stm32_rtc_pinmux_functions[] = {
+};
+
+static int stm32_rtc_pinmux_get_functions_count(struct pinctrl_dev *pctldev)
+{
+ return ARRAY_SIZE(stm32_rtc_pinmux_functions);
+}
+
+static const char *stm32_rtc_pinmux_get_fname(struct pinctrl_dev *pctldev, unsigned int selector)
+{
+ return stm32_rtc_pinmux_functions[selector].name;
+}
+
+static int stm32_rtc_pinmux_get_groups(struct pinctrl_dev *pctldev, unsigned int selector,
+ const char * const **groups, unsigned int * const num_groups)
+{
+ *groups = stm32_rtc_pinmux_functions[selector].groups;
+ *num_groups = stm32_rtc_pinmux_functions[selector].num_groups;
+ return 0;
+}
+
+static int stm32_rtc_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
+ unsigned int group)
+{
+ struct stm32_rtc_pinmux_func selected_func = stm32_rtc_pinmux_functions[selector];
+ struct pinctrl_pin_desc pin = stm32_rtc_pinctrl_pins[group];
+
+ /* Call action */
+ if (selected_func.action)
+ return selected_func.action(pctldev, pin.number);
+
+ return -EINVAL;
+}
+
+static const struct pinmux_ops stm32_rtc_pinmux_ops = {
+ .get_functions_count = stm32_rtc_pinmux_get_functions_count,
+ .get_function_name = stm32_rtc_pinmux_get_fname,
+ .get_function_groups = stm32_rtc_pinmux_get_groups,
+ .set_mux = stm32_rtc_pinmux_set_mux,
+ .strict = true,
+};
+
+static struct pinctrl_desc stm32_rtc_pdesc = {
+ .name = DRIVER_NAME,
+ .pins = stm32_rtc_pinctrl_pins,
+ .npins = ARRAY_SIZE(stm32_rtc_pinctrl_pins),
+ .owner = THIS_MODULE,
+ .pctlops = &stm32_rtc_pinctrl_ops,
+ .pmxops = &stm32_rtc_pinmux_ops,
+};
+
static int stm32_rtc_enter_init_mode(struct stm32_rtc *rtc)
{
const struct stm32_rtc_registers *regs = &rtc->data->regs;
@@ -791,6 +902,7 @@ static int stm32_rtc_probe(struct platform_device *pdev)
{
struct stm32_rtc *rtc;
const struct stm32_rtc_registers *regs;
+ struct pinctrl_dev *pctl;
int ret;
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
@@ -912,6 +1024,14 @@ static int stm32_rtc_probe(struct platform_device *pdev)
goto err;
}
+ ret = devm_pinctrl_register_and_init(&pdev->dev, &stm32_rtc_pdesc, rtc, &pctl);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "pinctrl register failed");
+
+ ret = pinctrl_enable(pctl);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "pinctrl enable failed");
+
/*
* If INITS flag is reset (calendar year field set to 0x00), calendar
* must be initialized
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
2024-07-22 16:00 ` [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes Valentin Caron
2024-07-22 16:00 ` [PATCH v3 2/4] rtc: stm32: add pinctrl and pinmux interfaces Valentin Caron
@ 2024-07-22 16:00 ` Valentin Caron
2024-07-26 20:50 ` Linus Walleij
2024-07-22 16:00 ` [PATCH v3 4/4] rtc: stm32: add alarm A out feature Valentin Caron
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Valentin Caron @ 2024-07-22 16:00 UTC (permalink / raw)
To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay, Valentin Caron
RTC is able to output on a pin the "LSE" internal clock.
STM32 RTC is now registered as a clock provider.
It provides rtc_lsco clock, that means RTC_LSCO is output on either
RTC_OUT1 or RTC_OUT2_RMP, depending on pinmux DT property.
The clock is marked as CLK_IGNORE_UNUSED and CLK_IS_CRITICAL because
RTC_LSCO can be early required by devices needed it to init.
Add LSCO in pinmux functions.
Add "stm32_rtc_clean_outs" to disable LSCO. As RTC is part of "backup"
power domain, it is not reset during shutdown or reboot. So force LSCO
disable at probe.
Co-developed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
---
drivers/rtc/Kconfig | 1 +
drivers/rtc/rtc-stm32.c | 101 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+)
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 4b1a87027a3d..b3469f6986e9 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1928,6 +1928,7 @@ config RTC_DRV_STM32
select PINMUX
select PINCONF
select GENERIC_PINCONF
+ depends on COMMON_CLK
help
If you say yes here you get support for the STM32 On-Chip
Real Time Clock.
diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index 6dfd9dc07e2e..675860a13051 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -7,6 +7,7 @@
#include <linux/bcd.h>
#include <linux/bitfield.h>
#include <linux/clk.h>
+#include <linux/clk-provider.h>
#include <linux/errno.h>
#include <linux/iopoll.h>
#include <linux/ioport.h>
@@ -45,6 +46,10 @@
#define STM32_RTC_CR_FMT BIT(6)
#define STM32_RTC_CR_ALRAE BIT(8)
#define STM32_RTC_CR_ALRAIE BIT(12)
+#define STM32_RTC_CR_OSEL GENMASK(22, 21)
+#define STM32_RTC_CR_COE BIT(23)
+#define STM32_RTC_CR_TAMPOE BIT(26)
+#define STM32_RTC_CR_OUT2EN BIT(31)
/* STM32_RTC_ISR/STM32_RTC_ICSR bit fields */
#define STM32_RTC_ISR_ALRAWF BIT(0)
@@ -81,6 +86,12 @@
/* STM32_RTC_SR/_SCR bit fields */
#define STM32_RTC_SR_ALRA BIT(0)
+/* STM32_RTC_CFGR bit fields */
+#define STM32_RTC_CFGR_OUT2_RMP BIT(0)
+#define STM32_RTC_CFGR_LSCOEN GENMASK(2, 1)
+#define STM32_RTC_CFGR_LSCOEN_OUT1 1
+#define STM32_RTC_CFGR_LSCOEN_OUT2_RMP 2
+
/* STM32_RTC_VERR bit fields */
#define STM32_RTC_VERR_MINREV_SHIFT 0
#define STM32_RTC_VERR_MINREV GENMASK(3, 0)
@@ -130,6 +141,7 @@ struct stm32_rtc_registers {
u16 wpr;
u16 sr;
u16 scr;
+ u16 cfgr;
u16 verr;
};
@@ -145,6 +157,7 @@ struct stm32_rtc_data {
bool need_dbp;
bool need_accuracy;
bool rif_protected;
+ bool has_lsco;
};
struct stm32_rtc {
@@ -157,6 +170,7 @@ struct stm32_rtc {
struct clk *rtc_ck;
const struct stm32_rtc_data *data;
int irq_alarm;
+ struct clk *clk_lsco;
};
struct stm32_rtc_rif_resource {
@@ -231,7 +245,68 @@ struct stm32_rtc_pinmux_func {
int (*action)(struct pinctrl_dev *pctl_dev, unsigned int pin);
};
+static int stm32_rtc_pinmux_lsco_available(struct pinctrl_dev *pctldev, unsigned int pin)
+{
+ struct stm32_rtc *rtc = pinctrl_dev_get_drvdata(pctldev);
+ struct stm32_rtc_registers regs = rtc->data->regs;
+ unsigned int cr = readl_relaxed(rtc->base + regs.cr);
+ unsigned int cfgr = readl_relaxed(rtc->base + regs.cfgr);
+ unsigned int calib = STM32_RTC_CR_COE;
+ unsigned int tampalrm = STM32_RTC_CR_TAMPOE | STM32_RTC_CR_OSEL;
+
+ switch (pin) {
+ case OUT1:
+ if ((!(cr & STM32_RTC_CR_OUT2EN) &&
+ ((cr & calib) || cr & tampalrm)) ||
+ ((cr & calib) && (cr & tampalrm)))
+ return -EBUSY;
+ break;
+ case OUT2_RMP:
+ if ((cr & STM32_RTC_CR_OUT2EN) &&
+ (cfgr & STM32_RTC_CFGR_OUT2_RMP) &&
+ ((cr & calib) || (cr & tampalrm)))
+ return -EBUSY;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if (clk_get_rate(rtc->rtc_ck) != 32768)
+ return -ERANGE;
+
+ return 0;
+}
+
+static int stm32_rtc_pinmux_action_lsco(struct pinctrl_dev *pctldev, unsigned int pin)
+{
+ struct stm32_rtc *rtc = pinctrl_dev_get_drvdata(pctldev);
+ struct stm32_rtc_registers regs = rtc->data->regs;
+ struct device *dev = rtc->rtc_dev->dev.parent;
+ u8 lscoen;
+ int ret;
+
+ if (!rtc->data->has_lsco)
+ return -EPERM;
+
+ ret = stm32_rtc_pinmux_lsco_available(pctldev, pin);
+ if (ret)
+ return ret;
+
+ lscoen = (pin == OUT1) ? STM32_RTC_CFGR_LSCOEN_OUT1 : STM32_RTC_CFGR_LSCOEN_OUT2_RMP;
+
+ rtc->clk_lsco = clk_register_gate(dev, "rtc_lsco", __clk_get_name(rtc->rtc_ck),
+ CLK_IGNORE_UNUSED | CLK_IS_CRITICAL,
+ rtc->base + regs.cfgr, lscoen, 0, NULL);
+ if (IS_ERR(rtc->clk_lsco))
+ return PTR_ERR(rtc->clk_lsco);
+
+ of_clk_add_provider(dev->of_node, of_clk_src_simple_get, rtc->clk_lsco);
+
+ return 0;
+}
+
static const struct stm32_rtc_pinmux_func stm32_rtc_pinmux_functions[] = {
+ STM32_RTC_PINMUX("lsco", &stm32_rtc_pinmux_action_lsco, "out1", "out2_rmp"),
};
static int stm32_rtc_pinmux_get_functions_count(struct pinctrl_dev *pctldev)
@@ -687,6 +762,7 @@ static const struct stm32_rtc_data stm32_rtc_data = {
.need_dbp = true,
.need_accuracy = false,
.rif_protected = false,
+ .has_lsco = false,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -697,6 +773,7 @@ static const struct stm32_rtc_data stm32_rtc_data = {
.wpr = 0x24,
.sr = 0x0C, /* set to ISR offset to ease alarm management */
.scr = UNDEF_REG,
+ .cfgr = UNDEF_REG,
.verr = UNDEF_REG,
},
.events = {
@@ -710,6 +787,7 @@ static const struct stm32_rtc_data stm32h7_rtc_data = {
.need_dbp = true,
.need_accuracy = false,
.rif_protected = false,
+ .has_lsco = false,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -720,6 +798,7 @@ static const struct stm32_rtc_data stm32h7_rtc_data = {
.wpr = 0x24,
.sr = 0x0C, /* set to ISR offset to ease alarm management */
.scr = UNDEF_REG,
+ .cfgr = UNDEF_REG,
.verr = UNDEF_REG,
},
.events = {
@@ -742,6 +821,7 @@ static const struct stm32_rtc_data stm32mp1_data = {
.need_dbp = false,
.need_accuracy = true,
.rif_protected = false,
+ .has_lsco = true,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -752,6 +832,7 @@ static const struct stm32_rtc_data stm32mp1_data = {
.wpr = 0x24,
.sr = 0x50,
.scr = 0x5C,
+ .cfgr = 0x60,
.verr = 0x3F4,
},
.events = {
@@ -765,6 +846,7 @@ static const struct stm32_rtc_data stm32mp25_data = {
.need_dbp = false,
.need_accuracy = true,
.rif_protected = true,
+ .has_lsco = true,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -775,6 +857,7 @@ static const struct stm32_rtc_data stm32mp25_data = {
.wpr = 0x24,
.sr = 0x50,
.scr = 0x5C,
+ .cfgr = 0x60,
.verr = 0x3F4,
},
.events = {
@@ -792,6 +875,19 @@ static const struct of_device_id stm32_rtc_of_match[] = {
};
MODULE_DEVICE_TABLE(of, stm32_rtc_of_match);
+static void stm32_rtc_clean_outs(struct stm32_rtc *rtc)
+{
+ struct stm32_rtc_registers regs = rtc->data->regs;
+
+ if (regs.cfgr != UNDEF_REG) {
+ unsigned int cfgr = readl_relaxed(rtc->base + regs.cfgr);
+
+ cfgr &= ~STM32_RTC_CFGR_LSCOEN;
+ cfgr &= ~STM32_RTC_CFGR_OUT2_RMP;
+ writel_relaxed(cfgr, rtc->base + regs.cfgr);
+ }
+}
+
static int stm32_rtc_check_rif(struct stm32_rtc *stm32_rtc,
struct stm32_rtc_rif_resource res)
{
@@ -1024,6 +1120,8 @@ static int stm32_rtc_probe(struct platform_device *pdev)
goto err;
}
+ stm32_rtc_clean_outs(rtc);
+
ret = devm_pinctrl_register_and_init(&pdev->dev, &stm32_rtc_pdesc, rtc, &pctl);
if (ret)
return dev_err_probe(&pdev->dev, ret, "pinctrl register failed");
@@ -1070,6 +1168,9 @@ static void stm32_rtc_remove(struct platform_device *pdev)
const struct stm32_rtc_registers *regs = &rtc->data->regs;
unsigned int cr;
+ if (!IS_ERR_OR_NULL(rtc->clk_lsco))
+ clk_unregister_gate(rtc->clk_lsco);
+
/* Disable interrupts */
stm32_rtc_wpr_unlock(rtc);
cr = readl_relaxed(rtc->base + regs->cr);
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 4/4] rtc: stm32: add alarm A out feature
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
` (2 preceding siblings ...)
2024-07-22 16:00 ` [PATCH v3 3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support Valentin Caron
@ 2024-07-22 16:00 ` Valentin Caron
2024-07-26 20:51 ` Linus Walleij
2024-07-26 20:37 ` [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Linus Walleij
2024-08-14 9:39 ` Alexandre Belloni
5 siblings, 1 reply; 13+ messages in thread
From: Valentin Caron @ 2024-07-22 16:00 UTC (permalink / raw)
To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay, Valentin Caron
STM32 RTC can pulse some SOC pins when an RTC alarm expires.
This patch adds this functionality for alarm A. The pulse can out on three
pins RTC_OUT1, RTC_OUT2, RTC_OUT2_RMP (PC13, PB2, PI8 on stm32mp15)
(PC13, PB2, PI1 on stm32mp13) (PC13, PF4/PF6, PI8 on stm32mp25).
This patch only adds the functionality for devices which are using
st,stm32mp1-rtc and st,stm32mp25-rtc compatible.
Add "alarm-a" in pinmux functions.
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
---
drivers/rtc/rtc-stm32.c | 60 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index 675860a13051..3e4f2ee22b0b 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -47,8 +47,10 @@
#define STM32_RTC_CR_ALRAE BIT(8)
#define STM32_RTC_CR_ALRAIE BIT(12)
#define STM32_RTC_CR_OSEL GENMASK(22, 21)
+#define STM32_RTC_CR_OSEL_ALARM_A FIELD_PREP(STM32_RTC_CR_OSEL, 0x01)
#define STM32_RTC_CR_COE BIT(23)
#define STM32_RTC_CR_TAMPOE BIT(26)
+#define STM32_RTC_CR_TAMPALRM_TYPE BIT(30)
#define STM32_RTC_CR_OUT2EN BIT(31)
/* STM32_RTC_ISR/STM32_RTC_ICSR bit fields */
@@ -158,6 +160,7 @@ struct stm32_rtc_data {
bool need_accuracy;
bool rif_protected;
bool has_lsco;
+ bool has_alarm_out;
};
struct stm32_rtc {
@@ -245,6 +248,47 @@ struct stm32_rtc_pinmux_func {
int (*action)(struct pinctrl_dev *pctl_dev, unsigned int pin);
};
+static int stm32_rtc_pinmux_action_alarm(struct pinctrl_dev *pctldev, unsigned int pin)
+{
+ struct stm32_rtc *rtc = pinctrl_dev_get_drvdata(pctldev);
+ struct stm32_rtc_registers regs = rtc->data->regs;
+ unsigned int cr = readl_relaxed(rtc->base + regs.cr);
+ unsigned int cfgr = readl_relaxed(rtc->base + regs.cfgr);
+
+ if (!rtc->data->has_alarm_out)
+ return -EPERM;
+
+ cr &= ~STM32_RTC_CR_OSEL;
+ cr |= STM32_RTC_CR_OSEL_ALARM_A;
+ cr &= ~STM32_RTC_CR_TAMPOE;
+ cr &= ~STM32_RTC_CR_COE;
+ cr &= ~STM32_RTC_CR_TAMPALRM_TYPE;
+
+ switch (pin) {
+ case OUT1:
+ cr &= ~STM32_RTC_CR_OUT2EN;
+ cfgr &= ~STM32_RTC_CFGR_OUT2_RMP;
+ break;
+ case OUT2:
+ cr |= STM32_RTC_CR_OUT2EN;
+ cfgr &= ~STM32_RTC_CFGR_OUT2_RMP;
+ break;
+ case OUT2_RMP:
+ cr |= STM32_RTC_CR_OUT2EN;
+ cfgr |= STM32_RTC_CFGR_OUT2_RMP;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ stm32_rtc_wpr_unlock(rtc);
+ writel_relaxed(cr, rtc->base + regs.cr);
+ writel_relaxed(cfgr, rtc->base + regs.cfgr);
+ stm32_rtc_wpr_lock(rtc);
+
+ return 0;
+}
+
static int stm32_rtc_pinmux_lsco_available(struct pinctrl_dev *pctldev, unsigned int pin)
{
struct stm32_rtc *rtc = pinctrl_dev_get_drvdata(pctldev);
@@ -307,6 +351,7 @@ static int stm32_rtc_pinmux_action_lsco(struct pinctrl_dev *pctldev, unsigned in
static const struct stm32_rtc_pinmux_func stm32_rtc_pinmux_functions[] = {
STM32_RTC_PINMUX("lsco", &stm32_rtc_pinmux_action_lsco, "out1", "out2_rmp"),
+ STM32_RTC_PINMUX("alarm-a", &stm32_rtc_pinmux_action_alarm, "out1", "out2", "out2_rmp"),
};
static int stm32_rtc_pinmux_get_functions_count(struct pinctrl_dev *pctldev)
@@ -763,6 +808,7 @@ static const struct stm32_rtc_data stm32_rtc_data = {
.need_accuracy = false,
.rif_protected = false,
.has_lsco = false,
+ .has_alarm_out = false,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -788,6 +834,7 @@ static const struct stm32_rtc_data stm32h7_rtc_data = {
.need_accuracy = false,
.rif_protected = false,
.has_lsco = false,
+ .has_alarm_out = false,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -822,6 +869,7 @@ static const struct stm32_rtc_data stm32mp1_data = {
.need_accuracy = true,
.rif_protected = false,
.has_lsco = true,
+ .has_alarm_out = true,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -847,6 +895,7 @@ static const struct stm32_rtc_data stm32mp25_data = {
.need_accuracy = true,
.rif_protected = true,
.has_lsco = true,
+ .has_alarm_out = true,
.regs = {
.tr = 0x00,
.dr = 0x04,
@@ -878,6 +927,17 @@ MODULE_DEVICE_TABLE(of, stm32_rtc_of_match);
static void stm32_rtc_clean_outs(struct stm32_rtc *rtc)
{
struct stm32_rtc_registers regs = rtc->data->regs;
+ unsigned int cr = readl_relaxed(rtc->base + regs.cr);
+
+ cr &= ~STM32_RTC_CR_OSEL;
+ cr &= ~STM32_RTC_CR_TAMPOE;
+ cr &= ~STM32_RTC_CR_COE;
+ cr &= ~STM32_RTC_CR_TAMPALRM_TYPE;
+ cr &= ~STM32_RTC_CR_OUT2EN;
+
+ stm32_rtc_wpr_unlock(rtc);
+ writel_relaxed(cr, rtc->base + regs.cr);
+ stm32_rtc_wpr_lock(rtc);
if (regs.cfgr != UNDEF_REG) {
unsigned int cfgr = readl_relaxed(rtc->base + regs.cfgr);
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes
2024-07-22 16:00 ` [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes Valentin Caron
@ 2024-07-23 8:48 ` Krzysztof Kozlowski
2024-07-26 20:38 ` Linus Walleij
1 sibling, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-23 8:48 UTC (permalink / raw)
To: Valentin Caron, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alexandre Torgue
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay
On 22/07/2024 18:00, Valentin Caron wrote:
> STM32 RTC is capable to handle 3 specific pins of the soc (out1, out2,
> out2_rmp) and to outputs 2 signals (LSCO, alarm-a).
>
> This feature is configured thanks to pinmux nodes and pinctrl framework.
> This feature is available with compatible st,stm32mp1-rtc and
> st,stm32mp25-rtc only.
>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
` (3 preceding siblings ...)
2024-07-22 16:00 ` [PATCH v3 4/4] rtc: stm32: add alarm A out feature Valentin Caron
@ 2024-07-26 20:37 ` Linus Walleij
2024-07-26 21:29 ` Alexandre Belloni
2024-08-14 9:39 ` Alexandre Belloni
5 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2024-07-26 20:37 UTC (permalink / raw)
To: Valentin Caron
Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue, linux-rtc, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Amelie Delaunay
Hi Valentin,
On Mon, Jul 22, 2024 at 6:02 PM Valentin Caron
<valentin.caron@foss.st.com> wrote:
> This series adds a pinctrl/pinmux interface to control STM32 RTC outputs.
Interesting! I think it is the first pin controller outside on
drivers/pinctrl in the kernel tree.
Please include me and the linux-gpio@vger.kernel.org list in
subsequent postings, I want to be sure what gets merged here
and I only noticed this from the LWN driver patches summary.
> As device-trees will be upstreamed separately, here is an example:
>
> stm32-pinctrl {
> rtc_rsvd_pins_a: rtc-rsvd-0 {
> pins {
> pinmux = <STM32_PINMUX('B', 2, AF1)>, /* OUT2 */
> <STM32_PINMUX('I', 8, ANALOG)>; /* OUT2_RMP */
> };
> };
> };
>
> stm32-rtc {
> pinctrl-0 = <&rtc_rsvd_pins_a &rtc_alarma_pins_a>;
So the first one is a generic pin control setting and the second
one is a hog for the pins defined by the device itself.
It's clever, and works. Nice work!
(There should probably be a comment in the device tree to say
what is going on so people reading it are not confused.)
> /* 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";
> };
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes
2024-07-22 16:00 ` [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes Valentin Caron
2024-07-23 8:48 ` Krzysztof Kozlowski
@ 2024-07-26 20:38 ` Linus Walleij
1 sibling, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2024-07-26 20:38 UTC (permalink / raw)
To: Valentin Caron
Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue, linux-rtc, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Amelie Delaunay
On Mon, Jul 22, 2024 at 6:02 PM Valentin Caron
<valentin.caron@foss.st.com> wrote:
> STM32 RTC is capable to handle 3 specific pins of the soc (out1, out2,
> out2_rmp) and to outputs 2 signals (LSCO, alarm-a).
>
> This feature is configured thanks to pinmux nodes and pinctrl framework.
> This feature is available with compatible st,stm32mp1-rtc and
> st,stm32mp25-rtc only.
>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/4] rtc: stm32: add pinctrl and pinmux interfaces
2024-07-22 16:00 ` [PATCH v3 2/4] rtc: stm32: add pinctrl and pinmux interfaces Valentin Caron
@ 2024-07-26 20:46 ` Linus Walleij
0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2024-07-26 20:46 UTC (permalink / raw)
To: Valentin Caron
Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue, linux-rtc, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Amelie Delaunay
On Mon, Jul 22, 2024 at 6:02 PM Valentin Caron
<valentin.caron@foss.st.com> wrote:
> STM32 RTC is capable to handle 3 specific pins of the soc.
> "out1, out2 and out2_rmp". To handle this, we use pinctrl framework.
> There is a single pin per group.
>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
(...)
> +/* STM32 RTC pinctrl helpers */
> +#define STM32_RTC_PINMUX(_name, _action, ...) { \
> + .name = (_name), \
> + .action = (_action), \
> + .groups = ((const char *[]){ __VA_ARGS__ }), \
> + .num_groups = ARRAY_SIZE(((const char *[]){ __VA_ARGS__ })), \
> +}
This is a very clever and clean macro.
We have PINCTRL_PINFUNCTION() in <linux/pinctrl/pinctrl.h> which isn't
smart enough to use VA_ARGS and ARRAY_SIZE.
Now you also need .action but if it wasn't for that I would have asked
for the macro to be made generic.
The implementation is clean and impeccable.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support
2024-07-22 16:00 ` [PATCH v3 3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support Valentin Caron
@ 2024-07-26 20:50 ` Linus Walleij
0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2024-07-26 20:50 UTC (permalink / raw)
To: Valentin Caron
Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue, linux-rtc, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Amelie Delaunay, linux-clk
Hi Valentin,
On Mon, Jul 22, 2024 at 6:02 PM Valentin Caron
<valentin.caron@foss.st.com> wrote:
> RTC is able to output on a pin the "LSE" internal clock.
>
> STM32 RTC is now registered as a clock provider.
> It provides rtc_lsco clock, that means RTC_LSCO is output on either
> RTC_OUT1 or RTC_OUT2_RMP, depending on pinmux DT property.
> The clock is marked as CLK_IGNORE_UNUSED and CLK_IS_CRITICAL because
> RTC_LSCO can be early required by devices needed it to init.
>
> Add LSCO in pinmux functions.
>
> Add "stm32_rtc_clean_outs" to disable LSCO. As RTC is part of "backup"
> power domain, it is not reset during shutdown or reboot. So force LSCO
> disable at probe.
>
> Co-developed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
(...)
> @@ -1928,6 +1928,7 @@ config RTC_DRV_STM32
> select PINMUX
> select PINCONF
> select GENERIC_PINCONF
> + depends on COMMON_CLK
Just
select COMMON_CLK
Why not, it will with 100% certainty be needed anyway by the system
clock controller.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 4/4] rtc: stm32: add alarm A out feature
2024-07-22 16:00 ` [PATCH v3 4/4] rtc: stm32: add alarm A out feature Valentin Caron
@ 2024-07-26 20:51 ` Linus Walleij
0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2024-07-26 20:51 UTC (permalink / raw)
To: Valentin Caron
Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue, linux-rtc, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Amelie Delaunay
On Mon, Jul 22, 2024 at 6:02 PM Valentin Caron
<valentin.caron@foss.st.com> wrote:
> STM32 RTC can pulse some SOC pins when an RTC alarm expires.
> This patch adds this functionality for alarm A. The pulse can out on three
> pins RTC_OUT1, RTC_OUT2, RTC_OUT2_RMP (PC13, PB2, PI8 on stm32mp15)
> (PC13, PB2, PI1 on stm32mp13) (PC13, PF4/PF6, PI8 on stm32mp25).
>
> This patch only adds the functionality for devices which are using
> st,stm32mp1-rtc and st,stm32mp25-rtc compatible.
>
> Add "alarm-a" in pinmux functions.
>
> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Looks good to me:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs
2024-07-26 20:37 ` [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Linus Walleij
@ 2024-07-26 21:29 ` Alexandre Belloni
0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2024-07-26 21:29 UTC (permalink / raw)
To: Linus Walleij
Cc: Valentin Caron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alexandre Torgue, linux-rtc, devicetree, linux-stm32,
linux-arm-kernel, linux-kernel, Amelie Delaunay
Hello Linus,
On 26/07/2024 22:37:21+0200, Linus Walleij wrote:
> On Mon, Jul 22, 2024 at 6:02 PM Valentin Caron
> <valentin.caron@foss.st.com> wrote:
>
> > This series adds a pinctrl/pinmux interface to control STM32 RTC outputs.
>
> Interesting! I think it is the first pin controller outside on
> drivers/pinctrl in the kernel tree.
Actually, we have rtc-omap which does this too. I've been pushing for
more RTC to do this instead of defining custom dt bindings to do what
boils down to pinmuxing.
>
> Please include me and the linux-gpio@vger.kernel.org list in
> subsequent postings, I want to be sure what gets merged here
> and I only noticed this from the LWN driver patches summary.
I'll also ensure you get copied on pinctrl related patches.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
` (4 preceding siblings ...)
2024-07-26 20:37 ` [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Linus Walleij
@ 2024-08-14 9:39 ` Alexandre Belloni
5 siblings, 0 replies; 13+ messages in thread
From: Alexandre Belloni @ 2024-08-14 9:39 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alexandre Torgue,
Valentin Caron
Cc: linux-rtc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, Amelie Delaunay
On Mon, 22 Jul 2024 18:00:18 +0200, Valentin Caron wrote:
> 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.
>
> [...]
Applied, thanks!
[1/4] dt-bindings: rtc: stm32: describe pinmux nodes
https://git.kernel.org/abelloni/c/5b19519d4e6f
[2/4] rtc: stm32: add pinctrl and pinmux interfaces
https://git.kernel.org/abelloni/c/16ad2bc09efb
[3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support
https://git.kernel.org/abelloni/c/bb7b0df2be5c
[4/4] rtc: stm32: add alarm A out feature
https://git.kernel.org/abelloni/c/04dcadb87da6
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-08-14 9:39 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 16:00 [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Valentin Caron
2024-07-22 16:00 ` [PATCH v3 1/4] dt-bindings: rtc: stm32: describe pinmux nodes Valentin Caron
2024-07-23 8:48 ` Krzysztof Kozlowski
2024-07-26 20:38 ` Linus Walleij
2024-07-22 16:00 ` [PATCH v3 2/4] rtc: stm32: add pinctrl and pinmux interfaces Valentin Caron
2024-07-26 20:46 ` Linus Walleij
2024-07-22 16:00 ` [PATCH v3 3/4] rtc: stm32: add Low Speed Clock Output (LSCO) support Valentin Caron
2024-07-26 20:50 ` Linus Walleij
2024-07-22 16:00 ` [PATCH v3 4/4] rtc: stm32: add alarm A out feature Valentin Caron
2024-07-26 20:51 ` Linus Walleij
2024-07-26 20:37 ` [PATCH v3 0/4] rtc: stm32: add pinctrl interface to handle RTC outs Linus Walleij
2024-07-26 21:29 ` Alexandre Belloni
2024-08-14 9:39 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).