Hi Andrew, On Fri, Oct 31, 2014 at 02:17:31PM -0700, Andrew Bresticker wrote: > > + /* > > + * To avoid slave event interrupts in automatic mode, use a timer to > > + * poll the abort condition if we don't get an interrupt for too long. > > + */ > > Why would polling be better than taking the interrupt? Are an > excessive number of interrupts generated during normal operation? You get a slave event and transaction done interrupt for each atomic mode command (start, data, ack, stop, etc) that gets completed, none of which are of interest when using automatic mode since those atomic mode commands are managed automatically by hardware rather than by the I2C state machine in the ISR. In practice, normal I2C transactions will be complete well before you get the timer interrupt, as the timer is "pushed back" during FIFO maintenance and disabled after the transaction is complete. In this way normal automatic mode operation isn't impacted by unnecessary interrupts, but the exceptional abort condition can still be detected (with a slight delay). > > +/* > > + * Timer function to check if something has gone wrong in automatic mode (so we > > + * don't have to handle so many interrupts just to catch an exception). > > + */ > > +static void img_i2c_check_timer(unsigned long arg) > > When are slave event interrupts generated during normal operation? > It's not clear from the TRM I have. Mainly on completion (or rather detection) of certain atomic mode commands on the bus. Look for the use of at_slave_event in the driver. This is used with the atomic mode part, and set to false while it is waiting for a slave event interrupt before it can continue with the next atomic mode command. Cheers James -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html