All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Cc: jic23@cam.ac.uk, dmitry.torokhov@gmail.com,
	sameo@linux.intel.com, linux-iio@vger.kernel.org,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	bigeasy@linutronix.de, gregkh@linuxfoundation.org,
	Russ.Dill@ti.com
Subject: Re: [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support
Date: Tue, 13 Aug 2013 18:05:00 +0100	[thread overview]
Message-ID: <20130813170500.GI15278@lee--X1> (raw)
In-Reply-To: <1376412499-21007-5-git-send-email-zubair.lutfullah@gmail.com>

On Tue, 13 Aug 2013, Zubair Lutfullah wrote:

> Previously the driver had only one-shot reading functionality.
> This patch adds triggered buffer support to the driver.
> A buffer of samples can now be read via /dev/iio.
> Any IIO trigger can be used to start acquisition.
> 
> Patil Rachna (TI) laid the ground work for ADC HW register access.
> Russ Dill (TI) fixed bugs in the driver relevant to FIFOs and IRQs.
> 
> I fixed channel scanning so multiple ADC channels can be read
> simultaneously and pushed to userspace. Restructured the driver
> to fit IIO ABI. And added trigger support.
> 
> Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Russ Dill <Russ.Dill@ti.com>
> ---
>  drivers/iio/adc/ti_am335x_adc.c      |  353 ++++++++++++++++++++++++++++------
>  include/linux/mfd/ti_am335x_tscadc.h |   13 +-
>  2 files changed, 303 insertions(+), 63 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c

<snip>

> diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
> index e2db978..a1d22de 100644
> --- a/include/linux/mfd/ti_am335x_tscadc.h
> +++ b/include/linux/mfd/ti_am335x_tscadc.h
> @@ -46,6 +46,9 @@
>  /* Step Enable */
>  #define STEPENB_MASK		(0x1FFFF << 0)
>  #define STEPENB(val)		((val) << 0)
> +#define ENB(val)			(1 << (val))
> +#define STPENB_STEPENB		STEPENB(0x1FFFF)
> +#define STPENB_STEPENB_TC	STEPENB(0x1FFF)
>  
>  /* IRQ enable */
>  #define IRQENB_HW_PEN		BIT(0)
> @@ -54,11 +57,14 @@
>  #define IRQENB_FIFO0UNDRFLW	BIT(4)
>  #define IRQENB_FIFO1THRES	BIT(5)
>  #define IRQENB_PENUP		BIT(9)
> +#define IRQENB_FIFO1OVRRUN	BIT(6)
> +#define IRQENB_FIFO1UNDRFLW	BIT(7)

Nit: Can we keep these in numerical order?

>  /* Step Configuration */
>  #define STEPCONFIG_MODE_MASK	(3 << 0)
>  #define STEPCONFIG_MODE(val)	((val) << 0)
>  #define STEPCONFIG_MODE_HWSYNC	STEPCONFIG_MODE(2)
> +#define STEPCONFIG_MODE_SWCNT	STEPCONFIG_MODE(1)
>  #define STEPCONFIG_AVG_MASK	(7 << 2)
>  #define STEPCONFIG_AVG(val)	((val) << 2)
>  #define STEPCONFIG_AVG_16	STEPCONFIG_AVG(4)
> @@ -126,7 +132,8 @@
>  #define	MAX_CLK_DIV		7
>  #define TOTAL_STEPS		16
>  #define TOTAL_CHANNELS		8
> -
> +#define FIFO1_THRESHOLD		19
> +#define FIFO_SIZE			64

Nit: Keep the line space between the defines and the multi-line comment.

>  /*
>  * ADC runs at 3MHz, and it takes
>  * 15 cycles to latch one data output.
> @@ -155,6 +162,10 @@ struct ti_tscadc_dev {
>  
>  	/* adc device */
>  	struct adc_device *adc;
> +
> +	/* Context save */
> +	unsigned int irqstat;
> +	unsigned int ctrl;
>  };
>  
>  static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Cc: jic23@cam.ac.uk, dmitry.torokhov@gmail.com,
	sameo@linux.intel.com, linux-iio@vger.kernel.org,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	bigeasy@linutronix.de, gregkh@linuxfoundation.org,
	Russ.Dill@ti.com
