-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: regulator: add support for AXP2101 power management IC #82474
base: main
Are you sure you want to change the base?
Conversation
6426c15
to
16d230b
Compare
pmic@68 { | ||
reg = <0x68>; | ||
... | ||
regulators { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are missing a top-level compatible here, this is a MFD device. It's ok to just add support for regulators now, but DT layout needs to be designed according to how device is.
@@ -76,6 +76,30 @@ axp192@4 { | |||
}; | |||
}; | |||
|
|||
axp2101@7 { | |||
compatible = "x-powers,axp2101"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where's this?
|
||
ret = i2c_reg_update_byte_dt(&config->i2c, config->desc->enable_reg, | ||
config->desc->enable_mask, 0u); | ||
if (ret != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ret != 0) { | |
if (ret < 0) { |
others as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gmarull
thanks, I changed the if statements
const struct regulator_axp2101_desc *desc; | ||
const struct i2c_dt_spec i2c; | ||
|
||
LOG_INSTANCE_PTR_DECLARE(log); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is instance level logging really needed? Very few drivers do this, and, in most cases, I'd say there's only a single regulator instance on a system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gmarull,
I remove the per instance logging.
f02b2fc
to
24296fd
Compare
24296fd
to
479ff76
Compare
Indeed, sorry, didn't check before submitting this one. |
Your and Ranranff's codes are obviously similar because they are copied from regulator_axp192.c. Since the implementation is almost the same, and only the definition is different, I think it is preferable to support it as an extension of regulator_axp192.c. I tried making something based on your code. soburi@6c74c9d I have yet to test it, but I hope it helps. |
@soburi
|
479ff76
to
8090c68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It would help if you still addressed pointed by @gmarull #82474 (comment).
8090c68
to
78b2ccf
Compare
Thanks! |
78b2ccf
to
c90deed
Compare
x-powers,axp2101-regulator.yaml updated. |
89e610a
to
bbee302
Compare
Fixed m5stack boards m5stack_core2 and m5stickc_plus defconfigs. The current fails are related to SMP issues. I will rebase the driver when they are fixed. |
bbee302
to
2fefb04
Compare
Rebased to main, the SMP related build failure was fixed (thanks @sylvioalves !) |
416a2d9
to
7908746
Compare
I will rebase when #83813 is merged |
7908746
to
f98f3e7
Compare
Rebased to main now that #82813 was merged |
From what I've tried, there seem to be some general issues with using ranges, and the values set in the registers seem strange. Have you checked this? |
I have checked some of the LDOs on my board using a multimeter. So the settings do set the correct voltage on the LDOs I tested (within sane ranges for this board. Need to check which ones, it has been a few weeks). I don't know why that should be ranges, though. |
30eba8f
to
c7553b6
Compare
@soburi I still have no hardware that uses a DC/DC besides DCDC1, sorry.
|
add initial support for the AXP2101 power management IC from X-powers Co-authored-by: TOKITA Hiroshi <[email protected]> Signed-off-by: Lothar Felten <[email protected]>
c7553b6
to
c19a915
Compare
Please note this in the commit message about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add initial support for the AXP2101 power management IC from X-powers