Example #1
0
void __init msm8930_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	

	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;
	else if (cpu_is_msm8930ab()) {
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 500000000;
		grp3d_max_vectors[0].ib = KGSL_CONVERT_TO_MBPS(4800);
	}

	

	if (cpu_is_msm8930ab())
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 3);
	else if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
		(SOCINFO_VERSION_MINOR(version) == 2))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

	platform_device_register(&device_kgsl_3d0);
}
static int lvds_pixel_remap(void)
{
	u32 ver = socinfo_get_version();

	if (machine_is_apq8064_cdp() ||
	    machine_is_apq8064_liquid()) {
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return LVDS_PIXEL_MAP_PATTERN_1;
	} else if (machine_is_mpq8064_dtv()) {
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return LVDS_PIXEL_MAP_PATTERN_2;
	}
	return 0;
}
Example #3
0
void __init msm8930_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	/* Set the turbo speed for the AA and AB respectively */

	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 487500000;
	else if (cpu_is_msm8930ab()) {
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 500000000;
		grp3d_max_vectors[0].ib = KGSL_CONVERT_TO_MBPS(4800);
	}

	/* Set up the chip ID based on the SoC version */

	if (cpu_is_msm8930ab())
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 3);
	else if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
		(SOCINFO_VERSION_MINOR(version) == 2))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

	platform_device_register(&device_kgsl_3d0);
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8930_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8930_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}
	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.wpswitch_gpio = 0;
		msm8930_sdc3_data.wpswitch_polarity = 0;
	}
	msm_add_sdcc(3, &msm8930_sdc3_data);
#endif
}
/*
 * this a software workaround for not having two distinct board
 * files for 8660v1 and 8660v2. 8660v1 has a faulty 2d clock, and
 * this workaround detects the cpu version to tell if the kernel is on a
 * 8660v1, and should disable the 2d core. it is called from the board file
 */
void __init msm8x60_check_2d_hardware(void)
{
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) &&
	    (SOCINFO_VERSION_MINOR(socinfo_get_version()) == 0)) {
		printk(KERN_WARNING "kgsl: 2D cores disabled on 8660v1\n");
		kgsl_pdata.grp2d0_clk_name = NULL;
		kgsl_pdata.grp2d1_clk_name = NULL;
	}
}
static int msm_fb_detect_panel(const char *name)
{
	/* OPPO 2012-07-24 zhengzk Modify for MIPI start */
#ifndef CONFIG_VENDOR_EDIT
	u32 version;
	if (machine_is_apq8064_liquid()) {
		version = socinfo_get_platform_version();
		if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
			(SOCINFO_VERSION_MINOR(version) == 1)) {
			if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		} else {
			if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
				strnlen(LVDS_CHIMEI_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
	} else if (machine_is_apq8064_mtp()) {
		if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
			strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
			return 0;
	} else if (machine_is_apq8064_cdp()) {
		if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
			strnlen(LVDS_CHIMEI_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
			return 0;
	} else if (machine_is_mpq8064_dtv()) {
		if (!strncmp(name, LVDS_FRC_PANEL_NAME,
			strnlen(LVDS_FRC_PANEL_NAME,
			PANEL_NAME_MAX_LEN))) {
			set_mdp_clocks_for_wuxga();
			return 0;
		}
	}
#else
	if (!strncmp(name, MIPI_VIDEO_ORISE_OPPO_PANEL_NAME,
		strnlen(MIPI_VIDEO_ORISE_OPPO_PANEL_NAME,
			PANEL_NAME_MAX_LEN)))
		return 0;
#endif
/* OPPO 2012-07-24 zhengzk Modify for MIPI end */

	if (!strncmp(name, HDMI_PANEL_NAME,
			strnlen(HDMI_PANEL_NAME,
				PANEL_NAME_MAX_LEN))) {
		if (apq8064_hdmi_as_primary_selected())
			set_mdp_clocks_for_wuxga();
		return 0;
	}


	return -ENODEV;
}
static int lvds_pixel_remap(void)
{
	if (machine_is_apq8064_cdp() ||
	    machine_is_apq8064_liquid()) {
		u32 ver = socinfo_get_version();
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return 1;
	}
	return 0;
}
static int lvds_pixel_remap(void)
{
	if (machine_is_apq8064_cdp() ||
	    machine_is_apq8064_liquid()) {
		u32 ver = socinfo_get_platform_version(); //+++ ASUS_BSP : miniporting
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return 1;
	}
	return 0;
}
Example #9
0
void __init apq8064_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
			(SOCINFO_VERSION_MINOR(version) == 1))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 1);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 0);

	platform_device_register(&device_kgsl_3d0);
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8930_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8960_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}

	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.wpswitch_gpio = 0;
		msm8960_sdc3_data.is_wpswitch_active_low = false;
	}
	
	/* Emily Jiang, 20130326, modify clk rate from MMC_CAP_UHS_SDR104 to MMC_CAP_UHS_SDR25,in order to support UHS-1 SDR104 sd card. {*/  
	if ( msm_project_id <= SAPPORO && system_rev >= EVT0) {
		msm8960_sdc3_data.uhs_caps |= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_MAX_CURRENT_800);
	} else { 
		// unknown project
		msm8960_sdc3_data.uhs_caps |= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
			MMC_CAP_UHS_SDR104 | MMC_CAP_MAX_CURRENT_800);
	}
	/* } Emily Jiang, 20130326, modify clk rate from MMC_CAP_UHS_SDR104 to MMC_CAP_UHS_SDR25,in order to support UHS-1 SDR104 sd card. */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
}
void __init msm8930_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;

	if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
		(SOCINFO_VERSION_MINOR(version) == 2))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

	platform_device_register(&device_kgsl_3d0);
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8930_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) < 2) {
		msm8960_sdc3_data.vreg_data->vdd_data->always_on = true;
		msm8960_sdc3_data.vreg_data->vdd_data->reset_at_init = true;
	}
	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.wpswitch_gpio = 0;
		msm8960_sdc3_data.is_wpswitch_active_low = false;
	}

	if (machine_is_msm8930_evt()) {
		msm8960_sdc3_data.status_gpio = 90;
		msm8960_sdc3_data.status_irq = MSM_GPIO_TO_INT(90);
	}

	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	/* SDC4: WIFI BCM4334 */
	msm_add_sdcc(4, &msm8960_sdc4_data);
