*/
static int bq27xxx_battery_read_health(struct bq27xxx_device_info *di)
{
- u16 flags;
+ int flags;
flags = bq27xxx_read(di, BQ27XXX_REG_FLAGS, false);
if (flags < 0) {
di->last_update = jiffies;
}
-static irqreturn_t bq27xxx_battery_irq_handler_thread(int irq, void *data)
-{
- struct bq27xxx_device_info *di = data;
-
- bq27xxx_battery_update(di);
-
- return IRQ_HANDLED;
-}
-
static void bq27xxx_battery_poll(struct work_struct *work)
{
struct bq27xxx_device_info *di =
static DEFINE_IDR(battery_id);
static DEFINE_MUTEX(battery_mutex);
+static irqreturn_t bq27xxx_battery_irq_handler_thread(int irq, void *data)
+{
+ struct bq27xxx_device_info *di = data;
+
+ bq27xxx_battery_update(di);
+
+ return IRQ_HANDLED;
+}
+
static int bq27xxx_battery_i2c_read(struct bq27xxx_device_info *di, u8 reg,
bool single)
{
di->dev = &pdev->dev;
di->chip = pdata->chip;
+ di->regs = bq27xxx_regs[di->chip];
name = pdata->name ?: dev_name(&pdev->dev);
di->bus.read = &bq27xxx_battery_platform_read;