]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM i.MX53 enable i2c on EVK board
authorYong Shen <yong.shen@freescale.com>
Fri, 7 Jan 2011 04:25:33 +0000 (12:25 +0800)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 7 Jan 2011 14:20:53 +0000 (15:20 +0100)
add i2c platform data and clock

Signed-off-by: Yong Shen <yong.shen@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx5/Kconfig
arch/arm/mach-mx5/board-mx53_evk.c
arch/arm/mach-mx5/clock-mx51-mx53.c
arch/arm/mach-mx5/devices-imx53.h
arch/arm/plat-mxc/devices/platform-imx-i2c.c

index 55254b6e9460be654747f97f30526c33802e3525..632d711f1925a53b15996a698ce1933504b8a4e7 100644 (file)
@@ -124,6 +124,7 @@ config MACH_MX53_EVK
        bool "Support MX53 EVK platforms"
        select SOC_IMX53
        select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_IMX_I2C
        help
          Include support for MX53 EVK platform. This includes specific
          configurations for the board and its peripherals.
index 8a744ae09f6f0a7aa3ff747866671caad3813457..d0b4570f44eec30046b6868e80da61bda1fc23ae 100644 (file)
@@ -65,6 +65,10 @@ static inline void mx53_evk_init_uart(void)
        imx53_add_imx_uart(2, &mx53_evk_uart_pdata);
 }
 
+static const struct imxi2c_platform_data mx53_evk_i2c_data __initconst = {
+       .bitrate = 100000,
+};
+
 static inline void mx53_evk_fec_reset(void)
 {
        int ret;
@@ -92,6 +96,9 @@ static void __init mx53_evk_board_init(void)
        mx53_evk_init_uart();
        mx53_evk_fec_reset();
        imx53_add_fec(&mx53_evk_fec_pdata);
+
+       imx53_add_imx_i2c(0, &mx53_evk_i2c_data);
+       imx53_add_imx_i2c(1, &mx53_evk_i2c_data);
 }
 
 static void __init mx53_evk_timer_init(void)
index b21bc47d4827e769a22eed0df4624a5e47aa1bdd..0ade3c4cc6c545b791e0f4f2fd3cf0deb1d5ccfa 100644 (file)
@@ -1326,6 +1326,8 @@ static struct clk_lookup mx53_lookups[] = {
        _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
        _REGISTER_CLOCK("fec.0", NULL, fec_clk)
        _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
+       _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
+       _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
 };
 
 static void clk_tree_init(void)
index dbf1989b451d9a74263cb286fc80f2a55a8446c8..ca1232bcedebdd8ab16a75560cf83fe6f9b66576 100644 (file)
@@ -15,3 +15,8 @@ extern const struct imx_fec_data imx53_fec_data __initconst;
 extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst;
 #define imx53_add_imx_uart(id, pdata)  \
        imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata)
+
+
+extern const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst;
+#define imx53_add_imx_i2c(id, pdata)   \
+       imx_add_imx_i2c(&imx53_imx_i2c_data[id], pdata)
index 72ba880c75aff666dc6db76a54205a63d1481361..7ba94e1bbda30d48960931ddae2d0182e1a5d009 100644 (file)
@@ -78,6 +78,15 @@ const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
 };
 #endif /* ifdef CONFIG_SOC_IMX51 */
 
+#ifdef CONFIG_SOC_IMX53
+const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = {
+#define imx53_imx_i2c_data_entry(_id, _hwid)                           \
+       imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K)
+       imx53_imx_i2c_data_entry(0, 1),
+       imx53_imx_i2c_data_entry(1, 2),
+};
+#endif /* ifdef CONFIG_SOC_IMX51 */
+
 struct platform_device *__init imx_add_imx_i2c(
                const struct imx_imx_i2c_data *data,
                const struct imxi2c_platform_data *pdata)