Skip to contentSkip to conversation

pxa: add frame buffer on pxa168 aspenite platform

PATCH New Jun Nie 1 participant 1 message Nov 10, 2009

Subsystems (3)
lore
Share & tools
lore

Jun Nie

author
#0 lore raw

PATCH 1/1 pxa: add frame buffer on pxa168 aspenite platform

---
 arch/arm/configs/pxa168_defconfig       |   86 ++++++++++++++++++++-
 arch/arm/mach-mmp/aspenite.c            |  131 +++++++++++++++++++++++++++++++
 arch/arm/mach-mmp/include/mach/pxa168.h |    8 ++
 arch/arm/mach-mmp/pxa168.c              |    3 +
 4 files changed, 226 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/arch/arm/configs/pxa168_defconfig
index db5faea..b736517 100644

arch/arm/configs/pxa168_defconfig +84 -2

110 lines not on this page · raw message

arch/arm/mach-mmp/aspenite.c +76 -0

91 lines not on this page · raw message

spi_gpio_cs, unsigned int spi_gpio_reset, int on) +{
+ int err = 0;
+ if (on) {
+ if (spi_gpio_reset != -1) {
+ err = gpio_request(spi_gpio_reset, "TPO_LCD_SPI_RESET");
+ if (err) {
+ printk("failed to request GPIO for TPO LCD RESET\n");
+ return err;
+ }
+ gpio_direction_output(spi_gpio_reset, 0);
+ msleep(100);
+ gpio_set_value(spi_gpio_reset, 1);
+ msleep(100);
+ gpio_free(spi_gpio_reset);
+ }
+ return pxa168fb_spi_send(fbi, tpo_spi_cmdon,
ARRAY_SIZE(tpo_spi_cmdon), spi_gpio_cs, 0, 1);
+ } else
+ return pxa168fb_spi_send(fbi, tpo_spi_cmdoff,
ARRAY_SIZE(tpo_spi_cmdoff), spi_gpio_cs, 0, 1); +}
+
+static struct fb_videomode video_modes_aspen[] = {
+ [0] = {

+		.pixclock       = 30120,
+		.refresh        = 60,
+		.xres           = 800,
+		.yres           = 480,
+		.hsync_len      = 1,
+		.left_margin    = 215,
+		.right_margin   = 40,
+		.vsync_len      = 1,
+		.upper_margin   = 34,
+		.lower_margin   = 10,
+		.sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,

+ },
+};
+
+struct pxa168fb_mach_info aspenite_lcd_info __initdata = {

+	.id                     = "Base-aspen",
+	.modes                  = video_modes_aspen,
+	.num_modes              = ARRAY_SIZE(video_modes_aspen),
+	.pix_fmt                = PIX_FMT_RGB565,

+ .io_pin_allocation_mode = PIN_MODE_DUMB_24,
+ .dumb_mode = DUMB_MODE_RGB888,
+ .active = 1,
+ .spi_ctrl = CFG_SCLKCNT(2) | CFG_TXBITS(16) | CFG_SPI_SEL(1) |
CFG_SPI_3W4WB(1) | CFG_SPI_ENA(1),
+ .spi_gpio_cs = GPIO_EXT1(14),
+ .spi_gpio_reset = -1,
+ .pxa168fb_lcd_power = tpo_lcd_power,
+};
+
+#endif
+
#if defined(CONFIG_MTD_NAND) || defined(CONFIG_MTD_NAND_MODULE) static struct mtd_partition apn_nand_partitions[] = {
{
@@ -184,6 +312,9 @@ static void __init common_init(void)

/* on-chip devices */
pxa168_add_uart(1);
+#ifdef CONFIG_FB_PXA168
+ pxa168_add_fb(&aspenite_lcd_info);
+#endif

apn_init_nand();
pxa168_add_twsi(0, &pwri2c_info, ARRAY_AND_SIZE(aspenite_i2c_board_info));

(quoted diff) +0 -0

b/arch/arm/mach-mmp/include/mach/pxa168.h
index d117ceb..d43fb13 100644

arch/arm/mach-mmp/include/mach/pxa168.h +8 -0
@@ -4,6 +4,7 @@
 #include <linux/i2c.h>
 #include <mach/devices.h>
 #include <plat/i2c.h>
+#include <video/pxa168fb.h>
 
 extern struct pxa_device_desc pxa168_device_uart1;
 extern struct pxa_device_desc pxa168_device_uart2;
@@ -14,6 +15,7 @@ extern struct pxa_device_desc pxa168_device_pwm2;
 extern struct pxa_device_desc pxa168_device_pwm3;
 extern struct pxa_device_desc pxa168_device_pwm4;
 extern struct pxa_device_desc pxa168_device_nand;
+extern struct pxa_device_desc pxa168_device_fb;
 
 static inline int pxa168_add_uart(int id)
 {
@@ -65,4 +67,10 @@ static inline int pxa168_add_pwm(int id)
 
 	return pxa_register_device(d, NULL, 0);
 }
+
+static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
+{
+	return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
+}
+
 #endif /* __ASM_MACH_PXA168_H */
arch/arm/mach-mmp/pxa168.c +2 -0
index 59b393e..8be1e46 100644
@@ -74,6 +74,7 @@ static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000);
 static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000);
 
 static APMU_CLK(nand, NAND, 0x1db, 208000000);
+static APMU_CLK(lcd, LCD, 0x003f, 312000000);
 
 /* device and clock bindings */
 static struct clk_lookup pxa168_clkregs[] = {
@@ -86,6 +87,7 @@ static struct clk_lookup pxa168_clkregs[] = {
 	INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL),
 	INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL),
 	INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL),
+	INIT_CLKREG(&clk_lcd, "pxa168-fb", "LCDCLK"),
 };
 
 static int __init pxa168_init(void)
@@ -132,3 +134,4 @@ PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE,

0xd401a400, 0x10);
PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10); PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10); PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x200, 97, 99);
+PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);

Signature · 1 line
1.5.4.3