Exemplo n.º 1
0
static ssize_t
cpufreq_ceiling_store(struct kobject *kobj, struct kobj_attribute *attr,
		const char *buf, size_t n)
{
	int val, ret = -EINVAL;

	if (sscanf(buf, "%d", &val) > 0) {
		if (val == 11 && !is_perf_lock_active(&user_cpu_ceiling_lock)) {
			perf_lock(&user_cpu_ceiling_lock);
			ret = n;
		} else if (val == 10 && is_perf_lock_active(&user_cpu_ceiling_lock)) {
			perf_unlock(&user_cpu_ceiling_lock);
			ret = n;
		} else {
			switch (val){
			ceiling_level_wrapper(0, 1, PERF_LOCK_LOWEST);
			ceiling_level_wrapper(2, 3, PERF_LOCK_LOW);
			ceiling_level_wrapper(4, 5, PERF_LOCK_MEDIUM);
			ceiling_level_wrapper(6, 7, PERF_LOCK_HIGH);
			ceiling_level_wrapper(8, 9, PERF_LOCK_HIGHEST);
			default:
				
				break;
			}
			ret = n;
		}
	}

	return ret;
}
static int mipi_himax_lcd_off(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;

	mfd = platform_get_drvdata(pdev);
	PR_DISP_DEBUG("%s\n", __func__);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;
	mutex_lock(&cmdlock);
#if defined CONFIG_FB_MSM_SELF_REFRESH
#ifdef CONFIG_PERFLOCK
	if (!is_perf_lock_active(&himax_perf_lock))
		perf_lock(&himax_perf_lock);
#endif
#endif
	mipi_dsi_cmds_tx(&himax_tx_buf, himax_display_off_cmd1,
		ARRAY_SIZE(himax_display_off_cmd1));
	mipi_dsi_cmds_tx(&himax_tx_buf, himax_display_off_cmd2,
		ARRAY_SIZE(himax_display_off_cmd2));
#if defined CONFIG_FB_MSM_SELF_REFRESH
#ifdef CONFIG_PERFLOCK
	if (is_perf_lock_active(&himax_perf_lock))
		perf_unlock(&himax_perf_lock);
#endif
#endif
	mutex_unlock(&cmdlock);

	return 0;
}
Exemplo n.º 3
0
static inline void user_cpufreq_ceiling_lock(int level, int val)
{
	if (val == 1 && !is_perf_lock_active(&user_ceiling_lock[level]))
		perf_lock(&user_ceiling_lock[level]);
	if (val == 0 && is_perf_lock_active(&user_ceiling_lock[level]))
		perf_unlock(&user_ceiling_lock[level]);
}
Exemplo n.º 4
0
static void usbnet_unlock_perf(void)
{
	pr_info("[USBNET] %s\n", __func__);

#ifdef CONFIG_PERFLOCK
	if (is_perf_lock_active(&usbnet_perf_lock))
		perf_unlock(&usbnet_perf_lock);
#endif
	pm_qos_update_request(&usbnet_req_freq, (s32)PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE);
	pm_qos_update_request(&usbnet_req_cpus, (s32)PM_QOS_MIN_ONLINE_CPUS_DEFAULT_VALUE);

	is_usbnet_perf_locked = 0;
}
Exemplo n.º 5
0
int32_t imx081_sensor_power_down(struct msm_sensor_ctrl_t *s_ctrl)
{
	long fps = 0;
	uint16_t ll_pclk;
	uint16_t fl_lines;
	uint32_t delay = 0;
	
	CDBG("%s\n", __func__);
	s_ctrl->sensor_i2c_client->i2c_func_tbl->i2c_write(
			s_ctrl->sensor_i2c_client,
			0x0100,
			0x00, MSM_CAMERA_I2C_BYTE_DATA);
	
	s_ctrl->sensor_i2c_client->i2c_func_tbl->i2c_read(
			s_ctrl->sensor_i2c_client,
			0x342,
			&ll_pclk, MSM_CAMERA_I2C_WORD_DATA);

	s_ctrl->sensor_i2c_client->i2c_func_tbl->i2c_read(
			s_ctrl->sensor_i2c_client,
			0x340,
			&fl_lines, MSM_CAMERA_I2C_WORD_DATA);
	
	CDBG("%s ll_pclk = %d, frame fl_lines = %d\n", __func__, ll_pclk, fl_lines);

	if((ll_pclk != 0) && (fl_lines != 0)){
#if defined(CONFIG_MACH_DECKARD_AS97)
		fps = 269629630 /
			fl_lines / ll_pclk;
#else
		fps = 268800000 /
			fl_lines / ll_pclk;
#endif
		if(fps != 0)
			delay = 1000 / fps;
	}
	CDBG("%s fps = %ld, frame time = %d\n", __func__, fps, delay);
	msleep(delay);
	
	msm_sensor_power_down(s_ctrl);
	
	CDBG("%s MSM_TLMM_BASE + 0x2024 = 0x%0x\n", __func__, (unsigned int)MSM_TLMM_BASE + 0x2024);
	CDBG("%s __raw_readl = 0x%0x\n", __func__, __raw_readl(MSM_TLMM_BASE + 0x2024));
	
	__raw_writel(__raw_readl((MSM_TLMM_BASE + 0x2024)) & ~(0x01), (MSM_TLMM_BASE + 0x2024));

	perf_unlock(&imx081_perf_lock);

	return 0;
}
Exemplo n.º 6
0
static int perflock_release(struct inode *inode, struct file *file)
{
	mutex_lock(&lock);
	num--;
	printk(KERN_DEBUG "[perflock] Perflock node is closed by [%s]/[PID=%d], numbers of opened nodes = [%d].\n",
		current->comm, current->pid, num);
	if (num == 0) {
		perf_unlock(&media_perf_lock);
		printk(KERN_DEBUG "[perflock] Perflock disabled.\n");
	}
	mutex_unlock(&lock);

	return 0;
}
void shextdev_SetFlipInformation(shextdet_form_position_result_t state)
{
#ifdef FLIP_USE
#if defined(CONFIG_SENSORS_AMI602) || defined(CONFIG_SENSORS_AMI603)
	switch(state)
	{
	case SHEXTDET_FORM_POSITION_OPEN:
		AMI602_SetFlipInformation(MS_POSITION_OPEN);
		break;
	case SHEXTDET_FORM_POSITION_CLOSE:
		AMI602_SetFlipInformation(MS_POSITION_CLOSE);
		break;
	case SHEXTDET_FORM_POSITION_SWIVEL:
		AMI602_SetFlipInformation(MS_POSITION_SWIVEL);
		break;
	}
#endif	/* CONFIG_SENSORS_AMI602 */

#ifdef CONFIG_SH_YAS530
	switch(state)
	{
	case SHEXTDET_FORM_POSITION_OPEN:
		YAS530_SetShape(YAS_POSITION_OPEN);
		break;
	case SHEXTDET_FORM_POSITION_CLOSE:
		YAS530_SetShape(YAS_POSITION_CLOSE);
		break;
	}
#endif	/* CONFIG_SH_YAS530 */

#if defined( CONFIG_SHTPS_SY3000_TM1918_001 ) | defined( CONFIG_SHTPS_SY3000_TM1963_001 ) | defined( CONFIG_SHTPS_TMA3XX_TMA340_005 )
	switch(state)
	{
	case SHEXTDET_FORM_POSITION_OPEN:
		shtps_setFlipInformation(TPS_POSITION_OPEN);
		break;
	case SHEXTDET_FORM_POSITION_CLOSE:
		shtps_setFlipInformation(TPS_POSITION_CLOSE);
		break;
	}
#endif /* #if defined( CONFIG_SHTPS_SY3000_TM1918_001 ) | defined( CONFIG_SHTPS_SY3000_TM1963_001 ) | defined( CONFIG_SHTPS_TMA3XX_TMA340_005 ) */

#ifdef CONFIG_PERF_LOCK_ENABLE
		perf_lock(&flip_perf_lock);
		perf_unlock(&flip_perf_lock);
#endif	/* CONFIG_PERF_LOCK_ENABLE */

#endif	/* FLIP_USE */
}
Exemplo n.º 8
0
static ssize_t
perflock_store(struct kobject *kobj, struct kobj_attribute *attr,
		const char *buf, size_t n)
{
	int val;

	if (sscanf(buf, "%d", &val) > 0) {
		if (val == 1 && !is_perf_lock_active(&user_perf_lock))
			perf_lock(&user_perf_lock);
		if (val == 0 && is_perf_lock_active(&user_perf_lock))
			perf_unlock(&user_perf_lock);
		return n;
	}
	return -EINVAL;
}
static void himax_self_refresh_switch(int on)
{
	int vsync_timeout;
	mutex_lock(&cmdlock);

	wake_lock(&himax_idle_wake_lock);
#ifdef CONFIG_PERFLOCK
	if (!is_perf_lock_active(&himax_perf_lock))
		perf_lock(&himax_perf_lock);
#endif
	if (on) {
		mipi_set_tx_power_mode(0);
		mipi_dsi_cmds_tx(&himax_tx_buf, video_to_cmd,
			ARRAY_SIZE(video_to_cmd));
		mipi_set_tx_power_mode(1);
		disable_video_mode_clk();
	} else {
		mipi_set_tx_power_mode(0);
		enable_irq(vsync_irq);
		mipi_dsi_cmds_tx(&himax_tx_buf, cmd_to_video,
			ARRAY_SIZE(cmd_to_video));
		wait_vsync = 1;
		udelay(300);
		vsync_timeout = wait_event_timeout(himax_vsync_wait, himax_vsync_gpio ||
					gpio_get_value(28), HZ/2);
		if (vsync_timeout == 0)
			PR_DISP_DEBUG("Lost vsync!\n");
		disable_irq(vsync_irq);
		wait_vsync = 0;
		himax_vsync_gpio = 0;
		udelay(300);
		mipi_dsi_cmds_tx(&himax_tx_buf, vsync_hsync_cmds,
			ARRAY_SIZE(vsync_hsync_cmds));
		enable_video_mode_clk();
		if (vsync_timeout == 0)
			mipi_himax_panel_recover();
	}
#ifdef CONFIG_PERFLOCK
	if (is_perf_lock_active(&himax_perf_lock))
		perf_unlock(&himax_perf_lock);
#endif
	wake_unlock(&himax_idle_wake_lock);

	PR_DISP_DEBUG("[SR] %d\n", on);
	mutex_unlock(&cmdlock);
}
Exemplo n.º 10
0
static inline void user_perflock(int level, int val)
{
	mutex_lock(&user_lock_mutex);
	if (val == 1) {
		if (!is_perf_locked())
			pm_qos_update_request(&user_perf_lock_qos, SHSYS_PM_QOS_USER_PERFLOCK_LATENCY);
		if (!is_perf_lock_active(&user_perf_lock[level]))
			perf_lock(&user_perf_lock[level]);
		user_perf_lock_num[level]++;
	}
	if (val == 0) {
		if(user_perf_lock_num[level] > 0)
			user_perf_lock_num[level]--;
		if (user_perf_lock_num[level] == 0 && is_perf_lock_active(&user_perf_lock[level]))
			perf_unlock(&user_perf_lock[level]);
		if (!is_perf_locked())
			pm_qos_update_request(&user_perf_lock_qos, PM_QOS_DEFAULT_VALUE);
	}
	mutex_unlock(&user_lock_mutex);
}
static void mipi_himax_cmi_display_on(struct msm_fb_data_type *mfd)
{
	PR_DISP_DEBUG("%s+\n", __func__);

	mutex_lock(&cmdlock);
#if defined CONFIG_FB_MSM_SELF_REFRESH
#ifdef CONFIG_PERFLOCK
	if (!is_perf_lock_active(&himax_perf_lock))
		perf_lock(&himax_perf_lock);
#endif
#endif
	mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_display_on_cmds,
		ARRAY_SIZE(himax_CMI_display_on_cmds));
