/* *IftheIRQistriggeredonfallingedge,weneedtomarkthe *interruptasactivelow,ifthehardwaresupportsthis.
*/
irq_trig = irq_get_trigger_type(sdata->irq); switch(irq_trig) { case IRQF_TRIGGER_FALLING: case IRQF_TRIGGER_LOW: if (!sdata->sensor_settings->drdy_irq.addr_ihl) {
dev_err(parent, "falling/low specified for IRQ but hardware supports only rising/high: will request rising/high\n"); if (irq_trig == IRQF_TRIGGER_FALLING)
irq_trig = IRQF_TRIGGER_RISING; if (irq_trig == IRQF_TRIGGER_LOW)
irq_trig = IRQF_TRIGGER_HIGH;
} else { /* Set up INT active low i.e. falling edge */
err = st_sensors_write_data_with_mask(indio_dev,
sdata->sensor_settings->drdy_irq.addr_ihl,
sdata->sensor_settings->drdy_irq.mask_ihl, 1); if (err < 0) return err;
dev_info(parent, "interrupts on the falling edge or active low level\n");
} break; case IRQF_TRIGGER_RISING:
dev_info(parent, "interrupts on the rising edge\n"); break; case IRQF_TRIGGER_HIGH:
dev_info(parent, "interrupts active high level\n"); break; default: /* This is the most preferred mode, if possible */
dev_err(parent, "unsupported IRQ trigger specified (%lx), enforce rising edge\n", irq_trig);
irq_trig = IRQF_TRIGGER_RISING;
}
/* Tell the interrupt handler that we're dealing with edges */ if (irq_trig == IRQF_TRIGGER_FALLING ||
irq_trig == IRQF_TRIGGER_RISING) { if (!sdata->sensor_settings->drdy_irq.stat_drdy.addr) {
dev_err(parent, "edge IRQ not supported w/o stat register.\n"); return -EOPNOTSUPP;
}
sdata->edge_irq = true;
} else { /* *Ifwe'renotusingedges(i.e.levelinterrupts)we *justmaskofftheIRQ,handleoneinterrupt,then *ifthelineisstilllow,wereturntothe *interrupthandlertophalfagainandstartover.
*/
irq_trig |= IRQF_ONESHOT;
}
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.