/* * Driver for the TI bq24190 battery charger. * * Author: Mark A. Greer <mgreer@animalcreek.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include<linux/module.h>#include<linux/interrupt.h>#include<linux/delay.h>#include<linux/of_irq.h>#include<linux/of_device.h>#include<linux/pm_runtime.h>#include<linux/power_supply.h>#include<linux/gpio.h>#include<linux/i2c.h>#include<linux/power/bq24190_charger.h>#define BQ24190_MANUFACTURER "Texas Instruments"#define BQ24190_REG_ISC 0x00 /* Input Source Control */#define BQ24190_REG_ISC_EN_HIZ_MASK BIT(7)#define BQ24190_REG_ISC_EN_HIZ_SHIFT 7#define BQ24190_REG_ISC_VINDPM_MASK (BIT(6) | BIT(5) | BIT(4) | \ BIT(3))#define BQ24190_REG_ISC_VINDPM_SHIFT 3#define BQ24190_REG_ISC_IINLIM_MASK (BIT(2) | BIT(1) | BIT(0))#define BQ24190_REG_ISC_IINLIM_SHIFT 0#define BQ24190_REG_POC 0x01 /* Power-On Configuration */#define BQ24190_REG_POC_RESET_MASK BIT(7)#define BQ24190_REG_POC_RESET_SHIFT 7#define BQ24190_REG_POC_WDT_RESET_MASK BIT(6)#define BQ24190_REG_POC_WDT_RESET_SHIFT 6#define BQ24190_REG_POC_CHG_CONFIG_MASK (BIT(5) | BIT(4))#define BQ24190_REG_POC_CHG_CONFIG_SHIFT 4#define BQ24190_REG_POC_SYS_MIN_MASK (BIT(3) | BIT(2) | BIT(1))#define BQ24190_REG_POC_SYS_MIN_SHIFT 1#define BQ24190_REG_POC_BOOST_LIM_MASK BIT(0