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

C++ regulator_bulk_disable函数代码示例

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

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



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

示例1: wm8770_probe

static int wm8770_probe(struct snd_soc_codec *codec)
{
	struct wm8770_priv *wm8770;
	int ret;

	wm8770 = snd_soc_codec_get_drvdata(codec);
	wm8770->codec = codec;

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies),
				    wm8770->supplies);
	if (ret) {
		dev_err(codec->dev, "Failed to enable supplies: %d\n", ret);
		return ret;
	}

	ret = wm8770_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
		goto err_reg_enable;
	}

	/* latch the volume update bits */
	snd_soc_update_bits(codec, WM8770_MSDIGVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_MSALGVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_VOUT1RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_VOUT2RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_VOUT3RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_VOUT4RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_DAC1RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_DAC2RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_DAC3RVOL, 0x100, 0x100);
	snd_soc_update_bits(codec, WM8770_DAC4RVOL, 0x100, 0x100);

	/* mute all DACs */
	snd_soc_update_bits(codec, WM8770_DACMUTE, 0x10, 0x10);

err_reg_enable:
	regulator_bulk_disable(ARRAY_SIZE(wm8770->supplies), wm8770->supplies);
	return ret;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:46,代码来源:wm8770.c


示例2: cs35l32_runtime_suspend

static int cs35l32_runtime_suspend(struct device *dev)
{
	struct cs35l32_private *cs35l32 = dev_get_drvdata(dev);

	regcache_cache_only(cs35l32->regmap, true);
	regcache_mark_dirty(cs35l32->regmap);

	/* Hold down reset */
	if (cs35l32->reset_gpio)
		gpiod_set_value_cansleep(cs35l32->reset_gpio, 0);

	/* remove power */
	regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies),
			       cs35l32->supplies);

	return 0;
}
开发者ID:383530895,项目名称:linux,代码行数:17,代码来源:cs35l32.c


示例3: wm8994_suspend

static int wm8994_suspend(struct device *dev)
{
	struct wm8994 *wm8994 = dev_get_drvdata(dev);
	int ret;

	/* Don't actually go through with the suspend if the CODEC is
	 * still active (eg, for audio passthrough from CP. */
	ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1);
	if (ret < 0) {
		dev_err(dev, "Failed to read power status: %d\n", ret);
	} else if (ret & WM8994_VMID_SEL_MASK) {
		dev_dbg(dev, "CODEC still active, ignoring suspend\n");
		return 0;
	}

	/* GPIO configuration state is saved here since we may be configuring
	 * the GPIO alternate functions even if we're not using the gpiolib
	 * driver for them.
	 */
	ret = wm8994_read(wm8994, WM8994_GPIO_1, WM8994_NUM_GPIO_REGS * 2,
			  &wm8994->gpio_regs);
	if (ret < 0)
		dev_err(dev, "Failed to save GPIO registers: %d\n", ret);

	/* For similar reasons we also stash the regulator states */
	ret = wm8994_read(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
			  &wm8994->ldo_regs);
	if (ret < 0)
		dev_err(dev, "Failed to save LDO registers: %d\n", ret);

	/* Explicitly put the device into reset in case regulators
	 * don't get disabled in order to ensure consistent restart.
	 */
	wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET, 0x8994);

	wm8994->suspended = true;

	ret = regulator_bulk_disable(wm8994->num_supplies,
				     wm8994->supplies);
	if (ret != 0) {
		dev_err(dev, "Failed to disable supplies: %d\n", ret);
		return ret;
	}

	return 0;
}
开发者ID:WenBinWu,项目名称:m040,代码行数:46,代码来源:wm8994-core.c


示例4: es8328_suspend

