update hdmi drivers: mod gpio control for phonepad project
authorkfx <kfx@rock-chips.com>
Thu, 11 Aug 2011 02:22:43 +0000 (10:22 +0800)
committerkfx <kfx@rock-chips.com>
Thu, 11 Aug 2011 02:22:43 +0000 (10:22 +0800)
arch/arm/mach-rk29/board-rk29-a22.c
arch/arm/mach-rk29/board-rk29-ddr3sdk.c
arch/arm/mach-rk29/board-rk29-phonesdk.c
arch/arm/mach-rk29/board-rk29sdk.c
arch/arm/mach-rk29/include/mach/board.h
drivers/video/hdmi/chips/anx7150.c
drivers/video/hdmi/chips/anx7150.h

index b02d84d3f70a3f55a276e1eb805bd1dc63dc35a0..f755656c009b12a4f0b95fb117b8e31c18fd88b1 100644 (file)
@@ -1739,6 +1739,17 @@ struct i2c_gpio_platform_data default_i2c3_data = {
        .io_init = rk29_i2c3_io_init,
 };
 #endif
+#if defined (CONFIG_ANX7150)
+#define HDMI_VDD_CTL RK29_PIN6_PD3
+int anx7150_io_init(void)
+{
+       return 0;
+}
+struct hdmi_platform_data anx7150_data  = {
+       .io_init = anx7150_io_init,
+};
+#endif
+
 #ifdef CONFIG_I2C0_RK29
 static struct i2c_board_info __initdata board_i2c0_devices[] = {
 #if defined (CONFIG_RK1000_CONTROL)
@@ -1850,6 +1861,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
         .addr           = 0x39,             //0x39, 0x3d
         .flags          = 0,
         .irq            = RK29_PIN2_PA3,
+               .platform_data  = &anx7150_data,
     },
 #endif
 #if defined (CONFIG_SENSORS_MPU3050) 
index f4e883fa9feefb8e375a5d015052db2b834ae5d3..55c5030385e35fdfc031c61d7e94514c44cfbe5e 100755 (executable)
@@ -789,6 +789,15 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
 #endif
 };
 #endif
+#if defined (CONFIG_ANX7150)
+int anx7150_io_init(void)
+{
+       return 0;
+}
+struct hdmi_platform_data anx7150_data  = {
+       .io_init = anx7150_io_init,
+};
+#endif
 
 #ifdef CONFIG_I2C1_RK29
 static struct i2c_board_info __initdata board_i2c1_devices[] = {
@@ -799,12 +808,13 @@ static struct i2c_board_info __initdata board_i2c1_devices[] = {
                .flags                  = 0,
        },
 #endif
-#if defined (CONFIG_ANX7150) || defined (CONFIG_ANX7150_NEW)
+#if defined (CONFIG_ANX7150)
     {
                .type           = "anx7150",
         .addr           = 0x39,             //0x39, 0x3d
         .flags          = 0,
         .irq            = RK29_PIN1_PD7,
+               .platform_data  = &anx7150_data,
     },
 #endif
 
index d1580c9b9eea221a0c8ff99f92e030ce3be00759..faf7893c57a819173934e305a42281cae5bd6457 100755 (executable)
@@ -1796,6 +1796,21 @@ struct i2c_gpio_platform_data default_i2c3_data = {
        .io_init = rk29_i2c3_io_init,
 };
 #endif
+
+#if defined (CONFIG_ANX7150)
+#define HDMI_VDD_CTL RK29_PIN6_PD3
+int anx7150_io_init(void)
+{
+       gpio_request(HDMI_VDD_CTL, "hdmi pwr ctl");
+       gpio_direction_output(HDMI_VDD_CTL, GPIO_HIGH);
+       //gpio_set_value(HDMI_VDD_CTL, GPIO_HIGH); 
+       mdelay(10);
+       return 0;
+}
+struct hdmi_platform_data anx7150_data = {
+       .io_init = anx7150_io_init,
+};
+#endif
 #ifdef CONFIG_I2C0_RK29
 static struct i2c_board_info __initdata board_i2c0_devices[] = {
 #if defined (CONFIG_RK1000_CONTROL)
@@ -1890,6 +1905,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
         .addr           = 0x39,             //0x39, 0x3d
         .flags          = 0,
         .irq            = RK29_PIN2_PA3,
+               .platform_data  = &anx7150_data,
     },
 #endif
 #if defined (CONFIG_GS_L3G4200D)
index 064441f203b5d02617f223d077fe1c06143bb7da..6c0865d40a3ca3466acf9f306c46ef4944532f12 100755 (executable)
@@ -795,7 +795,15 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
 #endif
 };
 #endif
