* [RFC PATCH] iio: Add new operating mode for non triggered sw buffers
@ 2015-01-07 18:36 Karol Wrona
2015-01-08 10:47 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Karol Wrona @ 2015-01-07 18:36 UTC (permalink / raw)
To: Jonathan Cameron, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald, linux-kernel
Cc: Bartlomiej Zolnierkiewicz, Kyungmin Park, Karol Wrona, Karol Wrona
There was a need for non triggered software buffer type. It can be used when
triggered model does not fit and INDIO_BUFFER_HARDWARE causes confusion because
the data stream can be obtained not directly form hardware backend.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
---
drivers/iio/industrialio-buffer.c | 2 ++
include/linux/iio/iio.h | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index f971f79..15e6de3 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -680,6 +680,8 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
indio_dev->currentmode = INDIO_BUFFER_TRIGGERED;
} else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) {
indio_dev->currentmode = INDIO_BUFFER_HARDWARE;
+ } else if (indio_dev->modes & INDIO_BUFFER_SOFTWARE) {
+ indio_dev->currentmode = INDIO_BUFFER_SOFTWARE;
} else { /* Should never be reached */
ret = -EINVAL;
goto error_run_postdisable;
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 3642ce7..55e63fd 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -284,10 +284,11 @@ static inline s64 iio_get_time_ns(void)
/* Device operating modes */
#define INDIO_DIRECT_MODE 0x01
#define INDIO_BUFFER_TRIGGERED 0x02
+#define INDIO_BUFFER_SOFTWARE 0x04
#define INDIO_BUFFER_HARDWARE 0x08
#define INDIO_ALL_BUFFER_MODES \
- (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE)
+ (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE)
#define INDIO_MAX_RAW_ELEMENTS 4
@@ -591,7 +592,8 @@ void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
{
return indio_dev->currentmode
- & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE);
+ & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE |
+ INDIO_BUFFER_SOFTWARE);
}
/**
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] iio: Add new operating mode for non triggered sw buffers
2015-01-07 18:36 [RFC PATCH] iio: Add new operating mode for non triggered sw buffers Karol Wrona
@ 2015-01-08 10:47 ` Lars-Peter Clausen
2015-01-10 22:11 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2015-01-08 10:47 UTC (permalink / raw)
To: Karol Wrona, Jonathan Cameron, linux-iio, Hartmut Knaack,
Peter Meerwald, linux-kernel
Cc: Bartlomiej Zolnierkiewicz, Kyungmin Park, Karol Wrona
On 01/07/2015 07:36 PM, Karol Wrona wrote:
> There was a need for non triggered software buffer type. It can be used when
> triggered model does not fit and INDIO_BUFFER_HARDWARE causes confusion because
> the data stream can be obtained not directly form hardware backend.
>
> Suggested-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Looks good, thanks.
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> drivers/iio/industrialio-buffer.c | 2 ++
> include/linux/iio/iio.h | 6 ++++--
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index f971f79..15e6de3 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -680,6 +680,8 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
> indio_dev->currentmode = INDIO_BUFFER_TRIGGERED;
> } else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) {
> indio_dev->currentmode = INDIO_BUFFER_HARDWARE;
> + } else if (indio_dev->modes & INDIO_BUFFER_SOFTWARE) {
> + indio_dev->currentmode = INDIO_BUFFER_SOFTWARE;
> } else { /* Should never be reached */
> ret = -EINVAL;
> goto error_run_postdisable;
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 3642ce7..55e63fd 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -284,10 +284,11 @@ static inline s64 iio_get_time_ns(void)
> /* Device operating modes */
> #define INDIO_DIRECT_MODE 0x01
> #define INDIO_BUFFER_TRIGGERED 0x02
> +#define INDIO_BUFFER_SOFTWARE 0x04
> #define INDIO_BUFFER_HARDWARE 0x08
>
> #define INDIO_ALL_BUFFER_MODES \
> - (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE)
> + (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE)
>
> #define INDIO_MAX_RAW_ELEMENTS 4
>
> @@ -591,7 +592,8 @@ void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
> static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
> {
> return indio_dev->currentmode
> - & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE);
> + & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE |
> + INDIO_BUFFER_SOFTWARE);
> }
>
> /**
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] iio: Add new operating mode for non triggered sw buffers
2015-01-08 10:47 ` Lars-Peter Clausen
@ 2015-01-10 22:11 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2015-01-10 22:11 UTC (permalink / raw)
To: Lars-Peter Clausen, Karol Wrona, linux-iio, Hartmut Knaack,
Peter Meerwald, linux-kernel
Cc: Bartlomiej Zolnierkiewicz, Kyungmin Park, Karol Wrona
On 08/01/15 10:47, Lars-Peter Clausen wrote:
> On 01/07/2015 07:36 PM, Karol Wrona wrote:
>> There was a need for non triggered software buffer type. It can be used when
>> triggered model does not fit and INDIO_BUFFER_HARDWARE causes confusion because
>> the data stream can be obtained not directly form hardware backend.
>>
>> Suggested-by: Jonathan Cameron <jic23@kernel.org>
>> Signed-off-by: Karol Wrona <k.wrona@samsung.com>
>
> Looks good, thanks.
>
> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
>
Thanks for doing this.
Applied to the togreg branch of iio.git - initially pushed out
as testing.
Jonathan
>> ---
>> drivers/iio/industrialio-buffer.c | 2 ++
>> include/linux/iio/iio.h | 6 ++++--
>> 2 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
>> index f971f79..15e6de3 100644
>> --- a/drivers/iio/industrialio-buffer.c
>> +++ b/drivers/iio/industrialio-buffer.c
>> @@ -680,6 +680,8 @@ static int __iio_update_buffers(struct iio_dev *indio_dev,
>> indio_dev->currentmode = INDIO_BUFFER_TRIGGERED;
>> } else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) {
>> indio_dev->currentmode = INDIO_BUFFER_HARDWARE;
>> + } else if (indio_dev->modes & INDIO_BUFFER_SOFTWARE) {
>> + indio_dev->currentmode = INDIO_BUFFER_SOFTWARE;
>> } else { /* Should never be reached */
>> ret = -EINVAL;
>> goto error_run_postdisable;
>> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
>> index 3642ce7..55e63fd 100644
>> --- a/include/linux/iio/iio.h
>> +++ b/include/linux/iio/iio.h
>> @@ -284,10 +284,11 @@ static inline s64 iio_get_time_ns(void)
>> /* Device operating modes */
>> #define INDIO_DIRECT_MODE 0x01
>> #define INDIO_BUFFER_TRIGGERED 0x02
>> +#define INDIO_BUFFER_SOFTWARE 0x04
>> #define INDIO_BUFFER_HARDWARE 0x08
>>
>> #define INDIO_ALL_BUFFER_MODES \
>> - (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE)
>> + (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE)
>>
>> #define INDIO_MAX_RAW_ELEMENTS 4
>>
>> @@ -591,7 +592,8 @@ void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
>> static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
>> {
>> return indio_dev->currentmode
>> - & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE);
>> + & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE |
>> + INDIO_BUFFER_SOFTWARE);
>> }
>>
>> /**
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-10 22:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 18:36 [RFC PATCH] iio: Add new operating mode for non triggered sw buffers Karol Wrona
2015-01-08 10:47 ` Lars-Peter Clausen
2015-01-10 22:11 ` Jonathan Cameron
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).