Skip to content
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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ivangilmercano
Copy link

@ivangilmercano ivangilmercano commented Nov 29, 2024

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

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

@CLAassistant
Copy link

CLAassistant commented Nov 29, 2024

CLA assistant check
All committers have signed the CLA.

@kister-jimenez kister-jimenez self-requested a review November 29, 2024 06:57
@kister-jimenez
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).


ADP1050 IIO Driver Initialization Example
ADP105x IIO Driver Initialization Example
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy


reg_fedge = ADP1050_OUTA_FALLING_EDGE_TIMING;
reg_redge = ADP1050_OUTA_RISING_EDGE_TIMING;
reg_lsb = ADP1050_OUTA_RISING_FALLING_TIMING_LSB;

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy

break;

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy

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);
Copy link
Contributor

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

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto on indention

@@ -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*/
Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Author

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

@@ -1184,4 +1354,4 @@ int adp1050_remove(struct adp1050_desc *desc)
no_os_free(desc);

return 0;
}
}
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy

#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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto on unnecessary comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy

@@ -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******************/
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy

struct no_os_pwm_init_param *syni_param;
struct no_os_gpio_init_param *pg_alt_param;
Copy link
Contributor

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.

BASIC_EXAMPLE = n
IIO_EXAMPLE = y
BASIC_EXAMPLE = y
IIO_EXAMPLE = n
Copy link
Contributor

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
======================
Copy link
Contributor

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;
}
}
Copy link
Contributor

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.
Copy link
Contributor

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.

@@ -5,30 +5,36 @@
********************************************************************************
* Copyright 2024(c) Analog Devices, Inc.
*
* All rights reserved.
Copy link
Contributor

@CiprianRegus CiprianRegus Nov 29, 2024

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.

@kister-jimenez kister-jimenez marked this pull request as draft November 29, 2024 09:12
@ivangilmercano ivangilmercano force-pushed the dev/adp1051 branch 2 times, most recently from 41af4a3 to 4db75de Compare December 2, 2024 05:37
@ivangilmercano ivangilmercano force-pushed the dev/adp1051 branch 9 times, most recently from e3adef1 to df8eab2 Compare December 2, 2024 07:46
@buha
Copy link
Contributor

buha commented Dec 2, 2024

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kister-jimenez
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants