Commit Graph

4 Commits

Author SHA1 Message Date
Manimaran A 270ec8cdb3 drivers: pwm: bbled: Update bbled-pwm, to be compatible with PWM-LED
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>
2024-03-03 18:59:03 +01:00
Manimaran A b4cd531e2c drivers: bbled: pwm: mchp: BBLED low power mode updated
Updated the driver to support low power mode.
Introduced "enable-low-power" flag in device tree to
control(on/off) low power mode.

If flag added in DTS, during sleep BBLED will switch off the LEDs.
Otherwise BBLED will continue the configured blinking pattern on LEDs.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2023-07-25 09:09:44 +02:00
Gerard Marull-Paretas b2d9212ea0 drivers: all: mchp_xec: remove conditional support for pinctrl
The Microchip XEC platform always uses pinctrl, there's no need to keep
extra macrology around pinctrl. Also updated driver's Kconfig options to
`select PINCTRL`.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-24 13:34:22 +02:00
Jay Vasanth f3714825ad drivers: pwm: Add Microchip XEC BBLED PWM driver
The Microchip XEC (MEC172x and MEC152x) have a breathing-blinking
LED (BBLED) block which implements a simple PWM mode. The BBLED
PWM frequencies are 32KHz and 48MHz selectable in device tree.
Frequency divider is 12-bit resolution from 256 to (256 * 4096).

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2023-02-19 20:40:22 -05:00