Tiva I2C: Legacy mode reset logic ommitted in last commit

This commit is contained in:
Gregory Nutt 2014-12-12 09:31:17 -06:00
parent 19ef820925
commit 54c8d5c6e4

View File

@ -194,7 +194,7 @@ struct tiva_i2c_config_s
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
uint32_t rcgbit; /* Bit in the RCG1 register to enable clocking */ uint32_t rcgbit; /* Bit in the RCG1 register to enable clocking */
#endif #endif
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_SRI2C
uint32_t rstbit; /* Bit in the SRCR1 register to reset I2C */ uint32_t rstbit; /* Bit in the SRCR1 register to reset I2C */
#endif #endif
uint32_t scl_pin; /* GPIO configuration for SCL as SCL */ uint32_t scl_pin; /* GPIO configuration for SCL as SCL */
@ -354,6 +354,9 @@ static const struct tiva_i2c_config_s tiva_i2c0_config =
.base = TIVA_I2C0_BASE, .base = TIVA_I2C0_BASE,
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
.rcgbit = SYSCON_RCGC1_I2C0, .rcgbit = SYSCON_RCGC1_I2C0,
#endif
#ifndef TIVA_SYSCON_SRI2C
.rstbit = SYSCON_SRCR1_I2C0,
#endif #endif
.scl_pin = GPIO_I2C0_SCL, .scl_pin = GPIO_I2C0_SCL,
.sda_pin = GPIO_I2C0_SDA, .sda_pin = GPIO_I2C0_SDA,
@ -373,6 +376,9 @@ static const struct tiva_i2c_config_s tiva_i2c1_config =
.base = TIVA_I2C1_BASE, .base = TIVA_I2C1_BASE,
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
.rcgbit = SYSCON_RCGC1_I2C1, .rcgbit = SYSCON_RCGC1_I2C1,
#endif
#ifndef TIVA_SYSCON_SRI2C
.rstbit = SYSCON_SRCR1_I2C1,
#endif #endif
.scl_pin = GPIO_I2C1_SCL, .scl_pin = GPIO_I2C1_SCL,
.sda_pin = GPIO_I2C1_SDA, .sda_pin = GPIO_I2C1_SDA,
@ -392,6 +398,9 @@ static const struct tiva_i2c_config_s tiva_i2c2_config =
.base = TIVA_I2C2_BASE, .base = TIVA_I2C2_BASE,
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
.rcgbit = SYSCON_RCGC1_I2C2, .rcgbit = SYSCON_RCGC1_I2C2,
#endif
#ifndef TIVA_SYSCON_SRI2C
.rstbit = SYSCON_SRCR1_I2C2,
#endif #endif
.scl_pin = GPIO_I2C2_SCL, .scl_pin = GPIO_I2C2_SCL,
.sda_pin = GPIO_I2C2_SDA, .sda_pin = GPIO_I2C2_SDA,
@ -411,6 +420,9 @@ static const struct tiva_i2c_config_s tiva_i2c3_config =
.base = TIVA_I2C3_BASE, .base = TIVA_I2C3_BASE,
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
.rcgbit = SYSCON_RCGC1_I2C3, .rcgbit = SYSCON_RCGC1_I2C3,
#endif
#ifndef TIVA_SYSCON_SRI2C
.rstbit = SYSCON_SRCR1_I2C3,
#endif #endif
.scl_pin = GPIO_I2C3_SCL, .scl_pin = GPIO_I2C3_SCL,
.sda_pin = GPIO_I2C3_SDA, .sda_pin = GPIO_I2C3_SDA,
@ -430,6 +442,9 @@ static const struct tiva_i2c_config_s tiva_i2c4_config =
.base = TIVA_I2C4_BASE, .base = TIVA_I2C4_BASE,
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
.rcgbit = SYSCON_RCGC1_I2C4, .rcgbit = SYSCON_RCGC1_I2C4,
#endif
#ifndef TIVA_SYSCON_SRI2C
.rstbit = SYSCON_SRCR1_I2C4,
#endif #endif
.scl_pin = GPIO_I2C4_SCL, .scl_pin = GPIO_I2C4_SCL,
.sda_pin = GPIO_I2C4_SDA, .sda_pin = GPIO_I2C4_SDA,
@ -449,6 +464,9 @@ static const struct tiva_i2c_config_s tiva_i2c5_config =
.base = TIVA_I2C5_BASE, .base = TIVA_I2C5_BASE,
#ifndef TIVA_SYSCON_RCGCI2C #ifndef TIVA_SYSCON_RCGCI2C
.rcgbit = SYSCON_RCGC1_I2C5, .rcgbit = SYSCON_RCGC1_I2C5,
#endif
#ifndef TIVA_SYSCON_SRI2C
.rstbit = SYSCON_SRCR1_I2C5,
#endif #endif
.scl_pin = GPIO_I2C5_SCL, .scl_pin = GPIO_I2C5_SCL,
.sda_pin = GPIO_I2C5_SDA, .sda_pin = GPIO_I2C5_SDA,
@ -1483,7 +1501,7 @@ static int tiva_i2c_initialize(struct tiva_i2c_priv_s *priv, uint32_t frequency)
modifyreg32(TIVA_SYSCON_SRI2C, SYSCON_SRI2C(config->devno), 0); modifyreg32(TIVA_SYSCON_SRI2C, SYSCON_SRI2C(config->devno), 0);
#else #else
modifyreg32(TIVA_SYSCON_SRCR1, 0, priv->rstbit); modifyreg32(TIVA_SYSCON_SRCR1, 0, priv->rstbit);
modifyreg32(TIVA_SYSCON_SRCR1, 0, priv->rstbit); modifyreg32(TIVA_SYSCON_SRCR1, priv->rstbit, 0);
#endif #endif
/* Configure pins */ /* Configure pins */