#if defined CONFIG_FB_MSM_SELF_REFRESH
#ifdef CONFIG_PERFLOCK
	if (is_perf_lock_active(&himax_perf_lock))
		perf_unlock(&himax_perf_lock);
#endif
#endif
	mutex_unlock(&cmdlock);
}
Exemplo n.º 12
0
void shextdev_SetFlipInformation(shextdet_form_position_result_t state)
{
#ifdef FLIP_USE
#ifdef CONFIG_SENSORS_AMI602
	switch(state)
	{
	case SHEXTDET_FORM_POSITION_OPEN:
		AMI602_SetFlipInformation(MS_POSITION_OPEN);
		break;
	case SHEXTDET_FORM_POSITION_CLOSE:
		AMI602_SetFlipInformation(MS_POSITION_CLOSE);
		break;
	case SHEXTDET_FORM_POSITION_SWIVEL:
		AMI602_SetFlipInformation(MS_POSITION_SWIVEL);
		break;
	}
#endif	/* CONFIG_SENSORS_AMI602 */

#ifdef CONFIG_SH_YAS530
	switch(state)
	{
	case SHEXTDET_FORM_POSITION_OPEN:
		YAS530_SetShape(YAS_POSITION_OPEN);
		break;
	case SHEXTDET_FORM_POSITION_CLOSE:
		YAS530_SetShape(YAS_POSITION_CLOSE);
		break;
	}
#endif	/* CONFIG_SH_YAS530 */

#ifdef CONFIG_PERF_LOCK_ENABLE
		perf_lock(&flip_perf_lock);
		perf_unlock(&flip_perf_lock);
#endif	/* CONFIG_PERF_LOCK_ENABLE */

#endif	/* FLIP_USE */
}
/* -----------------------------------------------------------------------------
//                         Common Routine Implementation
// -----------------------------------------------------------------------------
*/
static int mipi_himax_lcd_on(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	struct mipi_panel_info *mipi;
	static int turn_on_logo = 1;

	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;

	mipi  = &mfd->panel_info.mipi;

	mutex_lock(&cmdlock);
#if defined CONFIG_FB_MSM_SELF_REFRESH
#ifdef CONFIG_PERFLOCK
	if (!is_perf_lock_active(&himax_perf_lock))
		perf_lock(&himax_perf_lock);
#endif
#endif
	if (mipi->mode == DSI_VIDEO_MODE) {
		PR_DISP_DEBUG("DSI_VIDEO_MODE.%s", __func__);
		if (panel_type == PANEL_ID_VIG_CHIMEI_HX) {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_CHIMEI_HX\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_cmds,
				ARRAY_SIZE(himax_CMI_video_on_cmds));
		} else if (panel_type == PANEL_ID_VIG_CHIMEI_HX_C25) {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_CHIMEI_HX_C25\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_c25_cmds,
				ARRAY_SIZE(himax_CMI_video_on_c25_cmds));
		} else if (panel_type == PANEL_ID_VIG_CHIMEI_HX_C3) {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_CHIMEI_HX_C3\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_c3_cmds,
				ARRAY_SIZE(himax_CMI_video_on_c3_cmds));
		} else if (panel_type == PANEL_ID_VIG_SHARP_HX_C3) {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX_C3\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_c3_cmds,
				ARRAY_SIZE(himax_video_on_c3_cmds));
		} else if (panel_type == PANEL_ID_VIG_SHARP_HX_C25) {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX_C25\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_c2_cmds,
				ARRAY_SIZE(himax_video_on_c2_cmds));
		} else if (panel_type == PANEL_ID_VIG_SHARP_HX_C2) {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX_C2\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_c2_cmds,
				ARRAY_SIZE(himax_video_on_c2_cmds));
		} else {
			PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX\n");
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_cmds,
				ARRAY_SIZE(himax_video_on_cmds));
		}
		if (turn_on_logo && board_mfg_mode() == 0) {
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_show_logo_cmds,
			ARRAY_SIZE(himax_show_logo_cmds));
			turn_on_logo = 0;
		}
	} else {
		PR_DISP_DEBUG("DSI_CMD_MODE.%s", __func__);
		if (panel_type == PANEL_ID_VIG_CHIMEI_HX) {
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_cmd_on_cmds,
				ARRAY_SIZE(himax_CMI_cmd_on_cmds));
		} else {
			mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_on_cmds,
				ARRAY_SIZE(himax_cmd_on_cmds));
		}

		mipi_dsi_cmd_bta_sw_trigger();
		mipi_himax_manufacture_id();
	}
#if defined CONFIG_FB_MSM_SELF_REFRESH
#ifdef CONFIG_PERFLOCK
	if (is_perf_lock_active(&himax_perf_lock))
		perf_unlock(&himax_perf_lock);
#endif
#endif
	mutex_unlock(&cmdlock);
	return 0;
}