All of lore.kernel.org
 help / color / mirror / Atom feed
* lis3l02dq_core fails to compile
@ 2012-08-06  8:39 Peter Meerwald
  2012-08-06  8:53 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Meerwald @ 2012-08-06  8:39 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio

Hello,

staging/iio/accel/lis3l02dq_core.c fails to compile when irq_to_gpio() is 
not available

the solution is to pass both, irq and gpio via platform data (e.g. as 
done by staging/iio/magnetometer/ak8975.c)?

regards, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)

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

* Re: lis3l02dq_core fails to compile
  2012-08-06  8:39 lis3l02dq_core fails to compile Peter Meerwald
@ 2012-08-06  8:53 ` Lars-Peter Clausen
  2012-08-06  9:04   ` Peter Meerwald
  0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2012-08-06  8:53 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: jic23, linux-iio

On 08/06/2012 10:39 AM, Peter Meerwald wrote:
> Hello,
> 
> staging/iio/accel/lis3l02dq_core.c fails to compile when irq_to_gpio() is 
> not available
> 
> the solution is to pass both, irq and gpio via platform data (e.g. as 
> done by staging/iio/magnetometer/ak8975.c)?
> 

gpio_to_irq will always be available. While irq_to_gpio is deprecated. So it
should work if you just pass the gpio.

But looking at the driver it only seems to check if the IRQ is a valid GPIO,
but never seems use the GPIO pin otherwise. Maybe I missed something, but
I'd just remove the whole  gpio_is_valid(irq_to_gpio(spi->irq)) check.

- Lars

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

* Re: lis3l02dq_core fails to compile
  2012-08-06  8:53 ` Lars-Peter Clausen
@ 2012-08-06  9:04   ` Peter Meerwald
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Meerwald @ 2012-08-06  9:04 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: jic23, linux-iio

Hello,

> > staging/iio/accel/lis3l02dq_core.c fails to compile when irq_to_gpio() is 
> > not available
> > 
> > the solution is to pass both, irq and gpio via platform data (e.g. as 
> > done by staging/iio/magnetometer/ak8975.c)?

> gpio_to_irq will always be available. While irq_to_gpio is deprecated. So it
> should work if you just pass the gpio.

so: pass gpio via platform data, and derive irq from that

> But looking at the driver it only seems to check if the IRQ is a valid GPIO,
> but never seems use the GPIO pin otherwise. Maybe I missed something, but
> I'd just remove the whole  gpio_is_valid(irq_to_gpio(spi->irq)) check.

the irq is used in lis3l02dq_ring.c (I should have pointed that out):

static int lis3l02dq_trig_try_reen(struct iio_trigger *trig)
...
		if (gpio_get_value(irq_to_gpio(st->us->irq)))

p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)

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

end of thread, other threads:[~2012-08-06  9:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06  8:39 lis3l02dq_core fails to compile Peter Meerwald
2012-08-06  8:53 ` Lars-Peter Clausen
2012-08-06  9:04   ` Peter Meerwald

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.