• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ regulator_force_disable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中regulator_force_disable函数的典型用法代码示例。如果您正苦于以下问题:C++ regulator_force_disable函数的具体用法?C++ regulator_force_disable怎么用?C++ regulator_force_disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了regulator_force_disable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: muic_set_safeout

int muic_set_safeout(int safeout_path)
{
	struct regulator *regulator;
	int ret;

	pr_info("%s:MUIC safeout path=%d\n", __func__, safeout_path);

	if (safeout_path == MUIC_PATH_USB_CP) {
		regulator = regulator_get(NULL, "safeout1_range");
		if (IS_ERR(regulator) || regulator == NULL)
			return -ENODEV;

		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);

		regulator = regulator_get(NULL, "safeout2_range");
		if (IS_ERR(regulator) || regulator == NULL)
			return -ENODEV;

		if (!regulator_is_enabled(regulator)) {
			ret = regulator_enable(regulator);
			if (ret)
				goto err;
		}
		regulator_put(regulator);
	} else if (safeout_path == MUIC_PATH_USB_AP) {
		regulator = regulator_get(NULL, "safeout1_range");
		if (IS_ERR(regulator) || regulator == NULL)
			return -ENODEV;

		if (!regulator_is_enabled(regulator)) {
			ret = regulator_enable(regulator);
			if (ret)
				goto err;
		}
		regulator_put(regulator);

		regulator = regulator_get(NULL, "safeout2_range");
		if (IS_ERR(regulator) || regulator == NULL)
			return -ENODEV;

		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);
	}  else {
		pr_info("%s: not control safeout(%d)\n", __func__, safeout_path);
		return -EINVAL;
	}

	return 0;
err:
	pr_info("%s: cannot regulator_enable (%d)\n", __func__, ret);
	regulator_put(regulator);
	return ret;
}
开发者ID:djmax81,项目名称:Suemax-kernel_Exynos5433_BASIC_MM,代码行数:56,代码来源:muic-core.c


示例2: db8131m_power_down

static int db8131m_power_down(void)
{
	struct regulator *regulator;
	int ret = 0;

	pr_debug("%s: in", __func__);

	db8131m_gpio_request();

	/* VT_CAM_nSTBY(1.3M EN) DIS */
	ret = gpio_direction_output(GPIO_VT_CAM_nSTBY, 0);
	CAM_CHECK_ERR_RET(ret, "low VT_CAM_nSTBY");

	/* CAM_VT_nRST(1.3M RESET) DIS */
	ret = gpio_direction_output(GPIO_CAM_VT_nRST, 0);
	CAM_CHECK_ERR_RET(ret, "low CAM_VT_nRST");

	/* MCLK */
	ret = s3c_gpio_cfgpin(GPIO_CAM_MCLK, S3C_GPIO_INPUT);
	s3c_gpio_setpull(GPIO_CAM_MCLK, S3C_GPIO_PULL_DOWN);
	CAM_CHECK_ERR(ret, "cfg mclk");

	/* CAM_DVDD_1.5V(1.3M Core 1.8V) */
	regulator = regulator_get(NULL, "cam_dvdd_1.5v");
	if (IS_ERR(regulator))
		return -ENODEV;
	if (regulator_is_enabled(regulator))
		ret = regulator_force_disable(regulator);
	regulator_put(regulator);
	CAM_CHECK_ERR_RET(ret, "disable cam_dvdd_1.5v");

	/* CAM_SENSOR_A2.8V */
	regulator = regulator_get(NULL, "cam_sensor_a2.8v");
	if (IS_ERR(regulator))
		return -ENODEV;
	if (regulator_is_enabled(regulator))
		ret = regulator_force_disable(regulator);
	regulator_put(regulator);
	CAM_CHECK_ERR_RET(ret, "disable cam_sensor_a2.8v");

	/* VT_CAM_1.8V(VDDIO) */
	regulator = regulator_get(NULL, "vt_cam_1.8v");
	if (IS_ERR(regulator))
		return -ENODEV;
	if (regulator_is_enabled(regulator))
		ret = regulator_force_disable(regulator);
	regulator_put(regulator);
	CAM_CHECK_ERR_RET(ret, "disable vt_cam_1.8v");

	gpio_free(GPIO_VT_CAM_nSTBY);
	gpio_free(GPIO_CAM_VT_nRST);
	gpio_free(GPIO_VT_CAM_ID);

	return ret;
}
开发者ID:0x7678,项目名称:SJKernel-gn2,代码行数:55,代码来源:naples-camera.c


