/* 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;
}
Exemple #2
0
static int mddi_get_panel_num(void)
{
	if (machine_is_msm7201a_surf())
		return 2;
	else
		return 1;
}
Exemple #3
0
static void __init halibut_init_mmc(void)
{
	if (machine_is_msm7201a_ffa()) {
		mpp_mmc = mpp_get(NULL, "mpp3");
		if (!mpp_mmc) {
			printk(KERN_ERR "%s: mpp get failed (%ld)\n",
			       __func__, PTR_ERR(vreg_mmc));
			return;
		}
	} else {
		vreg_mmc = vreg_get(NULL, "mmc");
		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, &halibut_sdcc_data);
#endif

	if (machine_is_msm7201a_surf()) {
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
		msm_add_sdcc(2, &halibut_sdcc_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
		msm_add_sdcc(4, &halibut_sdcc_data);
#endif
	}
}
Exemple #4
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;
}
/* 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;
}
static irqreturn_t ts_interrupt(int irq, void *dev_id)
{
	u32 avgs, x, y, lx, ly, x_prime, y_prime;
	u32 num_op, num_samp;
	u32 status;

	struct ts *ts = dev_id;
	status = readl(TSSC_REG(STATUS));
	avgs = readl(TSSC_REG(AVG12));
	x = avgs & 0xFFFF;
	y = avgs >> 16;

	/* For pen down make sure that the data just read is still valid.
	 * The DATA bit will still be set if the ARM9 hasn't clobbered
	 * the TSSC. If it's not set, then it doesn't need to be cleared
	 * here, so just return.
	 */
	if (!(readl(TSSC_REG(CTL)) & TSSC_CTL_DATA))
		goto out;

	/* Data has been read, OK to clear the data flag */
	writel(TSSC_CTL_STATE, TSSC_REG(CTL));
    writel(TSSC_SI_STATE, TSSC_REG(SI));

	/* Valid samples are indicated by the sample number in the status
	 * register being the number of expected samples and the number of
	 * samples collected being zero (this check is due to ADC contention).
	 */
	num_op = (status & TSSC_STS_OPN_BMSK) >> TSSC_STS_OPN_SHIFT;
	num_samp = (status & TSSC_STS_NUMSAMP_BMSK) >> TSSC_STS_NUMSAMP_SHFT;

	if ((num_op == TSSC_NUMBER_OF_OPERATIONS) && (num_samp == 0)) {
		/* TSSC can do Z axis measurment, but driver doesn't support
		 * this yet.
		 */

		/*
		 * REMOVE THIS:
		 * These x, y co-ordinates adjustments will be removed once
		 * Android framework adds calibration framework.
		 */
		
		x_prime = y;
		y_prime = x;

#if defined(CONFIG_MACH_MSM7X27_SWIFT)
		lx = x_prime;
		ly = 3300 - y_prime;  /* 10bit : 827  12bit : 3300 */
#else
#ifdef CONFIG_ANDROID_TOUCHSCREEN_MSM_HACKS
		lx = ts->x_max + 25 - x;
		ly = ts->y_max + 25 - y;
		if (machine_is_msm7201a_surf()) {
			if (lx > 435) {
				/* Max out x for points lying outside hvga display */
				lx = X_MAX;
			} else {
				/* Scale x for hvga display */
				if (lx < 250)
					lx = lx * 2 - 55;
				else if (lx > 250 && lx < 260)
					lx = lx * 2;
				else
					lx = lx * 2 + 70;
			}
		} else {
			/* manipulate x,y co-ordinates for ffa */
			if (lx > 700 || ly > 820) {
				/* Max out x for points lying outside hvga display */
				lx = X_MAX;
				ly = Y_MAX;
			} else {
				if (ly < 700 && ly > 280) {
					lx = lx * 2 - 250 ;
					ly = ly  + 160;
				} else if (lx > 530)
					lx = lx * 2 + 30;
				else if (ly < 280)
					ly = ly - 50;
				else
					ly = ly + 250;
			}
		}
#else
		lx = x;
		ly = y;
#endif
#endif

		if (msm_tsdebug & 1)
			printk("++++++++x=%d, y=%d++++++++\n", lx, ly);

		if ((lx  <  menu_x) && (ly > menu_y)) {
#if defined(CONFIG_MACH_MSM7X27_SWIFT_REV_1)
			if (msm_tsdebug & 1)
				printk("Menu key : x=%d, y=%d\n", lx, ly);
			
			if (ts->keypad == 0) {
				printk("input report MENU key\n");
				input_report_key(ts->input, KEY_MENU, 1);
				ts->keypad = KEY_MENU;
			}
#else
			if (msm_tsdebug & 1)
				printk("Home key : x=%d, y=%d\n", lx, ly);
			
			if (ts->keypad == 0) {
				printk("input report HOME key\n");
				input_report_key(ts->input, KEY_HOME, 1);
				ts->keypad = KEY_HOME;
			}
#endif 
		} else if ((lx > back_x) && (ly > back_y)) {
			if (msm_tsdebug & 1)
				printk("Back key : x=%d, y=%d\n", lx, ly);

			if (ts->keypad == 0) {
				printk("input report BACK key\n");
				input_report_key(ts->input, KEY_BACK, 1);
				ts->keypad = KEY_BACK;
				ts_key_event = 1;
			}	
		
		} else {
			if (PreRejectTouchCount > preRejectValue) {
				ts_update_pen_state(ts, lx, ly, 255);
			} else {
				PreRejectTouchCount++;
			}
		}
		
		/* kick pen up timer - to make sure it expires again(!) */
		mod_timer(&ts->timer, jiffies + msecs_to_jiffies(TS_PENUP_TIMEOUT_MS));

	} else
		printk(KERN_INFO "Ignored interrupt: {%3d, %3d},"
				" op = %3d samp = %3d\n",
				x, y, num_op, num_samp);

out:
		return IRQ_HANDLED;
}