-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: power: adp1050: add support for adp1051 #2381
base: main
Are you sure you want to change the base?
Conversation
/AzurePipelines run |
Azure Pipelines successfully started running 2 pipeline(s). |
drivers/power/adp1050/README.rst
Outdated
|
||
ADP1050 IIO Driver Initialization Example | ||
ADP105x IIO Driver Initialization Example |
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.
changes from ADP1050
to ADP105x
(this and some above) are unnecessary
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.
copy
drivers/power/adp1050/adp1050.c
Outdated
|
||
reg_fedge = ADP1050_OUTA_FALLING_EDGE_TIMING; | ||
reg_redge = ADP1050_OUTA_RISING_EDGE_TIMING; | ||
reg_lsb = ADP1050_OUTA_RISING_FALLING_TIMING_LSB; | ||
|
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.
remove these kinds of changes
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.
dont include these changes: removed/added empty lines
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.
copy
drivers/power/adp1050/adp1050.c
Outdated
break; | ||
|
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.
ditto on added empty lines
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.
copy
drivers/power/adp1050/adp1050.c
Outdated
case ADP1050_OUTB: | ||
fedge_msb = no_os_field_get(ADP1050_EDGE_MSB_MASK, pulse_width + pulse_start); | ||
redge_msb = no_os_field_get(ADP1050_EDGE_MSB_MASK, pulse_start); | ||
lsb = no_os_field_get(ADP1050_FALLING_EDGE_LSB_MASK, | ||
pulse_width + pulse_start) | no_os_field_get(ADP1050_RISING_EDGE_LSB_MASK, | ||
pulse_start); | ||
pulse_start); |
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.
does this change only involve indention? if so, i think this is unnecessary
drivers/power/adp1050/adp1050.c
Outdated
case ADP1050_SR1: | ||
redge_msb = no_os_field_get(ADP1050_EDGE_MSB_MASK, pulse_width + pulse_start); | ||
fedge_msb = no_os_field_get(ADP1050_EDGE_MSB_MASK, pulse_start); | ||
lsb = no_os_field_get(ADP1050_RISING_EDGE_LSB_MASK, | ||
pulse_width + pulse_start) | no_os_field_get(ADP1050_FALLING_EDGE_LSB_MASK, | ||
pulse_start); | ||
pulse_start); |
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.
ditto on indention
drivers/power/adp1050/adp1050.c
Outdated
@@ -610,6 +750,7 @@ int adp1050_set_open_loop(struct adp1050_desc *desc, uint8_t rising_edge, | |||
switch (chan) { | |||
case ADP1050_OUTA: | |||
case ADP1050_OUTB: | |||
/** notice 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.
i think this comment is unnecessary
int adp1050_filter(struct adp1050_desc *desc, uint8_t zero, uint8_t pole, | ||
uint8_t lf, uint8_t hf) | ||
int adp1050_nfilter(struct adp1050_desc *desc, uint8_t zero, uint8_t pole, | ||
uint8_t lf, uint8_t hf) |
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.
what is the reason for this renaming?
also, ditto on indention
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.
the renaming was done due to the addition of a new filter from the adp1051 which includes normal filter and light filter
drivers/power/adp1050/adp1050.c
Outdated
@@ -1184,4 +1354,4 @@ int adp1050_remove(struct adp1050_desc *desc) | |||
no_os_free(desc); | |||
|
|||
return 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.
don't remove empty line on EOF
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.
copy
drivers/power/adp1050/adp1050.h
Outdated
@@ -205,15 +240,20 @@ | |||
#define ADP1050_VOUT_MARGIN_HIGH 0x25 | |||
#define ADP1050_VOUT_MARGIN_LOW 0x26 | |||
#define ADP1050_VOUT_TRANSITION_RATE 0x27 | |||
#define ADP1051_VOUT_DROOP 0x28 //ADP1051 |
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.
unnecessary comment
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.
copy
drivers/power/adp1050/adp1050.h
Outdated
#define ADP1050_VOUT_SCALE_LOOP 0x29 | ||
#define ADP1050_VOUT_SCALE_MONITOR 0x2A | ||
#define ADP1050_FREQUENCY_SWITCH 0x33 | ||
#define ADP1050_VIN_ON 0x35 | ||
#define ADP1050_VIN_OFF 0x36 | ||
#define ADP1051_IOUT_CAL_GAIN 0x38 //ADP1051 |
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.
ditto on unnecessary comment
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.
copy
drivers/power/adp1050/adp1050.h
Outdated
@@ -328,6 +374,11 @@ | |||
#define ADP1050_PWM_180_PHASE_SHIFT_SETTINGS 0xFE3B | |||
#define ADP1050_MODULATION_LIMIT 0xFE3C | |||
#define ADP1050_FEEDFORWARD_SS_FILTER_GAIN 0xFE3D | |||
/***********Added Support for ADP1051******************/ |
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 think ADP1051_
prefix should suffice. These comments are unnecessary.
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.
copy
drivers/power/adp1050/adp1050.h
Outdated
struct no_os_pwm_init_param *syni_param; | ||
struct no_os_gpio_init_param *pg_alt_param; |
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.
This struct member already exists, you just moved it.
projects/adp1050/Makefile
Outdated
BASIC_EXAMPLE = n | ||
IIO_EXAMPLE = y | ||
BASIC_EXAMPLE = y | ||
IIO_EXAMPLE = n |
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.
these changes are unnecessary
ADP1050 no-OS Example Project | ||
============================= | ||
Evaluating the ADP105x | ||
====================== |
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 just keep the existing texts.
|
||
exit: | ||
if (ret) | ||
pr_info("Error!\n"); | ||
adp1050_remove(adp1050_desc); | ||
return ret; | ||
} | ||
} |
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.
Ditto on empty line on EOF.
Also, If the existing basic_example also works on your device, you can leave it as it is.
@@ -65,8 +71,8 @@ int main() | |||
#error At least one example has to be selected using y value in Makefile. | |||
#elif (BASIC_EXAMPLE + IIO_EXAMPLE > 1) | |||
#error Selected example projects cannot be enabled at the same time. \ | |||
Please enable only one example and rebuild the project. | |||
Please enable only one example and re-build the project. |
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 think this is one of the reasons of the astyle check error. Remove this change.
drivers/power/adp1050/adp1050.c
Outdated
@@ -5,30 +5,36 @@ | |||
******************************************************************************** | |||
* Copyright 2024(c) Analog Devices, Inc. | |||
* | |||
* All rights reserved. |
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.
The current license for all No-OS code is BSD 3 clause. Please leave it as it currently is in the adpd1050.c file.
41af4a3
to
4db75de
Compare
e3adef1
to
df8eab2
Compare
Signed-off-by: ivangilmercano <[email protected]>
df8eab2
to
d5fe978
Compare
/AzurePipelines run |
Azure Pipelines successfully started running 2 pipeline(s). |
Signed-off-by: ivangilmercano <[email protected]>
Signed-off-by: ivangilmercano <[email protected]>
Signed-off-by: ivangilmercano <[email protected]>
7b7cb22
to
1d6a400
Compare
/AzurePipelines run |
Azure Pipelines successfully started running 2 pipeline(s). |
Pull Request Description
The ADP1051 is an advanced digital controller with a PMBusTM interface targeting high density, high efficiency dc-to-dc power
conversion. This controller implements voltage mode control with high speed, input line feedforward for enhanced transient and improved noise performance. Some of the added support to the adp1050 driver to support adp1051 include extra pwm output, light load mode, and deep light load mode.
PR Type
PR Checklist