示例3: ts_power_off

static int ts_power_off(void)
{
	struct regulator *regulator;

	regulator = regulator_get(NULL, "touch_avdd");
	if (IS_ERR(regulator)) {
		printk(KERN_ERR "[TSP]ts_power_off : regulator_get failed\n");
		return -EIO;
	}

	if (regulator_is_enabled(regulator))
		regulator_force_disable(regulator);

	regulator_put(regulator);

	/* CAUTION : EVT1 board has CHG_INT problem
	* so it need a workaround code to ensure charging during sleep mode
	*/
	if (system_rev != 2) {
		regulator = regulator_get(NULL, "touch_vdd_1.8v");
		if (IS_ERR(regulator)) {
			printk(KERN_ERR "[TSP]ts_power_on : regulator_get failed\n");
			return -EIO;
		}

		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);

		regulator_put(regulator);
	}

	/* touch interrupt pin */
	s3c_gpio_cfgpin(GPIO_TOUCH_CHG, S3C_GPIO_INPUT);
	s3c_gpio_setpull(GPIO_TOUCH_CHG, S3C_GPIO_PULL_NONE);

	/* touch reset pin */
	s3c_gpio_cfgpin(GPIO_TOUCH_RESET, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_TOUCH_RESET, S3C_GPIO_PULL_NONE);
	gpio_set_value(GPIO_TOUCH_RESET, 0);

	/* touch xvdd en pin */
	s3c_gpio_cfgpin(GPIO_TOUCH_EN, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_TOUCH_EN, S3C_GPIO_PULL_NONE);
	gpio_set_value(GPIO_TOUCH_EN, 0);

	printk(KERN_ERR "mxt_power_off is finished\n");

	return 0;
}
开发者ID:0x7678,项目名称:SJKernel-gn2,代码行数:49,代码来源:p10-input.c


示例4: key_led_control

int key_led_control(bool on)
{
	struct regulator *regulator;

	if (tsp_keyled_enabled == on)
		return 0;

	printk(KERN_DEBUG "[TSP] %s %s\n",
		__func__, on ? "on" : "off");

	regulator = regulator_get(NULL, "vtouch_3.3v");
	if (IS_ERR(regulator))
		return PTR_ERR(regulator);

	if (on) {
		regulator_enable(regulator);
	} else {
		if (regulator_is_enabled(regulator))
			regulator_disable(regulator);
		else
			regulator_force_disable(regulator);
	}
	regulator_put(regulator);

	tsp_keyled_enabled = on;

	return 0;
}
开发者ID:arshull,项目名称:GalaTab3_KK_Kernel_T310,代码行数:28,代码来源:tab3-input.c


示例5: vreg_diag_disable

static int vreg_diag_disable(int vreg_no)
{
	printk(DIAG_LOG_06 "[%04d]:%s() start.  vreg_no = %d\n", __LINE__,
							__func__, vreg_no);
	vreg_no -= 1;
	if (!reg_store[vreg_no]) {
		reg_store[vreg_no] = regulator_get(NULL, vreg_data[vreg_no].id);
		if (IS_ERR(reg_store[vreg_no])) {
			reg_store[vreg_no] = NULL;
			printk(DIAG_LOG_01 "[%04d]:%s() ERR\n", __LINE__,
								__func__);
			return -ENODEV;
		}
	}
	if (vreg_data[vreg_no].vreg_type != PMIC_VREG_VS) {
		regulator_set_voltage(reg_store[vreg_no], 0,
						vreg_data[vreg_no].max_uV);
		regulator_force_disable(reg_store[vreg_no]);
	}
	else
		regulator_disable(reg_store[vreg_no]);

	regulator_put(reg_store[vreg_no]);
	reg_store[vreg_no] = NULL;
	reg_volt_set_check[vreg_no] = 0;
	printk(DIAG_LOG_06 "[%04d]:%s() end.\n", __LINE__, __func__);
	return 0;
}
开发者ID:PyYoshi,项目名称:android_kernel_kyocera_l03,代码行数:28,代码来源:kc_pmic_test.c


