static int htc_get_usbid(void)
{
	int usbid_gpio;
	if (of_board_is_a11ul() && of_machine_pcbid() < XF)
		usbid_gpio = HTC_8916_USB1_HS_ID_GPIO;
	else
		usbid_gpio = HTC_8916_USB1_HS_ID_GPIO_XF;
	pr_debug("%s: pcbid=%d, usbid_gpio=%d\n", __func__, of_machine_pcbid(), usbid_gpio);
	return usbid_gpio;
}
void __init htc_8226_init(void)
{
	struct of_dev_auxdata *adata = htc_8226_auxdata_lookup;
	printk(KERN_INFO"[htc_8226_init]: Test to see htc_8226_init()\n");

	if (socinfo_init() < 0)
		pr_err("%s: socinfo_init() failed\n", __func__);

	pr_info("%s: pid=%d, pcbid=%d, socver=0x%x\n", __func__
		, of_machine_pid(), of_machine_pcbid(), of_machine_socver());

#ifdef CONFIG_BT
	bt_export_bd_address();
#endif
	msm8226_htc_init_gpiomux();
	board_dt_populate(adata);
	htc_8226_add_drivers();
#ifdef CONFIG_HTC_BUILD_EDIAG
	platform_device_register(&android_pmem_ediag_device);
	platform_device_register(&android_pmem_ediag1_device);
	platform_device_register(&android_pmem_ediag2_device);
	platform_device_register(&android_pmem_ediag3_device);
#endif
#ifdef CONFIG_PERFLOCK
	platform_device_register(&msm8226_device_perf_lock);
#endif
#ifdef CONFIG_HTC_POWER_DEBUG
	htc_monitor_init();
#endif
}
void __init htc_8974_init(void)
{
	struct of_dev_auxdata *adata = htc_8974_auxdata_lookup;

	if (socinfo_init() < 0)
		pr_err("%s: socinfo_init() failed\n", __func__);

	pr_info("%s: pid=%d, pcbid=%d, socver=0x%x\n", __func__
		, of_machine_pid(), of_machine_pcbid(), of_machine_socver());

	msm_htc_8974_init_gpiomux();
	regulator_has_full_constraints();
	board_dt_populate(adata);
	htc_8974_add_drivers();
#ifdef CONFIG_HTC_BUILD_EDIAG
	platform_device_register(&android_pmem_ediag_device);
	platform_device_register(&android_pmem_ediag1_device);
	platform_device_register(&android_pmem_ediag2_device);
	platform_device_register(&android_pmem_ediag3_device);
#endif
#ifdef CONFIG_BT
	bt_export_bd_address();
#endif
#ifdef CONFIG_HTC_POWER_DEBUG
	htc_monitor_init();
#endif
}
static void __init htc_8916_init(void)
{
	struct of_dev_auxdata *adata = htc_8916_auxdata_lookup;

	of_platform_populate(NULL, of_default_bus_match_table, adata, NULL);
	msm_smem_init();

	if (socinfo_init() < 0)
		pr_err("%s: socinfo_init() failed\n", __func__);

       pr_info("%s: pid=%d, pcbid=0x%X, subtype=0x%X, socver=0x%X\n", __func__
               , of_machine_pid(), of_machine_pcbid(), of_machine_subtype(), of_machine_socver());

	htc_8916_add_drivers();

#ifdef CONFIG_HTC_POWER_DEBUG
        htc_monitor_init();
#endif

#ifdef CONFIG_BT
	bt_export_bd_address();
#endif
#ifdef CONFIG_PERFLOCK
	platform_device_register(&msm8916_device_perf_lock);
#endif
}
static int uncertain_support_dual_flashlight(void)
{
	int pid = of_machine_pid();
	int pcbid = of_machine_pcbid();
	FLT_INFO_LOG("pid=%d, pcbid=%d.\r\n", pid, pcbid);

	/*
	 * Which hardware version of sku starts to support dual flashlight
	 */

	/* m8ul: xe */
	if ( pid == 271 || pid == 272 || pid == 280 || pid == 286 )
	{
		if ( pcbid>=4 || pcbid<0 ) return 1;
		else                       return 0;
	}

	/* m8att: xe */
	if ( pid == 273 )
	{
		if ( pcbid>=4 || pcbid<0 ) return 1;
		else                       return 0;
	}

	/* m8wl: xd */
	if ( pid == 266 )
	{
		if ( pcbid>=3 || pcbid<0 ) return 1;
		else                       return 0;
	}

	/* m8ct: xb */
	if ( pid == 269 )
	{
		if ( pcbid>=1 || pcbid<0 ) return 1;
		else                       return 0;
	}

	/* m8whl: xd */
	if ( pid == 267 )
	{
		if ( pcbid>=3 || pcbid<0 ) return 1;
		else                       return 0;
	}

	/* m8tl: xb */
	if ( pid == 281 )
	{
		if ( pcbid>=1 || pcbid<0 ) return 1;
		else                       return 0;
	}

	/* default supporting dual flashlight */
	return 1;
}
static int uncertain_support_dual_flashlight(void)
{
	int pid = of_machine_pid();
	int pcbid = of_machine_pcbid();
	FLT_INFO_LOG("pid=%d, pcbid=%d.\r\n", pid, pcbid);


	
	if ( pid == 271 || pid == 272 || pid == 280 || pid == 286 )
	{
		if ( pcbid>=4 || pcbid<0 ) return 1;
		else                       return 0;
	}

	
	if ( pid == 273 )
	{
		if ( pcbid>=4 || pcbid<0 ) return 1;
		else                       return 0;
	}

	
	if ( pid == 266 )
	{
		if ( pcbid>=3 || pcbid<0 ) return 1;
		else                       return 0;
	}

	
	if ( pid == 269 )
	{
		if ( pcbid>=1 || pcbid<0 ) return 1;
		else                       return 0;
	}

	
	if ( pid == 267 )
	{
		if ( pcbid>=3 || pcbid<0 ) return 1;
		else                       return 0;
	}

	
	if ( pid == 281 )
	{
		if ( pcbid>=1 || pcbid<0 ) return 1;
		else                       return 0;
	}

	
	return 1;
}