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

C++ pmic_get函数代码示例

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

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



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

示例1: power_init_board

/* setup board specific PMIC */
int power_init_board(void)
{
	int rc;
#ifndef CONFIG_DM_I2C
	struct pmic *p = NULL;
#endif
	if (board_is_idk()) {
		rc = power_tps62362_init(0);
		if (rc)
			goto done;
#ifndef CONFIG_DM_I2C
		p = pmic_get("TPS62362");
		if (!p || pmic_probe(p))
			goto done;
#endif
		puts("PMIC:  TPS62362\n");
	} else {
		rc = power_tps65218_init(0);
		if (rc)
			goto done;
#ifndef CONFIG_DM_I2C
		p = pmic_get("TPS65218_PMIC");
		if (!p || pmic_probe(p))
			goto done;
#endif
		puts("PMIC:  TPS65218\n");
	}
done:
	return 0;
}
开发者ID:jsarenik,项目名称:u-boot,代码行数:31,代码来源:board.c


示例2: pmic_88pm880_init

int pmic_88pm880_init(struct pmic_chip_desc *chip)
{
	struct pmic *p_base, *p_buck, *p_ldo, *p_gpadc, *p_led;

	if (!chip) {
		printf("---%s: chip is empty.\n", __func__);
		return -EINVAL;
	}

	/*------------base page setting-----------*/
	p_base = pmic_get(chip->base_name);
	if (!p_base)
		return -1;
	if (pmic_probe(p_base))
		return -1;
	pmic_88pm880_base_init(p_base);
	board_pmic_base_fixup(p_base);

	/*------------gpadc page setting -----------*/
	p_gpadc = pmic_get(chip->gpadc_name);
	if (!p_gpadc)
		return -1;
	if (pmic_probe(p_gpadc))
		return -1;
	pmic_88pm880_gpadc_init(p_gpadc);
	board_pmic_gpadc_fixup(p_gpadc);

	/*------------buck page setting -----------*/
	p_buck = pmic_get(chip->buck_name);
	if (!p_buck)
		return -1;
	if (pmic_probe(p_buck))
		return -1;
	pmic_88pm880_buck_init(p_buck);
	board_pmic_buck_fixup(p_buck);

	/*------------ldo page setting ------------*/
	p_ldo = pmic_get(chip->ldo_name);
	if (!p_ldo)
		return -1;
	if (pmic_probe(p_ldo))
		return -1;
	pmic_88pm880_ldo_init(p_ldo);
	board_pmic_ldo_fixup(p_ldo);

	/*------------led page setting ------------*/
	p_led = pmic_get(chip->led_name);
	if (!p_led)
		return -1;
	if (pmic_probe(p_led))
		return -1;
	pmic_88pm880_led_init(p_led);

	printf("PMIC init done!\n");
	return 0;
}
开发者ID:acorn-marvell,项目名称:brillo_iap140_uboot,代码行数:56,代码来源:pmic_88pm880.c


示例3: exynos_power_init

int exynos_power_init(void)
{
	struct udevice *dev;
	int ret;

	ret = pmic_get("max77686", &dev);
	if (!ret) {
		/* TODO([email protected]): Move into the clock/pmic API */
		ret = pmic_clrsetbits(dev, MAX77686_REG_PMIC_32KHZ, 0,
				MAX77686_32KHCP_EN);
		if (ret)
			return ret;
		ret = pmic_clrsetbits(dev, MAX77686_REG_PMIC_BBAT, 0,
				MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V);
		if (ret)
			return ret;
	} else {
		ret = pmic_get("s5m8767-pmic", &dev);
		/* TODO([email protected]): Use driver model to access clock */
#ifdef CONFIG_PMIC_S5M8767
		if (!ret)
			s5m8767_enable_32khz_cp(dev);
#endif
	}
	if (ret == -ENODEV)
		return 0;

	ret = regulators_enable_boot_on(false);
	if (ret)
		return ret;

	ret = exynos_set_regulator("vdd_mif", 1100000);
	if (ret)
		return ret;

	/*
	 * This would normally be 1.3V, but since we are running slowly 1.1V
	 * is enough. For spring it helps reduce CPU temperature and avoid
	 * hangs with the case open. 1.1V is minimum voltage borderline for
	 * chained bootloaders.
	 */
	ret = exynos_set_regulator("vdd_arm", 1100000);
	if (ret)
		return ret;
	ret = exynos_set_regulator("vdd_int", 1012500);
	if (ret)
		return ret;
	ret = exynos_set_regulator("vdd_g3d", 1200000);
	if (ret)
		return ret;

	return 0;
}
开发者ID:CheezeCake,项目名称:edison-u-boot,代码行数:53,代码来源:exynos5-dt.c