static int es8328_suspend(struct snd_soc_codec *codec)
{
	struct es8328_priv *es8328;
	int ret;

	es8328 = snd_soc_codec_get_drvdata(codec);

	clk_disable_unprepare(es8328->clk);

	ret = regulator_bulk_disable(ARRAY_SIZE(es8328->supplies),
			es8328->supplies);
	if (ret) {
		dev_err(codec->dev, "unable to disable regulators\n");
		return ret;
	}
	return 0;
}
开发者ID:EvanHa,项目名称:rbp,代码行数:17,代码来源:es8328.c


示例5: wm8741_i2c_probe

static int wm8741_i2c_probe(struct i2c_client *i2c,
			    const struct i2c_device_id *id)
{
	struct wm8741_priv *wm8741;
	int ret, i;

	wm8741 = kzalloc(sizeof(struct wm8741_priv), GFP_KERNEL);
	if (wm8741 == NULL)
		return -ENOMEM;

	for (i = 0; i < ARRAY_SIZE(wm8741->supplies); i++)
		wm8741->supplies[i].supply = wm8741_supply_names[i];

	ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8741->supplies),
				 wm8741->supplies);
	if (ret != 0) {
		dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret);
		goto err;
	}

	ret = regulator_bulk_enable(ARRAY_SIZE(wm8741->supplies),
				    wm8741->supplies);
	if (ret != 0) {
		dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);
		goto err_get;
	}

	i2c_set_clientdata(i2c, wm8741);
	wm8741->control_type = SND_SOC_I2C;

	ret =  snd_soc_register_codec(&i2c->dev,
			&soc_codec_dev_wm8741, &wm8741_dai, 1);
	if (ret < 0)
		goto err_enable;
	return ret;

err_enable:
	regulator_bulk_disable(ARRAY_SIZE(wm8741->supplies), wm8741->supplies);

err_get:
	regulator_bulk_free(ARRAY_SIZE(wm8741->supplies), wm8741->supplies);
err:
	kfree(wm8741);
	return ret;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:45,代码来源:wm8741.c


示例6: cs4270_soc_suspend

