static int bcmbt_lpm_remove(struct platform_device *pdev) { if (priv_g == NULL) return 0; if (priv_g->pdata) { bcmbt_lpm_clean_bt_wake(priv_g, true); bcmbt_lpm_clean_host_wake(priv_g); if (pi_mgr_qos_request_remove(&priv_g->plpm->bt_wake_qos_node)) pr_info("%s failed to unregister " \ "qos_bw client\n", __func__); if (pi_mgr_qos_request_remove( &priv_g->plpm->host_wake_qos_node)) pr_info("%s failed to unregister" \ "qos_hw client\n", __func__); } if (priv_g != NULL) { if ((pdev->dev.of_node != NULL) && (priv_g->pdata != NULL)) { kfree(priv_g->pdata); kfree(priv_g->plpm); } kfree(priv_g); } pr_debug("%s BLUETOOTH:Exiting.\n", __func__); return 0; }
static int isp_release(struct inode *inode, struct file *filp) { struct isp_t *dev = (struct isp_t *) filp->private_data; free_irq(IRQ_ISP, dev); pi_mgr_qos_request_update(&isp_qos_node, PI_MGR_QOS_DEFAULT_VALUE); #ifndef CONFIG_ARCH_JAVA scu_standby(1); #endif disable_isp_clock(); if (pi_mgr_dfs_request_update(&isp_dfs_node, PI_MGR_DFS_MIN_VALUE)) { printk(KERN_ERR "%s: failed to update dfs request for isp\n", __func__); } pi_mgr_dfs_request_remove(&isp_dfs_node); isp_dfs_node.name = NULL; pi_mgr_qos_request_remove(&isp_qos_node); isp_qos_node.name = NULL; mutex_lock(&brcm_global_isp_lock); brcm_global_isp_in_use--; mutex_unlock(&brcm_global_isp_lock); kfree(dev); return 0; }
static int h264_release(struct inode *inode, struct file *filp) { struct h264_t *dev = (struct h264_t *) filp->private_data; /* Restore the default QOS value. Restore the minimum value for DVFS Removes the request for DFS and QOS Disables the clock. */ #ifdef H264_CLK_MGMT #ifdef H264_QOS_MGMT pi_mgr_qos_request_update(&h264_qos_node, PI_MGR_QOS_DEFAULT_VALUE); scu_standby(1); #endif disable_h264_clock(); if (pi_mgr_dfs_request_update(&h264_dfs_node, PI_MGR_DFS_MIN_VALUE)) { printk(KERN_ERR "%s: failed to update dfs request for h264\n", __func__); } pi_mgr_dfs_request_remove(&h264_dfs_node); h264_dfs_node.name = NULL; #ifdef H264_QOS_MGMT pi_mgr_qos_request_remove(&h264_qos_node); h264_qos_node.name = NULL; #endif #endif #ifdef ENABLE_H264_INT free_irq(H264_AOB_IRQ, dev); free_irq(H264_CME_IRQ, dev); free_irq(H264_MCIN_CBC_IRQ, dev); #endif kfree(dev); mutex_unlock(&h264_mutex); return 0; }
static int isp2_release(struct inode *inode, struct file *filp) { struct isp2_t *dev = (struct isp2_t *) filp->private_data; pi_mgr_qos_request_update(&isp2_qos_node, PI_MGR_QOS_DEFAULT_VALUE); disable_isp2_clock(); if (pi_mgr_dfs_request_update(&isp2_dfs_node, PI_MGR_DFS_MIN_VALUE)) { printk(KERN_ERR "%s: failed to update dfs request for isp2\n", __func__); } pi_mgr_dfs_request_remove(&isp2_dfs_node); isp2_dfs_node.name = NULL; pi_mgr_qos_request_remove(&isp2_qos_node); isp2_qos_node.name = NULL; free_irq(IRQ_ISP2, dev); kfree(dev); return 0; }
static int isp_open(struct inode *inode, struct file *filp) { int ret = 0; struct isp_t *dev = kmalloc(sizeof(struct isp_t), GFP_KERNEL); if (!dev) return -ENOMEM; filp->private_data = dev; spin_lock_init(&dev->lock); mutex_lock(&brcm_global_isp_lock); if (brcm_global_isp_in_use == 0) { brcm_global_isp_in_use++; } else { mutex_unlock(&brcm_global_isp_lock); kfree(dev); pr_err("ISP already in use"); return -EBUSY; } mutex_unlock(&brcm_global_isp_lock); dev->isp_status.status = 0; init_completion(&dev->irq_sem); ret = pi_mgr_dfs_add_request(&isp_dfs_node, "isp", PI_MGR_PI_ID_MM, PI_MGR_DFS_MIN_VALUE); if (ret) { printk(KERN_ERR "%s: failed to register PI DFS request\n", __func__); goto err; } ret = pi_mgr_qos_add_request(&isp_qos_node, "isp", PI_MGR_PI_ID_ARM_CORE, PI_MGR_QOS_DEFAULT_VALUE); if (ret) { printk(KERN_ERR "%s: failed to register PI QOS request\n", __func__); ret = -EIO; goto qos_request_fail; } enable_isp_clock(); pi_mgr_qos_request_update(&isp_qos_node, 0); #ifndef CONFIG_ARCH_JAVA scu_standby(0); #endif ret = request_irq(IRQ_ISP, isp_isr, IRQF_DISABLED | IRQF_SHARED, ISP_DEV_NAME, dev); if (ret) { err_print("request_irq failed ret = %d\n", ret); goto irq_request_fail; } /* Ensure that only one CORE handles interrupt for the MM block. */ irq_set_affinity(IRQ_ISP, cpumask_of(0)); disable_irq(IRQ_ISP); return 0; irq_request_fail: pi_mgr_qos_request_remove(&isp_qos_node); qos_request_fail: pi_mgr_dfs_request_remove(&isp_dfs_node); err: kfree(dev); return ret; }