/* We cannot mask the interrupt so ensure it's not enabled at request */ if (adis->data->unmasked_drdy)
adis->irq_flag |= IRQF_NO_AUTOEN; /* * Typically adis devices without FIFO have data ready either on the * rising edge or on the falling edge of the data ready pin. * IMU devices with FIFO support have the watermark pin level driven * either high or low when the FIFO is filled with the desired number * of samples. * It defaults to IRQF_TRIGGER_RISING for backward compatibility with * devices that don't support changing the pin polarity.
*/ if (direction == IRQF_TRIGGER_NONE) {
adis->irq_flag |= IRQF_TRIGGER_RISING; return 0;
} elseif (direction != IRQF_TRIGGER_RISING &&
direction != IRQF_TRIGGER_FALLING && !adis->data->has_fifo) {
dev_err(&adis->spi->dev, "Invalid IRQ mask: %08lx\n",
adis->irq_flag); return -EINVAL;
} elseif (direction != IRQF_TRIGGER_HIGH &&
direction != IRQF_TRIGGER_LOW && adis->data->has_fifo) {
dev_err(&adis->spi->dev, "Invalid IRQ mask: %08lx\n",
adis->irq_flag); return -EINVAL;
}
return 0;
}
/** * devm_adis_probe_trigger() - Sets up trigger for a managed adis device * @adis: The adis device * @indio_dev: The IIO device * * Returns 0 on success or a negative error code
*/ int devm_adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
{ int ret;
adis->trig = devm_iio_trigger_alloc(&adis->spi->dev, "%s-dev%d",
indio_dev->name,
iio_device_id(indio_dev)); if (!adis->trig) return -ENOMEM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.