示例4: press_onkey_check

int press_onkey_check(struct pmic_chip_desc *chip, int bootdelay)
{
	int pressed;
	int flag = 0;
	struct pmic *p_base;

	p_base = pmic_get(chip->base_name);
	if (!p_base || pmic_probe(p_base)) {
		printf("access pmic failed...\n");
		return 0;
	}
	pressed = onkey_state(p_base);
	while (bootdelay > 0) {
		int i = 0;
		--bootdelay;
		if (pressed == 0) {
			flag = 1;
			break;
		}
		for (i = 0; i < 2; ++i)
			udelay(10000);

		pressed = onkey_state(p_base);
	}

	if (flag == 1) {
		printf("Power key is pressed by mistake.Power down device here.\n");
		pmic_pm880_powerdown(p_base);
		return 0;
	} else
		return flag;
}
开发者ID:acorn-marvell,项目名称:brillo_iap140_uboot,代码行数:32,代码来源:pmic_88pm880.c


示例5: adc_power_control

static int adc_power_control(int on)
{
	struct udevice *dev;
	int ret;
	u8 reg;

	ret = pmic_get("max8998-pmic", &dev);
	if (ret) {
		puts("Failed to get MAX8998!\n");
		return ret;
	}

	reg = pmic_reg_read(dev, MAX8998_REG_ONOFF1);
	if (on)
		reg |= MAX8998_LDO4;
	else
		reg &= ~MAX8998_LDO4;

	ret = pmic_reg_write(dev, MAX8998_REG_ONOFF1, reg);
	if (ret) {
		puts("MAX8998 LDO setting error\n");
		return -EINVAL;
	}

	return 0;
}
开发者ID:Philippe12,项目名称:u-boot-sunxi,代码行数:26,代码来源:universal.c


示例6: board_usb_init

int board_usb_init(int index, enum usb_init_type init)
{
#ifdef CONFIG_CMD_USB
	struct pmic *p_pmic;

	/* Set Ref freq 0 => 24MHz, 1 => 26MHz*/
	/* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
	if (gd->board_type == ODROID_TYPE_U3)
		gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
	else
		gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);

	/* Disconnect, Reset, Connect */
	gpio_direction_output(EXYNOS4X12_GPIO_X34, 0);
	gpio_direction_output(EXYNOS4X12_GPIO_X35, 0);
	gpio_direction_output(EXYNOS4X12_GPIO_X35, 1);
	gpio_direction_output(EXYNOS4X12_GPIO_X34, 1);

	/* Power off and on BUCK8 for LAN9730 */
	debug("LAN9730 - Turning power buck 8 OFF and ON.\n");

	p_pmic = pmic_get("MAX77686_PMIC");
	if (p_pmic && !pmic_probe(p_pmic)) {
		max77686_set_buck_voltage(p_pmic, 8, 750000);
		max77686_set_buck_voltage(p_pmic, 8, 3300000);
	}

#endif

	debug("USB_udc_probe\n");
	return s3c_udc_probe(&s5pc210_otg_data);
}
开发者ID:hoangt,项目名称:u-boot,代码行数:32,代码来源:odroid.c


示例7: power_init_board

/* setup board specific PMIC */
int power_init_board(void)
{
	struct pmic *p;
	u32 reg;
	int ret;

	power_pfuze100_init(1);
	p = pmic_get("PFUZE100");
	if (!p)
		return -EINVAL;

	ret = pmic_probe(p);
	if (ret)
		return ret;

	pmic_reg_read(p, PFUZE100_DEVICEID, &reg);
	printf("PMIC:  PFUZE100 ID=0x%02x\n", reg);

	/* Set SWBST to 5.0V and enable (for USB) */
	pmic_reg_read(p, PFUZE100_SWBSTCON1, &reg);
	reg &= ~(SWBST_MODE_MASK | SWBST_VOL_MASK);
	reg |= (SWBST_5_00V | SWBST_MODE_AUTO);
	pmic_reg_write(p, PFUZE100_SWBSTCON1, reg);

	return 0;
}
开发者ID:150balbes,项目名称:Amlogic_S905-u-boot,代码行数:27,代码来源:novena.c


示例8: power_init_board

