14 #include <linux/device.h>
22 #include <linux/i2c.h>
27 #include <linux/videodev2.h>
35 #include <asm/clock.h>
36 #include <asm/suspend.h>
52 static struct resource smsc9118_resources[] = {
68 .num_resources =
ARRAY_SIZE(smsc9118_resources),
69 .resource = smsc9118_resources,
71 .platform_data = &smsc911x_config,
79 static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
83 .size = (1 * 1024 * 1024),
88 .size = (2 * 1024 * 1024),
92 .size = ((7 * 1024 * 1024) + (512 * 1024)),
97 .size = (1024 * 128 * 2),
107 .parts = ap325rxa_nor_flash_partitions,
108 .nr_parts =
ARRAY_SIZE(ap325rxa_nor_flash_partitions),
111 static struct resource ap325rxa_nor_flash_resources[] = {
121 .name =
"physmap-flash",
122 .resource = ap325rxa_nor_flash_resources,
123 .num_resources =
ARRAY_SIZE(ap325rxa_nor_flash_resources),
125 .platform_data = &ap325rxa_nor_flash_data,
137 static struct resource nand_flash_resources[] = {
146 .parts = nand_partition_info,
154 .resource = nand_flash_resources,
155 .num_resources =
ARRAY_SIZE(nand_flash_resources),
157 .platform_data = &nand_flash_data,
161 #define FPGA_LCDREG 0xB4100180
162 #define FPGA_BKLREG 0xB4100212
163 #define FPGA_LCDREG_VAL 0x0018
164 #define PORT_MSELCRB 0xA4050182
165 #define PORT_HIZCRC 0xA405015C
166 #define PORT_DRVCRA 0xA405018A
167 #define PORT_DRVCRB 0xA405018C
169 static int ap320_wvga_set_brightness(
int brightness)
182 static int ap320_wvga_get_brightness(
void)
187 static void ap320_wvga_power_on(
void)
195 static void ap320_wvga_power_off(
void)
201 static const struct fb_videomode ap325rxa_lcdc_modes[] = {
221 .interface_type =
RGB18,
223 .lcd_modes = ap325rxa_lcdc_modes,
228 .display_on = ap320_wvga_power_on,
229 .display_off = ap320_wvga_power_off,
232 .name =
"sh_mobile_lcdc_bl",
234 .set_brightness = ap320_wvga_set_brightness,
235 .get_brightness = ap320_wvga_get_brightness,
240 static struct resource lcdc_resources[] = {
254 .name =
"sh_mobile_lcdc_fb",
256 .resource = lcdc_resources,
258 .platform_data = &lcdc_info,
262 static void camera_power(
int val)
270 static unsigned char camera_ncm03j_magic[] =
272 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
273 0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36,
274 0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F,
275 0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55,
276 0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12,
277 0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0,
278 0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F,
279 0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A,
280 0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A,
281 0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A,
282 0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56,
283 0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37,
284 0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A,
285 0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56,
286 0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC,
287 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
290 static int camera_probe(
void)
301 msg.buf = camera_ncm03j_magic;
323 for (i = 0; i <
ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
331 buf[0] = camera_ncm03j_magic[
i];
332 buf[1] = camera_ncm03j_magic[i + 1];
357 .set_capture = camera_set_capture,
362 .add_device = ap325rxa_camera_add,
363 .del_device = ap325rxa_camera_del,
364 .module_name =
"soc_camera_platform",
365 .priv = &camera_info,
370 static void ap325rxa_camera_release(
struct device *
dev)
372 soc_camera_platform_release(&camera_device);
377 int ret = soc_camera_platform_add(icd, &camera_device, &camera_link,
378 ap325rxa_camera_release, 0);
382 ret = camera_probe();
384 soc_camera_platform_del(icd, camera_device, &camera_link);
391 soc_camera_platform_del(icd, camera_device, &camera_link);
408 static struct resource ceu_resources[] = {
425 .name =
"sh_mobile_ceu",
428 .resource = ceu_resources,
430 .platform_data = &sh_mobile_ceu_info,
443 static struct resource sdhi0_cn3_resources[] = {
461 .name =
"sh_mobile_sdhi",
463 .num_resources =
ARRAY_SIZE(sdhi0_cn3_resources),
464 .resource = sdhi0_cn3_resources,
466 .platform_data = &sdhi0_cn3_data,
470 static struct resource sdhi1_cn7_resources[] = {
488 .name =
"sh_mobile_sdhi",
490 .num_resources =
ARRAY_SIZE(sdhi1_cn7_resources),
491 .resource = sdhi1_cn7_resources,
493 .platform_data = &sdhi1_cn7_data,
516 .power = ov7725_power,
517 .board_info = &ap325rxa_i2c_camera[0],
519 .priv = &ov7725_info,
524 .name =
"soc-camera-pdrv",
527 .platform_data = &ov7725_link,
530 .name =
"soc-camera-pdrv",
533 .platform_data = &camera_link,
540 &ap325rxa_nor_flash_device,
555 static int __init ap325rxa_devices_setup(
void)
559 &ap325rxa_sdram_enter_start,
560 &ap325rxa_sdram_enter_end,
561 &ap325rxa_sdram_leave_start,
562 &ap325rxa_sdram_leave_end);
565 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
688 static int ap325rxa_mode_pins(
void)
699 .mv_name =
"AP-325RXA",
700 .mv_mode_pins = ap325rxa_mode_pins,