-
Notifications
You must be signed in to change notification settings - Fork 853
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
Add driver for MAX42500 #2659
base: main
Are you sure you want to change the base?
Add driver for MAX42500 #2659
Conversation
Is this still WIP? As it stands it's not really ready for reviewing... Please make sure to address CI complains and to re-organize your commits. Merge commits don't really make sense (rebase your dev branch) and please run |
a3dad5b
to
a6008ba
Compare
de38b83
to
3f0942b
Compare
Add documentation for devicetree bindings for MAX42500 Signed-off-by: Kent Libetario <[email protected]>
3f0942b
to
32dc5ba
Compare
The MAX42500 is a SoC power-system monitor with up to seven voltage monitor inputs that will be SIL 3-Certified. Each input has programmable OV/UV thresholds of between 2.5% and 10% with ±1.3% accuracy over the full temperature range. Two of the inputs have a separate remote ground-sense input and support DVS through the integrated I2C interface. The MAX42500 contains a programmable flexible power sequence recorder (FPSR). This recorder stores power-up and power-down timestamps separately, and supports on/off and sleep/standby power sequences. The MAX42500 also contains a programmable challenge/response watchdog, which is accessible through the I2C interface, along with a configurable RESET output. Signed-off-by: Kent Libetario <[email protected]>
Add entry for the MAX42500 driver Signed-off-by: Kent Libetario <[email protected]>
32dc5ba
to
5920e35
Compare
v2
|
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.
First review attempt.
I think you need to do some adjustments in you formatting especially the tabs to make the code more readable. I have commented some of them, but I see a lot needs to be adjusted.
- adi,max42500 | ||
|
||
reg: | ||
description: I2C address of slave device. |
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.
No need for description for the I2C address.
minimum: 0x28 | ||
maximum: 0x2B |
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 don't think this is needed.
#define MAX42500_REG_CONFIG1 0x01 | ||
#define MAX42500_REG_CONFIG2 0x02 |
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 can add more tabs to align this.
#define MAX42500_REG_RSTMAP 0x04 | ||
#define MAX42500_REG_STATOV 0x05 | ||
#define MAX42500_REG_STATUV 0x06 | ||
#define MAX42500_REG_STATOFF 0x07 |
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 can add more tabs to align this.
#define MAX42500_REG_FPSSTAT1 0x16 | ||
#define MAX42500_REG_FPSCFG1 0x17 |
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 can add more tabs to align these.
*/ | ||
static int max42500_set_nominal_voltage(struct max42500_state *st, | ||
enum max42500_vm_input vm_in, | ||
u8 voltage) |
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.
check your tabs
MAX42500_REG_OVUV1 + vm_in, | ||
GENMASK(7, 4), | ||
FIELD_PREP(GENMASK(7, 4), | ||
thresh)); |
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.
check your tabs
* @return 0 in case of success, negative error code otherwise. | ||
*/ | ||
static int max42500_get_comp_status(struct max42500_state *st, | ||
u8 vm_in, u8 *status) |
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.
check your tabs
} | ||
|
||
st->nominal_volt[vm_in] = voltage; | ||
return max42500_reg_write(st, reg_addr, voltage); |
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.
add a new line before this return for better readability.
HWMON_CHANNEL_INFO(chip, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY | | ||
HWMON_C_TEMP_RESET_HISTORY | HWMON_C_POWER_RESET_HISTORY | | ||
HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL | HWMON_C_ALARMS, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY, | ||
HWMON_C_IN_RESET_HISTORY | HWMON_C_CURR_RESET_HISTORY), | ||
HWMON_CHANNEL_INFO(in, | ||
HWMON_I_LABEL | HWMON_I_INPUT | HWMON_I_LOWEST | HWMON_I_MIN | | ||
HWMON_I_HIGHEST | HWMON_I_MAX, | ||
HWMON_I_LABEL | HWMON_I_INPUT | HWMON_I_LOWEST | HWMON_I_MIN | | ||
HWMON_I_HIGHEST | HWMON_I_MAX, | ||
HWMON_I_LABEL | HWMON_I_INPUT | HWMON_I_LOWEST | HWMON_I_MIN, | ||
HWMON_I_LABEL | HWMON_I_INPUT | HWMON_I_LOWEST | HWMON_I_MIN, | ||
HWMON_I_LABEL | HWMON_I_INPUT | HWMON_I_LOWEST | HWMON_I_MIN, | ||
HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, | ||
HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, | ||
HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, | ||
HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL, HWMON_I_LABEL), |
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.
can you double check the channels? I think there is a mismatch in the count.
PR Description
PR Type
PR Checklist