int power_init_board(void)
{
	struct pmic *p;
	int ret;
	unsigned int reg, rev_id;

	ret = power_pfuze3000_init(I2C_PMIC);
	if (ret)
		return ret;

	p = pmic_get("PFUZE3000");
	ret = pmic_probe(p);
	if (ret)
		return ret;

	pmic_reg_read(p, PFUZE3000_DEVICEID, &reg);
	pmic_reg_read(p, PFUZE3000_REVID, &rev_id);
	printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id);

	/* disable Low Power Mode during standby mode */
	pmic_reg_read(p, PFUZE3000_LDOGCTL, &reg);
	reg |= 0x1;
	pmic_reg_write(p, PFUZE3000_LDOGCTL, reg);

	return 0;
}
开发者ID:bradbishop,项目名称:u-boot,代码行数:26,代码来源:mx7dsabresd.c


示例9: exynos_lcd_power_on

void exynos_lcd_power_on(void)
{
	struct udevice *dev;
	int ret;
	u8 reg;

	ret = pmic_get("max8998-pmic", &dev);
	if (ret) {
		puts("Failed to get MAX8998!\n");
		return;
	}

	reg = pmic_reg_read(dev, MAX8998_REG_ONOFF3);
	reg |= MAX8998_LDO17;
	ret = pmic_reg_write(dev, MAX8998_REG_ONOFF3, reg);
	if (ret) {
		puts("MAX8998 LDO setting error\n");
		return;
	}

	reg = pmic_reg_read(dev, MAX8998_REG_ONOFF2);
	reg |= MAX8998_LDO7;
	ret = pmic_reg_write(dev, MAX8998_REG_ONOFF2, reg);
	if (ret) {
		puts("MAX8998 LDO setting error\n");
		return;
	}
}
开发者ID:Philippe12,项目名称:u-boot-sunxi,代码行数:28,代码来源:universal.c


示例10: dm_test_power_pmic_io

/* Test PMIC I/O */
static int dm_test_power_pmic_io(struct unit_test_state *uts)
{
	const char *name = "sandbox_pmic";
	uint8_t out_buffer, in_buffer;
	struct udevice *dev;
	int reg_count, i;

	ut_assertok(pmic_get(name, &dev));

	reg_count = pmic_reg_count(dev);
	ut_asserteq(reg_count, SANDBOX_PMIC_REG_COUNT);

	/*
	 * Test PMIC I/O - write and read a loop counter.
	 * usually we can't write to all PMIC's registers in the real hardware,
	 * but we can to the sandbox pmic.
	 */
	for (i = 0; i < reg_count; i++) {
		out_buffer = i;
		ut_assertok(pmic_write(dev, i, &out_buffer, 1));
		ut_assertok(pmic_read(dev, i, &in_buffer, 1));
		ut_asserteq(out_buffer, in_buffer);
	}

	return 0;
}
开发者ID:0xFelix,项目名称:u-boot-edminiv2,代码行数:27,代码来源:pmic.c


示例11: power_init

static int power_init(void)
{
	struct udevice *dev;
	int ret;

	ret = pmic_get("mc34708", &dev);
	if (ret) {
		printf("%s: mc34708 not found !\n", __func__);
		return ret;
	}

	/* Set VDDGP to 1.110V for 800 MHz on SW1 */
	pmic_clrsetbits(dev, REG_SW_0, SWx_VOLT_MASK_MC34708,
			SWx_1_110V_MC34708);

	/* Set VCC as 1.30V on SW2 */
	pmic_clrsetbits(dev, REG_SW_1, SWx_VOLT_MASK_MC34708,
			SWx_1_300V_MC34708);

	/* Set global reset timer to 4s */
	pmic_clrsetbits(dev, REG_POWER_CTL2, TIMER_MASK_MC34708,
			TIMER_4S_MC34708);

	return ret;
}
开发者ID:sartura,项目名称:u-boot,代码行数:25,代码来源:kp_imx53.c


示例12: power_key_pressed

static int power_key_pressed(u32 reg)
{
	struct pmic *pmic;
	u32 status;
	u32 mask;

	pmic = pmic_get(KEY_PWR_PMIC_NAME);
	if (!pmic) {
		printf("%s: Not found\n", KEY_PWR_PMIC_NAME);
		return 0;
	}

	if (pmic_probe(pmic))
		return 0;

	if (reg == KEY_PWR_STATUS_REG)
		mask = KEY_PWR_STATUS_MASK;
	else
		mask = KEY_PWR_INTERRUPT_MASK;

	if (pmic_reg_read(pmic, reg, &status))
		return 0;

	return !!(status & mask);
}
开发者ID:Android4SAM,项目名称:u-boot-at91,代码行数:25,代码来源:misc.c


示例13: rtc_get

