Skip to content

Commit 1c6350f

Browse files
committed
regulator: Merge dependency for tps65086
Merge Lee Jones' tag 'ib-mfd-regulator-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into 20230818204514.GA1380343@google.com so we can build the tps65086 support: Immutable branch between MFD and Regulator due for the v6.6 merge window
2 parents 90a82b2 + c014673 commit 1c6350f

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

drivers/mfd/tps65086.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,23 @@ static int tps65086_probe(struct i2c_client *client)
8181
return PTR_ERR(tps->regmap);
8282
}
8383

84-
ret = regmap_read(tps->regmap, TPS65086_DEVICEID, &version);
84+
/* Store device ID to load regulator configuration that fit to IC variant */
85+
ret = regmap_read(tps->regmap, TPS65086_DEVICEID1, &tps->chip_id);
8586
if (ret) {
86-
dev_err(tps->dev, "Failed to read revision register\n");
87+
dev_err(tps->dev, "Failed to read revision register 1\n");
88+
return ret;
89+
}
90+
91+
ret = regmap_read(tps->regmap, TPS65086_DEVICEID2, &version);
92+
if (ret) {
93+
dev_err(tps->dev, "Failed to read revision register 2\n");
8794
return ret;
8895
}
8996

9097
dev_info(tps->dev, "Device: TPS65086%01lX, OTP: %c, Rev: %ld\n",
91-
(version & TPS65086_DEVICEID_PART_MASK),
92-
(char)((version & TPS65086_DEVICEID_OTP_MASK) >> 4) + 'A',
93-
(version & TPS65086_DEVICEID_REV_MASK) >> 6);
98+
(version & TPS65086_DEVICEID2_PART_MASK),
99+
(char)((version & TPS65086_DEVICEID2_OTP_MASK) >> 4) + 'A',
100+
(version & TPS65086_DEVICEID2_REV_MASK) >> 6);
94101

95102
if (tps->irq > 0) {
96103
ret = regmap_add_irq_chip(tps->regmap, tps->irq, IRQF_ONESHOT, 0,

include/linux/mfd/tps65086.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
#include <linux/regmap.h>
1414

1515
/* List of registers for TPS65086 */
16-
#define TPS65086_DEVICEID 0x01
17-
#define TPS65086_IRQ 0x02
16+
#define TPS65086_DEVICEID1 0x00
17+
#define TPS65086_DEVICEID2 0x01
18+
#define TPS65086_IRQ 0x02
1819
#define TPS65086_IRQ_MASK 0x03
1920
#define TPS65086_PMICSTAT 0x04
2021
#define TPS65086_SHUTDNSRC 0x05
@@ -75,10 +76,16 @@
7576
#define TPS65086_IRQ_SHUTDN_MASK BIT(3)
7677
#define TPS65086_IRQ_FAULT_MASK BIT(7)
7778

78-
/* DEVICEID Register field definitions */
79-
#define TPS65086_DEVICEID_PART_MASK GENMASK(3, 0)
80-
#define TPS65086_DEVICEID_OTP_MASK GENMASK(5, 4)
81-
#define TPS65086_DEVICEID_REV_MASK GENMASK(7, 6)
79+
/* DEVICEID1 Register field definitions */
80+
#define TPS6508640_ID 0x00
81+
#define TPS65086401_ID 0x01
82+
#define TPS6508641_ID 0x10
83+
#define TPS65086470_ID 0x70
84+
85+
/* DEVICEID2 Register field definitions */
86+
#define TPS65086_DEVICEID2_PART_MASK GENMASK(3, 0)
87+
#define TPS65086_DEVICEID2_OTP_MASK GENMASK(5, 4)
88+
#define TPS65086_DEVICEID2_REV_MASK GENMASK(7, 6)
8289

8390
/* VID Masks */
8491
#define BUCK_VID_MASK GENMASK(7, 1)
@@ -100,6 +107,7 @@ enum tps65086_irqs {
100107
struct tps65086 {
101108
struct device *dev;
102109
struct regmap *regmap;
110+
unsigned int chip_id;
103111

104112
/* IRQ Data */
105113
int irq;

0 commit comments

Comments
 (0)