ARM i.MX23/28: Add framebuffer device support
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 14 Jan 2011 14:32:49 +0000 (15:32 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Mon, 7 Mar 2011 18:29:31 +0000 (19:29 +0100)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
arch/arm/mach-mxs/clock-mx23.c
arch/arm/mach-mxs/clock-mx28.c
arch/arm/mach-mxs/devices-mx23.h
arch/arm/mach-mxs/devices-mx28.h
arch/arm/mach-mxs/devices/Kconfig
arch/arm/mach-mxs/devices/Makefile
arch/arm/mach-mxs/devices/platform-mxsfb.c [new file with mode: 0644]

index 38ee1b17a27d0ae56da717078facbd054489750b..2415b33d79c032fde3467c6953c230af60a29245 100644 (file)
@@ -452,6 +452,7 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk)
        _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk)
        _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk)
+       _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk)
 };
 
 static int clk_misc_init(void)
index 40726c70328f4784c19d6cc05ea2f0423a19aa4f..82770568845eb9bd00f3d2656bb2054840837e38 100644 (file)
@@ -632,6 +632,7 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK("mxs-pwm.7", NULL, pwm_clk)
        _REGISTER_CLOCK(NULL, "lradc", lradc_clk)
        _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
+       _REGISTER_CLOCK("imx28-fb", NULL, lcdif_clk)
 };
 
 static int clk_misc_init(void)
index 7fb27b12bea9ff2968fde9a8c2152caec6747a6a..c7e14f4e3669379e201f3ed6492264e3591cf8ec 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <mach/mx23.h>
 #include <mach/devices-common.h>
+#include <mach/mxsfb.h>
 
 extern const struct amba_device mx23_duart_device __initconst;
 #define mx23_add_duart() \
@@ -21,3 +22,6 @@ extern const struct mxs_auart_data mx23_auart_data[] __initconst;
 #define mx23_add_auart1()              mx23_add_auart(1)
 
 #define mx23_add_mxs_pwm(id)           mxs_add_mxs_pwm(MX23_PWM_BASE_ADDR, id)
+
+struct platform_device *__init mx23_add_mxsfb(
+               const struct mxsfb_platform_data *pdata);
index a9eecdc7e22796ad95dc2f91403fe35bb18af95c..9d08555c4cf06583751fd221e4f4825f84d5f866 100644 (file)
@@ -10,6 +10,7 @@
  */
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
+#include <mach/mxsfb.h>
 
 extern const struct amba_device mx28_duart_device __initconst;
 #define mx28_add_duart() \
@@ -37,3 +38,6 @@ extern const struct mxs_i2c_data mx28_mxs_i2c_data[] __initconst;
 #define mx28_add_mxs_i2c(id)           mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id])
 
 #define mx28_add_mxs_pwm(id)           mxs_add_mxs_pwm(MX28_PWM_BASE_ADDR, id)
+
+struct platform_device *__init mx28_add_mxsfb(
+               const struct mxsfb_platform_data *pdata);
index a878915063edc9d0fa722ca20a93e9e2b0f0e938..1451ad060d826bcad5f0304e208ca2734cf75e44 100644 (file)
@@ -17,3 +17,6 @@ config MXS_HAVE_PLATFORM_MXS_I2C
 
 config MXS_HAVE_PLATFORM_MXS_PWM
        bool
+
+config MXS_HAVE_PLATFORM_MXSFB
+       bool
index 345b8399b80ec831161ea98a7671c280385c8a53..39bd77348a42e8de6be720eaa4ff46b4c05afcb4 100644 (file)
@@ -4,3 +4,4 @@ obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o
+obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
diff --git a/arch/arm/mach-mxs/devices/platform-mxsfb.c b/arch/arm/mach-mxs/devices/platform-mxsfb.c
new file mode 100644 (file)
index 0000000..bf72c9b
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <asm/sizes.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+#include <mach/mxsfb.h>
+
+#ifdef CONFIG_SOC_IMX23
+struct platform_device *__init mx23_add_mxsfb(
+               const struct mxsfb_platform_data *pdata)
+{
+       struct resource res[] = {
+               {
+                       .start = MX23_LCDIF_BASE_ADDR,
+                       .end = MX23_LCDIF_BASE_ADDR + SZ_8K - 1,
+                       .flags = IORESOURCE_MEM,
+               },
+       };
+
+       return mxs_add_platform_device_dmamask("imx23-fb", -1,
+                       res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
+}
+#endif /* ifdef CONFIG_SOC_IMX23 */
+
+#ifdef CONFIG_SOC_IMX28
+struct platform_device *__init mx28_add_mxsfb(
+               const struct mxsfb_platform_data *pdata)
+{
+       struct resource res[] = {
+               {
+                       .start = MX28_LCDIF_BASE_ADDR,
+                       .end = MX28_LCDIF_BASE_ADDR + SZ_8K - 1,
+                       .flags = IORESOURCE_MEM,
+               },
+       };
+
+       return mxs_add_platform_device_dmamask("imx28-fb", -1,
+                       res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
+}
+#endif /* ifdef CONFIG_SOC_IMX28 */