regulator: Fixes for v6.9

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.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmY+C2IACgkQJNaLcl1U
 h9BkKAf+Jf9Xu7YMB66E4+6bn7T95+9Fn0U8u3pjdjpNXn6Z70Kf+Tpr2mCFwJbV
 DNoMuFZzav1+TK/aKQaB1iEXIKgZck3VjsFTRjEwAH4jtjOnEwuvMBnXlrNXZGBb
 /nHOf8y3GAyrYJ0I6E/4BwyHq+WfzK1Dp61dkv91B5W3Cmz/sfuzpZ5uRJpAP33v
 OyGfrUl12F5H3HkqmSPGMmUvyCpt+vzi+Fc/haltEsGVM8TmvyDy/qBML7K2sr2d
 K7ESqCw/0kZ0YlOCSnU8SbMClYj8awGXtWVBLSNWA+51qGvcwgVrOhcX/320x0J8
 Qvug1DZ/dm4DvzwgjD2p013/SQykww==
 =V0Kh
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-05-10 10:18:31 -07:00
commit 99dff48496
2 changed files with 19 additions and 15 deletions

View File

@ -1911,19 +1911,24 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
}
}
if (err != -EEXIST)
if (err != -EEXIST) {
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
if (IS_ERR(regulator->debugfs))
rdev_dbg(rdev, "Failed to create debugfs directory\n");
if (IS_ERR(regulator->debugfs)) {
rdev_dbg(rdev, "Failed to create debugfs directory\n");
regulator->debugfs = NULL;
}
}
debugfs_create_u32("uA_load", 0444, regulator->debugfs,
&regulator->uA_load);
debugfs_create_u32("min_uV", 0444, regulator->debugfs,
&regulator->voltage[PM_SUSPEND_ON].min_uV);
debugfs_create_u32("max_uV", 0444, regulator->debugfs,
&regulator->voltage[PM_SUSPEND_ON].max_uV);
debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
regulator, &constraint_flags_fops);
if (regulator->debugfs) {
debugfs_create_u32("uA_load", 0444, regulator->debugfs,
&regulator->uA_load);
debugfs_create_u32("min_uV", 0444, regulator->debugfs,
&regulator->voltage[PM_SUSPEND_ON].min_uV);
debugfs_create_u32("max_uV", 0444, regulator->debugfs,
&regulator->voltage[PM_SUSPEND_ON].max_uV);
debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
regulator, &constraint_flags_fops);
}
/*
* Check now if the regulator is an always on regulator - if

View File

@ -48,7 +48,7 @@
/* Value */
#define RTQ2208_RAMP_VALUE_MIN_uV 500
#define RTQ2208_RAMP_VALUE_MAX_uV 64000
#define RTQ2208_RAMP_VALUE_MAX_uV 16000
#define RTQ2208_BUCK_MASK(uv_irq, ov_irq) (1 << ((uv_irq) % 8) | 1 << ((ov_irq) % 8))
@ -142,12 +142,11 @@ static int rtq2208_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
* Because the relation of seleltion and value is like that
*
* seletion: value
* 000: 64mv
* 001: 32mv
* 010: 16mv
* ...
* 111: 0.5mv
*
* For example, if I would like to select 64mv, the fls(ramp_delay) - 1 will be 0b111,
* For example, if I would like to select 16mv, the fls(ramp_delay) - 1 will be 0b010,
* and I need to use 0b111 - sel to do the shifting
*/