Lines Matching +full:stm32 +full:- +full:lptimer +full:- +full:timer
1 // SPDX-License-Identifier: GPL-2.0
3 * STM32 Low-Power Timer Trigger driver
9 * Inspired by Benjamin Gaignard's stm32-timer-trigger driver
12 #include <linux/iio/timer/stm32-lptim-trigger.h>
13 #include <linux/mfd/stm32-lptimer.h>
19 /* List Low-Power Timer triggers */
34 if (indio_dev->modes & INDIO_HARDWARE_TRIGGERED) in stm32_lptim_validate_device()
37 return -EINVAL; in stm32_lptim_validate_device()
48 * return true if the trigger is a valid STM32 IIO Low-Power Timer Trigger
53 return (trig->ops == &stm32_lptim_trigger_ops); in is_stm32_lptim_trigger()
61 trig = devm_iio_trigger_alloc(priv->dev, "%s", priv->trg); in stm32_lptim_setup_trig()
63 return -ENOMEM; in stm32_lptim_setup_trig()
65 trig->dev.parent = priv->dev->parent; in stm32_lptim_setup_trig()
66 trig->ops = &stm32_lptim_trigger_ops; in stm32_lptim_setup_trig()
69 return devm_iio_trigger_register(priv->dev, trig); in stm32_lptim_setup_trig()
77 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in stm32_lptim_trigger_probe()
79 return -ENOMEM; in stm32_lptim_trigger_probe()
81 if (device_property_read_u32(&pdev->dev, "reg", &index)) in stm32_lptim_trigger_probe()
82 return -EINVAL; in stm32_lptim_trigger_probe()
85 return -EINVAL; in stm32_lptim_trigger_probe()
87 priv->dev = &pdev->dev; in stm32_lptim_trigger_probe()
88 priv->trg = stm32_lptim_triggers[index]; in stm32_lptim_trigger_probe()
94 { .compatible = "st,stm32-lptimer-trigger", },
102 .name = "stm32-lptimer-trigger",
109 MODULE_ALIAS("platform:stm32-lptimer-trigger");
110 MODULE_DESCRIPTION("STMicroelectronics STM32 LPTIM trigger driver");