* [PATCH] spi: rockchip-sfc: Support ACPI
@ 2024-11-20 1:22 Jon Lin
2024-12-02 16:51 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Jon Lin @ 2024-11-20 1:22 UTC (permalink / raw)
To: broonie
Cc: linux-rockchip, linux-kernel, heiko, jon.lin, linux-arm-kernel,
linux-spi
Compatible with ACPI.
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
---
drivers/spi/spi-rockchip-sfc.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index 69d0f2175568..138508d2c736 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -491,7 +491,7 @@ static int rockchip_sfc_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op
u32 len = op->data.nbytes;
int ret;
- if (unlikely(mem->spi->max_speed_hz != sfc->frequency)) {
+ if (unlikely(mem->spi->max_speed_hz != sfc->frequency) && !has_acpi_companion(sfc->dev)) {
ret = clk_set_rate(sfc->clk, mem->spi->max_speed_hz);
if (ret)
return ret;
@@ -579,16 +579,24 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
if (IS_ERR(sfc->regbase))
return PTR_ERR(sfc->regbase);
- sfc->clk = devm_clk_get(&pdev->dev, "clk_sfc");
+ if (!has_acpi_companion(&pdev->dev))
+ sfc->clk = devm_clk_get(&pdev->dev, "clk_sfc");
if (IS_ERR(sfc->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(sfc->clk),
"Failed to get sfc interface clk\n");
- sfc->hclk = devm_clk_get(&pdev->dev, "hclk_sfc");
+ if (!has_acpi_companion(&pdev->dev))
+ sfc->hclk = devm_clk_get(&pdev->dev, "hclk_sfc");
if (IS_ERR(sfc->hclk))
return dev_err_probe(&pdev->dev, PTR_ERR(sfc->hclk),
"Failed to get sfc ahb clk\n");
+ if (has_acpi_companion(&pdev->dev)) {
+ ret = device_property_read_u32(&pdev->dev, "clock-frequency", &sfc->frequency);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "Failed to find clock-frequency\n");
+ }
+
sfc->use_dma = !of_property_read_bool(sfc->dev->of_node, "rockchip,sfc-no-dma");
if (sfc->use_dma) {
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] spi: rockchip-sfc: Support ACPI
2024-11-20 1:22 [PATCH] spi: rockchip-sfc: Support ACPI Jon Lin
@ 2024-12-02 16:51 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-12-02 16:51 UTC (permalink / raw)
To: Jon Lin; +Cc: linux-rockchip, linux-kernel, heiko, linux-arm-kernel, linux-spi
On Wed, 20 Nov 2024 09:22:08 +0800, Jon Lin wrote:
> Compatible with ACPI.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: rockchip-sfc: Support ACPI
commit: e39531352aed30156b270a61ba075e5b8d3b8498
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-02 16:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-20 1:22 [PATCH] spi: rockchip-sfc: Support ACPI Jon Lin
2024-12-02 16:51 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®