summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/i2c-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 13:35:15 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-19 16:10:52 +0200
commit70253f80bc90a03b5fff535b35e51640f592f975 (patch)
treecb9ffc4c62766dc8552cb3f0fb210940851af6c5 /firmware/target/arm/imx233/i2c-imx233.c
parent07138ba2ba08ce586486baab081aa455eb021fea (diff)
downloadrockbox-70253f80bc90a03b5fff535b35e51640f592f975.tar.gz
rockbox-70253f80bc90a03b5fff535b35e51640f592f975.tar.bz2
rockbox-70253f80bc90a03b5fff535b35e51640f592f975.zip
imx233: fix i2c to be more correct
Change-Id: Ib707a0b87d01f24eeccc39c6cbc1c015456fd503
Diffstat (limited to 'firmware/target/arm/imx233/i2c-imx233.c')
-rw-r--r--firmware/target/arm/imx233/i2c-imx233.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/target/arm/imx233/i2c-imx233.c b/firmware/target/arm/imx233/i2c-imx233.c
index c58494154f..fd9801ec1d 100644
--- a/firmware/target/arm/imx233/i2c-imx233.c
+++ b/firmware/target/arm/imx233/i2c-imx233.c
@@ -55,7 +55,8 @@ void INT_I2C_DMA(void)
void imx233_i2c_init(void)
{
- imx233_reset_block(&HW_I2C_CTRL0);
+ //imx233_reset_block(&HW_I2C_CTRL0);
+ __REG_SET(HW_I2C_CTRL0) = __BLOCK_SFTRST;
/* setup pins (must be done when shutdown) */
imx233_pinctrl_acquire_pin(0, 30, "i2c");
imx233_pinctrl_acquire_pin(0, 31, "i2c");
@@ -124,12 +125,12 @@ enum imx233_i2c_error_t imx233_i2c_end(unsigned timeout)
i2c_stage[i2c_nr_stages - 1].dma.cmd |= HW_APB_CHx_CMD__SEMAPHORE | HW_APB_CHx_CMD__IRQONCMPLT;
__REG_CLR(HW_I2C_CTRL1) = HW_I2C_CTRL1__ALL_IRQ;
+ imx233_dma_reset_channel(APB_I2C);
imx233_icoll_enable_interrupt(INT_SRC_I2C_DMA, true);
imx233_dma_enable_channel_interrupt(APB_I2C, true);
- imx233_dma_reset_channel(APB_I2C);
imx233_dma_start_command(APB_I2C, &i2c_stage[0].dma);
- enum imx233_i2c_error_t ret ;
+ enum imx233_i2c_error_t ret;
if(semaphore_wait(&i2c_sema, timeout) == OBJ_WAIT_TIMEDOUT)
{
imx233_dma_reset_channel(APB_I2C);