Enable most of the relevant debug log messages in the smb1360 driver. Those are useful to see how it behaves on downstream to check if the mainline driver for it works correctly (see https://github.com/msm8916-mainline/linux/pull/155). diff --git a/drivers/power/smb1360-charger-fg.c b/drivers/power/smb1360-charger-fg.c index 249b9825550..d9fdb9fd1cd 100644 --- a/drivers/power/smb1360-charger-fg.c +++ b/drivers/power/smb1360-charger-fg.c @@ -9,6 +9,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#define DEBUG #define pr_fmt(fmt) "SMB:%s: " fmt, __func__ #include @@ -543,7 +544,7 @@ static int __smb1360_read(struct smb1360_chip *chip, int reg, } else { *val = ret; } - pr_debug("Reading 0x%02x=0x%02x\n", reg, *val); + //pr_debug("Reading 0x%02x=0x%02x\n", reg, *val); return 0; } @@ -742,7 +743,7 @@ static int64_t float_decode(u16 reg) mantissa = (reg & MANTISSA_MASK); sign = !!(reg & SIGN_MASK); - pr_debug("exponent=%d mantissa=%d sign=%d\n", exponent, mantissa, sign); + //pr_debug("exponent=%d mantissa=%d sign=%d\n", exponent, mantissa, sign); mantissa_val = mantissa * MICRO_UNIT; @@ -1139,6 +1140,10 @@ static enum power_supply_property smb1360_battery_properties[] = { }; static int smb1360_get_prop_batt_present(struct smb1360_chip *chip) +/* Disable pr_debug() for read routines, those spam too much */ +#pragma push_macro("pr_debug") +#undef pr_debug +#define pr_debug(fmt, ...) { return chip->batt_present; } @@ -1381,6 +1386,7 @@ static int smb1360_get_prop_current_now(struct smb1360_chip *chip) } static int smb1360_set_minimum_usb_current(struct smb1360_chip *chip) +#pragma pop_macro("pr_debug") { int rc = 0; @@ -2828,7 +2834,7 @@ static irqreturn_t smb1360_stat_handler(int irq, void *dev_id) handlers[i].prev_val = handlers[i].val; } - pr_debug("handler count = %d\n", handler_count); + //pr_debug("handler count = %d\n", handler_count); if (handler_count) power_supply_changed(&chip->batt_psy);