示例6: touchkey_led_power_on

static int touchkey_led_power_on(bool on)
{
#ifdef LED_LDO_WITH_REGULATOR
	struct regulator *regulator;

	if (on) {
		regulator = regulator_get(NULL, TK_LED_REGULATOR_NAME);
		if (IS_ERR(regulator)) {
			printk(KERN_ERR
			"[Touchkey] touchkey_led_power_on : TK_LED regulator_get failed\n");
			return -EIO;
		}

		regulator_enable(regulator);
		regulator_put(regulator);
	} else {
		regulator = regulator_get(NULL, TK_LED_REGULATOR_NAME);
		if (IS_ERR(regulator)) {
			printk(KERN_ERR
			"[Touchkey] touchkey_led_power_on : TK_LED regulator_get failed\n");
			return -EIO;
		}

		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);
	}
#else
	if (on)
		gpio_direction_output(GPIO_3_TOUCH_EN, 1);
	else
		gpio_direction_output(GPIO_3_TOUCH_EN, 0);
#endif
	return 1;
}
开发者ID:turter99,项目名称:android_kernel_samsung_jaltektt_perseus_4.2.2,代码行数:35,代码来源:board-universal5410-input.c


示例7: touchkey_ldo_on

int touchkey_ldo_on(bool on)
{
	struct regulator *regulator;

	if (on) {
		regulator = regulator_get(NULL, "touch");
		if (IS_ERR(regulator)){
			printk(KERN_ERR "[TouchKey] touchkey_ldo_on(1): regulator error \n");
			return 0;
		}
		regulator_enable(regulator);
		regulator_put(regulator);
	} else {
		regulator = regulator_get(NULL, "touch");
		if (IS_ERR(regulator)) {
			printk(KERN_ERR "[TouchKey] touchkey_ldo_on(0): regulator error \n");
			return 0;
		}
		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);
	}

	return 1;
}
开发者ID:myfluxi,项目名称:xxKernel,代码行数:25,代码来源:cypress-touchkey.c


示例8: usi_bm01a_power_onoff

static int usi_bm01a_power_onoff(int onoff)
{
	struct regulator* wifi_ldo = NULL;
	static int first = 1;
	  
#ifndef CONFIG_AW_AXP
	usi_msg("AXP driver is disabled, pls check !!\n");
	return 0;
#endif

	usi_msg("usi_bm01a_power_onoff\n");
	wifi_ldo = regulator_get(NULL, "axp20_pll");
	if (!wifi_ldo)
		usi_msg("Get power regulator failed\n");
	if (first) {
		usi_msg("first time\n");
		regulator_force_disable(wifi_ldo);
		first = 0;
	}
	if (onoff) {
		usi_msg("regulator on\n");
		regulator_set_voltage(wifi_ldo, 3300000, 3300000);
		regulator_enable(wifi_ldo);
	} else {
		usi_msg("regulator off\n");
		regulator_disable(wifi_ldo);
	}
	return 0;
}
开发者ID:Michael-Pizzileo,项目名称:lichee_linux-3.0,代码行数:29,代码来源:mmc_pm_usi_bm01a.c


示例9: pmic_safeout2

