Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319300
b: refs/heads/master
c: f5e8779
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jun 21, 2012
1 parent 40fd2bb commit 6f2180b
Show file tree
Hide file tree
Showing 9 changed files with 414 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 080e0d1384a3fce16b7d5324dbfc47c136cc3573
refs/heads/master: f5e8779a5e3e40cf1bf97dfe00ae24d681b66396
20 changes: 11 additions & 9 deletions trunk/arch/arm/configs/armadillo800eva_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SLAB=y
CONFIG_MODULES=y
Expand Down Expand Up @@ -89,26 +86,32 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
CONFIG_I2C=y
CONFIG_I2C_SH_MOBILE=y
# CONFIG_HWMON is not set
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_DEV=y
# CONFIG_RC_CORE is not set
# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
# CONFIG_V4L_USB_DRIVERS is not set
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_SOC_CAMERA=y
CONFIG_SOC_CAMERA_MT9T112=y
CONFIG_VIDEO_SH_MOBILE_CEU=y
# CONFIG_RADIO_ADAPTERS is not set
CONFIG_FB=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_SH_MOBILE_LCDC=y
CONFIG_FB_SH_MOBILE_HDMI=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=y
CONFIG_SND=y
# CONFIG_SND_SUPPORT_OLD_API is not set
# CONFIG_SND_VERBOSE_PROCFS is not set
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_ARM is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_SH4_FSI=y
# CONFIG_HID_SUPPORT is not set
CONFIG_USB=y
# CONFIG_USB_DEVICE_CLASS is not set
CONFIG_USB_RENESAS_USBHS=y
CONFIG_USB_GADGET=y
CONFIG_USB_RENESAS_USBHS_UDC=y
Expand All @@ -124,7 +127,6 @@ CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_NFS_V4_1=y
Expand Down
212 changes: 211 additions & 1 deletion trunk/arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@
#include <linux/mmc/sh_mobile_sdhi.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/r8a7740.h>
#include <media/mt9t112.h>
#include <media/sh_mobile_ceu.h>
#include <media/soc_camera.h>
#include <asm/page.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/hardware/cache-l2x0.h>
#include <mach/r8a7740.h>
#include <video/sh_mobile_lcdc.h>
#include <video/sh_mobile_hdmi.h>

/*
* CON1 Camera Module
Expand Down Expand Up @@ -384,6 +388,103 @@ static struct platform_device lcdc0_device = {
},
};

/*
* LCDC1/HDMI
*/
static struct sh_mobile_hdmi_info hdmi_info = {
.flags = HDMI_OUTPUT_PUSH_PULL |
HDMI_OUTPUT_POLARITY_HI |
HDMI_32BIT_REG |
HDMI_HAS_HTOP1 |
HDMI_SND_SRC_SPDIF,
};

static struct resource hdmi_resources[] = {
[0] = {
.name = "HDMI",
.start = 0xe6be0000,
.end = 0xe6be03ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0x1700),
.flags = IORESOURCE_IRQ,
},
[2] = {
.name = "HDMI emma3pf",
.start = 0xe6be4000,
.end = 0xe6be43ff,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device hdmi_device = {
.name = "sh-mobile-hdmi",
.num_resources = ARRAY_SIZE(hdmi_resources),
.resource = hdmi_resources,
.id = -1,
.dev = {
.platform_data = &hdmi_info,
},
};

static const struct fb_videomode lcdc1_mode = {
.name = "HDMI 720p",
.xres = 1280,
.yres = 720,
.pixclock = 13468,
.left_margin = 220,
.right_margin = 110,
.hsync_len = 40,
.upper_margin = 20,
.lower_margin = 5,
.vsync_len = 5,
.refresh = 60,
.sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
};

static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
.clock_source = LCDC_CLK_PERIPHERAL, /* HDMI clock */
.ch[0] = {
.chan = LCDC_CHAN_MAINLCD,
.fourcc = V4L2_PIX_FMT_RGB565,
.interface_type = RGB24,
.clock_divider = 1,
.flags = LCDC_FLAGS_DWPOL,
.lcd_modes = &lcdc1_mode,
.num_modes = 1,
.tx_dev = &hdmi_device,
.panel_cfg = {
.width = 1280,
.height = 720,
},
},
};

static struct resource hdmi_lcdc_resources[] = {
[0] = {
.name = "LCDC1",
.start = 0xfe944000,
.end = 0xfe948000 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = intcs_evt2irq(0x1780),
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device hdmi_lcdc_device = {
.name = "sh_mobile_lcdc_fb",
.num_resources = ARRAY_SIZE(hdmi_lcdc_resources),
.resource = hdmi_lcdc_resources,
.id = 1,
.dev = {
.platform_data = &hdmi_lcdc_info,
.coherent_dma_mask = ~0,
},
};

/* GPIO KEY */
#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }

Expand Down Expand Up @@ -532,6 +633,87 @@ static struct platform_device sh_mmcif_device = {
.resource = sh_mmcif_resources,
};

/* Camera */
static int mt9t111_power(struct device *dev, int mode)
{
struct clk *mclk = clk_get(NULL, "video1");

if (IS_ERR(mclk)) {
dev_err(dev, "can't get video1 clock\n");
return -EINVAL;
}

if (mode) {
/* video1 (= CON1 camera) expect 24MHz */
clk_set_rate(mclk, clk_round_rate(mclk, 24000000));
clk_enable(mclk);
gpio_direction_output(GPIO_PORT158, 1);
} else {
gpio_direction_output(GPIO_PORT158, 0);
clk_disable(mclk);
}

clk_put(mclk);

return 0;
}

static struct i2c_board_info i2c_camera_mt9t111 = {
I2C_BOARD_INFO("mt9t112", 0x3d),
};

static struct mt9t112_camera_info mt9t111_info = {
.divider = { 16, 0, 0, 7, 0, 10, 14, 7, 7 },
};

static struct soc_camera_link mt9t111_link = {
.i2c_adapter_id = 0,
.bus_id = 0,
.board_info = &i2c_camera_mt9t111,
.power = mt9t111_power,
.priv = &mt9t111_info,
};

static struct platform_device camera_device = {
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &mt9t111_link,
},
};

/* CEU0 */
static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
.flags = SH_CEU_FLAG_LOWER_8BIT,
};

static struct resource ceu0_resources[] = {
[0] = {
.name = "CEU",
.start = 0xfe910000,
.end = 0xfe91009f,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = intcs_evt2irq(0x0500),
.flags = IORESOURCE_IRQ,
},
[2] = {
/* place holder for contiguous memory */
},
};

static struct platform_device ceu0_device = {
.name = "sh_mobile_ceu",
.id = 0,
.num_resources = ARRAY_SIZE(ceu0_resources),
.resource = ceu0_resources,
.dev = {
.platform_data = &sh_mobile_ceu0_info,
.coherent_dma_mask = 0xffffffff,
},
};

/* I2C */
static struct i2c_board_info i2c0_devices[] = {
{
Expand All @@ -549,6 +731,10 @@ static struct platform_device *eva_devices[] __initdata = {
&sh_eth_device,
&sdhi0_device,
&sh_mmcif_device,
&hdmi_device,
&hdmi_lcdc_device,
&camera_device,
&ceu0_device,
};

static void __init eva_clock_init(void)
Expand Down Expand Up @@ -587,6 +773,7 @@ static void __init eva_init(void)
eva_clock_init();

r8a7740_pinmux_init();
r8a7740_meram_workaround();

/* SCIFA1 */
gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
Expand Down Expand Up @@ -706,6 +893,29 @@ static void __init eva_init(void)
gpio_request(GPIO_FN_MMC1_D6_PORT143, NULL);
gpio_request(GPIO_FN_MMC1_D7_PORT142, NULL);

/* CEU0 */
gpio_request(GPIO_FN_VIO0_D7, NULL);
gpio_request(GPIO_FN_VIO0_D6, NULL);
gpio_request(GPIO_FN_VIO0_D5, NULL);
gpio_request(GPIO_FN_VIO0_D4, NULL);
gpio_request(GPIO_FN_VIO0_D3, NULL);
gpio_request(GPIO_FN_VIO0_D2, NULL);
gpio_request(GPIO_FN_VIO0_D1, NULL);
gpio_request(GPIO_FN_VIO0_D0, NULL);
gpio_request(GPIO_FN_VIO0_CLK, NULL);
gpio_request(GPIO_FN_VIO0_HD, NULL);
gpio_request(GPIO_FN_VIO0_VD, NULL);
gpio_request(GPIO_FN_VIO0_FIELD, NULL);
gpio_request(GPIO_FN_VIO_CKO, NULL);

/* CON1/CON15 Camera */
gpio_request(GPIO_PORT173, NULL); /* STANDBY */
gpio_request(GPIO_PORT172, NULL); /* RST */
gpio_request(GPIO_PORT158, NULL); /* CAM_PON */
gpio_direction_output(GPIO_PORT173, 0);
gpio_direction_output(GPIO_PORT172, 1);
gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */

/*
* CAUTION
*
Expand Down
Loading

0 comments on commit 6f2180b

Please sign in to comment.