static int cs4270_soc_suspend(struct snd_soc_codec *codec)
{
	struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
	int reg, ret;

	reg = snd_soc_read(codec, CS4270_PWRCTL) | CS4270_PWRCTL_PDN_ALL;
	if (reg < 0)
		return reg;

	ret = snd_soc_write(codec, CS4270_PWRCTL, reg);
	if (ret < 0)
		return ret;

	regulator_bulk_disable(ARRAY_SIZE(cs4270->supplies),
			       cs4270->supplies);

	return 0;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:18,代码来源:cs4270.c


示例7: twl6040_remove

static int twl6040_remove(struct i2c_client *client)
{
	struct twl6040 *twl6040 = i2c_get_clientdata(client);

	if (twl6040->power_count)
		twl6040_power(twl6040, 0);

	devm_free_irq(&client->dev, twl6040->irq_ready, twl6040);
	devm_free_irq(&client->dev, twl6040->irq_th, twl6040);
	regmap_del_irq_chip(twl6040->irq, twl6040->irq_data);

	mfd_remove_devices(&client->dev);
	i2c_set_clientdata(client, NULL);

	regulator_bulk_disable(TWL6040_NUM_SUPPLIES, twl6040->supplies);

	return 0;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:18,代码来源:twl6040.c


示例8: ov7690_cam_power

static int ov7690_cam_power(int enable)
{
	struct regulator_bulk_data supplies[2];
	int num_consumers = ARRAY_SIZE(supplies);
	unsigned int gpio;
	int ret;

	pr_info("%s():%d\n", __FUNCTION__, enable);

	if (machine_is_m030()) {
		supplies[0].supply = "cam_isp_1.8v";
		supplies[1].supply = "cam_front_2.8v";
		gpio = M030_GPIO_CAMERA1_PDN;
	} else {
		supplies[0].supply = "cam_1.8v";
		supplies[1].supply = "cam1_2.8v";
		gpio = FRONT_CAM_DOWN;
	}

	ret = regulator_bulk_get(NULL, num_consumers, supplies);
	if (ret) {
		pr_err("%s():regulator_bulk_get failed\n", __func__);
		return ret;
	}

	if (enable) {
		ret = regulator_bulk_enable(num_consumers, supplies);
	}
	else {
		ret = regulator_bulk_disable(num_consumers, supplies);
	}
	if (ret) {
		pr_err("%s():regulator_bulk_%sable failed\n", __func__, enable?"en":"dis");
		goto exit_regulator;
	}

	usleep_range(5000, 5000);

exit_regulator:
	regulator_bulk_free(num_consumers, supplies);
	
	return ret;
}
开发者ID:Abioy,项目名称:meizu-mx-kernel,代码行数:43,代码来源:mx_camera.c


示例9: m5mols_sensor_power

static int m5mols_sensor_power(struct m5mols_info *info, bool enable)
{
	struct v4l2_subdev *sd = &info->sd;
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	const struct m5mols_platform_data *pdata = info->pdata;
	int ret;

	if (info->power == enable)
		return 0;

	if (enable) {
		if (info->set_power) {
			ret = info->set_power(&client->dev, 1);
			if (ret)
				return ret;
		}

		ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies);
		if (ret) {
			info->set_power(&client->dev, 0);
			return ret;
		}

		gpio_set_value(pdata->gpio_reset, !pdata->reset_polarity);
		info->power = 1;

		return ret;
	}

	ret = regulator_bulk_disable(ARRAY_SIZE(supplies), supplies);
	if (ret)
		return ret;

	if (info->set_power)
		info->set_power(&client->dev, 0);

	gpio_set_value(pdata->gpio_reset, pdata->reset_polarity);

	info->isp_ready = 0;
	info->power = 0;

	return ret;
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:43,代码来源:m5mols_core.c


示例10: cs4270_soc_suspend

static int cs4270_soc_suspend(struct platform_device *pdev, pm_message_t mesg)
{
	struct snd_soc_codec *codec = cs4270_codec;
	struct cs4270_private *cs4270 = codec->private_data;
	int reg, ret;

	reg = snd_soc_read(codec, CS4270_PWRCTL) | CS4270_PWRCTL_PDN_ALL;
	if (reg < 0)
		return reg;

	ret = snd_soc_write(codec, CS4270_PWRCTL, reg);
	if (ret < 0)
		return ret;

	regulator_bulk_disable(ARRAY_SIZE(cs4270->supplies),
			       cs4270->supplies);

	return 0;
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:19,代码来源:cs4270.c


示例11: mipi_power_control

static int mipi_power_control(struct mipi_dsim_device *dsim, unsigned int enable)
{
	int ret;

	ret = regulator_bulk_get(NULL, ARRAY_SIZE(mipi_supplies), mipi_supplies);
	if (ret) {
		pr_err("%s: failed to get regulators: %d\n", __func__, ret);
		return ret;
	}

	if (enable)
		regulator_bulk_enable(ARRAY_SIZE(mipi_supplies), mipi_supplies);
	else
		regulator_bulk_disable(ARRAY_SIZE(mipi_supplies), mipi_supplies);

	regulator_bulk_free(ARRAY_SIZE(mipi_supplies), mipi_supplies);

	return 0;
}
开发者ID:Biktorgj,项目名称:Android_b2_Kernel,代码行数:19,代码来源:board-universal5260-display.c


示例12: tas6424_i2c_remove

static int tas6424_i2c_remove(struct i2c_client *client)
{
	struct device *dev = &client->dev;
	struct tas6424_data *tas6424 = dev_get_drvdata(dev);
	int ret;

	snd_soc_unregister_codec(dev);

	cancel_delayed_work_sync(&tas6424->fault_check_work);

	ret = regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies),
				     tas6424->supplies);
	if (ret < 0) {
		dev_err(dev, "unable to disable supplies: %d\n", ret);
		return ret;
	}

	return 0;
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:19,代码来源:tas6424.c


示例13: tas6424_power_off

static int tas6424_power_off(struct snd_soc_codec *codec)
{
	struct tas6424_data *tas6424 = snd_soc_codec_get_drvdata(codec);
	int ret;

	snd_soc_write(codec, TAS6424_CH_STATE_CTRL, TAS6424_ALL_STATE_HIZ);

	regcache_cache_only(tas6424->regmap, true);
	regcache_mark_dirty(tas6424->regmap);

	ret = regulator_bulk_disable(ARRAY_SIZE(tas6424->supplies),
				     tas6424->supplies);
	if (ret < 0) {
		dev_err(codec->dev, "failed to disable supplies: %d\n", ret);
		return ret;
	}

	return 0;
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:19,代码来源:tas6424.c


示例14: arizona_dev_exit

int arizona_dev_exit(struct arizona *arizona)
{
	pm_runtime_disable(arizona->dev);

	regulator_disable(arizona->dcvdd);
	regulator_put(arizona->dcvdd);

	mfd_remove_devices(arizona->dev);
	arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona);
	arizona_free_irq(arizona, ARIZONA_IRQ_OVERCLOCKED, arizona);
	arizona_free_irq(arizona, ARIZONA_IRQ_CLKGEN_ERR, arizona);
	arizona_irq_exit(arizona);
	if (arizona->pdata.reset)
		gpio_set_value_cansleep(arizona->pdata.reset, 0);

	regulator_bulk_disable(arizona->num_core_supplies,
			       arizona->core_supplies);
	return 0;
}
开发者ID:AkyZero,项目名称:wrapfs-latest,代码行数:19,代码来源:arizona-core.c


示例15: pmu_led_off

static int pmu_led_off(struct hisi_flash_ctrl_t *flash_ctrl)
{
	struct pmu_led_private_data_t *pdata = NULL;
#if 0
	int rc=-1;
#endif

	cam_debug("%s ernter.\n", __func__);

	if (NULL == flash_ctrl) {
		cam_err("%s flash_ctrl is NULL.", __func__);
		return -1;
	}

	if (STANDBY_MODE == flash_ctrl->state.mode) {
		cam_notice("%s flash led has been powered off.", __func__);
		return 0;
	}

	if (pum_led_flash_on == true) {
		//hi6401_set_gain_for_flashlight(false);
		pum_led_flash_on = false;
	}

	mutex_lock(flash_ctrl->hisi_flash_mutex);
	pdata = (struct pmu_led_private_data_t *)flash_ctrl->pdata;
	flash_ctrl->state.mode = STANDBY_MODE;
	flash_ctrl->state.data = 0;
	pmu_led_write(LED_CTRL2, 0);
#if 0
	rc = regulator_bulk_disable(1, &pdata->led_vcc);
	if (rc) {
		cam_err("failed to enable regulators %d\n", rc);
		return rc;
	}
#endif
	boost5v_flash_led_enable(false);
	if(pdata!=NULL)
		wake_unlock(&pdata->pmu_led_wakelock);
	mutex_unlock(flash_ctrl->hisi_flash_mutex);

	return 0;
}
开发者ID:CM13-HI6210SFT,项目名称:hisi_kernel_3.10.86_hi6210sft,代码行数:43,代码来源:pmu_led.c


示例16: wm8741_probe

static int wm8741_probe(struct snd_soc_codec *codec)
{
	struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
	int ret = 0;

	ret = regulator_bulk_enable(ARRAY_SIZE(wm8741->supplies),
				    wm8741->supplies);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to enable supplies: %d\n", ret);
		goto err_get;
	}

	ret = snd_soc_codec_set_cache_io(codec, 7, 9, SND_SOC_REGMAP);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		goto err_enable;
	}

	ret = wm8741_reset(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to issue reset\n");
		goto err_enable;
	}

	/* Change some default settings - latch VU */
	snd_soc_update_bits(codec, WM8741_DACLLSB_ATTENUATION,
			    WM8741_UPDATELL, WM8741_UPDATELL);
	snd_soc_update_bits(codec, WM8741_DACLMSB_ATTENUATION,
			    WM8741_UPDATELM, WM8741_UPDATELM);
	snd_soc_update_bits(codec, WM8741_DACRLSB_ATTENUATION,
			    WM8741_UPDATERL, WM8741_UPDATERL);
	snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION,
			    WM8741_UPDATERM, WM8741_UPDATERM);

	dev_dbg(codec->dev, "Successful registration\n");
	return ret;

