On 02/23/2013 11:12 AM, Sascha Herrmann wrote:
> Add option to at86rf230 platform data to configure the type of the
> interrupt used by the driver.
>
> Signed-off-by: Sascha Herrmann <[email protected]>
> ---
> drivers/net/ieee802154/at86rf230.c | 9 ++++++++-
> include/linux/spi/at86rf230.h | 5 +++++
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ieee802154/at86rf230.c
> b/drivers/net/ieee802154/at86rf230.c
> index bb5d37d..e892ec3 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -37,7 +37,7 @@
> struct at86rf230_local {
> struct spi_device *spi;
> - int rstn, slp_tr, dig2;
> + int rstn, slp_tr, dig2, irq_type;
> u8 part;
> u8 vers;
> @@ -764,6 +764,7 @@ static int at86rf230_fill_data(struct spi_device *spi)
> lp->rstn = pdata->rstn;
> lp->slp_tr = pdata->slp_tr;
> lp->dig2 = pdata->dig2;
> + lp->irq_type = pdata->irq_type;
> return 0;
> }
> @@ -881,6 +882,12 @@ static int at86rf230_probe(struct spi_device *spi)
> if (rc)
> goto err_gpio_dir;
> + if (lp->irq_type) {
Stray space before the + in the above line. Are you using git
format-patch and git send-email?
> + rc = irq_set_irq_type(spi->irq, lp->irq_type);
> + if (rc)
> + goto err_gpio_dir;
> + }
> +
Since 0x0 is IRQ_TYPE_NONE, maybe you should print a warning here if
lp->irq_type is 0.
> rc = request_irq(spi->irq, at86rf230_isr, IRQF_SHARED,
> dev_name(&spi->dev), lp);
> if (rc)
> diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h
> index b2b1afb..5ed8934 100644
> --- a/include/linux/spi/at86rf230.h
> +++ b/include/linux/spi/at86rf230.h
> @@ -26,6 +26,11 @@ struct at86rf230_platform_data {
> int rstn;
> int slp_tr;
> int dig2;
> +
> + /* Set this if your platoform requires the driver to set the needed
> + * irq type. Most likely this will be IRQ_TYPE_EDGE_RISING.
> + */
> + int irq_type;
> };
> #endif
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Linux-zigbee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel