power: Add PMIC_ prefix to CHARGER_EN/DISABLE

This enum should be common across all PMICs rather than having it
independently defined with the same name in multiple places.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
master
Simon Glass 11 years ago committed by Minkyu Kang
parent 913702ca39
commit 78a36c3ef3
  1. 4
      drivers/power/battery/bat_trats.c
  2. 2
      drivers/power/battery/bat_trats2.c
  3. 2
      drivers/power/mfd/pmic_max77693.c
  4. 2
      drivers/power/pmic/pmic_max8997.c
  5. 2
      include/power/max77693_pmic.h
  6. 1
      include/power/max8997_pmic.h
  7. 5
      include/power/pmic.h

@ -19,7 +19,7 @@ static int power_battery_charge(struct pmic *bat)
struct battery *battery = p_bat->bat;
int k;
if (bat->chrg->chrg_state(p_bat->chrg, CHARGER_ENABLE, 450))
if (bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_ENABLE, 450))
return -1;
for (k = 0; bat->chrg->chrg_bat_present(p_bat->chrg) &&
@ -42,7 +42,7 @@ static int power_battery_charge(struct pmic *bat)
}
}
exit:
bat->chrg->chrg_state(p_bat->chrg, CHARGER_DISABLE, 0);
bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_DISABLE, 0);
return 0;
}

@ -17,7 +17,7 @@ static int power_battery_charge(struct pmic *bat)
{
struct power_battery *p_bat = bat->pbat;
if (bat->chrg->chrg_state(p_bat->chrg, CHARGER_ENABLE, 450))
if (bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_ENABLE, 450))
return -1;
return 0;

@ -22,7 +22,7 @@ static int max77693_charger_state(struct pmic *p, int state, int current)
val = MAX77693_CHG_UNLOCK;
pmic_reg_write(p, MAX77693_CHG_CNFG_06, val);
if (state == CHARGER_DISABLE) {
if (state == PMIC_CHARGER_DISABLE) {
puts("Disable the charger.\n");
pmic_reg_read(p, MAX77693_CHG_CNFG_00, &val);
val &= ~0x01;

@ -35,7 +35,7 @@ static int pmic_charger_state(struct pmic *p, int state, int current)
if (pmic_probe(p))
return -1;
if (state == CHARGER_DISABLE) {
if (state == PMIC_CHARGER_DISABLE) {
puts("Disable the charger.\n");
pmic_reg_read(p, MAX8997_REG_MBCCTRL2, &val);
val &= ~(MBCHOSTEN | VCHGR_FC);

@ -10,8 +10,6 @@
#include <power/power_chrg.h>
enum {CHARGER_ENABLE, CHARGER_DISABLE};
#define CHARGER_MIN_CURRENT 200
#define CHARGER_MAX_CURRENT 2000

@ -170,7 +170,6 @@ enum {
#define SAFEOUT_3_30V 0x03
/* Charger */
enum {CHARGER_ENABLE, CHARGER_DISABLE};
#define DETBAT (1 << 2)
#define MBCICHFCSET (1 << 4)
#define MBCHOSTEN (1 << 6)

@ -17,6 +17,11 @@ enum { I2C_PMIC, I2C_NUM, };
enum { PMIC_READ, PMIC_WRITE, };
enum { PMIC_SENSOR_BYTE_ORDER_LITTLE, PMIC_SENSOR_BYTE_ORDER_BIG, };
enum {
PMIC_CHARGER_DISABLE,
PMIC_CHARGER_ENABLE,
};
struct p_i2c {
unsigned char addr;
unsigned char *buf;

Loading…
Cancel
Save