static void pmic_safeout2(int onoff)
{
	struct regulator *regulator;

	regulator = regulator_get(NULL, "safeout2");
	BUG_ON(IS_ERR_OR_NULL(regulator));

	if (onoff) {
		if (!regulator_is_enabled(regulator)) {
			regulator_enable(regulator);
		} else {
			pr_err("%s: onoff:%d No change in safeout2\n",
			       __func__, onoff);
		}
	} else {
		if (regulator_is_enabled(regulator)) {
			regulator_force_disable(regulator);
		} else {
			pr_err("%s: onoff:%d No change in safeout2\n",
			       __func__, onoff);
		}
	}

	regulator_put(regulator);
}
开发者ID:Ante0,项目名称:xxICSKernel,代码行数:25,代码来源:px-switch.c


示例10: ts_led_power_on

static int ts_led_power_on(bool on)
{
	struct regulator *regulator;

	if (on) {
		regulator = regulator_get(NULL, "key_led_3.3v");
		if (IS_ERR(regulator)) {
			printk(KERN_ERR "[TSP_KEY] ts_led_power_on : TK_LED regulator_get failed\n");
			return -EIO;
		}

		regulator_enable(regulator);
		regulator_put(regulator);
	} else {
		regulator = regulator_get(NULL, "key_led_3.3v");
		if (IS_ERR(regulator)) {
			printk(KERN_ERR "[TSP_KEY] ts_led_power_on : TK_LED regulator_get failed\n");
			return -EIO;
		}

		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);
	}

	printk(KERN_ERR "[TSP_KEY] %s %s\n", __func__, on ? "on" : "off");

	return 0;
}
开发者ID:CM-Tab-S,项目名称:stock_chagalllte,代码行数:29,代码来源:board-vienna-input.c


示例11: vibrator_work

static void vibrator_work(struct work_struct *_work)
{
	struct vibrator_drvdata *data =
		container_of(_work, struct vibrator_drvdata, work);

	pr_debug("[VIB] time = %dms\n", data->timeout);

	if (0 == data->timeout) {
		if (!data->running)
			return ;
		pwm_disable(data->pwm);
		i2c_max8997_hapticmotor(data, false);
		if (data->pdata->motor_en)
			data->pdata->motor_en(false);
		else
			regulator_force_disable(data->regulator);
		data->running = false;

	} else {
		if (data->running)
			return ;
		if (data->pdata->motor_en)
			data->pdata->motor_en(true);
		else
			regulator_enable(data->regulator);
		i2c_max8997_hapticmotor(data, true);
		pwm_config(data->pwm, pwm_duty, data->pdata->period);
		pr_info("[VIB] %s: pwm_config duty=%d\n", __func__, pwm_duty);
		pwm_enable(data->pwm);

		data->running = true;
	}
}
开发者ID:gadido30,项目名称:bigfatwifi,代码行数:33,代码来源:max8997_vibrator.c


示例12: wacom_power

int wacom_power(bool on)
{
#ifdef GPIO_PEN_LDO_EN
	gpio_direction_output(GPIO_PEN_LDO_EN, on);
#else
	struct regulator *regulator_vdd;

	if (wacom_power_enabled == on) {
		printk(KERN_DEBUG "epen: %s %s\n",
			__func__, on ? "on" : "off");
		return 0;
	}

	regulator_vdd = regulator_get(NULL, "wacom_3.0v");
	if (IS_ERR(regulator_vdd)) {
		printk(KERN_ERR"epen: %s reg get err\n", __func__);
		return PTR_ERR(regulator_vdd);
	}

	if (on) {
		regulator_enable(regulator_vdd);
	} else {
		if (regulator_is_enabled(regulator_vdd))
			regulator_disable(regulator_vdd);
		else
			regulator_force_disable(regulator_vdd);
	}
	regulator_put(regulator_vdd);
	printk(KERN_DEBUG "epen: %s %s\n",
		__func__, on ? "on" : "off");

	wacom_power_enabled = on;
#endif
	return 0;
}
开发者ID:davidmueller13,项目名称:universal5420-device-tree,代码行数:35,代码来源:board-n1-input.c


示例13: vibtonz_en

void vibtonz_en(bool en)
{
	struct vibrator_drvdata	*data = g_data;

	if (en) {
		if (data->running)
			return ;
		if (data->pdata->motor_en)
			data->pdata->motor_en(true);
		else
			regulator_enable(data->regulator);
		i2c_max8997_hapticmotor(data, true);
		pwm_enable(data->pwm);
		data->running = true;
	} else {
		if (!data->running)
			return ;

		pwm_disable(data->pwm);
		i2c_max8997_hapticmotor(data, false);
		if (data->pdata->motor_en)
			data->pdata->motor_en(false);
		else
			regulator_force_disable(data->regulator);
		data->running = false;
	}
}
开发者ID:gadido30,项目名称:bigfatwifi,代码行数:27,代码来源:max8997_vibrator.c


示例14: lcd_power_on

static int lcd_power_on(struct lcd_device *ld, int enable)
{
	struct regulator *regulator;

	if (ld == NULL) {
		printk(KERN_ERR "lcd device object is NULL.\n");
		return 0;
	}

	if (enable) {
		regulator = regulator_get(NULL, "vlcd_3.0v");
		if (IS_ERR(regulator))
			return 0;

		regulator_enable(regulator);
		regulator_put(regulator);
	} else {
		regulator = regulator_get(NULL, "vlcd_3.0v");

	if (IS_ERR(regulator))
		return 0;

	if (regulator_is_enabled(regulator))
		regulator_force_disable(regulator);

		regulator_put(regulator);
	}

	return 1;
}
开发者ID:Entropy512,项目名称:I9300_N8013_Changes,代码行数:30,代码来源:board-grande-lcd.c


示例15: mxt_power_off

static int mxt_power_off(void)
{
	struct regulator *regulator;

#if defined(TSP_DEBUG_LOG)
	printk(KERN_DEBUG "[TSP] %s\n", __func__);
#endif

	gpio_set_value(GPIO_TOUCH_RESET, 0);

	/* disable XVDD */
	gpio_set_value(GPIO_TOUCH_EN, 0);
	usleep_range(3000, 3000);
	gpio_set_value(GPIO_TOUCH_EN_1, 0);
	usleep_range(3000, 3000);

	/* disable I2C pullup */
	regulator = regulator_get(NULL, "tsp_vdd_1.8v");
	if (IS_ERR(regulator)) {
		printk(KERN_ERR "[TSP] %s : regulator_get failed\n",
			__func__);
		return -EIO;
	}

	if (regulator_is_enabled(regulator))
		regulator_disable(regulator);
	else
		regulator_force_disable(regulator);
	regulator_put(regulator);

	/* touch interrupt pin */
	s3c_gpio_cfgpin(GPIO_TOUCH_CHG, S3C_GPIO_INPUT);
	s3c_gpio_setpull(GPIO_TOUCH_CHG, S3C_GPIO_PULL_NONE);
	return 0;
}
开发者ID:CM-Tab-S,项目名称:stock_chagalllte,代码行数:35,代码来源:board-vienna-input.c


示例16: ts_led_power_on

static int ts_led_power_on(bool on)
{
	struct regulator *regulator;

	if (on) {
		regulator = regulator_get(NULL, "touchkey_led");
		if (IS_ERR(regulator)) {
			printk(KERN_ERR "[TSP_KEY] ts_led_power_on : TK_LED regulator_get failed\n");
			return -EIO;
		}

		regulator_enable(regulator);
		regulator_put(regulator);
	} else {
		regulator = regulator_get(NULL, "touchkey_led");
		if (IS_ERR(regulator)) {
			printk(KERN_ERR "[TSP_KEY] ts_led_power_on : TK_LED regulator_get failed\n");
			return -EIO;
		}

		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);
	}

	return 0;
}
开发者ID:turter99,项目名称:android_kernel_samsung_jaltektt_perseus_4.2.2,代码行数:27,代码来源:board-universal5410-input.c


示例17: rtl8723as_module_power

