]> git.sur5r.net Git - u-boot/commitdiff
power: Add PMIC_ prefix to CHARGER_EN/DISABLE
authorSimon Glass <sjg@chromium.org>
Tue, 20 May 2014 12:01:35 +0000 (06:01 -0600)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 28 May 2014 01:58:18 +0000 (10:58 +0900)
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>
drivers/power/battery/bat_trats.c
drivers/power/battery/bat_trats2.c
drivers/power/mfd/pmic_max77693.c
drivers/power/pmic/pmic_max8997.c
include/power/max77693_pmic.h
include/power/max8997_pmic.h
include/power/pmic.h

index 41b179fc5402a5ee229f9408ac1499ac61149416..bfde6921764919e42348b051c35ab4a7e3ec19fb 100644 (file)
@@ -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;
 }
index 94015aa41a14db1fb64e16aab3b5f51c6c874ffc..57221adf81891acc45ea28d2903547013ab09d59 100644 (file)
@@ -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;
index 1a4416b54f4fd7dcb0997e899dbdf0cce840d46b..6b28e28b3f86c3c643cd9beb0c8b9d1403fd5a63 100644 (file)
@@ -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;
index ba016923275f781e7deb6418d2aa02c37ef85072..a36a9a08bf48b821bc3c47076f50fd8c561d7b54 100644 (file)
@@ -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);
index 616d051f1787cb86a56cb181c4b498609637d95b..3d59e5916e5f8562fe4c9450c72c95d82e0571d6 100644 (file)
@@ -10,8 +10,6 @@
 
 #include <power/power_chrg.h>
 
-enum {CHARGER_ENABLE, CHARGER_DISABLE};
-
 #define CHARGER_MIN_CURRENT 200
 #define CHARGER_MAX_CURRENT 2000
 
index 74c5d543871d8c4ca6b51520c3150ac5c1fe260c..728d60afa593b47bd93398b2184baa99222c2f41 100644 (file)
@@ -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)
index 8f282dd2f29c0e70a2011de19e8bf5aff7b78514..a62e6c90a5ec29bbc4c4c835dce3f4fbff9d98ee 100644 (file)
@@ -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;