Пример #1
0
static int msm_fb_detect_panel(const char *name)
{
	int ret = -EPERM;

	if (machine_is_qsd8x50_ffa() || machine_is_qsd8x50a_ffa()) {
		if (!strncmp(name, "mddi_toshiba_wvga_pt", 20))
			ret = 0;
		else
			ret = -ENODEV;
	} else if ((machine_is_qsd8x50_surf() || machine_is_qsd8x50a_surf())
			&& !strcmp(name, "lcdc_external"))
		ret = 0;
	else if (0 /*machine_is_qsd8x50_grapefruit() */) {
		if (!strcmp(name, "lcdc_grapefruit_vga"))
			ret = 0;
		else
			ret = -ENODEV;
	} else if (machine_is_qsd8x50_st1()) {
		if (!strcmp(name, "lcdc_st1_wxga"))
			ret = 0;
		else
			ret = -ENODEV;
	} else if (machine_is_qsd8x50a_st1_5()) {
		if (!strcmp(name, "lcdc_st15") ||
		    !strcmp(name, "hdmi_sii9022"))
			ret = 0;
		else
			ret = -ENODEV;
	}

	return ret;
}
Пример #2
0
static void __init qsd8x50_cfg_smc91x(void)
{
	int rc = 0;

	if (machine_is_qsd8x50_surf()) {
		smc91x_resources[0].start = 0x70000300;
		smc91x_resources[0].end = 0x70000400;
		smc91x_resources[1].start = MSM_GPIO_TO_INT(156);
		smc91x_resources[1].end = MSM_GPIO_TO_INT(156);
	}
	else if (machine_is_qsd8x50_ffa()) {
		smc91x_resources[0].start = 0x84000300;
		smc91x_resources[0].end = 0x84000400;
		smc91x_resources[1].start = MSM_GPIO_TO_INT(87);
		smc91x_resources[1].end = MSM_GPIO_TO_INT(87);

		rc = gpio_tlmm_config(GPIO_CFG(87, 0, GPIO_INPUT,
					       GPIO_PULL_DOWN, GPIO_2MA),
					       GPIO_ENABLE);
		if (rc) {
			printk(KERN_ERR "%s: gpio_tlmm_config=%d\n",
					__func__, rc);
		}
	}
	else printk(KERN_ERR "%s: running on invalid machine type\n", __func__);
}
/* rpc connect for charging */
int msm_chg_rpc_connect(void)
{
	uint32_t chg_vers;

	if (machine_is_msm7201a_surf() || machine_is_msm7x27_surf() ||
	    machine_is_qsd8x50_surf() || machine_is_msm7x25_surf() ||
	    machine_is_qsd8x50a_surf())
		return -ENOTSUPP;

	if (chg_ep && !IS_ERR(chg_ep)) {
		printk(KERN_INFO "%s: chg_ep already connected\n", __func__);
		return 0;
	}

	chg_vers = 0x00020001;
	if (!msm_chg_init_rpc(chg_vers))
		goto chg_found;

	chg_vers = 0x00010001;
	if (!msm_chg_init_rpc(chg_vers))
		goto chg_found;

	printk(KERN_ERR "%s: connect compatible failed \n",
			__func__);
	return -EAGAIN;

chg_found:
	printk(KERN_INFO "%s: connected to rpc vers = %x\n",
			__func__, chg_vers);
	return 0;
}
Пример #4
0
static void __init qsd8x50_init_mmc(void)
{
	if (machine_is_qsd8x50_ffa())
		vreg_mmc = vreg_get(NULL, "gp6");
	else
		vreg_mmc = vreg_get(NULL, "gp5");

	if (IS_ERR(vreg_mmc)) {
		printk(KERN_ERR "%s: vreg get failed (%ld)\n",
		       __func__, PTR_ERR(vreg_mmc));
		return;
	}

	sdcc_gpio_init();
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm_add_sdcc(1, &qsd8x50_sdcc_data);
#endif

	if (machine_is_qsd8x50_surf()) {
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
		msm_add_sdcc(2, &qsd8x50_sdcc_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
		msm_add_sdcc(3, &qsd8x50_sdcc_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
		msm_add_sdcc(4, &qsd8x50_sdcc_data);
#endif
	}

}
Пример #5
0
/* rpc connect for charging */
int msm_chg_rpc_connect(void)
{

	if (machine_is_msm7201a_surf() || machine_is_msm7x25_surf() ||
		machine_is_qst1500_surf() || machine_is_qst1600_surf()
					|| machine_is_qsd8x50_surf())
		return -ENOTSUPP;

	if (chg_ep && !IS_ERR(chg_ep)) {
		printk(KERN_INFO "%s: chg_ep already connected\n", __func__);
		return 0;
	}

	/* Initialize rpc ids */
	if (msm_chg_init_rpc_ids(0x00010001)) {
		printk(KERN_ERR "%s: rpc ids initialization failed\n"
			, __func__);
		return -ENODATA;
	}

	chg_ep = msm_rpc_connect_compatible(chg_rpc_ids.prog,
				chg_rpc_ids.vers_comp, 0);

	if (IS_ERR(chg_ep)) {
		printk(KERN_ERR "%s: connect compatible failed vers = %lx\n",
				__func__, chg_rpc_ids.vers_comp);
		return -EAGAIN;
	} else
		printk(KERN_INFO "%s: rpc connect success vers = %lx\n",
				__func__, chg_rpc_ids.vers_comp);

	return 0;
}
Пример #6
0
static int __init msm_init_smc91x(void)
{
	if (machine_is_qsd8x50_surf()) {
		smc91x_resources[0].start = qsd8x50_surf_smc91x_base;
		smc91x_resources[0].end   = qsd8x50_surf_smc91x_base + 0xff;
		smc91x_resources[1].start =
			gpio_to_irq(qsd8x50_surf_smc91x_gpio);
		smc91x_resources[1].end   =
			gpio_to_irq(qsd8x50_surf_smc91x_gpio);
		platform_device_register(&smc91x_device);
	}

	return 0;
}
Пример #7
0
/* rpc connect for charging */
int msm_chg_rpc_connect(void)
{
	uint32_t chg_vers;

#ifndef CONFIG_HUAWEI_APPS
	if (machine_is_msm7201a_surf() || machine_is_msm7x27_surf() ||
	    machine_is_qsd8x50_surf() || machine_is_msm7x25_surf() ||
	    machine_is_qsd8x50a_surf())
#else
if (machine_is_msm7201a_surf() || machine_is_msm7x27_surf() ||
	machine_is_qsd8x50_surf() || machine_is_qsd8x50a_surf() )
#endif
		return -ENOTSUPP;

	if (chg_ep && !IS_ERR(chg_ep)) {
		pr_debug("%s: chg_ep already connected\n", __func__);
		return 0;
	}

	chg_vers = 0x00020001;
	if (!msm_chg_init_rpc(chg_vers))
		goto chg_found;

	chg_vers = 0x00010001;
	if (!msm_chg_init_rpc(chg_vers))
		goto chg_found;

	pr_err("%s: connect compatible failed \n",
			__func__);
	return -EAGAIN;

chg_found:
	pr_debug("%s: connected to rpc vers = %x\n",
			__func__, chg_vers);
	return 0;
}
Пример #8
0
static int __devinit hs_rpc_init(void)
{
	int rc;

	if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa() ||
		machine_is_qsd8x50_surf() || machine_is_qsd8x50_ffa() ||
		machine_is_msm7x30_surf() || machine_is_msm7x30_ffa()) {
		rc = hs_rpc_cb_init();
		if (rc)
			pr_err("%s: failed to initialize\n", __func__);
	}

	rc = msm_rpc_create_server(&hs_rpc_server);
	if (rc < 0)
		pr_err("%s: failed to create rpc server\n", __func__);

	return 0;
}