1 From 50d9e1cc2f4b30ec6073271822c70ad22a308fda Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Sun, 5 Sep 2010 20:34:08 +0200
4 Subject: [PATCH] MIPS: JZ4740: Add id800wt board
7 arch/mips/jz4740/Kconfig | 3 +
8 arch/mips/jz4740/Makefile | 1 +
9 arch/mips/jz4740/board-id800wt.c | 158 ++++++++++++++++++++++++++++++++++++++
10 3 files changed, 162 insertions(+), 0 deletions(-)
11 create mode 100644 arch/mips/jz4740/board-id800wt.c
13 --- a/arch/mips/jz4740/Kconfig
14 +++ b/arch/mips/jz4740/Kconfig
15 @@ -12,6 +12,9 @@ config JZ4740_N516
17 bool "Hanvon n526 eBook reader"
19 +config JZ4740_ID800WT
20 + bool "Sungale id800wt picture frame"
25 --- a/arch/mips/jz4740/Makefile
26 +++ b/arch/mips/jz4740/Makefile
27 @@ -14,6 +14,7 @@ obj-$(CONFIG_DEBUG_FS) += clock-debugfs.
28 obj-$(CONFIG_JZ4740_QI_LB60) += board-qi_lb60.o
29 obj-$(CONFIG_JZ4740_N516) += board-n516.o board-n516-display.o
30 obj-$(CONFIG_JZ4740_N526) += board-n526.o
31 +obj-$(CONFIG_JZ4740_ID800WT) += board-id800wt.o
36 +++ b/arch/mips/jz4740/board-id800wt.c
39 + * Copyright (C) 2010 Lars-Peter Clausen <lars@metafoo.de>
41 + * This program is free software; you can redistribute it and/or modify
42 + * it under the terms of the GNU General Public License version 2 or later
43 + * as published by the Free Software Foundation.
46 +#include <linux/kernel.h>
47 +#include <linux/init.h>
48 +#include <linux/gpio.h>
50 +#include <asm/mach-jz4740/platform.h>
52 +#include <linux/input.h>
53 +#include <linux/power_supply.h>
54 +#include <linux/pwm_backlight.h>
58 +#include <asm/mach-jz4740/jz4740_fb.h>
59 +#include <asm/mach-jz4740/jz4740_nand.h>
62 +static struct nand_ecclayout id800wt_ecclayout = {
75 +static struct mtd_partition id800wt_partitions[] = {
76 + { .name = "NAND BOOT partition",
77 + .offset = 0 * 0x100000,
78 + .size = 2 * 0x100000,
80 + { .name = "NAND KERNEL partition",
81 + .offset = 2 * 0x100000,
82 + .size = 4 * 0x100000,
84 + { .name = "NAND ROOTFS partition",
85 + .offset = 6 * 0x100000,
86 + .size = 498 * 0x100000,
90 +static struct jz_nand_platform_data id800wt_nand_pdata = {
91 + .ecc_layout = &id800wt_ecclayout,
92 + .partitions = id800wt_partitions,
93 + .num_partitions = ARRAY_SIZE(id800wt_partitions),
94 + .busy_gpio = JZ_GPIO_PORTC(30),
98 +static struct fb_videomode id800wt_video_modes[] = {
105 + .right_margin = 255,
107 + .lower_margin = 35,
110 + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
111 + .vmode = FB_VMODE_NONINTERLACED,
115 +static struct jz4740_fb_platform_data id800wt_fb_pdata = {
118 + .num_modes = ARRAY_SIZE(id800wt_video_modes),
119 + .modes = id800wt_video_modes,
121 + .lcd_type = JZ_LCD_TYPE_SPECIAL_TFT_1,
122 + .pixclk_falling_edge = 1,
123 + .special_tft_config = {
124 + .spl = JZ4740_FB_SPECIAL_TFT_CONFIG(1051, 1053),
125 + .cls = JZ4740_FB_SPECIAL_TFT_CONFIG(631, 744),
126 + .ps = JZ4740_FB_SPECIAL_TFT_CONFIG(0, 45),
127 + .rev = JZ4740_FB_SPECIAL_TFT_CONFIG(0, 0),
132 +static int id800wt_backlight_invert(struct device *dev, int brightness)
134 + return 255 - brightness;
137 +static struct platform_pwm_backlight_data id800wt_backlight_data = {
139 + .max_brightness = 255,
140 + .dft_brightness = 255,
141 + .pwm_period_ns = 8000000,
142 + .notify = id800wt_backlight_invert,
145 +static struct platform_device id800wt_backlight_device = {
146 + .name = "pwm-backlight",
149 + .platform_data = &id800wt_backlight_data,
150 + .parent = &jz4740_framebuffer_device.dev,
154 +static struct platform_device *jz_platform_devices[] __initdata = {
155 + &jz4740_usb_ohci_device,
156 + &jz4740_udc_device,
157 + &jz4740_nand_device,
158 + &jz4740_framebuffer_device,
159 + &jz4740_i2s_device,
160 + &jz4740_codec_device,
161 + &jz4740_pcm_device,
162 + &jz4740_rtc_device,
163 + &jz4740_adc_device,
164 + &id800wt_backlight_device,
167 +static int __init id800wt_init_platform_devices(void)
169 + jz4740_framebuffer_device.dev.platform_data = &id800wt_fb_pdata;
170 + jz4740_nand_device.dev.platform_data = &id800wt_nand_pdata;
172 + jz4740_serial_device_register();
174 + jz_gpio_enable_pullup(JZ_GPIO_LCD_PS);
175 + jz_gpio_enable_pullup(JZ_GPIO_LCD_REV);
177 + return platform_add_devices(jz_platform_devices,
178 + ARRAY_SIZE(jz_platform_devices));
181 +struct jz4740_clock_board_data jz4740_clock_bdata = {
182 + .ext_rate = 12000000,
186 +static int __init id800wt_board_setup(void)
188 + printk("Sungale pictureframe id800wt setup\n");
190 + if (id800wt_init_platform_devices())
191 + panic("Failed to initalize platform devices\n");
195 +arch_initcall(id800wt_board_setup);