@@ -491,7 +491,7 @@ static int rockchip_sfc_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op
491
491
u32 len = op -> data .nbytes ;
492
492
int ret ;
493
493
494
- if (unlikely (mem -> spi -> max_speed_hz != sfc -> frequency )) {
494
+ if (unlikely (mem -> spi -> max_speed_hz != sfc -> frequency ) && ! has_acpi_companion ( sfc -> dev ) ) {
495
495
ret = clk_set_rate (sfc -> clk , mem -> spi -> max_speed_hz );
496
496
if (ret )
497
497
return ret ;
@@ -579,16 +579,24 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
579
579
if (IS_ERR (sfc -> regbase ))
580
580
return PTR_ERR (sfc -> regbase );
581
581
582
- sfc -> clk = devm_clk_get (& pdev -> dev , "clk_sfc" );
582
+ if (!has_acpi_companion (& pdev -> dev ))
583
+ sfc -> clk = devm_clk_get (& pdev -> dev , "clk_sfc" );
583
584
if (IS_ERR (sfc -> clk ))
584
585
return dev_err_probe (& pdev -> dev , PTR_ERR (sfc -> clk ),
585
586
"Failed to get sfc interface clk\n" );
586
587
587
- sfc -> hclk = devm_clk_get (& pdev -> dev , "hclk_sfc" );
588
+ if (!has_acpi_companion (& pdev -> dev ))
589
+ sfc -> hclk = devm_clk_get (& pdev -> dev , "hclk_sfc" );
588
590
if (IS_ERR (sfc -> hclk ))
589
591
return dev_err_probe (& pdev -> dev , PTR_ERR (sfc -> hclk ),
590
592
"Failed to get sfc ahb clk\n" );
591
593
594
+ if (has_acpi_companion (& pdev -> dev )) {
595
+ ret = device_property_read_u32 (& pdev -> dev , "clock-frequency" , & sfc -> frequency );
596
+ if (ret )
597
+ return dev_err_probe (& pdev -> dev , ret , "Failed to find clock-frequency\n" );
598
+ }
599
+
592
600
sfc -> use_dma = !of_property_read_bool (sfc -> dev -> of_node , "rockchip,sfc-no-dma" );
593
601
594
602
if (sfc -> use_dma ) {
0 commit comments