imx: Use MXC_I2C_CLK in imx i2c driver
authorMatthias Weisser <weisserm@arcor.de>
Mon, 24 Sep 2012 02:46:53 +0000 (02:46 +0000)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 18:54:10 +0000 (11:54 -0700)
i2c didn't work on imx25 due to missing MXC_IPG_PERCLK. Now using
MXC_I2C_CLK on all imx systems using i2c.

Signed-off-by: Matthias Weisser <weisserm@arcor.de>
Acked-by: Stefano Babic <sbabic@denx.de>
arch/arm/cpu/arm1136/mx31/generic.c
arch/arm/cpu/arm1136/mx35/generic.c
arch/arm/cpu/armv7/mx5/clock.c
arch/arm/cpu/armv7/mx6/clock.c
arch/arm/include/asm/arch-mx31/clock.h
arch/arm/include/asm/arch-mx35/clock.h
arch/arm/include/asm/arch-mx5/clock.h
arch/arm/include/asm/arch-mx6/clock.h
drivers/i2c/mxc_i2c.c

index 93f429cc52eccd31f362f8e26ec42bc76791f569..b9f9b43fa664adae1ee4982e7cc3230c05739ef8 100644 (file)
@@ -104,6 +104,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
        case MXC_CSPI_CLK:
        case MXC_UART_CLK:
        case MXC_ESDHC_CLK:
+       case MXC_I2C_CLK:
                return mx31_get_ipg_clk();
        case MXC_IPU_CLK:
                return mx31_get_hsp_clk();
index ef65176eed2c55c6c479cf7be9f07de61fddf6ca..7dc1a8ec58482fe03d46935d67593d83d06e8310 100644 (file)
@@ -357,6 +357,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
        case MXC_IPG_CLK:
                return get_ipg_clk();
        case MXC_IPG_PERCLK:
+       case MXC_I2C_CLK:
                return get_ipg_per_clk();
        case MXC_UART_CLK:
                return imx_get_uartclk();
index c67c3cfc483e28d40cf9f2bc02d871e21983bfeb..8fa737a2d83cc9c195ae66424a791d3719b1f60b 100644 (file)
@@ -482,6 +482,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
        case MXC_IPG_CLK:
                return get_ipg_clk();
        case MXC_IPG_PERCLK:
+       case MXC_I2C_CLK:
                return get_ipg_per_clk();
        case MXC_UART_CLK:
                return get_uart_clk();
index ed2c913f05f39f74f0b646dbbfa3aac126e85243..76486e7cf0893faf807f459924df7c9229efaf50 100644 (file)
@@ -357,6 +357,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
        case MXC_IPG_CLK:
                return get_ipg_clk();
        case MXC_IPG_PERCLK:
+       case MXC_I2C_CLK:
                return get_ipg_per_clk();
        case MXC_UART_CLK:
                return get_uart_clk();
index 9468b45feb0322c5cc8080930e8bcd3be2546bd4..1dbb8dabe97f29eb67f92dbca255c6c449b89970 100644 (file)
@@ -46,6 +46,7 @@ enum mxc_clock {
        MXC_UART_CLK,
        MXC_IPU_CLK,
        MXC_ESDHC_CLK,
+       MXC_I2C_CLK,
 };
 
 unsigned int mxc_get_clock(enum mxc_clock clk);
index eb7458a338dd42add1b661400b46ef6bc0f72acc..2eff08d1d49a681aed726f7a15e0987f39a7d78f 100644 (file)
@@ -48,6 +48,7 @@ enum mxc_clock {
        MXC_USB_CLK,
        MXC_CSPI_CLK,
        MXC_FEC_CLK,
+       MXC_I2C_CLK,
 };
 
 enum mxc_main_clock {
index 8d8fa18fc5fe9d0642e218ca8a2ca2075be884fd..21febd87a09e115c717237afde42d4ff18062748 100644 (file)
@@ -36,6 +36,7 @@ enum mxc_clock {
        MXC_DDR_CLK,
        MXC_NFC_CLK,
        MXC_PERIPH_CLK,
+       MXC_I2C_CLK,
 };
 
 u32 imx_get_uartclk(void);
index c55c18d51ba9eba01b66d0c7e599c3ca14626cad..2af04f0d3e20ccc5ed320ab0aae957238c142657 100644 (file)
@@ -41,6 +41,7 @@ enum mxc_clock {
        MXC_ESDHC4_CLK,
        MXC_SATA_CLK,
        MXC_NFC_CLK,
+       MXC_I2C_CLK,
 };
 
 u32 imx_get_uartclk(void);
index 73d895870196fbdec90cb2f756659a6342d469d4..18270b9de64f065dd583dadd8bf8b44acaafaeaa 100644 (file)
@@ -98,7 +98,7 @@ static uint8_t i2c_imx_get_clk(unsigned int rate)
 #endif
 
        /* Divider value calculation */
-       i2c_clk_rate = mxc_get_clock(MXC_IPG_PERCLK);
+       i2c_clk_rate = mxc_get_clock(MXC_I2C_CLK);
        div = (i2c_clk_rate + rate - 1) / rate;
        if (div < i2c_clk_div[0][0])
                clk_div = 0;
@@ -142,7 +142,7 @@ unsigned int bus_i2c_get_bus_speed(void *base)
        for (clk_div = 0; i2c_clk_div[clk_div][1] != clk_idx; clk_div++)
                ;
 
-       return mxc_get_clock(MXC_IPG_PERCLK) / i2c_clk_div[clk_div][0];
+       return mxc_get_clock(MXC_I2C_CLK) / i2c_clk_div[clk_div][0];
 }
 
 #define ST_BUS_IDLE (0 | (I2SR_IBB << 8))