Skip to content

Commit 8542e40

Browse files
smalaekartben
authored andcommitted
drivers: spi: siwx91x: SPI clock initialization for siwx91x
Clock driver changes required for initializing the SPI clock for the siwx91x driver Signed-off-by: Sai Santhosh Malae <[email protected]>
1 parent c6eb665 commit 8542e40

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/clock_control/clock_control_silabs_siwx91x.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "rsi_rom_ulpss_clk.h"
1414
#include "rsi_rom_clks.h"
1515
#include "rsi_sysrtc.h"
16+
#include "rsi_pll.h"
1617
#include "clock_update.h"
1718
#include "sl_si91x_clock_manager.h"
1819

@@ -77,6 +78,10 @@ static int siwx91x_clock_on(const struct device *dev, clock_control_subsys_t sys
7778
*/
7879
rsi_sysrtc_clk_set(RSI_SYSRTC_CLK_32kHz_Xtal, 0);
7980
break;
81+
case SIWX91X_CLK_GSPI:
82+
RSI_PS_M4ssPeriPowerUp(M4SS_PWRGATE_ULP_EFUSE_PERI);
83+
RSI_CLK_GspiClkConfig(M4CLK, GSPI_INTF_PLL_CLK);
84+
break;
8085
default:
8186
return -EINVAL;
8287
}
@@ -141,6 +146,9 @@ static int siwx91x_clock_get_rate(const struct device *dev, clock_control_subsys
141146
case SIWX91X_CLK_WATCHDOG:
142147
*rate = LF_FSM_CLOCK_FREQUENCY;
143148
return 0;
149+
case SIWX91X_CLK_GSPI:
150+
*rate = RSI_CLK_GetBaseClock(M4_GSPI);
151+
return 0;
144152
default:
145153
/* For now, no other driver need clock rate */
146154
return -EINVAL;

include/zephyr/dt-bindings/clock/silabs/siwx91x-clock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
#define SIWX91X_CLK_DMA0 7
1515
#define SIWX91X_CLK_WATCHDOG 8
1616
#define SIWX91X_CLK_PWM 9
17+
#define SIWX91X_CLK_GSPI 10
1718

1819
#endif

0 commit comments

Comments
 (0)