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(); }
static int setup_power(int is_resume) { int error = 0; int i; power_init(); if (is_resume) { return 0; } /* Initialize I2C bus to configure PMIC. */ exynos_pinmux_i2c4(); i2c_init(PMIC_I2C_BUS, 1000000, 0x00); /* 1MHz */ for (i = 0; i < ARRAY_SIZE(pmic_writes); i++) { uint8_t data = 0; uint8_t reg = pmic_writes[i].reg; if (pmic_writes[i].or_orig) error |= i2c_readb(4, MAX77802_I2C_ADDR, reg, &data); data |= pmic_writes[i].val; error |= i2c_writeb(4, MAX77802_I2C_ADDR, reg, data); } return error; }
static void setup_power(int is_resume) { int error = 0; int i; power_init(); if (is_resume) { return; } /* Initialize I2C bus to configure PMIC. */ exynos_pinmux_i2c4(); i2c_init(4, I2C_4_SPEED, 0x00); printk(BIOS_DEBUG, "%s: Setting up PMIC...\n", __func__); for (i = 0; i < ARRAY_SIZE(pmic_writes); i++) { uint8_t data = 0; uint8_t reg = pmic_writes[i].reg; if (pmic_writes[i].or_orig) error |= i2c_read(4, MAX77802_I2C_ADDR, reg, sizeof(reg), &data, sizeof(data)); data |= pmic_writes[i].val; error |= i2c_write(4, MAX77802_I2C_ADDR, reg, sizeof(reg), &data, sizeof(data)); } if (error) die("Failed to intialize PMIC.\n"); }
static void gpio_init(void) { /* Set up the I2C busses. */ exynos_pinmux_i2c2(); exynos_pinmux_i2c4(); exynos_pinmux_i2c7(); exynos_pinmux_i2c8(); exynos_pinmux_i2c9(); exynos_pinmux_i2c10(); }