This patch ensures that the TWIHS (i2c) hw get's its clock set when the sequence of

sam_i2cbus_initialize
sam_i2cbus_uninitialize
sam_i2cbus_initialize

Or twi_reset is called.

I found this a while back in the stm32 family, so there may be more arch-es with this sort of bug. I suppose any driver that has the notion of "do not set the freq if it is already set" could be suspect.
This commit is contained in:
David Sidrane 2016-05-23 13:38:34 -06:00 committed by Gregory Nutt
parent c019c270d5
commit fca329945b
3 changed files with 3 additions and 0 deletions

View File

@ -901,6 +901,7 @@ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid,
/* Set the initial TWI data transfer frequency */
priv->i2cfreq = 0;
twi_setfrequency(priv, frequency);
}

View File

@ -1200,6 +1200,7 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency)
/* Set the initial TWI data transfer frequency */
priv->frequency = 0
twi_setfrequency(priv, frequency);
/* Enable Interrupts */

View File

@ -1230,6 +1230,7 @@ static void twi_hw_initialize(struct twi_dev_s *priv, uint32_t frequency)
/* Set the initial TWIHS data transfer frequency */
priv->frequency = 0;
twi_setfrequency(priv, frequency);
/* Enable Interrupts */