-
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: pwm: bbled: bbled-pwm driver to compatible with led api #61748
drivers: pwm: bbled: bbled-pwm driver to compatible with led api #61748
Conversation
77327ca
to
4ba0197
Compare
@simonguinot @henrikbrixandersen Could you please help to review? |
Hi @Manimaran-A. I'll have a look at it this week-end. |
Hi @Manimaran-A. I apologize for the delay. Unfortunately I am not familiar enough with both the PWM subsystem and the MCHP PWM BBLED controller to help with this review. I can see the division by 256 you added in the In addition I think you probably should move the addition of the DT overlay files into a dedicated commit. |
@Manimaran-A do split the commit in two: one for dts changes, one driver changes |
a94cd5e
to
51633fe
Compare
@jvasanth1 please take a look |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Hi @jvasanth1 and @Manimaran-A, We need to merge this PR in order to remove the |
@albertofloyd can you help to review and approve? |
51633fe
to
a310787
Compare
|
||
&pinctrl { | ||
led0_gpio156_invert: led0_gpio156_invert { | ||
pinmux = < MCHP_XEC_PINMUX(0156, MCHP_AF1) >; |
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.
pinmux = < MCHP_XEC_PINMUX(0156, MCHP_AF1) >; | |
pinmux = <MCHP_XEC_PINMUX(0156, MCHP_AF1)>; |
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.
Ok, updated.
microchip,output-func-invert; | ||
}; | ||
led1_gpio157_invert: led1_gpio157_invert { | ||
pinmux = < MCHP_XEC_PINMUX(0157, MCHP_AF1) >; |
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.
pinmux = < MCHP_XEC_PINMUX(0157, MCHP_AF1) >; | |
pinmux = <MCHP_XEC_PINMUX(0157, MCHP_AF1)>; |
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.
Updated.
microchip,output-func-invert; | ||
}; | ||
led2_gpio153_invert: led2_gpio153_invert { | ||
pinmux = < MCHP_XEC_PINMUX(0153, MCHP_AF1) >; |
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.
pinmux = < MCHP_XEC_PINMUX(0153, MCHP_AF1) >; | |
pinmux = <MCHP_XEC_PINMUX(0153, MCHP_AF1)>; |
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.
Updated the comments.
|
||
&pinctrl { | ||
led0_gpio156_invert: led0_gpio156_invert { | ||
pinmux = < MCHP_XEC_PINMUX(0156, MCHP_AF1) >; |
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.
pinmux = < MCHP_XEC_PINMUX(0156, MCHP_AF1) >; | |
pinmux = <MCHP_XEC_PINMUX(0156, MCHP_AF1)>; |
etc... you got the idea :-)
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.
Updated.
1010143
a310787
to
1010143
Compare
Zephyr has a PWM-LED driver which makes calls to a PWM driver to control the pin. The previous MCHP PWM-BBLED driver do not report its actual PWM cycles, instead it reported the clock source it used: 32KHz or 48MHz. This bug caused the LED-PWM driver set brightness to compute incorrect parameters passed to the PWM-BBLED driver. The BBLED hardware has a built-in divider of 256 therefore its maximum cycles are 128 and 48M/256 respectively. This change also simplified the calculations. A DT overlay for the MEC172x EVB was added to the PWM-LED sample to demonstrate driver operation. We found specifying >= 50 ms for the PWM period in the device tree nodes provided a good operating range for the LED-PWM driver parameter calculations. Note: BBLED hardware implements an 8-bit PWM with a fixed divider of 256 and a 12-bit frequency pre-scaler. Duty cycle is represented by an 8-bit value. Signed-off-by: Manimaran A <manimaran.a@microchip.com>
Updated Overlay, dtsi and yaml files. Signed-off-by: Manimaran A <manimaran.a@microchip.com>
1010143
to
8594eeb
Compare
Zephyr has a PWM-LED driver which makes calls to a PWM driver to control the pin. The previous MCHP PWM-BBLED driver do not report its actual PWM cycles, instead it reported the clock source it used: 32KHz or 48MHz. This bug caused the LED-PWM driver set brightness to compute incorrect parameters passed to the PWM-BBLED driver. The BBLED hardware has a built-in divider of 256 therefore its maximum cycles are 128 and 48M/256 respectively. This change also simplified the calculations. A DT overlay for the MEC172x EVB was added to the PWM-LED sample to demonstrate driver operation. We found specifying >= 50 ms for the PWM period in the device tree nodes provided a good operating range for the LED-PWM driver parameter calculations. Note: BBLED hardware implements an 8-bit PWM with a fixed divider of 256 and a 12-bit frequency pre-scaler. Duty cycle is represented by an 8-bit value.