-
+#if defined (CONFIG_ANX7150)
+int anx7150_io_init(void)
+{
+      return 0;
+}
+struct hdmi_platform_data anx7150_data = {
+       .io_init = anx7150_io_init,
+};
+#endif
 #ifdef CONFIG_I2C1_RK29
 static struct i2c_board_info __initdata board_i2c1_devices[] = {
 #if defined (CONFIG_RK1000_CONTROL1)
@@ -805,12 +813,13 @@ static struct i2c_board_info __initdata board_i2c1_devices[] = {
                .flags                  = 0,
        },
 #endif
-#if defined (CONFIG_ANX7150) || defined (CONFIG_ANX7150_NEW)
+#if defined (CONFIG_ANX7150)
     {
                .type           = "anx7150",
         .addr           = 0x39,             //0x39, 0x3d
         .flags          = 0,
         .irq            = RK29_PIN1_PD7,
+               .platform_data  = &anx7150_data,
     },
 #endif
 
index 7c7f811cec889dc5294b671da5d9a13c2a1be5f8..a9a72b23e842a531e65b32de4f0674e4eca2502e 100644 (file)
@@ -38,6 +38,12 @@ struct led_newton_pwm_platform_data {
        struct led_newton_pwm* leds;
 };
 
+struct hdmi_platform_data {
+       u32 hdmi_on_pin;
+       u32 hdmi_on_level;
+       int (*io_init)(void);
+       int (*io_deinit)(void);
+};
 struct irda_info{
     u32 intr_pin;
     int (*iomux_init)(void);
index 74949e968b109bba396224d4212cf1232f37182f..e1a479b1fe20a0ff0078e68e775e7703251799e2 100755 (executable)
@@ -7,6 +7,7 @@
 #include <linux/interrupt.h>\r
 #include <mach/gpio.h>\r
 #include <mach/iomux.h>\r
+#include <mach/board.h>\r
 \r
 \r
 \r
@@ -159,12 +160,10 @@ static int anx7150_i2c_probe(struct i2c_client *client,const struct i2c_device_i
        struct hdmi *hdmi = NULL;\r
        struct anx7150_pdata *anx = NULL;\r
 \r
-#if defined(CONFIG_MACH_RK29_PHONEPADSDK)\r
-       gpio_request(HDMI_VDD_CTL, "hdmi pwr ctl");\r
-       gpio_direction_output(HDMI_VDD_CTL, GPIO_HIGH);\r
-       //gpio_set_value(HDMI_VDD_CTL, GPIO_HIGH); \r
-       mdelay(10);\r
-#endif\r
+       struct hdmi_platform_data *pdata = client->dev.platform_data;\r
+\r
+       if(pdata && pdata->io_init)\r
+               pdata->io_init();\r
 \r
        hdmi = hdmi_register(sizeof(struct anx7150_pdata), &client->dev);\r
     if (!hdmi)\r
index b1db5ae520bc37984079aaa4ba9259b1a273aeba..b9c5ee329e2a57b69a37ab39e3c20bf8394c502d 100755 (executable)
@@ -10,8 +10,6 @@
 \r
 #define ANX7150_SCL_RATE 100 * 1000\r
 \r
-/* VCC_HDMI 's control */\r
-#define HDMI_VDD_CTL     RK29_PIN6_PD3\r
 \r
 /* HDMI auto switch */\r
 #define HDMI_AUTO_SWITCH HDMI_ENABLE\r