drivers: pwm: ledc: esp32c2: esp32c6: Fix clock frequency

Fix clock frequency for both devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
This commit is contained in:
Raffael Rostagno 2024-11-01 16:27:03 -03:00 committed by Mahesh Mahadevan
parent ba52c8c350
commit b9fc4cc415

View file

@ -22,6 +22,17 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(pwm_ledc_esp32, CONFIG_PWM_LOG_LEVEL);
#if SOC_LEDC_SUPPORT_APB_CLOCK
#define CLOCK_SOURCE LEDC_APB_CLK
#elif SOC_LEDC_SUPPORT_PLL_DIV_CLOCK
#define CLOCK_SOURCE LEDC_SCLK
#if defined(CONFIG_SOC_SERIES_ESP32C2)
#define SCLK_CLK_FREQ MHZ(60)
#elif defined(CONFIG_SOC_SERIES_ESP32C6)
#define SCLK_CLK_FREQ MHZ(80)
#endif
#endif
struct pwm_ledc_esp32_data {
ledc_hal_context_t hal;
struct k_sem cmd_sem;
@ -350,12 +361,6 @@ static const struct pwm_driver_api pwm_led_esp32_api = {
PINCTRL_DT_INST_DEFINE(0);
#if SOC_LEDC_SUPPORT_APB_CLOCK
#define CLOCK_SOURCE LEDC_APB_CLK
#elif SOC_LEDC_SUPPORT_PLL_DIV_CLOCK
#define CLOCK_SOURCE LEDC_SCLK
#endif
#define CHANNEL_CONFIG(node_id) \
{ \
.idx = DT_REG_ADDR(node_id), \