static int rtl8723as_module_power(int onoff)
{
	struct regulator* wifi_ldo = NULL;
	static int first = 1;
	int ret = 0;

	rtl8723as_msg("rtl8723as module power set by axp.\n");
	wifi_ldo = regulator_get(NULL, axp_name);
	if (!wifi_ldo) {
		rtl8723as_msg("get power regulator failed.\n");
		return -ret;
	}

	if (first) {
		rtl8723as_msg("first time\n");
		ret = regulator_force_disable(wifi_ldo);
		if (ret < 0) {
			rtl8723as_msg("regulator_force_disable fail, return %d.\n", ret);
			regulator_put(wifi_ldo);
			return ret;
		}
		regulator_put(wifi_ldo);
		first = 0;
		return ret;
	}

	if (onoff) {
		if (axp_power_on == false) {
			rtl8723as_msg("regulator on.\n");
			ret = regulator_set_voltage(wifi_ldo, 3300000, 3300000);
			if (ret < 0) {
				rtl8723as_msg("regulator_set_voltage fail, return %d.\n", ret);
			regulator_put(wifi_ldo);
				return ret;
			}

			ret = regulator_enable(wifi_ldo);
			if (ret < 0) {
				rtl8723as_msg("regulator_enable fail, return %d.\n", ret);
			regulator_put(wifi_ldo);
				return ret;
			}
			axp_power_on = true;
		}
	} else {
		if (axp_power_on == true) {
			rtl8723as_msg("regulator off.\n");
			ret = regulator_disable(wifi_ldo);
			if (ret < 0) {
				rtl8723as_msg("regulator_disable fail, return %d.\n", ret);
			regulator_put(wifi_ldo);
				return ret;
			}
			axp_power_on = false;
		}
	}
	regulator_put(wifi_ldo);
	return ret;
}
开发者ID:BPI-SINOVOIP,项目名称:BPI-M2-bsp,代码行数:59,代码来源:wifi_pm_rtl8723as.c


示例18: lcd_power_on

static int lcd_power_on(void *ld, int enable)
{
	struct regulator *regulator;
	int err;

	printk(KERN_INFO "%s : enable=%d\n", __func__, enable);

	err = gpio_request(GPIO_LCD_BL_EN, "LCD_BL_EN");
	if (err) {
		printk(KERN_ERR "failed to request GPF0[5] for "
		"LCD_BL_EN control\n");
		return -EPERM;
	}
	err = gpio_request(GPIO_MLCD_RST, "MLCD_RST");
	if (err) {
		printk(KERN_ERR "failed to request GPY4[5] for "
			"MLCD_RST control\n");
		return -EPERM;
	}

	err = gpio_request(GPIO_LCD_22V_EN_00, "LCD_EN");
	if (err) {
		printk(KERN_ERR "failed to request GPM4[4] for "
			"LCD_2.2V_EN control\n");
		return -EPERM;
	}

	if (enable) {
		gpio_set_value(GPIO_LCD_22V_EN_00, GPIO_LEVEL_HIGH);
		msleep(25);
		regulator = regulator_get(NULL, "vlcd_3.3v");
		if (IS_ERR(regulator))
			goto out;
		regulator_enable(regulator);
		regulator_put(regulator);
	gpio_set_value(GPIO_LCD_BL_EN, 1);
	} else {
		regulator = regulator_get(NULL, "vlcd_3.3v");
		if (IS_ERR(regulator))
			goto out;
		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);

		gpio_set_value(GPIO_LCD_22V_EN_00, GPIO_LEVEL_LOW);
		gpio_set_value(GPIO_MLCD_RST, 0);
		gpio_set_value(GPIO_LCD_BL_EN, 0);
	}

out:
/* Release GPIO */
	gpio_free(GPIO_MLCD_RST);
	gpio_free(GPIO_LCD_22V_EN_00);
	gpio_free(GPIO_LCD_BL_EN);
return 0;

}
开发者ID:HAXTC,项目名称:android_kernel_samsung_n7000,代码行数:57,代码来源:midas-lcd.c


示例19: a6xx_gmu_reset

int a6xx_gmu_reset(struct a6xx_gpu *a6xx_gpu)
{
	struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
	int ret;
	u32 val;

	/* Flush all the queues */
	a6xx_hfi_stop(gmu);

	/* Stop the interrupts */
	a6xx_gmu_irq_disable(gmu);

	/* Force off SPTP in case the GMU is managing it */
	a6xx_sptprac_disable(gmu);

	/* Make sure there are no outstanding RPMh votes */
	gmu_poll_timeout(gmu, REG_A6XX_RSCC_TCS0_DRV0_STATUS, val,
		(val & 1), 100, 10000);
	gmu_poll_timeout(gmu, REG_A6XX_RSCC_TCS1_DRV0_STATUS, val,
		(val & 1), 100, 10000);
	gmu_poll_timeout(gmu, REG_A6XX_RSCC_TCS2_DRV0_STATUS, val,
		(val & 1), 100, 10000);
	gmu_poll_timeout(gmu, REG_A6XX_RSCC_TCS3_DRV0_STATUS, val,
		(val & 1), 100, 1000);

	/* Force off the GX GSDC */
	regulator_force_disable(gmu->gx);

	/* Disable the resources */
	clk_bulk_disable_unprepare(gmu->nr_clocks, gmu->clocks);
	pm_runtime_put_sync(gmu->dev);

	/* Re-enable the resources */
	pm_runtime_get_sync(gmu->dev);

	/* Use a known rate to bring up the GMU */
	clk_set_rate(gmu->core_clk, 200000000);
	ret = clk_bulk_prepare_enable(gmu->nr_clocks, gmu->clocks);
	if (ret)
		goto out;

	a6xx_gmu_irq_enable(gmu);

	ret = a6xx_gmu_fw_start(gmu, GMU_RESET);
	if (!ret)
		ret = a6xx_hfi_start(gmu, GMU_COLD_BOOT);

	/* Set the GPU back to the highest power frequency */
	a6xx_gmu_set_freq(gmu, gmu->nr_gpu_freqs - 1);

out:
	if (ret)
		a6xx_gmu_clear_oob(gmu, GMU_OOB_BOOT_SLUMBER);

	return ret;
}
开发者ID:Lyude,项目名称:linux,代码行数:56,代码来源:a6xx_gmu.c


示例20: hisi_pmic_sdcard_ocp_handler

static int hisi_pmic_sdcard_ocp_handler(char *power_name)
{
    static struct regulator *power_sd = NULL;
    static struct regulator *power_sdio = NULL;
    int ret = 0;

    if (NULL == power_sd) {
        power_sd = regulator_get(NULL, SUPPLY_SD);
        if (IS_ERR(power_sd)) {
            pr_err("[%s]sd regulator found.\n", __func__);
            return ENODEV;
        }
    }
    if (IS_ERR(power_sd)) {
        pr_err("[%s]sd regulator found.\n", __func__);
        return ENODEV;
    }
    ret = regulator_force_disable(power_sd);
    if (ret) {
        pr_err("[%s]disable sd regulator error.\n", __func__);
        return ret;
    }

    if (NULL == power_sdio) {
        power_sdio = regulator_get(NULL, SUPPLY_SD_IO);
        if (IS_ERR(power_sdio)) {
            pr_err("[%s]sdio regulator found.\n", __func__);
            return ENODEV;
        }
    }
    if (IS_ERR(power_sdio)) {
            pr_err("[%s]sdio regulator found.\n", __func__);
        return ENODEV;
    }
    ret = regulator_force_disable(power_sdio);
    if (ret) {
        pr_err("[%s]disable sdio regulator error.\n", __func__);
        return ret;
    }

    return ret;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:42,代码来源:hisi_pmic_mntn.c



注:本文中的regulator_force_disable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ regulator_get_voltage函数代码示例发布时间:2022-05-30
下一篇:
C++ regulator_enable函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap