From 2894b83777c415fe06be050b9324426ba6963f27 Mon Sep 17 00:00:00 2001 From: Brian Wood Date: Tue, 6 Mar 2012 14:33:37 -0800 Subject: [PATCH] MFLD_DV10: Camera sensor GPIO and SFI touchscreen change BZ: 27297 This commit has changes for camera sensor GPIO needed that differ from PRx phones in their IFWI SFI table. This is contains the removal of the touchscreen manual enablement that is now in latest IFWI. Change-Id: Ideafded12f854230b33ae907b724a2ffdd9a9580 Signed-off-by: Brian Wood Reviewed-on: http://android.intel.com:8080/37757 Reviewed-by: buildbot Tested-by: buildbot --- arch/x86/platform/intel-mid/board-redridge.c | 68 +++++++++------------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/arch/x86/platform/intel-mid/board-redridge.c b/arch/x86/platform/intel-mid/board-redridge.c index 70a0e11..bdce27e 100644 --- a/arch/x86/platform/intel-mid/board-redridge.c +++ b/arch/x86/platform/intel-mid/board-redridge.c @@ -997,19 +997,18 @@ static int mt9m114_flisclk_ctrl(struct v4l2_subdev *sd, int flag) static int mt9e013_reset; -#define MFLD_DV10_CAM_GPIO 176 static int mt9m114_power_ctrl(struct v4l2_subdev *sd, int flag) { int ret; - /* Note here, there maybe a workaround to avoid I2C SDA issue */ - if (gp_camera1_power_down < 0) { - ret = camera_sensor_gpio(MFLD_DV10_CAM_GPIO, GP_CAMERA_1_POWER_DOWN, - GPIOF_DIR_OUT, 1); - if (ret < 0) - return ret; - gp_camera1_power_down = ret; - } + /* With the DV10 documentation states that this gpio pin might not + * be a valid for this board (as it is for the PRx Medfield phones) + * We'll just test to see if it can be set, otherwise just ignore + * and move on. + */ + if (gp_camera1_power_down < 0) + gp_camera1_power_down = camera_sensor_gpio(-1, + GP_CAMERA_1_POWER_DOWN, GPIOF_DIR_OUT, 1); if (gp_camera1_reset < 0) { ret = camera_sensor_gpio(-1, GP_CAMERA_1_RESET, @@ -1028,19 +1027,21 @@ static int mt9m114_power_ctrl(struct v4l2_subdev *sd, int flag) mt9e013_power_ctrl(sd, 0); mt9e013_reset = 1; } - + gpio_direction_output(gp_camera1_reset, 0); gpio_set_value(gp_camera1_reset, 0); if (!camera_vprog1_on) { camera_vprog1_on = 1; intel_scu_ipc_msic_vprog1(1); } - gpio_set_value(gp_camera1_power_down, 1); + if (gp_camera1_power_down >= 0) + gpio_set_value(gp_camera1_power_down, 1); } else { if (camera_vprog1_on) { camera_vprog1_on = 0; intel_scu_ipc_msic_vprog1(0); } - gpio_set_value(gp_camera1_power_down, 0); + if (gp_camera1_power_down >= 0) + gpio_set_value(gp_camera1_power_down, 0); mt9e013_reset = 0; } @@ -2144,43 +2145,16 @@ static int __init blackbay_i2c_init(void) intel_ignore_i2c_device_register(&ov8830_pentry, dev); else pr_err("Dev id is NULL for %s\n", "ov8830"); - } - /* Add mt9m114 driver for detection - * -- FIXME: remove when the sensor is defined in SFI table */ - dev = get_device_id(SFI_DEV_TYPE_I2C, "mt9m114"); - if (dev != NULL) - intel_ignore_i2c_device_register(&mt9m114_pentry, dev); - else - pr_err("Dev id is NULL for %s\n", "mt9m114"); + /* Add mt9m114 driver for detection + * -- FIXME: remove when the sensor is defined in SFI table */ + dev = get_device_id(SFI_DEV_TYPE_I2C, "mt9m114"); + if (dev != NULL) + intel_ignore_i2c_device_register(&mt9m114_pentry, dev); + else + pr_err("Dev id is NULL for %s\n", "mt9m114"); + } return 0; } device_initcall(blackbay_i2c_init); - - -/* - * mxt1386 initialization routines for Redridge board - * (Should be removed once SFI tables are updated) - */ -static struct mxt_platform_data mxt1386_pdata = { - .irqflags = IRQF_TRIGGER_FALLING, - .init_platform_hw = atmel_mxt_init_platform_hw, - -}; - -static struct i2c_board_info dv10_i2c_bus0_devs[] = { - { .type = "mxt1386", - .addr = 0x4c, - .irq = TOUCH_IRQ_GPIO + MRST_IRQ_OFFSET, - .platform_data = &mxt1386_pdata, - }, -}; - -static int __init redridge_i2c_init(void) -{ - i2c_register_board_info(0, dv10_i2c_bus0_devs, - ARRAY_SIZE(dv10_i2c_bus0_devs)); - return 0; -} -device_initcall(redridge_i2c_init); -- 2.7.4