public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add support tw9910 driver setting for Migo-R
@ 2009-01-05  7:25 Kuninori Morimoto
  2009-01-05  8:26 ` Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2009-01-05  7:25 UTC (permalink / raw)
  To: linux-sh


Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
---
 arch/sh/boards/mach-migor/setup.c |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 6df933d..53537fe 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -20,6 +20,7 @@
 #include <linux/gpio.h>
 #include <media/sh_mobile_ceu.h>
 #include <media/ov772x.h>
+#include <media/tw9910.h>
 #include <video/sh_mobile_lcdc.h>
 #include <asm/clock.h>
 #include <asm/machvec.h>
@@ -292,9 +293,12 @@ static struct platform_device migor_lcdc_device = {
 };
 
 static struct clk *camera_clk;
+static DEFINE_MUTEX(camera_lock);
 
-static void camera_power_on(void)
+static void camera_power_on(int is_tw)
 {
+	mutex_lock(&camera_lock);
+
 	/* Use 10 MHz VIO_CKO instead of 24 MHz to work
 	 * around signal quality issues on Panel Board V2.1.
 	 */
@@ -304,6 +308,12 @@ static void camera_power_on(void)
 
 	/* use VIO_RST to take camera out of reset */
 	mdelay(10);
+	if (is_tw) {
+		gpio_set_value(GPIO_PTT2, 0);
+		gpio_set_value(GPIO_PTT0, 0);
+	} else {
+		gpio_set_value(GPIO_PTT0, 1);
+	}
 	gpio_set_value(GPIO_PTT3, 0);
 	mdelay(10);
 	gpio_set_value(GPIO_PTT3, 1);
@@ -316,12 +326,23 @@ static void camera_power_off(void)
 	clk_put(camera_clk);
 
 	gpio_set_value(GPIO_PTT3, 0);
+	mutex_unlock(&camera_lock);
 }
 
 static int ov7725_power(struct device *dev, int mode)
 {
 	if (mode)
-		camera_power_on();
+		camera_power_on(0);
+	else
+		camera_power_off();
+
+	return 0;
+}
+
+static int tw9910_power(struct device *dev, int mode)
+{
+	if (mode)
+		camera_power_on(1);
 	else
 		camera_power_off();
 
@@ -366,6 +387,14 @@ static struct ov772x_camera_info ov7725_info = {
 	},
 };
 
+static struct tw9910_video_info tw9910_info = {
+	.buswidth = SOCAM_DATAWIDTH_8,
+	.mpout    = TW9910_MPO_FIELD,
+	.link = {
+		.power  = tw9910_power,
+	}
+};
+
 static struct platform_device *migor_devices[] __initdata = {
 	&smc91x_eth_device,
 	&sh_keysc_device,
@@ -387,6 +416,10 @@ static struct i2c_board_info migor_i2c_devices[] = {
 		I2C_BOARD_INFO("ov772x", 0x21),
 		.platform_data = &ov7725_info,
 	},
+	{
+		I2C_BOARD_INFO("tw9910", 0x45),
+		.platform_data = &tw9910_info,
+	},
 };
 
 static int __init migor_devices_setup(void)
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add support tw9910 driver setting for Migo-R
  2009-01-05  7:25 [PATCH] Add support tw9910 driver setting for Migo-R Kuninori Morimoto
@ 2009-01-05  8:26 ` Paul Mundt
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2009-01-05  8:26 UTC (permalink / raw)
  To: linux-sh

On Mon, Jan 05, 2009 at 04:25:16PM +0900, Kuninori Morimoto wrote:
> 
> Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
> ---
>  arch/sh/boards/mach-migor/setup.c |   37 +++++++++++++++++++++++++++++++++++--
>  1 files changed, 35 insertions(+), 2 deletions(-)
> 
Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-05  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05  7:25 [PATCH] Add support tw9910 driver setting for Migo-R Kuninori Morimoto
2009-01-05  8:26 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox