/*[BCAST002][E]*/ int tdmb_fc8080_power_on(void) { int rc = FALSE; printk("tdmb_fc8080_power_on \n"); if ( fc8080_ctrl_info.TdmbPowerOnState == FALSE ) { wake_lock(&fc8080_ctrl_info.wake_lock); gpio_set_value(fc8080_ctrl_info.dmb_en, 0); mdelay(5); gpio_set_value(fc8080_ctrl_info.dmb_en, 1); mdelay(5); #ifdef FEATURE_DMB_USE_BUS_SCALE msm_bus_scale_client_update_request(fc8080_ctrl_info.bus_scale_client_id, 1); /* expensive call, index:1 is the <84 512 3000 152000> entry */ #endif #ifdef FEATURE_DMB_USE_XO if(fc8080_ctrl_info.clk != NULL) { rc = clk_prepare_enable(fc8080_ctrl_info.clk); if (rc) { gpio_set_value(fc8080_ctrl_info.dmb_en, 0); mdelay(5); dev_err(&fc8080_ctrl_info.spi_ptr->dev, "could not enable clock\n"); return rc; } } #endif #ifdef FEATURE_DMB_USE_PM_QOS if(pm_qos_request_active(&fc8080_ctrl_info.pm_req_list)) { pm_qos_update_request(&fc8080_ctrl_info.pm_req_list, 20); } #endif // gpio_set_value(PM8058_GPIO_PM_TO_SYS(DMB_ANT_SEL_P-1), 0); // gpio_set_value(PM8058_GPIO_PM_TO_SYS(DMB_ANT_SEL_N-1), 1); #if defined (CONFIG_MACH_MSM8926_VFP_KR)||defined(CONFIG_MACH_MSM8916_YG_SKT_KR) gpio_set_value(fc8080_ctrl_info.dmb_ant, 0); #endif mdelay(30); /* Due to X-tal stablization Time */ tdmb_fc8080_interrupt_free(); fc8080_ctrl_info.TdmbPowerOnState = TRUE; printk("tdmb_fc8080_power_on OK\n"); } else { printk("tdmb_fc8080_power_on the power already turn on \n"); } printk("tdmb_fc8080_power_on completed \n"); rc = TRUE; return rc; }
static int set_pmqos_data(struct pm_qos_request *any_qos_array, int pmqos_type, const char *buf) { int lock_id = KERNEL_RESERVED00, lock_value = 0; char *p2 = NULL; p2 = strstr(buf, "ID"); if (p2 == NULL) p2 = strstr(buf, "id"); if (p2 != NULL) lock_id = atoi(p2+2); else lock_id = KERNEL_RESERVED00; if (lock_id >= NUMBER_OF_LOCK) { pr_err("%s lock_id=%d is wrong", __FUNCTION__ ,lock_id); return -EINVAL; } if (strstr(buf, "-1")!=NULL) lock_value = -1; else lock_value = atoi(buf); printk(KERN_DEBUG "%s %s/%d id=%d value=%d\n", __FUNCTION__ , get_current()->comm ,get_current()->pid ,lock_id ,lock_value); if (lock_value == -1) { if (pm_qos_request_active(&any_qos_array[lock_id])) pm_qos_remove_request(&any_qos_array[lock_id]); } else { if (!pm_qos_request_active(&any_qos_array[lock_id])) { pm_qos_add_request(&any_qos_array[lock_id] , pmqos_type, lock_value); } else pm_qos_update_request(&any_qos_array[lock_id], lock_value); } return 0; }
static int omap_mcpdm_remove(struct snd_soc_dai *dai) { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); free_irq(mcpdm->irq, (void *)mcpdm); pm_runtime_disable(mcpdm->dev); if (pm_qos_request_active(&mcpdm->pm_qos_req)) pm_qos_remove_request(&mcpdm->pm_qos_req); return 0; }
static ssize_t store_boost_enable(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct tegra_ehci_hcd *tegra = dev_get_drvdata(dev); bool new_boost; bool old_boost = tegra->boost_enable; if (strtobool(buf, &new_boost) == 0) { tegra->boost_enable = new_boost; if (!old_boost && new_boost && tegra->boost_requested && pm_qos_request_active(&tegra->boost_cpu_freq_req)) pm_qos_update_request( &tegra->boost_cpu_freq_req, (s32)CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ * 1000); else if (old_boost && !new_boost && pm_qos_request_active(&tegra->boost_cpu_freq_req)) pm_qos_update_request(&tegra->boost_cpu_freq_req, PM_QOS_DEFAULT_VALUE); } return count; }
static void gpio_key_change_dvfs_lock(struct work_struct *work) { struct gpio_button_data *bdata = container_of(work, struct gpio_button_data, key_work_dvfs_chg.work); mutex_lock(&bdata->key_dvfs_lock); if (pm_qos_request_active(&bdata->key_mif_qos)) { pm_qos_update_request(&bdata->key_mif_qos, 400000); /* MIF 400MHz */ printk(KERN_DEBUG "[key] change_mif_dvfs_lock"); } mutex_unlock(&bdata->key_dvfs_lock); }
void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, s32 value) { if (!req) /*guard against callers passing in null */ return; if (pm_qos_request_active(req)) { WARN(1, KERN_ERR "pm_qos_add_request() called for already added request\n"); return; } req->pm_qos_class = pm_qos_class; INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, &req->node, PM_QOS_ADD_REQ, value); }
void cpufreq_release_all_cpu_lock(int lock_type) { int i =0; for(i=0; i<NUMBER_OF_LOCK; i++) { if (lock_type == TRM_CPU_MIN_FREQ_TYPE) { if (cpufreq_pm_qos_lock[i].min_value > 0) { if (pm_qos_request_active(&cpufreq_min_qos_array[i])) { cpufreq_pm_qos_lock[i].min_value = -1; pm_qos_remove_request(&cpufreq_min_qos_array[i]); pr_info("%s min id[%d] released forcibly\n", __FUNCTION__, i); } } } else if (lock_type == TRM_CPU_MAX_FREQ_TYPE) { if (cpufreq_pm_qos_lock[i].max_value > 0) { if (pm_qos_request_active(&cpufreq_max_qos_array[i])) { cpufreq_pm_qos_lock[i].max_value = -1; pm_qos_remove_request(&cpufreq_max_qos_array[i]); pr_info("%s max id[%d] released forcibly\n", __FUNCTION__, i); } } } } }
int tdmb_fc8050_power_on(void) { int rc; printk("tdmb_fc8050_power_on \n"); if ( fc8050_ctrl_info.TdmbPowerOnState == FALSE ) { rc = msm_xo_mode_vote(xo_handle_tdmb, MSM_XO_MODE_ON); if(rc < 0) { pr_err("Configuring MSM_XO_MODE_ON failed (%d)\n", rc); msm_xo_put(xo_handle_tdmb); return FALSE; } if(pm_qos_request_active(&fc8050_ctrl_info.pm_req_list)) { pm_qos_update_request(&fc8050_ctrl_info.pm_req_list, 20); } wake_lock(&fc8050_ctrl_info.wake_lock); gpio_set_value_cansleep(DMB_ANT_SEL_P_EAR, 0); gpio_set_value_cansleep(DMB_ANT_SEL_N_INNER, 1); gpio_set_value(DMB_EN, 0); gpio_set_value(DMB_RESET_N, 1); udelay(100); gpio_set_value(DMB_EN, 1); udelay(1000); /* Due to X-tal stablization Time */ gpio_set_value(DMB_RESET_N, 0); udelay(100); gpio_set_value(DMB_RESET_N, 1); tdmb_fc8050_interrupt_free(); fc8050_ctrl_info.TdmbPowerOnState = TRUE; printk("tdmb_fc8050_power_on OK\n"); } else { printk("tdmb_fc8050_power_on the power already turn on \n"); } printk("tdmb_fc8050_power_on completed \n"); return TRUE; }
/** * pm_qos_update_request - modifies an existing qos request * @req : handle to list element holding a pm_qos request to use * @value: defines the qos request * * Updates an existing qos request for the pm_qos_class of parameters along * with updating the target pm_qos_class value. * * Attempts are made to make this code callable on hot code paths. */ void pm_qos_update_request(struct pm_qos_request *req, s32 new_value) { if (!req) /*guard against callers passing in null */ return; if (!pm_qos_request_active(req)) { WARN(1, KERN_ERR "pm_qos_update_request() called for unknown object\n"); return; } if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work); __pm_qos_update_request(req, new_value); }
void midas_tsp_request_qos(void *data) { if (!work_pending(&flex_work)) schedule_work_on(0, &flex_work); /* Guarantee that the bus runs at >= 266MHz */ if (!pm_qos_request_active(&busfreq_qos)) pm_qos_add_request(&busfreq_qos, PM_QOS_BUS_DMA_THROUGHPUT, 266000); else { cancel_delayed_work_sync(&busqos_work); pm_qos_update_request(&busfreq_qos, 266000); } /* Cancel the QoS request after 1/10 sec */ schedule_delayed_work_on(0, &busqos_work, HZ / 5); }
static int fimc_is_isp_video_close(struct file *file) { int ret = 0; struct fimc_is_video *video = NULL; struct fimc_is_video_ctx *vctx = NULL; struct fimc_is_device_ischain *device = NULL; BUG_ON(!file); vctx = file->private_data; if (!vctx) { err("vctx is NULL"); ret = -EINVAL; goto p_err; } video = vctx->video; if (!video) { err("video is NULL"); ret = -EINVAL; goto p_err; } info("[ISP:V:%d] %s\n", video->id, __func__); device = vctx->device; if (!device) { err("device is NULL"); ret = -EINVAL; goto p_err; } if (pm_qos_request_active(&device->user_qos)) pm_qos_remove_request(&device->user_qos); fimc_is_ischain_close(device, vctx); fimc_is_video_close(vctx); ret = close_vctx(file, video, vctx); if (ret < 0) err("close_vctx is fail(%d)", ret); p_err: return ret; }
int tdmb_fc8050_power_on(void) { printk("tdmb_fc8050_power_on \n"); if ( fc8050_ctrl_info.TdmbPowerOnState == FALSE ) { #ifdef PM_QOS /* QOS */ if(pm_qos_request_active(&fc8050_ctrl_info.pm_req_list)) { pm_qos_update_request(&fc8050_ctrl_info.pm_req_list, 20); } #endif /* PM_QOS */ wake_lock(&fc8050_ctrl_info.wake_lock); #ifdef ANTENNA_SWITCHING gpio_set_value_cansleep(DMB_ANT_SEL_P, 0); gpio_set_value_cansleep(DMB_ANT_SEL_N, 1); #endif /* ANTENNA_SWITCHING */ gpio_direction_input(DMB_INT_N); // gpio_direction_output(DMB_RESET_N, false); // gpio_direction_output(DMB_EN, true); gpio_set_value(DMB_EN, 1); gpio_set_value(DMB_RESET_N, 1); udelay(1000); udelay(1000); udelay(1000); gpio_set_value(DMB_RESET_N, 0); udelay(5); gpio_set_value(DMB_RESET_N, 1); tdmb_fc8050_interrupt_free(); fc8050_ctrl_info.TdmbPowerOnState = TRUE; printk("tdmb_fc8050_power_on OK\n"); } else { printk("tdmb_fc8050_power_on the power already turn on \n"); } printk("tdmb_fc8050_power_on completed \n"); return TRUE; }
static ssize_t pm_qos_power_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos) { s32 value; unsigned long flags; struct pm_qos_request *req = filp->private_data; if (!req) return -EINVAL; if (!pm_qos_request_active(req)) return -EINVAL; spin_lock_irqsave(&pm_qos_lock, flags); value = pm_qos_get_value(pm_qos_array[req->pm_qos_class]->constraints); spin_unlock_irqrestore(&pm_qos_lock, flags); return simple_read_from_buffer(buf, count, f_pos, &value, sizeof(s32)); }
/** * pm_qos_update_request_timeout - modifies an existing qos request temporarily. * @req : handle to list element holding a pm_qos request to use * @new_value: defines the temporal qos request * @timeout_us: the effective duration of this qos request in usecs. * * After timeout_us, this qos request is cancelled automatically. */ void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value, unsigned long timeout_us) { if (!req) return; if (WARN(!pm_qos_request_active(req), "%s called for unknown object.", __func__)) return; if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work); if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value); schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us)); }
/** * pm_qos_update_request - modifies an existing qos request * @req : handle to list element holding a pm_qos request to use * @value: defines the qos request * * Updates an existing qos request for the pm_qos_class of parameters along * with updating the target pm_qos_class value. * * Attempts are made to make this code callable on hot code paths. */ void pm_qos_update_request(struct pm_qos_request *req, s32 new_value) { if (!req) /*guard against callers passing in null */ return; if (!pm_qos_request_active(req)) { WARN(1, KERN_ERR "pm_qos_update_request() called for unknown object\n"); return; } if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work); if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value); }
/** * pm_qos_remove_request - modifies an existing qos request * @req: handle to request list element * * Will remove pm qos request from the list of constraints and * recompute the current target value for the pm_qos_class. Call this * on slow code paths. */ void pm_qos_remove_request(struct pm_qos_request *req) { if (!req) /*guard against callers passing in null */ return; /* silent return to keep pcm code cleaner */ if (!pm_qos_request_active(req)) { WARN(1, KERN_ERR "pm_qos_remove_request() called for unknown object\n"); return; } if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work); pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); memset(req, 0, sizeof(*req)); }
int tdmb_fc8080_power_off(void) { if ( fc8080_ctrl_info.TdmbPowerOnState == TRUE ) { tdmb_fc8080_interrupt_lock(); #ifdef FEATURE_DMB_USE_XO if(fc8080_ctrl_info.clk != NULL) { clk_disable_unprepare(fc8080_ctrl_info.clk); } #endif fc8080_ctrl_info.TdmbPowerOnState = FALSE; gpio_set_value(fc8080_ctrl_info.dmb_en, 0); wake_unlock(&fc8080_ctrl_info.wake_lock); mdelay(20); // gpio_set_value(PM8058_GPIO_PM_TO_SYS(DMB_ANT_SEL_P-1), 1); // for ESD TEST // gpio_set_value(PM8058_GPIO_PM_TO_SYS(DMB_ANT_SEL_N-1), 0); #ifdef CONFIG_MACH_MSM8926_VFP_KR gpio_set_value(fc8080_ctrl_info.dmb_ant, 1); #endif #ifdef FEATURE_DMB_USE_BUS_SCALE msm_bus_scale_client_update_request(fc8080_ctrl_info.bus_scale_client_id, 0); /* expensive call, index:0 is the <84 512 0 0> entry */ #endif #ifdef FEATURE_DMB_USE_PM_QOS if(pm_qos_request_active(&fc8080_ctrl_info.pm_req_list)) { pm_qos_update_request(&fc8080_ctrl_info.pm_req_list, PM_QOS_DEFAULT_VALUE); } #endif } else { printk("tdmb_fc8080_power_on the power already turn off \n"); } printk("tdmb_fc8080_power_off completed \n"); return TRUE; }
int tdmb_t3a00_power_off(void) { if ( t3a00_ctrl_info.is_power_on == TRUE ) { tdmb_t3a00_interrupt_lock(); t3a00_ctrl_info.is_power_on = FALSE; gpio_set_value(DMB_RESET_N, 0); udelay(10); gpio_set_value(DMB_EN, 0); udelay(100); /* VDD IO 1.8V Disable */ power_set_pm8941_regulator(0); udelay(200); wake_unlock(&t3a00_ctrl_info.wake_lock); #ifdef FEATURE_DMB_USE_XO if(t3a00_ctrl_info.clk != NULL) { clk_disable_unprepare(t3a00_ctrl_info.clk); } #endif #ifdef FEATURE_DMB_USE_BUS_SCALE msm_bus_scale_client_update_request(t3a00_ctrl_info.bus_scale_client_id, 0); /* expensive call, index:0 is the <84 512 0 0> entry */ #endif #ifdef FEATURE_DMB_USE_PM_QOS if(pm_qos_request_active(&t3a00_ctrl_info.pm_req_list)) { pm_qos_update_request(&t3a00_ctrl_info.pm_req_list, PM_QOS_DEFAULT_VALUE); } #endif } else { printk("tdmb_t3a00_power_on the power already turn off \n"); } printk("tdmb_t3a00_power_off completed \n"); return TRUE; }
int tdmb_lg2102_power_on(void) { printk("lg2102_ctrl_info.TdmbPowerOnState = (%d)\n", lg2102_ctrl_info.TdmbPowerOnState); if ( lg2102_ctrl_info.TdmbPowerOnState == FALSE ) { /* Qos */ if(pm_qos_request_active(&lg2102_ctrl_info.pm_req_list)) { pm_qos_update_request(&lg2102_ctrl_info.pm_req_list, 20); } wake_lock(&lg2102_ctrl_info.wake_lock); gpio_direction_input(DMB_INT_N); gpio_direction_output(DMB_RESET_N, false); gpio_direction_output(DMB_EN, true); gpio_set_value(DMB_EN, 1); udelay(1000); //1ms gpio_set_value(DMB_RESET_N, 1); udelay(1000); //1ms gpio_set_value(DMB_RESET_N, 0); udelay(1000); //1ms gpio_set_value(DMB_RESET_N, 1); udelay(1000); //1ms tdmb_lg2102_interrupt_free(); lg2102_ctrl_info.TdmbPowerOnState = TRUE; } else { printk("tdmb_lg2102_power_on the power already turn on \n"); } printk("tdmb_lg2102_power_on completed \n"); return TRUE; }
static int msm_v4l2_close(struct file *filp) { int rc = 0; struct msm_vidc_inst *vidc_inst; vidc_inst = get_vidc_inst(filp, NULL); rc = msm_vidc_release_buffers(vidc_inst, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); if (rc) dprintk(VIDC_WARN, "Failed in %s for release output buffers\n", __func__); if (pm_qos_request_active(&vidc_inst->pm_qos)) { dprintk(VIDC_DBG, "pm_qos_update and remove\n"); pm_qos_update_request(&vidc_inst->pm_qos, PM_QOS_DEFAULT_VALUE); pm_qos_remove_request(&vidc_inst->pm_qos); } rc = msm_vidc_close(vidc_inst); return rc; }
static int tegra_ehci_bus_resume(struct usb_hcd *hcd) { struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); int err = 0; EHCI_DBG("%s() BEGIN\n", __func__); #ifdef CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ tegra->boost_requested = true; if (pm_qos_request_active(&tegra->boost_cpu_freq_req) && tegra->boost_enable) { schedule_delayed_work(&tegra->boost_cpu_freq_work, 4000); tegra->cpu_boost_in_work = true; } #endif mutex_lock(&tegra->sync_lock); usb_phy_set_suspend(get_usb_phy(tegra->phy), 0); err = ehci_bus_resume(hcd); mutex_unlock(&tegra->sync_lock); EHCI_DBG("%s() END\n", __func__); return err; }
int tdmb_t3a00_power_on(void) { #ifdef FEATURE_DMB_USE_XO int rc = FALSE; #endif printk("tdmb_t3a00_power_on \n"); if ( t3a00_ctrl_info.is_power_on == FALSE ) { #ifdef FEATURE_DMB_USE_BUS_SCALE msm_bus_scale_client_update_request(t3a00_ctrl_info.bus_scale_client_id, 1); /* expensive call, index:1 is the <84 512 3000 152000> entry */ #endif #ifdef FEATURE_DMB_USE_XO//³»ºÎŬ¶ô if(t3a00_ctrl_info.clk != NULL) { rc = clk_prepare_enable(t3a00_ctrl_info.clk); if (rc) { dev_err(&t3a00_ctrl_info.spi_ptr->dev, "could not enable clock\n"); return rc; } } #endif #ifdef FEATURE_DMB_USE_PM_QOS if(pm_qos_request_active(&t3a00_ctrl_info.pm_req_list)) { pm_qos_update_request(&t3a00_ctrl_info.pm_req_list, 20); } #endif wake_lock(&t3a00_ctrl_info.wake_lock); /* t3a00 Power On Sequence */ /* PMU Enable and RESET Pin Low */ gpio_set_value(DMB_EN, 0); gpio_set_value(DMB_RESET_N, 0); udelay(500); /* VDD IO 1.8V Enable */ power_set_pm8941_regulator(1); udelay(500); gpio_set_value(DMB_EN, 1); udelay(500); /* PMIC Clock is already on */ gpio_set_value(DMB_RESET_N, 1); udelay(500); gpio_set_value(DMB_RESET_N, 0); udelay(500); gpio_set_value(DMB_RESET_N, 1); udelay(50); tdmb_t3a00_interrupt_free(); t3a00_ctrl_info.is_power_on = TRUE; } else { printk("tdmb_t3a00_power_on the power already turn on \n"); } printk("tdmb_t3a00_power_on completed \n"); return TRUE; }