Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 99dff48

Browse files
committed
Merge tag 'regulator-fix-v6.9-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown: "Two fixes here, one from Johan which fixes error handling when we attempt to create duplicate debugfs files and one for an incorrect specification of ramp_delay with the rtq2208" * tag 'regulator-fix-v6.9-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: core: fix debugfs creation regression regulator: rtq2208: Fix the BUCK ramp_delay range to maximum of 16mVstep/us
2 parents 92d5030 + 2a4b49b commit 99dff48

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

drivers/regulator/core.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,19 +1911,24 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
19111911
}
19121912
}
19131913

1914-
if (err != -EEXIST)
1914+
if (err != -EEXIST) {
19151915
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
1916-
if (IS_ERR(regulator->debugfs))
1917-
rdev_dbg(rdev, "Failed to create debugfs directory\n");
1916+
if (IS_ERR(regulator->debugfs)) {
1917+
rdev_dbg(rdev, "Failed to create debugfs directory\n");
1918+
regulator->debugfs = NULL;
1919+
}
1920+
}
19181921

1919-
debugfs_create_u32("uA_load", 0444, regulator->debugfs,
1920-
&regulator->uA_load);
1921-
debugfs_create_u32("min_uV", 0444, regulator->debugfs,
1922-
&regulator->voltage[PM_SUSPEND_ON].min_uV);
1923-
debugfs_create_u32("max_uV", 0444, regulator->debugfs,
1924-
&regulator->voltage[PM_SUSPEND_ON].max_uV);
1925-
debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
1926-
regulator, &constraint_flags_fops);
1922+
if (regulator->debugfs) {
1923+
debugfs_create_u32("uA_load", 0444, regulator->debugfs,
1924+
&regulator->uA_load);
1925+
debugfs_create_u32("min_uV", 0444, regulator->debugfs,
1926+
&regulator->voltage[PM_SUSPEND_ON].min_uV);
1927+
debugfs_create_u32("max_uV", 0444, regulator->debugfs,
1928+
&regulator->voltage[PM_SUSPEND_ON].max_uV);
1929+
debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
1930+
regulator, &constraint_flags_fops);
1931+
}
19271932

19281933
/*
19291934
* Check now if the regulator is an always on regulator - if

drivers/regulator/rtq2208-regulator.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
/* Value */
5050
#define RTQ2208_RAMP_VALUE_MIN_uV 500
51-
#define RTQ2208_RAMP_VALUE_MAX_uV 64000
51+
#define RTQ2208_RAMP_VALUE_MAX_uV 16000
5252

5353
#define RTQ2208_BUCK_MASK(uv_irq, ov_irq) (1 << ((uv_irq) % 8) | 1 << ((ov_irq) % 8))
5454

@@ -142,12 +142,11 @@ static int rtq2208_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
142142
* Because the relation of seleltion and value is like that
143143
*
144144
* seletion: value
145-
* 000: 64mv
146-
* 001: 32mv
145+
* 010: 16mv
147146
* ...
148147
* 111: 0.5mv
149148
*
150-
* For example, if I would like to select 64mv, the fls(ramp_delay) - 1 will be 0b111,
149+
* For example, if I would like to select 16mv, the fls(ramp_delay) - 1 will be 0b010,
151150
* and I need to use 0b111 - sel to do the shifting
152151
*/
153152

0 commit comments

Comments
 (0)