linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jic23@kernel.org (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 9/9] iio: adc: stm32: add support for lptimer triggers
Date: Sun, 9 Jul 2017 21:13:48 +0100	[thread overview]
Message-ID: <20170709211348.17ae92f9@kernel.org> (raw)
In-Reply-To: <1499445068-7037-10-git-send-email-fabrice.gasnier@st.com>

On Fri, 7 Jul 2017 18:31:08 +0200
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> STM32 ADC supports hardware triggers like STM32 Low-Power Timer.
> For instance, STM32H7 ADC may be triggered by instances 1, 2 or 3.
> Add hardware triggered mode so Low-Power Timer Trigger driver can
> validate device.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
>  drivers/iio/adc/stm32-adc.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> index 5bfcc1f..1147d7e 100644
> --- a/drivers/iio/adc/stm32-adc.c
> +++ b/drivers/iio/adc/stm32-adc.c
> @@ -25,6 +25,7 @@
>  #include <linux/dmaengine.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/buffer.h>
> +#include <linux/iio/timer/stm32-lptim-trigger.h>
>  #include <linux/iio/timer/stm32-timer-trigger.h>
>  #include <linux/iio/trigger.h>
>  #include <linux/iio/trigger_consumer.h>
> @@ -182,6 +183,11 @@ enum stm32_adc_extsel {
>  	STM32_EXT13,
>  	STM32_EXT14,
>  	STM32_EXT15,
> +	STM32_EXT16,
> +	STM32_EXT17,
> +	STM32_EXT18,
> +	STM32_EXT19,
> +	STM32_EXT20,
>  };
>  
>  /**
> @@ -480,6 +486,9 @@ struct stm32_adc_info {
>  	{ TIM4_TRGO, STM32_EXT12 },
>  	{ TIM6_TRGO, STM32_EXT13 },
>  	{ TIM3_CH4, STM32_EXT15 },
> +	{ LPTIM1_OUT, STM32_EXT18 },
> +	{ LPTIM2_OUT, STM32_EXT19 },
> +	{ LPTIM3_OUT, STM32_EXT20 },
>  	{},
>  };
>  
> @@ -995,7 +1004,8 @@ static int stm32_adc_get_trig_extsel(struct iio_dev *indio_dev,
>  		 * Checking both stm32 timer trigger type and trig name
>  		 * should be safe against arbitrary trigger names.
>  		 */
> -		if (is_stm32_timer_trigger(trig) &&
> +		if ((is_stm32_timer_trigger(trig) ||
> +		     is_stm32_lptim_trigger(trig)) &&
>  		    !strcmp(adc->cfg->trigs[i].name, trig->name)) {
>  			return adc->cfg->trigs[i].extsel;
>  		}
> @@ -1634,7 +1644,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
>  	indio_dev->dev.parent = &pdev->dev;
>  	indio_dev->dev.of_node = pdev->dev.of_node;
>  	indio_dev->info = &stm32_adc_iio_info;
> -	indio_dev->modes = INDIO_DIRECT_MODE;
> +	indio_dev->modes = INDIO_DIRECT_MODE | INDIO_HARDWARE_TRIGGERED;
>  
>  	platform_set_drvdata(pdev, adc);
>  

  reply	other threads:[~2017-07-09 20:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 16:30 [PATCH v3 0/9] Add STM32 LPTimer: PWM, trigger and counter Fabrice Gasnier
2017-07-07 16:31 ` [PATCH v3 1/9] dt-bindings: mfd: Add STM32 LPTimer binding Fabrice Gasnier
2017-07-10 15:26   ` Rob Herring
2017-07-17 18:34   ` Lee Jones
2017-07-07 16:31 ` [PATCH v3 2/9] mfd: Add STM32 LPTimer driver Fabrice Gasnier
2017-07-17 18:33   ` Lee Jones
2017-07-07 16:31 ` [PATCH v3 3/9] dt-bindings: pwm: Add STM32 LPTimer PWM binding Fabrice Gasnier
2017-07-07 16:31 ` [PATCH v3 4/9] pwm: Add STM32 LPTimer PWM driver Fabrice Gasnier
2017-07-26 12:35   ` Fabrice Gasnier
2017-08-21  7:01   ` Thierry Reding
2017-07-07 16:31 ` [PATCH v3 5/9] dt-bindings: iio: Add STM32 LPTimer trigger binding Fabrice Gasnier
2017-07-10 15:27   ` Rob Herring
2017-07-07 16:31 ` [PATCH v3 6/9] iio: trigger: Add STM32 LPTimer trigger driver Fabrice Gasnier
2017-07-09 20:04   ` Jonathan Cameron
2017-07-07 16:31 ` [PATCH v3 7/9] dt-bindings: iio: Add STM32 LPTimer quadrature encoder and counter Fabrice Gasnier
2017-07-07 16:31 ` [PATCH v3 8/9] iio: counter: Add support for STM32 LPTimer Fabrice Gasnier
2017-07-09 20:12   ` Jonathan Cameron
2017-07-10 12:54     ` William Breathitt Gray
2017-07-07 16:31 ` [PATCH v3 9/9] iio: adc: stm32: add support for lptimer triggers Fabrice Gasnier
2017-07-09 20:13   ` Jonathan Cameron [this message]
2017-08-21  7:24 ` [PATCH v3 0/9] Add STM32 LPTimer: PWM, trigger and counter Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170709211348.17ae92f9@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).