int rtc_get(struct rtc_time *rtc)
{
	u32 day1, day2, time;
	int tim, i = 0;
	struct pmic *p = pmic_get("FSL_PMIC");
	int ret;

	if (!p)
		return -1;
	do {
		ret = pmic_reg_read(p, REG_RTC_DAY, &day1);
		if (ret < 0)
			return -1;

		ret = pmic_reg_read(p, REG_RTC_TIME, &time);
		if (ret < 0)
			return -1;

		ret = pmic_reg_read(p, REG_RTC_DAY, &day2);
		if (ret < 0)
			return -1;

	} while (day1 != day2 && i++ < 3);

	tim = day1 * 86400 + time;

	rtc_to_tm(tim, rtc);

	rtc->tm_yday = 0;
	rtc->tm_isdst = 0;

	return 0;
}
开发者ID:0xFelix,项目名称:u-boot-edminiv2,代码行数:33,代码来源:mc13xxx-rtc.c


示例14: exynos_power_init

int exynos_power_init(void)
{
	struct udevice *dev;
	int ret;

	ret = pmic_get("max77686", &dev);
	if (!ret) {
		/* TODO([email protected]): Move into the clock/pmic API */
		ret = pmic_clrsetbits(dev, MAX77686_REG_PMIC_32KHZ, 0,
				MAX77686_32KHCP_EN);
		if (ret)
			return ret;
		ret = pmic_clrsetbits(dev, MAX77686_REG_PMIC_BBAT, 0,
				MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V);
		if (ret)
			return ret;
	} else {
		ret = pmic_get("s5m8767-pmic", &dev);
		/* TODO([email protected]): Use driver model to access clock */
#ifdef CONFIG_PMIC_S5M8767
		if (!ret)
			s5m8767_enable_32khz_cp(dev);
#endif
	}
	if (ret == -ENODEV)
		return 0;

	ret = regulators_enable_boot_on(false);
	if (ret)
		return ret;

	ret = exynos_set_regulator("vdd_mif", 1100000);
	if (ret)
		return ret;

	ret = exynos_set_regulator("vdd_arm", 1300000);
	if (ret)
		return ret;
	ret = exynos_set_regulator("vdd_int", 1012500);
	if (ret)
		return ret;
	ret = exynos_set_regulator("vdd_g3d", 1200000);
	if (ret)
		return ret;

	return 0;
}
开发者ID:Philippe12,项目名称:u-boot-sunxi,代码行数:47,代码来源:exynos5-dt.c


示例15: g_dnl_board_usb_cable_connected

int g_dnl_board_usb_cable_connected(void)
{
	struct pmic *muic = pmic_get("MAX77693_MUIC");
	if (!muic)
		return 0;

	return !!muic->chrg->chrg_type(muic);
}
开发者ID:YuchengWang,项目名称:itop-uboot-2014-10,代码行数:8,代码来源:trats2.c


示例16: usb_cable_connected

int usb_cable_connected(void)
{
	struct pmic *muic = pmic_get("MAX8997_MUIC");
	if (!muic)
		return 0;

	return !!muic->chrg->chrg_type(muic);
}
开发者ID:Bing0,项目名称:u-boot,代码行数:8,代码来源:trats.c


示例17: s5pc210_phy_control

static int s5pc210_phy_control(int on)
{
	struct udevice *dev;
	int reg, ret;

	ret = pmic_get("max8997-pmic", &dev);
	if (ret)
		return ret;

	if (on) {
		reg = pmic_reg_read(dev, MAX8997_REG_SAFEOUTCTRL);
		reg |= ENSAFEOUT1;
		ret = pmic_reg_write(dev, MAX8997_REG_SAFEOUTCTRL, reg);
		if (ret) {
			puts("MAX8997 setting error!\n");
			return ret;
		}
		reg = pmic_reg_read(dev, MAX8997_REG_LDO3CTRL);
		reg |= EN_LDO;
		ret = pmic_reg_write(dev, MAX8997_REG_LDO3CTRL, reg);
		if (ret) {
			puts("MAX8997 setting error!\n");
			return ret;
		}
		reg = pmic_reg_read(dev, MAX8997_REG_LDO8CTRL);
		reg |= EN_LDO;
		ret = pmic_reg_write(dev, MAX8997_REG_LDO8CTRL, reg);
		if (ret) {
			puts("MAX8997 setting error!\n");
			return ret;
		}
	} else {
		reg = pmic_reg_read(dev, MAX8997_REG_LDO8CTRL);
		reg &= DIS_LDO;
		ret = pmic_reg_write(dev, MAX8997_REG_LDO8CTRL, reg);
		if (ret) {
			puts("MAX8997 setting error!\n");
			return ret;
		}
		reg = pmic_reg_read(dev, MAX8997_REG_LDO3CTRL);
		reg &= DIS_LDO;
		ret = pmic_reg_write(dev, MAX8997_REG_LDO3CTRL, reg);
		if (ret) {
			puts("MAX8997 setting error!\n");
			return ret;
		}
		reg = pmic_reg_read(dev, MAX8997_REG_SAFEOUTCTRL);
		reg &= ~ENSAFEOUT1;
		ret = pmic_reg_write(dev, MAX8997_REG_SAFEOUTCTRL, reg);
		if (ret) {
			puts("MAX8997 setting error!\n");
			return ret;
		}

	}

	return 0;
}
开发者ID:axxia,项目名称:axxia_u-boot,代码行数:58,代码来源:trats.c


