#include <linux/workqueue.h>
#include <linux/sched.h>
#include <linux/vmalloc.h>
-#include <linux/regulator/consumer.h>
#include <linux/page-flags.h>
#include <linux/mm_types.h>
#include <linux/types.h>
*/
static int vpu_open(struct inode *inode, struct file *filp)
{
- struct regulator *vpu_regulator;
-
mutex_lock(&vpu_data.lock);
-
- if (open_count++ == 0) {
- vpu_regulator = regulator_get(NULL, "cpu_vddvpu");
- if (IS_ERR(vpu_regulator))
- printk(KERN_ERR
- "%s: failed to get vpu regulator\n", __func__);
- else
- regulator_enable(vpu_regulator);
- }
-
+ open_count++;
filp->private_data = (void *)(&vpu_data);
mutex_unlock(&vpu_data.lock);
return 0;
*/
static int vpu_release(struct inode *inode, struct file *filp)
{
- struct regulator *vpu_regulator;
mutex_lock(&vpu_data.lock);
if (open_count > 0 && !(--open_count)) {
-
- vpu_regulator = regulator_get(NULL, "cpu_vddvpu");
- if (IS_ERR(vpu_regulator))
- printk(KERN_ERR
- "%s: failed to get vpu regulator\n", __func__);
- else
- regulator_disable(vpu_regulator);
-
vpu_free_buffers();
/* Free shared memory when vpu device is idle */