Avoid requiring board-model and probe pmic by its i2c address.
This is in preparation for being able to call pmic_setup() from SPL
and not need board type.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
}
/* setup board specific PMIC */
}
/* setup board specific PMIC */
-void setup_pmic(int board)
{
struct pmic *p;
u32 reg;
{
struct pmic *p;
u32 reg;
+ i2c_set_bus_num(CONFIG_I2C_PMIC);
+
/* configure PFUZE100 PMIC */
/* configure PFUZE100 PMIC */
- if (board == GW54xx || board == GW54proto) {
+ if (!i2c_probe(CONFIG_POWER_PFUZE100_I2C_ADDR)) {
+ debug("probed PFUZE100@0x%x\n", CONFIG_POWER_PFUZE100_I2C_ADDR);
power_pfuze100_init(CONFIG_I2C_PMIC);
p = pmic_get("PFUZE100");
if (p && !pmic_probe(p)) {
power_pfuze100_init(CONFIG_I2C_PMIC);
p = pmic_get("PFUZE100");
if (p && !pmic_probe(p)) {
}
/* configure LTC3676 PMIC */
}
/* configure LTC3676 PMIC */
+ else if (!i2c_probe(CONFIG_POWER_LTC3676_I2C_ADDR)) {
+ debug("probed LTC3676@0x%x\n", CONFIG_POWER_LTC3676_I2C_ADDR);
power_ltc3676_init(CONFIG_I2C_PMIC);
p = pmic_get("LTC3676_PMIC");
if (p && !pmic_probe(p)) {
power_ltc3676_init(CONFIG_I2C_PMIC);
p = pmic_get("LTC3676_PMIC");
if (p && !pmic_probe(p)) {
/* configure uart iomux */
void setup_iomux_uart(void);
/* conifgure PMIC */
/* configure uart iomux */
void setup_iomux_uart(void);
/* conifgure PMIC */
-void setup_pmic(int board);
/* configure gpio iomux/defaults */
void setup_iomux_gpio(int board, struct ventana_board_info *);
/* late setup of GPIO (configuration per baseboard and env) */
/* configure gpio iomux/defaults */
void setup_iomux_gpio(int board, struct ventana_board_info *);
/* late setup of GPIO (configuration per baseboard and env) */
/* setup board specific PMIC */
int power_init_board(void)
{
/* setup board specific PMIC */
int power_init_board(void)
{
- setup_pmic(board_type);