示例18: power_init_board

/* setup board specific PMIC */
int power_init_board(void)
{
	struct pmic *p;

	if (board_is_idk()) {
		power_tps62362_init(I2C_PMIC);
		p = pmic_get("TPS62362");
		if (p && !pmic_probe(p))
			puts("PMIC:  TPS62362\n");
	} else {
		power_tps65218_init(I2C_PMIC);
		p = pmic_get("TPS65218_PMIC");
		if (p && !pmic_probe(p))
			puts("PMIC:  TPS65218\n");
	}

	return 0;
}
开发者ID:RobertCNelson,项目名称:u-boot-boards,代码行数:19,代码来源:board.c


示例19: power_init_board

int power_init_board(void)
{
	struct pmic *p;
	int ret;
	unsigned int reg;

	ret = power_pfuze100_init(I2C_PMIC);
	if (ret)
		return ret;

	p = pmic_get("PFUZE100");
	ret = pmic_probe(p);
	if (ret)
		return ret;

	pmic_reg_read(p, PFUZE100_DEVICEID, &reg);
	printf("PMIC:  PFUZE100 ID=0x%02x\n", reg);

	/* Increase VGEN3 from 2.5 to 2.8V */
	pmic_reg_read(p, PFUZE100_VGEN3VOL, &reg);
	reg &= ~LDO_VOL_MASK;
	reg |= LDOB_2_80V;
	pmic_reg_write(p, PFUZE100_VGEN3VOL, reg);

	/* Increase VGEN5 from 2.8 to 3V */
	pmic_reg_read(p, PFUZE100_VGEN5VOL, &reg);
	reg &= ~LDO_VOL_MASK;
	reg |= LDOB_3_00V;
	pmic_reg_write(p, PFUZE100_VGEN5VOL, reg);

	/* Set SW1AB stanby volage to 0.975V */
	pmic_reg_read(p, PFUZE100_SW1ABSTBY, &reg);
	reg &= ~SW1x_STBY_MASK;
	reg |= SW1x_0_975V;
	pmic_reg_write(p, PFUZE100_SW1ABSTBY, reg);

	/* Set SW1AB/VDDARM step ramp up time from 16us to 4us/25mV */
	pmic_reg_read(p, PFUZE100_SW1ABCONF, &reg);
	reg &= ~SW1xCONF_DVSSPEED_MASK;
	reg |= SW1xCONF_DVSSPEED_4US;
	pmic_reg_write(p, PFUZE100_SW1ABCONF, reg);

	/* Set SW1C standby voltage to 0.975V */
	pmic_reg_read(p, PFUZE100_SW1CSTBY, &reg);
	reg &= ~SW1x_STBY_MASK;
	reg |= SW1x_0_975V;
	pmic_reg_write(p, PFUZE100_SW1CSTBY, reg);

	/* Set SW1C/VDDSOC step ramp up time from 16us to 4us/25mV */
	pmic_reg_read(p, PFUZE100_SW1CCONF, &reg);
	reg &= ~SW1xCONF_DVSSPEED_MASK;
	reg |= SW1xCONF_DVSSPEED_4US;
	pmic_reg_write(p, PFUZE100_SW1CCONF, reg);

	return 0;
}
开发者ID:Digilent,项目名称:u-boot-digilent,代码行数:56,代码来源:el6x.c


示例20: mipi_power

int mipi_power(void)
{
	struct pmic *p = pmic_get("MAX77686_PMIC");

	/* LDO8 VMIPI_1.0V_AP */
	s5m8767a_set_ldo_mode(p, 8, OPMODE_ON);
	/* LDO10 VMIPI_1.8V_AP */
	s5m8767a_set_ldo_mode(p, 10, OPMODE_ON);

	return 0;
}
开发者ID:YuchengWang,项目名称:itop-uboot-2014-10,代码行数:11,代码来源:trats2.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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