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: max20335: add support for ship mode #67222
drivers: regulator: max20335: add support for ship mode #67222
Conversation
5426b46
to
0a00b52
Compare
0a00b52
to
cfd1ae2
Compare
struct i2c_dt_spec bus; | ||
const struct regulator_max20335_desc *desc; | ||
uint8_t source; | ||
const struct device *parent; |
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.
note: not sure you save much by doing this (I removed it from some code a while ago), as it complicates things for just an address byte, depending on alignment you may actually save nothing.
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.
I followed the same pattern as in pca9420
. Not sure what savings you have in mind?
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.
Both the common and the individual regulator configs can have their own copy of struct i2c_dt_spec bus
.
Then you can access ->bus
directly instead of having to go via the parent.
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.
As you can see, struct i2c_dt_spec
has been removed from the individual regulator configs. Am I still wrong, am I still blind?
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.
I believe Gerard is suggesting that you keep struct i2c_dt_spec bus
in both the common and individual configs.
Then you don't need to get the parent config pointer, you can keep the original code.
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.
Thanks, I've fixed that.
Allows the user to disable PMIC. Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
cfd1ae2
to
45b5199
Compare
Allows the user to disable PMIC.