Example #1
0
static void gpio_init(void)
{
	/* Set up the I2C busses. */
	exynos_pinmux_i2c0();
	exynos_pinmux_i2c1();
	exynos_pinmux_i2c2();
	exynos_pinmux_i2c3();
	exynos_pinmux_i2c4();
	exynos_pinmux_i2c7();

	/* Set up the GPIOs used to arbitrate for I2C bus 4. */
	gpio_set_pull(GPIO_F03, GPIO_PULL_NONE);
	gpio_set_pull(GPIO_E04, GPIO_PULL_NONE);
	gpio_direction_output(GPIO_F03, 1);
	gpio_direction_input(GPIO_E04);

	/* Set up the GPIO used to enable the audio codec. */
	gpio_set_pull(GPIO_X17, GPIO_PULL_NONE);
	gpio_set_pull(GPIO_X15, GPIO_PULL_NONE);
	gpio_direction_output(GPIO_X17, 1);
	gpio_direction_output(GPIO_X15, 1);

	/* Set up the I2S busses. */
	exynos_pinmux_i2s0();
	exynos_pinmux_i2s1();
}
Example #2
0
static void setup_power(int is_resume)
{
	int error = 0;

	power_init();

	if (is_resume) {
		return;
	}

	/* Initialize I2C bus to configure PMIC. */
	exynos_pinmux_i2c0();
	i2c_init(0, I2C_0_SPEED, 0x00);

	printk(BIOS_DEBUG, "%s: Setting up PMIC...\n", __func__);
	/*
	 * We're using CR1616 coin cell battery that is non-rechargeable
	 * battery. But, BBCHOSTEN bit of the BBAT Charger Register in
	 * MAX77686 is enabled by default for charging coin cell.
	 *
	 * Also, we cannot meet the coin cell reverse current spec. in UL
	 * standard if BBCHOSTEN bit is enabled.
	 *
	 * Disable Coin BATT Charging
	 */
	error = max77686_disable_backup_batt(PMIC_BUS);

	error |= max77686_volsetting(PMIC_BUS, PMIC_BUCK2, VDD_ARM_MV,
						REG_ENABLE, MAX77686_MV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_BUCK3, VDD_INT_UV,
						REG_ENABLE, MAX77686_UV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_BUCK1, VDD_MIF_MV,
						REG_ENABLE, MAX77686_MV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_BUCK4, VDD_G3D_MV,
						REG_ENABLE, MAX77686_MV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_LDO2, VDD_LDO2_MV,
						REG_ENABLE, MAX77686_MV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_LDO3, VDD_LDO3_MV,
						REG_ENABLE, MAX77686_MV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_LDO5, VDD_LDO5_MV,
						REG_ENABLE, MAX77686_MV);
	error |= max77686_volsetting(PMIC_BUS, PMIC_LDO10, VDD_LDO10_MV,
						REG_ENABLE, MAX77686_MV);

	error |= max77686_enable_32khz_cp(PMIC_BUS);

	if (error) {
		printk(BIOS_CRIT, "%s: PMIC error: %#x\n", __func__, error);
		die("Failed to intialize PMIC.\n");
	}
}