Release 4.7 drivers/staging/iio/meter/ade7758_trigger.c
/*
* ADE7758 Poly Phase Multifunction Energy Metering IC driver
*
* Copyright 2010-2011 Analog Devices Inc.
*
* Licensed under the GPL-2.
*/
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/export.h>
#include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include "ade7758.h"
/**
* ade7758_data_rdy_trig_poll() the event handler for the data rdy trig
**/
static irqreturn_t ade7758_data_rdy_trig_poll(int irq, void *private)
{
disable_irq_nosync(irq);
iio_trigger_poll(private);
return IRQ_HANDLED;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
barry song | barry song | 17 | 65.38% | 1 | 50.00% |
jonathan cameron | jonathan cameron | 9 | 34.62% | 1 | 50.00% |
| Total | 26 | 100.00% | 2 | 100.00% |
/**
* ade7758_data_rdy_trigger_set_state() set datardy interrupt state
**/
static int ade7758_data_rdy_trigger_set_state(struct iio_trigger *trig,
bool state)
{
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
dev_dbg(&indio_dev->dev, "%s (%d)\n", __func__, state);
return ade7758_set_irq(&indio_dev->dev, state);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
barry song | barry song | 44 | 89.80% | 1 | 25.00% |
lars-peter clausen | lars-peter clausen | 3 | 6.12% | 1 | 25.00% |
jonathan cameron | jonathan cameron | 1 | 2.04% | 1 | 25.00% |
michael hennerich | michael hennerich | 1 | 2.04% | 1 | 25.00% |
| Total | 49 | 100.00% | 4 | 100.00% |
/**
* ade7758_trig_try_reen() try renabling irq for data rdy trigger
* @trig: the datardy trigger
**/
static int ade7758_trig_try_reen(struct iio_trigger *trig)
{
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
struct ade7758_state *st = iio_priv(indio_dev);
enable_irq(st->us->irq);
/* irq reenabled so success! */
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
barry song | barry song | 29 | 65.91% | 1 | 33.33% |
michael hennerich | michael hennerich | 12 | 27.27% | 1 | 33.33% |
lars-peter clausen | lars-peter clausen | 3 | 6.82% | 1 | 33.33% |
| Total | 44 | 100.00% | 3 | 100.00% |
static const struct iio_trigger_ops ade7758_trigger_ops = {
.owner = THIS_MODULE,
.set_trigger_state = &ade7758_data_rdy_trigger_set_state,
.try_reenable = &ade7758_trig_try_reen,
};
int ade7758_probe_trigger(struct iio_dev *indio_dev)
{
struct ade7758_state *st = iio_priv(indio_dev);
int ret;
st->trig = iio_trigger_alloc("%s-dev%d",
spi_get_device_id(st->us)->name,
indio_dev->id);
if (!st->trig) {
ret = -ENOMEM;
goto error_ret;
}
ret = request_irq(st->us->irq,
ade7758_data_rdy_trig_poll,
IRQF_TRIGGER_LOW,
spi_get_device_id(st->us)->name,
st->trig);
if (ret)
goto error_free_trig;
st->trig->dev.parent = &st->us->dev;
st->trig->ops = &ade7758_trigger_ops;
iio_trigger_set_drvdata(st->trig, indio_dev);
ret = iio_trigger_register(st->trig);
/* select default trigger */
indio_dev->trig = iio_trigger_get(st->trig);
if (ret)
goto error_free_irq;
return 0;
error_free_irq:
free_irq(st->us->irq, st->trig);
error_free_trig:
iio_trigger_free(st->trig);
error_ret:
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
barry song | barry song | 91 | 47.89% | 1 | 10.00% |
jonathan cameron | jonathan cameron | 53 | 27.89% | 3 | 30.00% |
michael hennerich | michael hennerich | 36 | 18.95% | 2 | 20.00% |
lars-peter clausen | lars-peter clausen | 6 | 3.16% | 2 | 20.00% |
srinivas pandruvada | srinivas pandruvada | 3 | 1.58% | 1 | 10.00% |
cristina opriceana | cristina opriceana | 1 | 0.53% | 1 | 10.00% |
| Total | 190 | 100.00% | 10 | 100.00% |
void ade7758_remove_trigger(struct iio_dev *indio_dev)
{
struct ade7758_state *st = iio_priv(indio_dev);
iio_trigger_unregister(st->trig);
free_irq(st->us->irq, st->trig);
iio_trigger_free(st->trig);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
barry song | barry song | 27 | 57.45% | 1 | 25.00% |
jonathan cameron | jonathan cameron | 11 | 23.40% | 1 | 25.00% |
michael hennerich | michael hennerich | 8 | 17.02% | 1 | 25.00% |
lars-peter clausen | lars-peter clausen | 1 | 2.13% | 1 | 25.00% |
| Total | 47 | 100.00% | 4 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
barry song | barry song | 227 | 55.91% | 1 | 8.33% |
jonathan cameron | jonathan cameron | 101 | 24.88% | 4 | 33.33% |
michael hennerich | michael hennerich | 58 | 14.29% | 2 | 16.67% |
lars-peter clausen | lars-peter clausen | 13 | 3.20% | 2 | 16.67% |
paul gortmaker | paul gortmaker | 3 | 0.74% | 1 | 8.33% |
srinivas pandruvada | srinivas pandruvada | 3 | 0.74% | 1 | 8.33% |
cristina opriceana | cristina opriceana | 1 | 0.25% | 1 | 8.33% |
| Total | 406 | 100.00% | 12 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.