err_enable:
	regulator_bulk_disable(ARRAY_SIZE(wm8741->supplies), wm8741->supplies);
err_get:
	return ret;
}
开发者ID:LuweiLight,项目名称:linux-3.14.35-vbal,代码行数:42,代码来源:wm8741.c


示例17: soc_camera_power_off

int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd)
{
	int ret = 0;
	int err;

	if (ssdd->power) {
		err = ssdd->power(dev, 0);
		if (err < 0) {
			dev_err(dev,
				"Platform failed to power-off the camera.\n");
			ret = err;
		}
	}

	err = regulator_bulk_disable(ssdd->num_regulators,
				     ssdd->regulators);
	if (err < 0) {
		dev_err(dev, "Cannot disable regulators\n");
		ret = ret ? : err;
	}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:20,代码来源:soc_camera.c


示例18: wm8770_set_bias_level

static int wm8770_set_bias_level(struct snd_soc_codec *codec,
				 enum snd_soc_bias_level level)
{
	int ret;
	struct wm8770_priv *wm8770;

	wm8770 = snd_soc_codec_get_drvdata(codec);

	switch (level) {
	case SND_SOC_BIAS_ON:
		break;
	case SND_SOC_BIAS_PREPARE:
		break;
	case SND_SOC_BIAS_STANDBY:
		if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
			ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies),
						    wm8770->supplies);
			if (ret) {
				dev_err(codec->dev,
					"Failed to enable supplies: %d\n",
					ret);
				return ret;
			}

			regcache_sync(wm8770->regmap);

			/* global powerup */
			snd_soc_write(codec, WM8770_PWDNCTRL, 0);
		}
		break;
	case SND_SOC_BIAS_OFF:
		/* global powerdown */
		snd_soc_write(codec, WM8770_PWDNCTRL, 1);
		regulator_bulk_disable(ARRAY_SIZE(wm8770->supplies),
				       wm8770->supplies);
		break;
	}

	codec->dapm.bias_level = level;
	return 0;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:41,代码来源:wm8770.c


