Commit 72cd7995 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] I2C: add i2c driver for TPS6501x

This adds an I2C driver for the TPS6501x series of power management chips.
It's used on many OMAP based boards, and this driver has been widely used
in the Linux-OMAP trees over the last year or so.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cc0b07ed
# #
# I2C Sensor device configuration # I2C Sensor and "other" chip configuration
# #
menu "Hardware Sensors Chip support" menu "Hardware Sensors Chip support"
...@@ -472,6 +472,23 @@ config ISP1301_OMAP ...@@ -472,6 +472,23 @@ config ISP1301_OMAP
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called isp1301_omap. will be called isp1301_omap.
# NOTE: This isn't really OMAP-specific, except for the current
# interface location in <include/asm-arm/arch-omap/tps65010.h>
# and having mostly OMAP-specific board support
config TPS65010
tristate "TPS6501x Power Management chips"
depends on I2C && ARCH_OMAP
default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK
help
If you say yes here you get support for the TPS6501x series of
Power Management chips. These include voltage regulators,
lithium ion/polymer battery charging, and other features that
are often used in portable devices like cell phones and cameras.
This driver can also be built as a module. If so, the module
will be called tps65010.
config SENSORS_M41T00 config SENSORS_M41T00
tristate "ST M41T00 RTC chip" tristate "ST M41T00 RTC chip"
depends on I2C && PPC32 depends on I2C && PPC32
......
# #
# Makefile for the kernel hardware sensors chip drivers. # Makefile for sensor and "other" I2C chip drivers.
# #
# asb100, then w83781d go first, as they can override other drivers' addresses. # asb100, then w83781d go first, as they can override other drivers' addresses.
...@@ -43,7 +43,9 @@ obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o ...@@ -43,7 +43,9 @@ obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
obj-$(CONFIG_SENSORS_VIA686A) += via686a.o obj-$(CONFIG_SENSORS_VIA686A) += via686a.o
obj-$(CONFIG_SENSORS_W83627EHF) += w83627ehf.o obj-$(CONFIG_SENSORS_W83627EHF) += w83627ehf.o
obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o
obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
obj-$(CONFIG_TPS65010) += tps65010.o
ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
EXTRA_CFLAGS += -DDEBUG EXTRA_CFLAGS += -DDEBUG
......
This diff is collapsed.
...@@ -28,6 +28,66 @@ ...@@ -28,6 +28,66 @@
#ifndef __ASM_ARCH_TPS65010_H #ifndef __ASM_ARCH_TPS65010_H
#define __ASM_ARCH_TPS65010_H #define __ASM_ARCH_TPS65010_H
/*
* ----------------------------------------------------------------------------
* Registers, all 8 bits
* ----------------------------------------------------------------------------
*/
#define TPS_CHGSTATUS 0x01
# define TPS_CHG_USB (1 << 7)
# define TPS_CHG_AC (1 << 6)
# define TPS_CHG_THERM (1 << 5)
# define TPS_CHG_TERM (1 << 4)
# define TPS_CHG_TAPER_TMO (1 << 3)
# define TPS_CHG_CHG_TMO (1 << 2)
# define TPS_CHG_PRECHG_TMO (1 << 1)
# define TPS_CHG_TEMP_ERR (1 << 0)
#define TPS_REGSTATUS 0x02
# define TPS_REG_ONOFF (1 << 7)
# define TPS_REG_COVER (1 << 6)
# define TPS_REG_UVLO (1 << 5)
# define TPS_REG_NO_CHG (1 << 4) /* tps65013 */
# define TPS_REG_PG_LD02 (1 << 3)
# define TPS_REG_PG_LD01 (1 << 2)
# define TPS_REG_PG_MAIN (1 << 1)
# define TPS_REG_PG_CORE (1 << 0)
#define TPS_MASK1 0x03
#define TPS_MASK2 0x04
#define TPS_ACKINT1 0x05
#define TPS_ACKINT2 0x06
#define TPS_CHGCONFIG 0x07
# define TPS_CHARGE_POR (1 << 7) /* 65010/65012 */
# define TPS65013_AUA (1 << 7) /* 65011/65013 */
# define TPS_CHARGE_RESET (1 << 6)
# define TPS_CHARGE_FAST (1 << 5)
# define TPS_CHARGE_CURRENT (3 << 3)
# define TPS_VBUS_500MA (1 << 2)
# define TPS_VBUS_CHARGING (1 << 1)
# define TPS_CHARGE_ENABLE (1 << 0)
#define TPS_LED1_ON 0x08
#define TPS_LED1_PER 0x09
#define TPS_LED2_ON 0x0a
#define TPS_LED2_PER 0x0b
#define TPS_VDCDC1 0x0c
# define TPS_ENABLE_LP (1 << 3)
#define TPS_VDCDC2 0x0d
#define TPS_VREGS1 0x0e
# define TPS_LDO2_ENABLE (1 << 7)
# define TPS_LDO2_OFF (1 << 6)
# define TPS_VLDO2_3_0V (3 << 4)
# define TPS_VLDO2_2_75V (2 << 4)
# define TPS_VLDO2_2_5V (1 << 4)
# define TPS_VLDO2_1_8V (0 << 4)
# define TPS_LDO1_ENABLE (1 << 3)
# define TPS_LDO1_OFF (1 << 2)
# define TPS_VLDO1_3_0V (3 << 0)
# define TPS_VLDO1_2_75V (2 << 0)
# define TPS_VLDO1_2_5V (1 << 0)
# define TPS_VLDO1_ADJ (0 << 0)
#define TPS_MASK3 0x0f
#define TPS_DEFGPIO 0x10
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* Macros used by exported functions * Macros used by exported functions
...@@ -71,10 +131,26 @@ extern int tps65010_set_gpio_out_value(unsigned gpio, unsigned value); ...@@ -71,10 +131,26 @@ extern int tps65010_set_gpio_out_value(unsigned gpio, unsigned value);
*/ */
extern int tps65010_set_led(unsigned led, unsigned mode); extern int tps65010_set_led(unsigned led, unsigned mode);
/* tps65010_set_vib parameter:
* value: ON or OFF
*/
extern int tps65010_set_vib(unsigned value);
/* tps65010_set_low_pwr parameter: /* tps65010_set_low_pwr parameter:
* mode: ON or OFF * mode: ON or OFF
*/ */
extern int tps65010_set_low_pwr(unsigned mode); extern int tps65010_set_low_pwr(unsigned mode);
/* tps65010_config_vregs1 parameter:
* value to be written to VREGS1 register
* Note: The complete register is written, set all bits you need
*/
extern int tps65010_config_vregs1(unsigned value);
/* tps65013_set_low_pwr parameter:
* mode: ON or OFF
*/
extern int tps65013_set_low_pwr(unsigned mode);
#endif /* __ASM_ARCH_TPS65010_H */ #endif /* __ASM_ARCH_TPS65010_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment