Source
static inline void show_chgconfig(int por, const char *label, u8 chgconfig) { }
/*
* tps65010 - driver for tps6501x power management chips
*
* Copyright (C) 2004 Texas Instruments
* Copyright (C) 2004-2005 David Brownell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*-------------------------------------------------------------------------*/
MODULE_DESCRIPTION("TPS6501x Power Management Driver");
MODULE_LICENSE("GPL");
static struct i2c_driver tps65010_driver;
/*-------------------------------------------------------------------------*/
/* This driver handles a family of multipurpose chips, which incorporate
* voltage regulators, lithium ion/polymer battery charging, GPIOs, LEDs,
* and other features often needed in portable devices like cell phones
* or digital cameras.
*
* The tps65011 and tps65013 have different voltage settings compared
* to tps65010 and tps65012. The tps65013 has a NO_CHG status/irq.
* All except tps65010 have "wait" mode, possibly defaulted so that
* battery-insert != device-on.
*
* We could distinguish between some models by checking VDCDC1.UVLO or
* other registers, unless they've been changed already after powerup
* as part of board setup by a bootloader.
*/
enum tps_model {
TPS65010,
TPS65011,
TPS65012,
TPS65013,
};
struct tps65010 {
struct i2c_client *client;
struct mutex lock;
struct delayed_work work;
struct dentry *file;
unsigned charging:1;
unsigned por:1;
unsigned model:8;
u16 vbus;
unsigned long flags;
/* copies of last register state */
u8 chgstatus, regstatus, chgconf;
u8 nmask1, nmask2;
u8 outmask;
struct gpio_chip chip;
struct platform_device *leds;