#endif
}
static int msm_fb_detect_panel(const char *name)
{
	u32 version;
	if (machine_is_apq8064_liquid()) {
		version = socinfo_get_platform_version();
		if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
			(SOCINFO_VERSION_MINOR(version) == 1)) {
			if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		} else {
			if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
				strnlen(LVDS_CHIMEI_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
	} else if (machine_is_apq8064_mtp()) {
		if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
			strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
			return 0;
	} else if (machine_is_apq8064_cdp()) {
		if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
			strnlen(LVDS_CHIMEI_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
			return 0;
	} else if (machine_is_mpq8064_dtv()) {
		if (!strncmp(name, LVDS_FRC_PANEL_NAME,
			strnlen(LVDS_FRC_PANEL_NAME,
			PANEL_NAME_MAX_LEN))) {
			set_mdp_clocks_for_wuxga();
			return 0;
		}
	}

	if (!strncmp(name, HDMI_PANEL_NAME,
			strnlen(HDMI_PANEL_NAME,
				PANEL_NAME_MAX_LEN))) {
		if (apq8064_hdmi_as_primary_selected())
			set_mdp_clocks_for_wuxga();
		return 0;
	}


	return -ENODEV;
}
Example #14
0
static void __init msm7x2x_map_io(void)
{
	msm_map_common_io();

	msm_msm7x2x_allocate_memory_regions();

	if (socinfo_init() < 0)
		BUG();

#ifdef CONFIG_CACHE_L2X0
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) > 1)
		|| ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
		&& (SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 3)))
		l2x0_init(MSM_L2CC_BASE, 0x0006801B, 0xfe000000);
	else
		l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);
#endif
}
void __init apq8064_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	if (cpu_is_apq8064ab())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;
	if (SOCINFO_VERSION_MAJOR(version) == 2) {
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 2);
	} else {
		if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
				(SOCINFO_VERSION_MINOR(version) == 1))
			kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 1);
		else
			kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 2, 0, 0);
	}

	platform_device_register(&device_kgsl_3d0);
}
Example #16
0
void operaul_init_gpu(void)
{
    unsigned int version = socinfo_get_version();

    /* Set the turbo speed for the AA and AB respectively */

    if (cpu_is_msm8930aa())
        kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;

    /* Set up the chip ID based on the SoC version */

    if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
            (SOCINFO_VERSION_MINOR(version) == 2))
        kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
    else
        kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

    platform_device_register(&device_kgsl_3d0);
}
/*
 * Version 1.0 parts can't reliably support more than 1 GHz, therefore truncate
 * the frequency table at that point if we're running on such parts.
 */
unsigned int __init msm_acpu_clock_fixup(void)
{
	unsigned int max;
	struct clkctl_acpu_speed *f;
	uint32_t version = socinfo_get_version();

	if (SOCINFO_VERSION_MINOR(version) == 0)
		max = 998400;
	else
		max = 1305600;

	for (f = acpu_freq_tbl; f->acpuclk_khz != 0; f++) {
		if (f->acpuclk_khz > max) {
			f->acpuclk_khz = 0;
			break;
		}
	}

	return (f - 1)->acpuclk_khz;
}
Example #18
0
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	
	msm_add_sdcc(1, &msm8930_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8930_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}
	
	if (!machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.wpswitch_gpio = 0;
	}
	msm_add_sdcc(3, &msm8930_sdc3_data);
#endif
}
static void __init marvelc_map_io(void)
{
	printk("marvelc_init_map_io()\n");
	msm_map_common_io();
	if (socinfo_init() < 0)
		BUG();
#ifdef CONFIG_CACHE_L2X0
	/* 7x27 has 256KB L2 cache:
	64Kb/Way and 4-Way Associativity;
	evmon/parity/share disabled. */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) > 1)
		|| ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
		&& (SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 3)))
		{
			/* R/W latency: 4 cycles; */
			l2x0_init(MSM_L2CC_BASE, 0x0006801B, 0xfe000000);
			printk("Marvelc_init L2-cache latency 4 cyc for 7x27-t\n");
		}else{
		/* R/W latency: 3 cycles; */
	l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);
			printk("Marvelc_init L2-cache latency 3 cyc for 7x27\n");
		}
#endif
}
static void __init chacha_init(void)
{
	int rc;
	char *cid = NULL;
	char *qwerty_color = NULL;
	struct kobject *properties_kobj;

	printk("chacha_init() revision = 0x%X\n", system_rev);
	msm_clock_init();
	board_get_cid_tag(&cid);
	board_get_qwerty_color_tag(&qwerty_color);

	if (qwerty_color && strcmp(qwerty_color, "white") == 0) {
		cm3628_pdata.levels[2] = 24;
		cm3628_pdata.levels[3] = 79;
		pr_info("[LS][CM3628] Update white table\n");
	} else
		pr_info("[LS][CM3628] Update %s table\n", qwerty_color);

	/* for bcm */
	bt_export_bd_address();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_request(CHACHA_GPIO_LS_EN, "ls_en");
	gpio_direction_output(CHACHA_GPIO_LS_EN, 0);


	msm_hw_reset_hook = chacha_reset;

	if (socinfo_init() < 0)
		BUG();

	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) > 1)
		|| ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
		&& (SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 3)))
		{
			msm_acpu_clock_init(&chacha_turbo_clock_data);
			perflock_init(&chacha_turbo_perflock_data);
		}else{
			msm_acpu_clock_init(&chacha_clock_data);
			perflock_init(&chacha_perflock_data);
		}

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(CHACHA_GPIO_UART3_RX));
#endif

	msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
	/*
	msm_change_usb_id(0x0bb4, 0x0c10);
	*/