Subject: Re: [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support
Date: Tue, 13 Aug 2013 18:05:00 +0100	[thread overview]
Message-ID: <20130813170500.GI15278@lee--X1> (raw)
In-Reply-To: <1376412499-21007-5-git-send-email-zubair.lutfullah@gmail.com>

On Tue, 13 Aug 2013, Zubair Lutfullah wrote:

> Previously the driver had only one-shot reading functionality.
> This patch adds triggered buffer support to the driver.
> A buffer of samples can now be read via /dev/iio.
> Any IIO trigger can be used to start acquisition.
> 
> Patil Rachna (TI) laid the ground work for ADC HW register access.
> Russ Dill (TI) fixed bugs in the driver relevant to FIFOs and IRQs.
> 
> I fixed channel scanning so multiple ADC channels can be read
> simultaneously and pushed to userspace. Restructured the driver
> to fit IIO ABI. And added trigger support.
> 
> Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Russ Dill <Russ.Dill@ti.com>
> ---
>  drivers/iio/adc/ti_am335x_adc.c      |  353 ++++++++++++++++++++++++++++------
>  include/linux/mfd/ti_am335x_tscadc.h |   13 +-
>  2 files changed, 303 insertions(+), 63 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c

<snip>

> diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
> index e2db978..a1d22de 100644
> --- a/include/linux/mfd/ti_am335x_tscadc.h
> +++ b/include/linux/mfd/ti_am335x_tscadc.h
> @@ -46,6 +46,9 @@
>  /* Step Enable */
>  #define STEPENB_MASK		(0x1FFFF << 0)
>  #define STEPENB(val)		((val) << 0)
> +#define ENB(val)			(1 << (val))
> +#define STPENB_STEPENB		STEPENB(0x1FFFF)
> +#define STPENB_STEPENB_TC	STEPENB(0x1FFF)
>  
>  /* IRQ enable */
>  #define IRQENB_HW_PEN		BIT(0)
> @@ -54,11 +57,14 @@
>  #define IRQENB_FIFO0UNDRFLW	BIT(4)
>  #define IRQENB_FIFO1THRES	BIT(5)
>  #define IRQENB_PENUP		BIT(9)
> +#define IRQENB_FIFO1OVRRUN	BIT(6)
> +#define IRQENB_FIFO1UNDRFLW	BIT(7)

Nit: Can we keep these in numerical order?

>  /* Step Configuration */
>  #define STEPCONFIG_MODE_MASK	(3 << 0)
>  #define STEPCONFIG_MODE(val)	((val) << 0)
>  #define STEPCONFIG_MODE_HWSYNC	STEPCONFIG_MODE(2)
> +#define STEPCONFIG_MODE_SWCNT	STEPCONFIG_MODE(1)
>  #define STEPCONFIG_AVG_MASK	(7 << 2)
>  #define STEPCONFIG_AVG(val)	((val) << 2)
>  #define STEPCONFIG_AVG_16	STEPCONFIG_AVG(4)
> @@ -126,7 +132,8 @@
>  #define	MAX_CLK_DIV		7
>  #define TOTAL_STEPS		16
>  #define TOTAL_CHANNELS		8
> -
> +#define FIFO1_THRESHOLD		19
> +#define FIFO_SIZE			64

Nit: Keep the line space between the defines and the multi-line comment.

>  /*
>  * ADC runs at 3MHz, and it takes
>  * 15 cycles to latch one data output.
> @@ -155,6 +162,10 @@ struct ti_tscadc_dev {
>  
>  	/* adc device */
>  	struct adc_device *adc;
> +
> +	/* Context save */
> +	unsigned int irqstat;
> +	unsigned int ctrl;
>  };
>  
>  static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-08-13 17:05 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 16:48 [PATCH 0/4] iio: input: ti_am335x_adc: Add continuous sampling support round 4 Zubair Lutfullah
2013-08-13 16:48 ` [PATCH 1/4] input: ti_am335x_tsc: correct step mask update after IRQ Zubair Lutfullah
2013-08-16  8:53   ` Sebastian Andrzej Siewior
2013-08-16 21:42     ` Zubair Lutfullah :
2013-08-13 16:48 ` [PATCH 2/4] input: ti_am335x_tsc: Increase sequencer delay time Zubair Lutfullah
2013-08-16  9:04   ` Sebastian Andrzej Siewior
2013-08-13 16:48 ` [PATCH 3/4] input: ti_tsc: Enable shared IRQ for TSC and add overrun, underflow checks Zubair Lutfullah
2013-08-13 17:07   ` Lee Jones
2013-08-16  9:14   ` Sebastian Andrzej Siewior
2013-08-16  9:14     ` Sebastian Andrzej Siewior
2013-08-16 21:31     ` Zubair Lutfullah :
2013-08-13 16:48 ` [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support Zubair Lutfullah
2013-08-13 17:05   ` Lee Jones [this message]
2013-08-13 17:05     ` Lee Jones
2013-08-13 20:04 [PATCH 0/4] iio: input: ti_am335x_adc: Add continuous sampling support round 5 Zubair Lutfullah
2013-08-13 20:05 ` [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support Zubair Lutfullah
2013-08-15 11:43   ` Jonathan Cameron
2013-08-15 11:43     ` Jonathan Cameron
2013-08-16 10:07     ` Sebastian Andrzej Siewior
2013-08-16 10:07       ` Sebastian Andrzej Siewior
2013-08-16 10:17       ` Sebastian Andrzej Siewior
2013-08-16 10:17         ` Sebastian Andrzej Siewior
2013-08-16 11:33       ` Jonathan Cameron
2013-08-16 11:33         ` Jonathan Cameron
2013-08-16 10:46         ` Sebastian Andrzej Siewior
2013-08-16 21:21           ` Zubair Lutfullah :
2013-08-17  8:58     ` Zubair Lutfullah :
2013-08-17  8:58       ` Zubair Lutfullah :
     [not found]       ` <520F9395.3050900@kernel.org>
2013-08-17 18:51         ` Zubair Lutfullah :
2013-08-16 12:53   ` Sebastian Andrzej Siewior
2013-08-16 12:53     ` Sebastian Andrzej Siewior
2013-08-16 21:18     ` Zubair Lutfullah :
2013-08-16 13:25   ` Sebastian Andrzej Siewior
2013-08-16 13:25     ` Sebastian Andrzej Siewior
2013-08-16 21:13     ` Zubair Lutfullah :
2013-08-16 14:59   ` Sebastian Andrzej Siewior
2013-08-16 14:59     ` Sebastian Andrzej Siewior
2013-08-16 21:10     ` Zubair Lutfullah :
2013-08-19 17:12   ` Sebastian Andrzej Siewior
2013-08-19 17:12     ` Sebastian Andrzej Siewior
2013-08-20 16:26     ` Zubair Lutfullah :
2013-08-20 16:26       ` Zubair Lutfullah :

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=20130813170500.GI15278@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=Russ.Dill@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=zubair.lutfullah@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.