Commit 8bc529b2 authored by Lee Jones's avatar Lee Jones Committed by Felipe Balbi

soc: qcom: geni: Add support for ACPI

When booting with ACPI as the active set of configuration tables,
all; clocks, regulators, pin functions ect are expected to be at
their ideal values/levels/rates, thus the associated frameworks
are unavailable.  Ensure calls to these APIs are shielded when
ACPI is enabled.
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent ad408a15
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. // Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
#include <linux/acpi.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
...@@ -450,6 +451,9 @@ int geni_se_resources_off(struct geni_se *se) ...@@ -450,6 +451,9 @@ int geni_se_resources_off(struct geni_se *se)
{ {
int ret; int ret;
if (has_acpi_companion(se->dev))
return 0;
ret = pinctrl_pm_select_sleep_state(se->dev); ret = pinctrl_pm_select_sleep_state(se->dev);
if (ret) if (ret)
return ret; return ret;
...@@ -487,6 +491,9 @@ int geni_se_resources_on(struct geni_se *se) ...@@ -487,6 +491,9 @@ int geni_se_resources_on(struct geni_se *se)
{ {
int ret; int ret;
if (has_acpi_companion(se->dev))
return 0;
ret = geni_se_clks_on(se); ret = geni_se_clks_on(se);
if (ret) if (ret)
return ret; return ret;
...@@ -724,6 +731,7 @@ static int geni_se_probe(struct platform_device *pdev) ...@@ -724,6 +731,7 @@ static int geni_se_probe(struct platform_device *pdev)
if (IS_ERR(wrapper->base)) if (IS_ERR(wrapper->base))
return PTR_ERR(wrapper->base); return PTR_ERR(wrapper->base);
if (!has_acpi_companion(&pdev->dev)) {
wrapper->ahb_clks[0].id = "m-ahb"; wrapper->ahb_clks[0].id = "m-ahb";
wrapper->ahb_clks[1].id = "s-ahb"; wrapper->ahb_clks[1].id = "s-ahb";
ret = devm_clk_bulk_get(dev, NUM_AHB_CLKS, wrapper->ahb_clks); ret = devm_clk_bulk_get(dev, NUM_AHB_CLKS, wrapper->ahb_clks);
...@@ -731,6 +739,7 @@ static int geni_se_probe(struct platform_device *pdev) ...@@ -731,6 +739,7 @@ static int geni_se_probe(struct platform_device *pdev)
dev_err(dev, "Err getting AHB clks %d\n", ret); dev_err(dev, "Err getting AHB clks %d\n", ret);
return ret; return ret;
} }
}
dev_set_drvdata(dev, wrapper); dev_set_drvdata(dev, wrapper);
dev_dbg(dev, "GENI SE Driver probed\n"); dev_dbg(dev, "GENI SE Driver probed\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment