From patchwork Wed Apr 21 08:45:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 93836 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3L8jU0J021833 for ; Wed, 21 Apr 2010 08:45:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753267Ab0DUIpT (ORCPT ); Wed, 21 Apr 2010 04:45:19 -0400 Received: from mail.gmx.net ([213.165.64.20]:47929 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753264Ab0DUIpR (ORCPT ); Wed, 21 Apr 2010 04:45:17 -0400 Received: (qmail invoked by alias); 21 Apr 2010 08:45:14 -0000 Received: from p57BD1949.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.25.73] by mail.gmx.net (mp063) with SMTP; 21 Apr 2010 10:45:14 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX19HoTpCQYlHbQp6HpJAJnk+dDvv7AZLu7sbnCUzWH ToqElMt8YQcz7Q Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1O4VYj-0003pd-8n; Wed, 21 Apr 2010 10:45:25 +0200 Date: Wed, 21 Apr 2010 10:45:25 +0200 (CEST) From: Guennadi Liakhovetski To: Linux Media Mailing List cc: "linux-sh@vger.kernel.org" Subject: [PATCH] SH: add Video Output Unit and AK8813 video encoder support on ecovec Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.41999999999999998 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 21 Apr 2010 08:45:30 +0000 (UTC) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 6c13b92..6f5697f 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -771,6 +771,51 @@ static struct platform_device irda_device = { .resource = irda_resources, }; +#include +#include + +struct ak881x_pdata ak881x_pdata = { + .flags = AK881X_IF_MODE_SLAVE, +}; + +static struct i2c_board_info ak8813 = { + I2C_BOARD_INFO("ak8813", 0x20), + .platform_data = &ak881x_pdata, +}; + +struct sh_vou_pdata sh_vou_pdata = { + .bus_fmt = SH_VOU_BUS_8BIT, + .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, + .board_info = &ak8813, + .i2c_adap = 0, + .module_name = "ak881x", +}; + +static struct resource sh_vou_resources[] = { + [0] = { + .start = 0xfe960000, + .end = 0xfe962043, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 55, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device vou_device = { + .name = "sh-vou", + .id = -1, + .num_resources = ARRAY_SIZE(sh_vou_resources), + .resource = sh_vou_resources, + .dev = { + .platform_data = &sh_vou_pdata, + }, + .archdata = { + .hwblk_id = HWBLK_VOU, + }, +}; + static struct platform_device *ecovec_devices[] __initdata = { &heartbeat_device, &nor_flash_device, @@ -792,6 +837,7 @@ static struct platform_device *ecovec_devices[] __initdata = { &camera_devices[2], &fsi_device, &irda_device, + &vou_device, }; #ifdef CONFIG_I2C @@ -1175,6 +1221,38 @@ static int __init arch_setup(void) i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices)); + /* VOU */ + gpio_request(GPIO_FN_DV_D15, NULL); + gpio_request(GPIO_FN_DV_D14, NULL); + gpio_request(GPIO_FN_DV_D13, NULL); + gpio_request(GPIO_FN_DV_D12, NULL); + gpio_request(GPIO_FN_DV_D11, NULL); + gpio_request(GPIO_FN_DV_D10, NULL); + gpio_request(GPIO_FN_DV_D9, NULL); + gpio_request(GPIO_FN_DV_D8, NULL); + gpio_request(GPIO_FN_DV_CLKI, NULL); + gpio_request(GPIO_FN_DV_CLK, NULL); + gpio_request(GPIO_FN_DV_VSYNC, NULL); + gpio_request(GPIO_FN_DV_HSYNC, NULL); + + /* AK8813 power / reset sequence */ + gpio_request(GPIO_PTG4, NULL); + gpio_request(GPIO_PTU3, NULL); + /* Reset */ + gpio_direction_output(GPIO_PTG4, 0); + /* Power down */ + gpio_direction_output(GPIO_PTU3, 1); + + udelay(10); + + /* Power up, reset */ + gpio_set_value(GPIO_PTU3, 0); + + udelay(10); + + /* Remove reset */ + gpio_set_value(GPIO_PTG4, 1); + return platform_add_devices(ecovec_devices, ARRAY_SIZE(ecovec_devices)); }