#ifdef CONFIG_USB_FUNCTION
	msm_add_usb_id_pin_gpio(CHACHA_GPIO_USB_ID_PIN);
	msm_add_usb_devices(chacha_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	config_chacha_usb_id_gpios(0);
	platform_device_register(&msm_device_hsusb);
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	msm_add_mem_devices(&pmem_setting);

#ifdef CONFIG_MICROP_COMMON
	chacha_microp_init();
#endif

	rc = chacha_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		rc = sysfs_create_group(properties_kobj,
						&chacha_properties_attr_group);
	if (!properties_kobj || rc)
		pr_err("failed to create board_properties\n");

	/* probe camera driver */
	i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

	printk(KERN_INFO "[HS_BOARD] (%s) system_rev = %d\n", __func__,
	       system_rev);
	if (system_rev >= 2) {
		htc_headset_microp.dev.platform_data = &htc_headset_microp_data_xc;
		htc_headset_mgr_data.headset_config_num =
			ARRAY_SIZE(htc_headset_mgr_config);
		htc_headset_mgr_data.headset_config = htc_headset_mgr_config;
		printk(KERN_INFO "[HS_BOARD] (%s) Set MEMS config\n", __func__);
	}

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));

	if (system_rev == 0)
		i2c_register_board_info(0, i2c_devices_XA,
			ARRAY_SIZE(i2c_devices_XA));
	else
		i2c_register_board_info(0, i2c_devices_XB,
			ARRAY_SIZE(i2c_devices_XB));

	chacha_init_panel();

	chacha_init_keypad();

	chacha_wifi_init();

	msm_init_pmic_vibrator(3100);
}
Example #21
0
static int __devinit gdsc_probe(struct platform_device *pdev)
{
    static atomic_t gdsc_count = ATOMIC_INIT(-1);
    struct regulator_init_data *init_data;
    struct resource *res;
    struct gdsc *sc;
    uint32_t regval;
    bool retain_mem, retain_periph;
    int i, ret;

    sc = devm_kzalloc(&pdev->dev, sizeof(struct gdsc), GFP_KERNEL);
    if (sc == NULL)
        return -ENOMEM;

    init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);
    if (init_data == NULL)
        return -ENOMEM;

    if (of_get_property(pdev->dev.of_node, "parent-supply", NULL))
        init_data->supply_regulator = "parent";

    ret = of_property_read_string(pdev->dev.of_node, "regulator-name",
                                  &sc->rdesc.name);
    if (ret)
        return ret;

    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    if (res == NULL)
        return -EINVAL;
    sc->gdscr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
    if (sc->gdscr == NULL)
        return -ENOMEM;

    sc->clock_count = of_property_count_strings(pdev->dev.of_node,
                      "qcom,clock-names");
    if (sc->clock_count == -EINVAL) {
        sc->clock_count = 0;
    } else if (IS_ERR_VALUE(sc->clock_count)) {
        dev_err(&pdev->dev, "Failed to get clock names\n");
        return -EINVAL;
    }

    sc->clocks = devm_kzalloc(&pdev->dev,
                              sizeof(struct clk *) * sc->clock_count, GFP_KERNEL);
    if (!sc->clocks)
        return -ENOMEM;
    for (i = 0; i < sc->clock_count; i++) {
        const char *clock_name;
        of_property_read_string_index(pdev->dev.of_node,
                                      "qcom,clock-names", i,
                                      &clock_name);
        sc->clocks[i] = devm_clk_get(&pdev->dev, clock_name);
        if (IS_ERR(sc->clocks[i])) {
            int rc = PTR_ERR(sc->clocks[i]);
            if (rc != -EPROBE_DEFER)
                dev_err(&pdev->dev, "Failed to get %s\n",
                        clock_name);
            return rc;
        }
    }

    sc->rdesc.id = atomic_inc_return(&gdsc_count);
    sc->rdesc.ops = &gdsc_ops;
    sc->rdesc.type = REGULATOR_VOLTAGE;
    sc->rdesc.owner = THIS_MODULE;
    platform_set_drvdata(pdev, sc);

    /*
     * Disable HW trigger: collapse/restore occur based on registers writes.
     * Disable SW override: Use hardware state-machine for sequencing.
     */
    regval = readl_relaxed(sc->gdscr);
    regval &= ~(HW_CONTROL_MASK | SW_OVERRIDE_MASK);

    /* Configure wait time between states. */
    regval &= ~(EN_REST_WAIT_MASK | EN_FEW_WAIT_MASK | CLK_DIS_WAIT_MASK);
    regval |= EN_REST_WAIT_VAL | EN_FEW_WAIT_VAL | CLK_DIS_WAIT_VAL;
    writel_relaxed(regval, sc->gdscr);

    retain_mem = of_property_read_bool(pdev->dev.of_node,
                                       "qcom,retain-mem");
    sc->toggle_mem = !retain_mem;
    retain_periph = of_property_read_bool(pdev->dev.of_node,
                                          "qcom,retain-periph");
    sc->toggle_periph = !retain_periph;
    sc->toggle_logic = !of_property_read_bool(pdev->dev.of_node,
                       "qcom,skip-logic-collapse");

#if defined(CONFIG_MACH_TBS) && defined(CONFIG_ANDROID_ENGINEERING)
    {
        static sharp_smem_common_type *smemdata = NULL;
        unsigned long hw_revision = sh_boot_get_hw_revision();
        unsigned int version = socinfo_get_version();
        const char* target_names_collapse[] = {
            "gdsc_venus", "gdsc_mdss"
        };
        const char* target_names_retention[] = {
            "gdsc_venus", "gdsc_mdss", "gdsc_oxili_gx"
        };

        if( smemdata == NULL ) {
            smemdata = sh_smem_get_common_address();
        }

        if( (smemdata != NULL)
                && ((hw_revision == HW_VERSION_PP_1) || (hw_revision == HW_VERSION_PP_2)) ) {
            if (smemdata->shdiag_rvcflg != SHDIAG_RVCFLG_ON) {
                if ( (SOCINFO_VERSION_MAJOR(version) == 2) && (SOCINFO_VERSION_MINOR(version) == 2) ) {
                    int i = 0;
                    for(i=0; i<(sizeof(target_names_retention)/sizeof(target_names_retention[0])); i++) {
                        if( strcmp(sc->rdesc.name, target_names_retention[i]) == 0 ) {
                            break;
                        }
                    }
                    if( i != (sizeof(target_names_retention)/sizeof(target_names_retention[0])) ) {
                        if( retain_mem != true ) {
                            dev_err(&pdev->dev, "%s is forced to use retain_mem\n", sc->rdesc.name);
                            retain_mem = true;
                            sc->toggle_mem = !retain_mem;
                        }
                        if( retain_periph != true ) {
                            dev_err(&pdev->dev, "%s is forced to use retain_periph\n", sc->rdesc.name);
                            retain_periph = true;
                            sc->toggle_periph = !retain_periph;
                        }
                    }
                    for(i=0; i<(sizeof(target_names_collapse)/sizeof(target_names_collapse[0])); i++) {
                        if( strcmp(sc->rdesc.name, target_names_collapse[i]) == 0 ) {
                            break;
                        }
                    }
                    if( i != (sizeof(target_names_collapse)/sizeof(target_names_collapse[0])) ) {
                        if( sc->toggle_logic != false ) {
                            dev_err(&pdev->dev, "%s is forced to use skip_logic_collapse\n", sc->rdesc.name);
                            sc->toggle_logic = false;
                        }
                    }
                }
            }
        }
    }
#endif

    if (!sc->toggle_logic) {
        regval &= ~SW_COLLAPSE_MASK;
        writel_relaxed(regval, sc->gdscr);

        ret = readl_tight_poll_timeout(sc->gdscr, regval,
                                       regval & PWR_ON_MASK, TIMEOUT_US);
        if (ret) {
            dev_err(&pdev->dev, "%s enable timed out\n",
                    sc->rdesc.name);
            return ret;
        }
    }

    for (i = 0; i < sc->clock_count; i++) {
        if (retain_mem || (regval & PWR_ON_MASK))
            clk_set_flags(sc->clocks[i], CLKFLAG_RETAIN_MEM);
        else
            clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_MEM);

        if (retain_periph || (regval & PWR_ON_MASK))
            clk_set_flags(sc->clocks[i], CLKFLAG_RETAIN_PERIPH);
        else
            clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_PERIPH);
    }

    sc->rdev = regulator_register(&sc->rdesc, &pdev->dev, init_data, sc,
                                  pdev->dev.of_node);
    if (IS_ERR(sc->rdev)) {
        dev_err(&pdev->dev, "regulator_register(\"%s\") failed.\n",
                sc->rdesc.name);
        return PTR_ERR(sc->rdev);
    }

    return 0;
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();
#ifdef CONFIG_MACH_APQ8064_ALTEV
	hw_rev_type lge_bd_rev = HW_REV_EVB1;//                                             
#endif
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
#ifdef CONFIG_SWITCH_MAX1462X
       msm_gpiomux_install(apq8064_earjack_configs,
                            ARRAY_SIZE(apq8064_earjack_configs));
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));

#if !defined(CONFIG_MACH_LGE)
		if (!(machine_is_apq8064_mtp() &&
		(SOCINFO_VERSION_MINOR(platform_version) == 1)))
			msm_gpiomux_install(apq8064_non_mi2s_gsbi_configs,
				ARRAY_SIZE(apq8064_non_mi2s_gsbi_configs));
#endif
	}
	if (machine_is_apq8064_mtp() &&
	(SOCINFO_VERSION_MINOR(platform_version) == 1)) {
			msm_gpiomux_install(apq8064_mic_i2s_configs,
				ARRAY_SIZE(apq8064_mic_i2s_configs));
			msm_gpiomux_install(apq8064_spkr_i2s_configs,
				ARRAY_SIZE(apq8064_spkr_i2s_configs));
			msm_gpiomux_install(apq8064_mi2s_configs,
				ARRAY_SIZE(apq8064_mi2s_configs));
			msm_gpiomux_install(apq8064_gsbi1_i2c_2ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_2ma_configs));
	} else {
		msm_gpiomux_install(apq8064_slimbus_config,
				ARRAY_SIZE(apq8064_slimbus_config));
		msm_gpiomux_install(apq8064_gsbi1_i2c_8ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_8ma_configs));
	}

#if defined(CONFIG_LGE_IRRC)
       msm_gpiomux_install(apq8064_irrc_configs,
                     ARRAY_SIZE(apq8064_irrc_configs));
       pr_debug("[IRRC] gpiomux_install");
#endif

#if defined(CONFIG_ANDROID_SW_IRRC)
		msm_gpiomux_install(apq8064_irrc_tx_configs,
			ARRAY_SIZE(apq8064_irrc_tx_configs));
	pr_debug("[SW IRRC] gpiomux_install");
#endif


#if defined(CONFIG_SND_SOC_TPA2028D_DUAL_SPEAKER)
	msm_gpiomux_install(apq8064_gsbi7_i2c_8ma_configs,
					ARRAY_SIZE(apq8064_gsbi7_i2c_8ma_configs));
	pr_debug("[DUAL AMP] gpiomux_install");
#endif

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));


// kyle00.choi, 20130402, To feature out the modem. [START]
#if defined(CONFIG_MODEM_SUPPORT)
	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));

	}
#endif
// kyle00.choi, 20130402, To feature out the modem. [START]

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif
/*                                  */
#if defined(CONFIG_LGE_NFC)
		msm_gpiomux_install(apq8064_nfc_configs,
		ARRAY_SIZE(apq8064_nfc_configs));
#endif
/*                                */ 

//                                                                   
//                                             
//ADD: 0019632: [F200][BT] Bluetooth board bring-up
#ifdef CONFIG_LGE_BLUESLEEP
	msm_gpiomux_install(bt_pcm_configs,
			ARRAY_SIZE(bt_pcm_configs));
	msm_gpiomux_install(mpq8064_uartdm_configs,
			ARRAY_SIZE(mpq8064_uartdm_configs));
/* 	msm_gpiomux_install(gsbi6_uart_configs,
		 	ARRAY_SIZE(gsbi6_uart_configs)); */

	msm_gpiomux_install(msm8960_bt_host_wakeup_configs,
			ARRAY_SIZE(msm8960_bt_host_wakeup_configs));

	msm_gpiomux_install(msm8960_bt_wakeup_configs,
			ARRAY_SIZE(msm8960_bt_wakeup_configs));
#endif
//                                           
//                                                                   
	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
//                                                                          
//                                                          
#if defined (CONFIG_SLIMPORT_ANX7808)
        msm_gpiomux_install(apq8064_slimport_configs,
			ARRAY_SIZE(apq8064_slimport_configs));
    pr_err("[Slimport] revision = %d gpiomux install complete!\n", lge_get_board_revno());
#endif
//                                                        
//                                                                        

#if !defined (CONFIG_MACH_LGE)
	if (apq8064_mhl_display_enabled())
		msm_gpiomux_install(apq8064_mhl_configs,
				ARRAY_SIZE(apq8064_mhl_configs));
#endif

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#else
		msm_gpiomux_install(apq8064_sdc2_not_configs,
				     ARRAY_SIZE(apq8064_sdc2_not_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif
	 	msm_gpiomux_install(apq8064_sdc3_configs_chg,
				ARRAY_SIZE(apq8064_sdc3_configs_chg));
				


#if defined(CONFIG_BATTERY_MAX17043) || defined(CONFIG_BATTERY_MAX17047) || defined(CONFIG_BATTERY_MAX17048)
		msm_gpiomux_install(apq8064_fuel_gauge_configs,
				ARRAY_SIZE(apq8064_fuel_gauge_configs));
#endif

#if defined(CONFIG_BQ24262_CHARGER)
	msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
			ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif

//                                             

}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
	if (!(machine_is_mpq8064_hrd()))
		msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
		msm_gpiomux_install(mpq8064_gsbi5_uart_configs,
				ARRAY_SIZE(mpq8064_gsbi5_uart_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		if (machine_is_fsm8064_ep())
			msm_gpiomux_install(fsm8064_ep_gsbi_configs,
					ARRAY_SIZE(fsm8064_ep_gsbi_configs));
		else
			msm_gpiomux_install(apq8064_gsbi_configs,
					ARRAY_SIZE(apq8064_gsbi_configs));

		if (!(machine_is_apq8064_mtp() &&
		(SOCINFO_VERSION_MINOR(platform_version) == 1)))
			msm_gpiomux_install(apq8064_non_mi2s_gsbi_configs,
				ARRAY_SIZE(apq8064_non_mi2s_gsbi_configs));
	}
	if (machine_is_apq8064_mtp() &&
	(SOCINFO_VERSION_MINOR(platform_version) == 1)) {
			msm_gpiomux_install(apq8064_mic_i2s_configs,
				ARRAY_SIZE(apq8064_mic_i2s_configs));
			msm_gpiomux_install(apq8064_spkr_i2s_configs,
				ARRAY_SIZE(apq8064_spkr_i2s_configs));
			msm_gpiomux_install(apq8064_mi2s_configs,
				ARRAY_SIZE(apq8064_mi2s_configs));
			msm_gpiomux_install(apq8064_gsbi1_i2c_2ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_2ma_configs));
	} else {
		if (!machine_is_fsm8064_ep()) {
			msm_gpiomux_install(apq8064_slimbus_config,
				ARRAY_SIZE(apq8064_slimbus_config));
		}
	}

	if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) && !machine_is_apq8064_mtp()) {
		msm_gpiomux_install(apq8064_gsbi1_i2c_8ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_8ma_configs));
	}

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {

		msm_gpiomux_install(mpq8064_audio_auxpcm_configs,
			ARRAY_SIZE(mpq8064_audio_auxpcm_configs));

		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	if (!machine_is_mpq8064_hrd() && !machine_is_fsm8064_ep())
		msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));

	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	if (!machine_is_fsm8064_ep())
		msm_gpiomux_install(apq8064_hdmi_configs,
				ARRAY_SIZE(apq8064_hdmi_configs));

	if (apq8064_mhl_display_enabled())
		msm_gpiomux_install(apq8064_mhl_configs,
				ARRAY_SIZE(apq8064_mhl_configs));

	if (machine_is_mpq8064_cdp()) {
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

		msm_gpiomux_install(mpq8064_gsbi6_spi_configs,
				ARRAY_SIZE(mpq8064_gsbi6_spi_configs));
	}

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv())) {
		msm_gpiomux_install(apq8064_sdc3_configs,
				ARRAY_SIZE(apq8064_sdc3_configs));
	}
	 if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_uartdm_configs,
				ARRAY_SIZE(mpq8064_uartdm_configs));

	if (machine_is_fsm8064_ep()) {
		msm_gpiomux_install(fsm8064_ep_boot_configs,
				    ARRAY_SIZE(fsm8064_ep_boot_configs));
		msm_gpiomux_install(fsm8064_ep_backup_configs,
				    ARRAY_SIZE(fsm8064_ep_backup_configs));
		msm_gpiomux_install(fsm8064_ep_uim_configs,
				    ARRAY_SIZE(fsm8064_ep_uim_configs));
		msm_gpiomux_install(fsm8064_ep_sync_configs,
				    ARRAY_SIZE(fsm8064_ep_sync_configs));
		msm_gpiomux_install(fsm8064_ep_led_configs,
				    ARRAY_SIZE(fsm8064_ep_led_configs));
	}
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	if (system_rev < BOARD_REV09) {
		msm_gpiomux_install(sdc4_interface,
				ARRAY_SIZE(sdc4_interface));
		msm_gpiomux_install(sd_ls_en_60_config,
				ARRAY_SIZE(sd_ls_en_60_config));
	} else {
		msm_gpiomux_install(sdc2_interface,
				ARRAY_SIZE(sdc2_interface));
		msm_gpiomux_install(sd_ls_en_64_config,
				ARRAY_SIZE(sd_ls_en_64_config));
	}
#else
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_nc_configs,
			ARRAY_SIZE(apq8064_nc_configs));

	msm_gpiomux_install(sensorhub_configs,
			ARRAY_SIZE(sensorhub_configs));
	if (system_rev > BOARD_REV11)
		msm_gpiomux_install(nfc_firmware_configs,
			ARRAY_SIZE(nfc_firmware_configs));

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	msm_gpiomux_install(apq8064_auxpcm_configs,
		ARRAY_SIZE(apq8064_auxpcm_configs));		

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
			msm_gpiomux_install(amdm_configs,
					ARRAY_SIZE(amdm_configs));
			msm_gpiomux_install(bmdm_configs,
					ARRAY_SIZE(bmdm_configs));
		} else if (socinfo_get_platform_subtype() ==
				PLATFORM_SUBTYPE_SGLTE2) {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
			msm_gpiomux_install(sglte2_qsc_configs,
					ARRAY_SIZE(sglte2_qsc_configs));

			/* GSBI4 UART GPIOs for Primary IPC */
			msm_gpiomux_install(apq8064_uartdm_gsbi4_configs,
					ARRAY_SIZE(apq8064_uartdm_gsbi4_configs));
		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		} else {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}
	}

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()|| machine_is_JF())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

	if (system_rev < BOARD_REV10)
		msm_gpiomux_install(msm8064_sd_det_config,
				ARRAY_SIZE(msm8064_sd_det_config));

#if defined(CONFIG_VIDEO_MHL_V2)
	msm_gpiomux_install(msm8960_mhl_configs,
		ARRAY_SIZE(msm8960_mhl_configs));
#endif

#if defined(CONFIG_LEDS_AN30259A)
	msm_gpiomux_install(apq8064_leds_configs,
		ARRAY_SIZE(apq8064_leds_configs));
#endif

#ifdef CONFIG_KEYBOARD_CYPRESS_TOUCH_236
	printk(KERN_INFO"cypress gpio init in %s",__func__);
	if (system_rev > BOARD_REV10)
		msm_gpiomux_install(apq8064_tkey_config,
				ARRAY_SIZE(apq8064_tkey_config));
#endif

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI
	if (system_rev >= BOARD_REV09) {
		printk(KERN_INFO "%s: config touch_irq config.\n",__func__);
		msm_gpiomux_install(apq8064_touch_irq_config,
				ARRAY_SIZE(apq8064_touch_irq_config));
	}
#endif
#ifdef CONFIG_MFD_MAX77693
	msm_gpiomux_install(apq8064_muic_config,
		ARRAY_SIZE(apq8064_muic_config));
#endif
	msm_gpiomux_install(apq8064_sec_jack_configs,
			ARRAY_SIZE(apq8064_sec_jack_configs));
	if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_uartdm_configs,
				ARRAY_SIZE(mpq8064_uartdm_configs));
}
Example #25
0
void __init apq8064_init_gpiomux(void)
{
    int rc;
    int platform_version = socinfo_get_platform_version();

    rc = msm_gpiomux_init(NR_GPIO_IRQS);
    if (rc) {
        pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
        return;
    }

    msm_gpiomux_install(wcnss_5wire_interface,
                        ARRAY_SIZE(wcnss_5wire_interface));

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv()) {
        msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
                            ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
        msm_gpiomux_install(vcap_configs,
                            ARRAY_SIZE(vcap_configs));
#endif
        msm_gpiomux_install(sx150x_int_configs,
                            ARRAY_SIZE(sx150x_int_configs));
    } else {
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
        /*added by congshan 20121008 start*/
#ifdef CONFIG_ZTEMT_MHL_8064
#else
        msm_gpiomux_install(apq8064_ethernet_configs,
                            ARRAY_SIZE(apq8064_ethernet_configs));
#endif
        /*added by congshan 20121008 end*/
#endif
        msm_gpiomux_install(apq8064_gsbi_configs,
                            ARRAY_SIZE(apq8064_gsbi_configs));
    }

    msm_gpiomux_install(apq8064_slimbus_config,
                        ARRAY_SIZE(apq8064_slimbus_config));

    msm_gpiomux_install(apq8064_audio_codec_configs,
                        ARRAY_SIZE(apq8064_audio_codec_configs));

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv()) {
        msm_gpiomux_install(mpq8064_spkr_i2s_config,
                            ARRAY_SIZE(mpq8064_spkr_i2s_config));
    }

    pr_debug("%s(): audio-auxpcm: Include GPIO configs"
             " as audio is not the primary user"
             " for these GPIO Pins\n", __func__);

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv())
        msm_gpiomux_install(mpq8064_mi2s_configs,
                            ARRAY_SIZE(mpq8064_mi2s_configs));

    msm_gpiomux_install(apq8064_ext_regulator_configs,
                        ARRAY_SIZE(apq8064_ext_regulator_configs));

    if (machine_is_apq8064_mtp()) {
        if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
            msm_gpiomux_install(amdm_configs,
                                ARRAY_SIZE(amdm_configs));
            msm_gpiomux_install(bmdm_configs,
                                ARRAY_SIZE(bmdm_configs));
        } else if (socinfo_get_platform_subtype() ==
                   PLATFORM_SUBTYPE_SGLTE2) {
            msm_gpiomux_install(mdm_configs,
                                ARRAY_SIZE(mdm_configs));
            msm_gpiomux_install(sglte2_qsc_configs,
                                ARRAY_SIZE(sglte2_qsc_configs));

            /* GSBI4 UART GPIOs for Primary IPC */
            msm_gpiomux_install(apq8064_uartdm_gsbi4_configs,
                                ARRAY_SIZE(apq8064_uartdm_gsbi4_configs));
        } else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
            msm_gpiomux_install(mdm_i2s_configs,
                                ARRAY_SIZE(mdm_i2s_configs));
        } else {
            msm_gpiomux_install(mdm_configs,
                                ARRAY_SIZE(mdm_configs));
        }
    }

    if (machine_is_apq8064_mtp()) {
        if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
            msm_gpiomux_install(cyts_gpio_alt_config,
                                ARRAY_SIZE(cyts_gpio_alt_config));
        } else {
            msm_gpiomux_install(cyts_gpio_configs,
                                ARRAY_SIZE(cyts_gpio_configs));
        }
    }

#ifdef CONFIG_USB_EHCI_MSM_HSIC
    if (machine_is_apq8064_mtp())
        msm_gpiomux_install(apq8064_hsic_configs,
                            ARRAY_SIZE(apq8064_hsic_configs));
#endif

    if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
        msm_gpiomux_install(apq8064_mxt_configs,
                            ARRAY_SIZE(apq8064_mxt_configs));

    msm_gpiomux_install(apq8064_hdmi_configs,
                        ARRAY_SIZE(apq8064_hdmi_configs));

    if (machine_is_mpq8064_cdp())
        msm_gpiomux_install(mpq8064_ir_configs,
                            ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
    msm_gpiomux_install(apq8064_sdc2_configs,
                        ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
    msm_gpiomux_install(apq8064_sdc4_configs,
                        ARRAY_SIZE(apq8064_sdc4_configs));
#endif

    msm_gpiomux_install(apq8064_sdc3_configs,
                        ARRAY_SIZE(apq8064_sdc3_configs));
    /*added by congshan 20121008 start*/
#ifdef CONFIG_ZTEMT_MHL_8064
    msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
                        ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif
    /*added by congshan 20121008 end*/
    /* ZTEMT Added by LiuYongfeng, 2012/10/10 */
#ifdef CONFIG_SERIAL_MSM_HSL
    msm_gpiomux_install(mpq8064_gsbi5_uart_configs,
                        ARRAY_SIZE(mpq8064_gsbi5_uart_configs));
#endif
    /* ZTEMT END */
    //# config the sensors' gpio
#ifdef CONFIG_ZTEMT_SENSORS
    msm_gpiomux_install(sensors_gpio_configs, ARRAY_SIZE(sensors_gpio_configs));
#endif
    if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
        msm_gpiomux_install(mpq8064_uartdm_configs,
                            ARRAY_SIZE(mpq8064_uartdm_configs));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();
#ifdef CONFIG_MACH_ASUSTEK
	hw_rev revision = HW_REV_INVALID;
	revision = asustek_get_hw_rev();
#endif
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

#ifdef CONFIG_MACH_ASUSTEK
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		msm_gpiomux_install(asustek_pcbid_pins_configs,
			ARRAY_SIZE(asustek_pcbid_pins_configs));

		if (revision == HW_REV_B) {
			msm_gpiomux_install(asustek_gpio_keys_configs,
				ARRAY_SIZE(asustek_gpio_keys_configs));
		}

		msm_gpiomux_install(asustek_pwr_keys_configs,
			ARRAY_SIZE(asustek_pwr_keys_configs));
	}
#endif

	msm_gpiomux_install(gpio_bat_low_configs,
			ARRAY_SIZE(gpio_bat_low_configs));


	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));
/*
	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));
*/
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
#endif
	//add touch
	msm_gpiomux_install(msm8064_ts_gpio_config,
			ARRAY_SIZE(msm8064_ts_gpio_config));  

	msm_gpiomux_install(smb345_pin_configs,
			ARRAY_SIZE(smb345_pin_configs));

	switch (revision) {
	case HW_REV_B:
	case HW_REV_C:
	case HW_REV_D:
	case HW_REV_E:
		msm_gpiomux_install(wpc_pok_configs,
			ARRAY_SIZE(wpc_pok_configs));
		break;
	default:
		break;
	}

	if (machine_is_apq8064_flo() || machine_is_apq8064_deb())
		msm_gpiomux_install(apq8064_bcm2079x_nfc_configs,
			ARRAY_SIZE(apq8064_bcm2079x_nfc_configs));
