Esempio n. 1
0
/**
 * Open File.
 *
 */
static int dsps_open(struct inode *ip, struct file *fp)
{
	int ret = 0;

	pr_debug("%s.\n", __func__);

	if (drv->ref_count == 0) {

		/* clocks must be ON before loading.*/
		ret = dsps_power_on_handler();
		if (ret)
			return ret;

		ret = dsps_load(drv->pdata->pil_name);

		if (ret) {
			dsps_power_off_handler();
			return ret;
		}

		dsps_resume();
	}
	drv->ref_count++;

	return ret;
}
Esempio n. 2
0
static int dsps_open(struct inode *ip, struct file *fp)
{
	int ret = 0;

	pr_debug("%s.\n", __func__);

	if (drv->ref_count == 0) {

		
		ret = dsps_power_on_handler();
		if (ret)
			return ret;

		ret = dsps_load();

		if (ret) {
			dsps_power_off_handler();
			return ret;
		}

		if (!drv->pdata->dsps_pwr_ctl_en)
			dsps_resume();
	}
	drv->ref_count++;

	return ret;
}
Esempio n. 3
0
/**
 *  Powerup function
 * called by the restart notifier
 *
 */
static int dsps_powerup(const struct subsys_data *subsys)
{
	pr_debug("%s\n", __func__);
	if (dsps_load(drv->pdata->pil_name) != 0) {
		pr_err("%s: fail to restart DSPS after reboot\n",
		       __func__);
		return 1;
	}
	return 0;
}