pxa: add frame buffer on pxa910 ttc_dkb platform
Subsystems (3)
PATCH 1/1 pxa: add frame buffer on pxa910 ttc_dkb platform
--- arch/arm/configs/pxa910_defconfig | 39 ++++++++- arch/arm/mach-mmp/include/mach/pxa910.h | 8 ++ arch/arm/mach-mmp/pxa910.c | 4 + arch/arm/mach-mmp/ttc_dkb.c | 140 +++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+), 1 deletions(-)
(quoted diff) +0 -0
b/arch/arm/configs/pxa910_defconfig
index 8c7e299..b9b1a85 100644
arch/arm/configs/pxa910_defconfig +38 -1
@@ -578,7 +578,34 @@ CONFIG_SSB_POSSIBLE=y # # CONFIG_VGASTATE is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_S1D13XXX is not set +CONFIG_FB_PXA168=y +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set #
@@ -591,6 +618,16 @@ CONFIG_SSB_POSSIBLE=y # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_SOUND is not set # CONFIG_HID_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
(quoted diff) +0 -0
b/arch/arm/mach-mmp/include/mach/pxa910.h
index 6ae1ed7..7698793 100644
arch/arm/mach-mmp/include/mach/pxa910.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 pxa910_device_uart1;extern struct pxa_device_desc pxa910_device_uart2;
@@ -13,6 +14,7 @@ extern struct pxa_device_desc pxa910_device_pwm1;extern struct pxa_device_desc pxa910_device_pwm2;extern struct pxa_device_desc pxa910_device_pwm3;extern struct pxa_device_desc pxa910_device_pwm4; +extern struct pxa_device_desc pxa910_device_fb;static inline int pxa910_add_uart (int id) {
@@ -64,4 +66,10 @@ static inline int pxa910_add_pwm(int id) return pxa_register_device(d, NULL, 0); } + +static inline int pxa910_add_fb (struct pxa168fb_mach_info *mi) +{ +return pxa_register_device (&pxa910_device_fb, mi,sizeof (*mi)); +} +#endif /* __ASM_MACH_PXA910_H */
arch/arm/mach-mmp/pxa910.c +3 -0
@@ -110,6 +110,8 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); +static APMU_CLK(lcd, LCD, 0x003f, 312000000); +/* device and clock bindings */ static struct clk_lookup pxa910_clkregs[] = {INIT_CLKREG (&clk_uart1,"pxa2xx-uart.0" ,NULL ),
@@ -120,6 +122,7 @@ static struct clk_lookup pxa910_clkregs[] = {INIT_CLKREG (&clk_pwm2,"pxa910-pwm.1" ,NULL ),INIT_CLKREG (&clk_pwm3,"pxa910-pwm.2" ,NULL ),INIT_CLKREG (&clk_pwm4,"pxa910-pwm.3" ,NULL ), + INIT_CLKREG(&clk_lcd, "pxa910-fb", "LCDCLK"), };static int __init pxa910_init (void )
@@ -174,3 +177,4 @@ PXA910_DEVICE(pwm1, "pxa910-pwm", 0, NONE,
0xd401a000, 0x10);
PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10); PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
+PXA910_DEVICE(fb, "pxa910-fb", -1, LCD, 0xd420b000, 0x1c8);
arch/arm/mach-mmp/ttc_dkb.c +85 -0
100 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 -1;
+ }
+ 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, 40);
+ } else
+ return pxa168fb_spi_send(fbi, tpo_spi_cmdoff,ARRAY_SIZE(tpo_spi_cmdoff), spi_gpio_cs, 0, 0);
+}
+
+static struct fb_videomode video_modes[] = {
+ /* lpj032l001b HVGA mode info */
+ [0] = {
+ .pixclock = 100000, + .refresh = 60, + .xres = 320, + .yres = 480, + .hsync_len = 10, + .left_margin = 15, + .right_margin = 10, + .vsync_len = 2, + .upper_margin = 4, + .lower_margin = 2, + .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
+ },
};
+static struct pxa168fb_mach_info ttc_dkb_lcd_info __initdata = {
+ .id = "Base", + .modes = video_modes, + .num_modes = ARRAY_SIZE(video_modes), + .pix_fmt = PIX_FMT_RGB565, + .io_pin_allocation_mode = PIN_MODE_DUMB_18_SPI, + .dumb_mode = DUMB_MODE_RGB666, + .active = 1, + .spi_ctrl = CFG_SCLKCNT(16) | CFG_TXBITS(16) |
CFG_SPI_SEL(1) | CFG_SPI_3W4WB(1) | CFG_SPI_ENA(1),
+ .spi_gpio_cs = -1,
+ .spi_gpio_reset = mfp_to_gpio(MFP_PIN_GPIO106),
+ .invert_pixclock = 1,
+ .pxa168fb_lcd_power = tpo_lcd_power,
+};
+#endif
+
#if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) static struct mtd_partition ttc_dkb_onenand_partitions[] = {
{
@@ -123,6 +260,9 @@ static void __init ttc_dkb_init(void)
/* on-chip devices */
pxa910_add_uart(1);
+#ifdef CONFIG_FB_PXA168
+ pxa910_add_fb(&ttc_dkb_lcd_info);
+#endif
/* off-chip devices */
ttc_dkb_init_onenand();
Signature · 1 line
1.5.4.3