#ifdef CONFIG_SLIMPORT_ANX7808
	msm_gpiomux_install(msm8064_sp_gpio_config,
			ARRAY_SIZE(msm8064_sp_gpio_config));
#endif
	msm_gpiomux_install(apq8064_headphone_configs,
			ARRAY_SIZE(apq8064_headphone_configs));

	msm_gpiomux_install(asustek_gsbi4_configs,
		ARRAY_SIZE(asustek_gsbi4_configs));

#ifdef CONFIG_INPUT_LID
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if ((revision == HW_REV_C) || (revision == HW_REV_D) || (revision == HW_REV_E)) {
			msm_gpiomux_install(asustek_hall_sensor_configs,
			ARRAY_SIZE(asustek_hall_sensor_configs));
		}
	}
#endif

}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
#ifndef CONFIG_MACH_APQ8064_FIND5
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif

#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif

#ifndef CONFIG_MACH_APQ8064_FIND5
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
#endif
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
#ifdef CONFIG_MACH_APQ8064_FIND5
		if (get_pcb_version() >= PCB_VERSION_DVT) {
			msm_gpiomux_install(apq8064_gsbi7_i2c_config, ARRAY_SIZE(apq8064_gsbi7_i2c_config));
		}
#endif
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));

#ifdef CONFIG_MACH_APQ8064_FIND5
	msm_gpiomux_install(apq8064_backlight_enable,
			ARRAY_SIZE(apq8064_backlight_enable));
#endif

	if (machine_is_apq8064_mtp()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
			msm_gpiomux_install(amdm_configs,
					ARRAY_SIZE(amdm_configs));
			msm_gpiomux_install(bmdm_configs,
				ARRAY_SIZE(bmdm_configs));
		} else if (socinfo_get_platform_subtype() ==
					PLATFORM_SUBTYPE_SGLTE2) {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
			msm_gpiomux_install(sglte2_qsc_configs,
					ARRAY_SIZE(sglte2_qsc_configs));

			/* GSBI4 UART GPIOs for Primary IPC */
			msm_gpiomux_install(apq8064_uartdm_gsbi4_configs,
				ARRAY_SIZE(apq8064_uartdm_gsbi4_configs));
		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		} else {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
		}
	}

	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
	
/* OPPO 2012-11-14 DuYuanHua Add to config GPIO_72 as input pin for sim card detection */
#ifdef OPPO_FEATURE_UIM_CARD_HOTSWAP
	msm_gpiomux_install(apq8064_uim_card_detection_configs,
			ARRAY_SIZE(apq8064_uim_card_detection_configs));
#endif
/* OPPO 2012-11-14 DuYuanHua Add End*/

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
	 if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_uartdm_configs,
				ARRAY_SIZE(mpq8064_uartdm_configs));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	if (system_rev < BOARD_REV08)
		msm_gpiomux_install(sdc4_interface,
				ARRAY_SIZE(sdc4_interface));
	else
		msm_gpiomux_install(sdc2_interface,
				ARRAY_SIZE(sdc2_interface));
#else
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

/*	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	} */

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()|| machine_is_JF())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

	msm_gpiomux_install(msm8064_sd_det_config,
			ARRAY_SIZE(msm8064_sd_det_config));

#if defined(CONFIG_VIDEO_MHL_V2)
	msm_gpiomux_install(msm8960_mhl_configs,
		ARRAY_SIZE(msm8960_mhl_configs));
#endif

#if defined(CONFIG_LEDS_AN30259A)
	msm_gpiomux_install(apq8064_leds_configs,
		ARRAY_SIZE(apq8064_leds_configs));
#endif
#ifdef CONFIG_MFD_MAX77693
	msm_gpiomux_install(apq8064_muic_config,
		ARRAY_SIZE(apq8064_muic_config));
#endif
}
void __init apq8064_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
#ifdef CONFIG_SWITCH_MAX1462X
	msm_gpiomux_install(apq8064_earjack_configs,
			ARRAY_SIZE(apq8064_earjack_configs));
#endif
#ifndef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif
	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

#if defined(CONFIG_ANDROID_IRRC)
	msm_gpiomux_install(apq8064_irrc_tx_configs,
			ARRAY_SIZE(apq8064_irrc_tx_configs));
#endif

#ifdef CONFIG_SND_SOC_TPA2028D_DUAL_SPEAKER
	msm_gpiomux_install(apq8064_gsbi7_i2c_8ma_configs,
					ARRAY_SIZE(apq8064_gsbi7_i2c_8ma_configs));
#endif

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

#if defined(CONFIG_MODEM_SUPPORT)
	if (machine_is_apq8064_mtp()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
			msm_gpiomux_install(amdm_configs,
					ARRAY_SIZE(amdm_configs));
			msm_gpiomux_install(bmdm_configs,
				ARRAY_SIZE(bmdm_configs));
		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}
#endif

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
#if defined (CONFIG_SLIMPORT_ANX7808)
	msm_gpiomux_install(apq8064_slimport_configs,
			ARRAY_SIZE(apq8064_slimport_configs));
    pr_err("[Slimport] revision = %d gpiomux install complete!\n", lge_get_board_revno());
#endif

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(apq8064_sdc2_configs,
			ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(apq8064_sdc4_configs,
			ARRAY_SIZE(apq8064_sdc4_configs));
#endif
	msm_gpiomux_install(apq8064_sdc3_configs_chg,
			ARRAY_SIZE(apq8064_sdc3_configs_chg));
}