From 240b57428f23d189429f8dc2814482e3a84ec97f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 21 Dec 2014 13:02:12 -0600 Subject: [PATCH] TM4C129X: Increated power/clocking macros into I2C driver --- arch/arm/src/tiva/tiva_gpio.c | 2 +- arch/arm/src/tiva/tiva_i2c.c | 7 +++++-- arch/arm/src/tiva/tiva_lowputc.c | 15 ++++++++------- arch/arm/src/tiva/tiva_ssi.c | 4 ++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/arch/arm/src/tiva/tiva_gpio.c b/arch/arm/src/tiva/tiva_gpio.c index c9cabf3059..e2fae8f2a0 100644 --- a/arch/arm/src/tiva/tiva_gpio.c +++ b/arch/arm/src/tiva/tiva_gpio.c @@ -837,7 +837,7 @@ int tiva_configgpio(uint32_t cfgset) /* Enable power and clocking for this GPIO peripheral. */ - tiva_gpio_enablepwr(port); + tiva_gpio_enablepwr(port); /* State will be retained of clocking disabled */ tiva_gpio_enableclk(port); /* First, set the port to digital input. This is the safest state in which diff --git a/arch/arm/src/tiva/tiva_i2c.c b/arch/arm/src/tiva/tiva_i2c.c index b75fdc3a85..657b5349f8 100644 --- a/arch/arm/src/tiva/tiva_i2c.c +++ b/arch/arm/src/tiva/tiva_i2c.c @@ -65,6 +65,8 @@ #include "up_arch.h" +#include "tiva_enablepwr.h" +#include "tiva_enableclks.h" #include "tiva_gpio.h" #include "chip/tiva_pinmap.h" #include "chip/tiva_syscontrol.h" @@ -171,7 +173,7 @@ enum tiva_trace_e I2CEVENT_SENDBYTE, /* Send byte, param = mcnt */ I2CEVENT_SPURIOUS, /* Spurious interrupt received, param = msgc */ I2CEVENT_NEXTMSG, /* Starting next message, param = msgc */ - I2CEVENT_TIMEOUT, /* Software detectected timeout, param = RIS */ + I2CEVENT_TIMEOUT, /* Software detected timeout, param = RIS */ I2CEVENT_DONE /* All messages transferred, param = intstate */ }; @@ -1521,7 +1523,8 @@ static int tiva_i2c_initialize(struct tiva_i2c_priv_s *priv, uint32_t frequency) /* Enable clocking to the I2C peripheral */ #ifdef TIVA_SYSCON_RCGCI2C - modifyreg32(TIVA_SYSCON_RCGCI2C, 0, SYSCON_RCGCI2C(config->devno)); + tiva_i2c_enablepwr(config->devno); /* State will be retained if clocking stopped */ + tiva_i2c_enableclk(config->devno); i2cvdbg("I2C%d: RCGI2C[%08x]=%08x\n", config->devno, TIVA_SYSCON_RCGCI2C, getreg32(TIVA_SYSCON_RCGCI2C)); diff --git a/arch/arm/src/tiva/tiva_lowputc.c b/arch/arm/src/tiva/tiva_lowputc.c index b5b16986fe..740495d55a 100644 --- a/arch/arm/src/tiva/tiva_lowputc.c +++ b/arch/arm/src/tiva/tiva_lowputc.c @@ -258,7 +258,7 @@ void up_lowsetup(void) */ #ifdef CONFIG_TIVA_UART0 - tiva_uart0_enablepwr(); + tiva_uart0_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart0_enableclk(); tiva_configgpio(GPIO_UART0_RX); @@ -266,7 +266,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART1 - tiva_uart1_enablepwr(); + tiva_uart1_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart1_enableclk(); tiva_configgpio(GPIO_UART1_RX); @@ -274,7 +274,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART2 - tiva_uart2_enablepwr(); + tiva_uart2_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart2_enableclk(); tiva_configgpio(GPIO_UART2_RX); @@ -282,7 +282,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART3 - tiva_uart3_enablepwr(); + tiva_uart3_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart3_enableclk(); tiva_configgpio(GPIO_UART3_RX); @@ -290,6 +290,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART4 + tiva_uart4_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart4_enableclk(); tiva_configgpio(GPIO_UART4_RX); @@ -297,7 +298,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART5 - tiva_uart5_enablepwr(); + tiva_uart5_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart5_enableclk(); tiva_configgpio(GPIO_UART5_RX); @@ -305,7 +306,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART6 - tiva_uart6_enablepwr(); + tiva_uart6_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart6_enableclk(); tiva_configgpio(GPIO_UART6_RX); @@ -313,7 +314,7 @@ void up_lowsetup(void) #endif #ifdef CONFIG_TIVA_UART7 - tiva_uart7_enablepwr(); + tiva_uart7_enablepwr(); /* State will be retained if clocking disabled */ tiva_uart7_enableclk(); tiva_configgpio(GPIO_UART7_RX); diff --git a/arch/arm/src/tiva/tiva_ssi.c b/arch/arm/src/tiva/tiva_ssi.c index fcc1040cb9..36c89d488b 100644 --- a/arch/arm/src/tiva/tiva_ssi.c +++ b/arch/arm/src/tiva/tiva_ssi.c @@ -1477,7 +1477,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port) /* Enable power and clocking to the SSI0 peripheral */ - tiva_ssi0_enablepwr(); + tiva_ssi0_enablepwr(); /* State will be ratained if clocking disabled */ tiva_ssi0_enableclk(); /* Configure SSI0 GPIOs (NOTE that SS is not initialized here, the @@ -1499,7 +1499,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port) /* Enable power and clocking to the SSI1 peripheral */ - tiva_ssi1_enablepwr(); + tiva_ssi1_enablepwr(); /* State will be ratained if clocking disabled */ tiva_ssi1_enableclk(); /* Configure SSI1 GPIOs */