示例19: soc_camera_power_on

int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd)
{
	int ret = regulator_bulk_enable(ssdd->num_regulators,
					ssdd->regulators);
	if (ret < 0) {
		dev_err(dev, "Cannot enable regulators\n");
		return ret;
	}

	if (ssdd->power) {
		ret = ssdd->power(dev, 1);
		if (ret < 0) {
			dev_err(dev,
				"Platform failed to power-on the camera.\n");
			regulator_bulk_disable(ssdd->num_regulators,
					       ssdd->regulators);
		}
	}

	return ret;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:21,代码来源:soc_camera.c


示例20: soc_camera_power_on

int soc_camera_power_on(struct device *dev, struct soc_camera_link *icl)
{
	int ret = regulator_bulk_enable(icl->num_regulators,
					icl->regulators);
	if (ret < 0) {
		dev_err(dev, "Cannot enable regulators\n");
		return ret;
	}

	if (icl->power) {
		ret = icl->power(dev, 1);
		if (ret < 0) {
			dev_err(dev,
				"Platform failed to power-on the camera.\n");
			regulator_bulk_disable(icl->num_regulators,
					       icl->regulators);
		}
	}

	return ret;
}
开发者ID:Forzaferrarileo,项目名称:linux,代码行数:21,代码来源:soc_camera.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ regulator_bulk_enable函数代码示例发布时间:2022-05-30
下一篇:
C++ regtyp函数代码示例发布时间: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