Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 0/6 V2] staging:iio Build issue fixes
@ 2010-07-29 16:50 Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 1/6] staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer builds Jonathan Cameron
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Hi All,

This lot are in response to Randy Dunlap finding a number of build
issues.  The final patch actually fixes a bug that has been there
quite some time.

Sorry again for clearly not testing my previous series properly!


Jonathan Cameron (6):
  staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer
    builds.
  staging:iio:lis3l02dq add a thresh_timestamp field to state for no
    ring case
  staging:iio:adis16350 add dummy ring functions for no ring build case
  staging:iio:ring_sw  Add select of triggers to avoid build issue.
  staging:iio:ring_sw  remove unnecessary function stub.
  staging:iio:ring_sw  Fix pointer arithmetic for 64bit arches by using
    phys_addr_t

 drivers/staging/iio/Kconfig                |    1 +
 drivers/staging/iio/accel/lis3l02dq.h      |    2 ++
 drivers/staging/iio/accel/lis3l02dq_core.c |   14 +++++++-------
 drivers/staging/iio/imu/adis16350.h        |    8 ++++++++
 drivers/staging/iio/ring_sw.c              |    2 +-
 drivers/staging/iio/ring_sw.h              |    5 +++--
 6 files changed, 22 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer builds.
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
@ 2010-07-29 16:50 ` Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 2/6] staging:iio:lis3l02dq add a thresh_timestamp field to state for no ring case Jonathan Cameron
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/ring_sw.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/iio/ring_sw.h b/drivers/staging/iio/ring_sw.h
index 0194e7f..7c27e2c 100644
--- a/drivers/staging/iio/ring_sw.h
+++ b/drivers/staging/iio/ring_sw.h
@@ -222,5 +222,8 @@ void iio_sw_trigger_bh_to_ring(struct work_struct *work_s);
 #else /* CONFIG_IIO_RING_BUFFER*/
 static inline void iio_ring_sw_register_funcs(struct iio_ring_access_funcs *ra)
 {};
+struct iio_sw_ring_helper_state {
+	struct iio_dev			*indio_dev;
+};
 #endif /* !CONFIG_IIO_RING_BUFFER */
 #endif /* _IIO_RING_SW_H_ */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/6] staging:iio:lis3l02dq add a thresh_timestamp field to state for no ring case
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 1/6] staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer builds Jonathan Cameron
@ 2010-07-29 16:50 ` Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 3/6] staging:iio:adis16350 add dummy ring functions for no ring build case Jonathan Cameron
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/accel/lis3l02dq.h      |    2 ++
 drivers/staging/iio/accel/lis3l02dq_core.c |   14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/iio/accel/lis3l02dq.h b/drivers/staging/iio/accel/lis3l02dq.h
index 44669ee..6e73055 100644
--- a/drivers/staging/iio/accel/lis3l02dq.h
+++ b/drivers/staging/iio/accel/lis3l02dq.h
@@ -151,6 +151,7 @@ Form of high byte dependant on justification set in ctrl reg */
  * @helper:		data and func pointer allowing generic functions
  * @us:			actual spi_device
  * @work_thresh:	bh for threshold events
+ * @thresh_timestamp:	timestamp for threshold interrupts.
  * @inter:		used to check if new interrupt has been triggered
  * @trig:		data ready trigger registered with iio
  * @tx:			transmit buffer
@@ -161,6 +162,7 @@ struct lis3l02dq_state {
 	struct iio_sw_ring_helper_state	help;
 	struct spi_device		*us;
 	struct work_struct		work_thresh;
+	s64				thresh_timestamp;
 	bool				inter;
 	struct iio_trigger		*trig;
 	u8				*tx;
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index b04f498..0ee9337 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -615,7 +615,7 @@ static int lis3l02dq_thresh_handler_th(struct iio_dev *indio_dev,
 	struct lis3l02dq_state *st = lis3l02dq_h_to_s(h);
 
 	/* Stash the timestamp somewhere convenient for the bh */
-	h->last_timestamp = timestamp;
+	st->thresh_timestamp = timestamp;
 	schedule_work(&st->work_thresh);
 
 	return 0;
@@ -640,32 +640,32 @@ static void lis3l02dq_thresh_handler_bh_no_check(struct work_struct *work_s)
 	if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Z_HIGH)
 		iio_push_event(st->help.indio_dev, 0,
 			       IIO_EVENT_CODE_ACCEL_Z_HIGH,
-			       st->help.last_timestamp);
+			       st->thresh_timestamp);
 
 	if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Z_LOW)
 		iio_push_event(st->help.indio_dev, 0,
 			       IIO_EVENT_CODE_ACCEL_Z_LOW,
-			       st->help.last_timestamp);
+			       st->thresh_timestamp);
 
 	if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Y_HIGH)
 		iio_push_event(st->help.indio_dev, 0,
 			       IIO_EVENT_CODE_ACCEL_Y_HIGH,
-			       st->help.last_timestamp);
+			       st->thresh_timestamp);
 
 	if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_Y_LOW)
 		iio_push_event(st->help.indio_dev, 0,
 			       IIO_EVENT_CODE_ACCEL_Y_LOW,
-			       st->help.last_timestamp);
+			       st->thresh_timestamp);
 
 	if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_X_HIGH)
 		iio_push_event(st->help.indio_dev, 0,
 			       IIO_EVENT_CODE_ACCEL_X_HIGH,
-			       st->help.last_timestamp);
+			       st->thresh_timestamp);
 
 	if (t & LIS3L02DQ_REG_WAKE_UP_SRC_INTERRUPT_X_LOW)
 		iio_push_event(st->help.indio_dev, 0,
 			       IIO_EVENT_CODE_ACCEL_X_LOW,
-			       st->help.last_timestamp);
+			       st->thresh_timestamp);
 	/* reenable the irq */
 	enable_irq(st->us->irq);
 	/* Ack and allow for new interrupts */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/6] staging:iio:adis16350 add dummy ring functions for no ring build case
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 1/6] staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer builds Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 2/6] staging:iio:lis3l02dq add a thresh_timestamp field to state for no ring case Jonathan Cameron
@ 2010-07-29 16:50 ` Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 4/6] staging:iio:ring_sw Add select of triggers to avoid build issue Jonathan Cameron
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/imu/adis16350.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/iio/imu/adis16350.h b/drivers/staging/iio/imu/adis16350.h
index 738deba..b00001e 100644
--- a/drivers/staging/iio/imu/adis16350.h
+++ b/drivers/staging/iio/imu/adis16350.h
@@ -165,5 +165,13 @@ adis16350_read_data_from_ring(struct device *dev,
 	return 0;
 }
 
+static inline int adis16350_configure_ring(struct iio_dev *indio_dev)
+{
+	return 0;
+}
+
+static inline void adis16350_unconfigure_ring(struct iio_dev *indio_dev)
+{
+}
 #endif /* CONFIG_IIO_RING_BUFFER */
 #endif /* SPI_ADIS16350_H_ */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/6] staging:iio:ring_sw  Add select of triggers to avoid build issue.
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
                   ` (2 preceding siblings ...)
  2010-07-29 16:50 ` [PATCH 3/6] staging:iio:adis16350 add dummy ring functions for no ring build case Jonathan Cameron
@ 2010-07-29 16:50 ` Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 5/6] staging:iio:ring_sw remove unnecessary function stub Jonathan Cameron
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Currently all drivers that use ring_sw use triggers and I am yet
to see a good reason for any driver not doing so.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/iio/Kconfig b/drivers/staging/iio/Kconfig
index 569b938..ed48815 100644
--- a/drivers/staging/iio/Kconfig
+++ b/drivers/staging/iio/Kconfig
@@ -21,6 +21,7 @@ config IIO_RING_BUFFER
 if IIO_RING_BUFFER
 
 config IIO_SW_RING
+       select IIO_TRIGGER
 	tristate "Industrial I/O lock free software ring"
 	help
 	  Example software ring buffer implementation.  The design aim
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/6] staging:iio:ring_sw  remove unnecessary function stub.
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
                   ` (3 preceding siblings ...)
  2010-07-29 16:50 ` [PATCH 4/6] staging:iio:ring_sw Add select of triggers to avoid build issue Jonathan Cameron
@ 2010-07-29 16:50 ` Jonathan Cameron
  2010-07-29 16:50 ` [PATCH 6/6] staging:iio:ring_sw Fix pointer arithmetic for 64bit arches by using phys_addr_t Jonathan Cameron
  2010-07-29 17:38 ` [PATCH 0/6 V2] staging:iio Build issue fixes Randy Dunlap
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/ring_sw.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/ring_sw.h b/drivers/staging/iio/ring_sw.h
index 7c27e2c..61f1ed6 100644
--- a/drivers/staging/iio/ring_sw.h
+++ b/drivers/staging/iio/ring_sw.h
@@ -220,8 +220,6 @@ void iio_sw_poll_func_th(struct iio_dev *indio_dev, s64 time);
 void iio_sw_trigger_bh_to_ring(struct work_struct *work_s);
 
 #else /* CONFIG_IIO_RING_BUFFER*/
-static inline void iio_ring_sw_register_funcs(struct iio_ring_access_funcs *ra)
-{};
 struct iio_sw_ring_helper_state {
 	struct iio_dev			*indio_dev;
 };
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/6] staging:iio:ring_sw  Fix pointer arithmetic for 64bit arches by using phys_addr_t
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
                   ` (4 preceding siblings ...)
  2010-07-29 16:50 ` [PATCH 5/6] staging:iio:ring_sw remove unnecessary function stub Jonathan Cameron
@ 2010-07-29 16:50 ` Jonathan Cameron
  2010-07-29 17:38 ` [PATCH 0/6 V2] staging:iio Build issue fixes Randy Dunlap
  6 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2010-07-29 16:50 UTC (permalink / raw)
  To: Greg KH; +Cc: Randy Dunlap, akpm, linux-iio, Jonathan Cameron

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
 drivers/staging/iio/ring_sw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c
index 9b3598e..e2f01c6 100644
--- a/drivers/staging/iio/ring_sw.c
+++ b/drivers/staging/iio/ring_sw.c
@@ -478,7 +478,7 @@ void iio_sw_trigger_bh_to_ring(struct work_struct *work_s)
 
 	  /* Guaranteed to be aligned with 8 byte boundary */
 	if (st->indio_dev->scan_timestamp)
-		*(s64 *)(((u32)data + len
+		*(s64 *)(((phys_addr_t)data + len
 				+ sizeof(s64) - 1) & ~(sizeof(s64) - 1))
 			= st->last_timestamp;
 	  st->indio_dev->ring->access.store_to(st->indio_dev->ring,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/6 V2] staging:iio Build issue fixes
  2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
                   ` (5 preceding siblings ...)
  2010-07-29 16:50 ` [PATCH 6/6] staging:iio:ring_sw Fix pointer arithmetic for 64bit arches by using phys_addr_t Jonathan Cameron
@ 2010-07-29 17:38 ` Randy Dunlap
  6 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2010-07-29 17:38 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Greg KH, akpm, linux-iio

On 07/29/10 09:50, Jonathan Cameron wrote:
> Hi All,
> 
> This lot are in response to Randy Dunlap finding a number of build
> issues.  The final patch actually fixes a bug that has been there
> quite some time.
> 
> Sorry again for clearly not testing my previous series properly!
> 

Thanks for the quick update.
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>


> 
> Jonathan Cameron (6):
>   staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer
>     builds.
>   staging:iio:lis3l02dq add a thresh_timestamp field to state for no
>     ring case
>   staging:iio:adis16350 add dummy ring functions for no ring build case
>   staging:iio:ring_sw  Add select of triggers to avoid build issue.
>   staging:iio:ring_sw  remove unnecessary function stub.
>   staging:iio:ring_sw  Fix pointer arithmetic for 64bit arches by using
>     phys_addr_t
> 
>  drivers/staging/iio/Kconfig                |    1 +
>  drivers/staging/iio/accel/lis3l02dq.h      |    2 ++
>  drivers/staging/iio/accel/lis3l02dq_core.c |   14 +++++++-------
>  drivers/staging/iio/imu/adis16350.h        |    8 ++++++++
>  drivers/staging/iio/ring_sw.c              |    2 +-
>  drivers/staging/iio/ring_sw.h              |    5 +++--
>  6 files changed, 22 insertions(+), 10 deletions(-)
> 


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-29 17:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 16:50 [PATCH 0/6 V2] staging:iio Build issue fixes Jonathan Cameron
2010-07-29 16:50 ` [PATCH 1/6] staging:iio: iio_sw_ring_helper_state - add dummy case for no buffer builds Jonathan Cameron
2010-07-29 16:50 ` [PATCH 2/6] staging:iio:lis3l02dq add a thresh_timestamp field to state for no ring case Jonathan Cameron
2010-07-29 16:50 ` [PATCH 3/6] staging:iio:adis16350 add dummy ring functions for no ring build case Jonathan Cameron
2010-07-29 16:50 ` [PATCH 4/6] staging:iio:ring_sw Add select of triggers to avoid build issue Jonathan Cameron
2010-07-29 16:50 ` [PATCH 5/6] staging:iio:ring_sw remove unnecessary function stub Jonathan Cameron
2010-07-29 16:50 ` [PATCH 6/6] staging:iio:ring_sw Fix pointer arithmetic for 64bit arches by using phys_addr_t Jonathan Cameron
2010-07-29 17:38 ` [PATCH 0/6 V2] staging:iio Build issue fixes Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox