mfd: tps6586x: Add version detection

Use the VERSIONCRC to determine the exact device version. According to
the datasheet this register can be used as device identifier. The
identification is needed since some tps6586x regulators use a different
voltage table.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Stefan Agner
2013-12-06 13:51:45 +01:00
committed by Lee Jones
parent af66b3c093
commit e0a3da80c6
2 changed files with 49 additions and 8 deletions

View File

@@ -13,6 +13,12 @@
#define TPS6586X_SLEW_RATE_SET 0x08
#define TPS6586X_SLEW_RATE_MASK 0x07
/* VERSION CRC */
#define TPS658621A 0x15
#define TPS658621CD 0x2c
#define TPS658623 0x1b
#define TPS658643 0x03
enum {
TPS6586X_ID_SYS,
TPS6586X_ID_SM_0,
@@ -97,5 +103,6 @@ extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
extern int tps6586x_update(struct device *dev, int reg, uint8_t val,
uint8_t mask);
extern int tps6586x_irq_get_virq(struct device *dev, int irq);
extern int tps6586x_get_version(struct device *dev);
#endif /*__LINUX_MFD_TPS6586X_H */