Re: [PATCH v2 2/3] soc: qcom: geni: move struct geni_wrapper to header

From: Bjorn Andersson
Date: Fri Jun 18 2021 - 13:10:43 EST


On Fri 18 Jun 09:18 CDT 2021, Vinod Koul wrote:

> SPI & I2C geni driver needs to access struct geni_wrapper, so move it to
> header. The drivers needs this header to find the geni device and use it
> in dma mapping.
>

How does this differ from engine->dev->parent?

> Using this method works for both DT and ACPI systems
>

I was under the impression that the wrapper and engines are describe
completely independently in ACPI, so we don't have a link between them.

If that's not the case, then I guess that answers the above question
about ->parent.

Regards,
Bjorn

> Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
> ---
> drivers/soc/qcom/qcom-geni-se.c | 14 --------------
> include/linux/qcom-geni-se.h | 14 ++++++++++++++
> 2 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
> index fe666ea0c487..08d645b90ed3 100644
> --- a/drivers/soc/qcom/qcom-geni-se.c
> +++ b/drivers/soc/qcom/qcom-geni-se.c
> @@ -78,20 +78,6 @@
> */
>
> #define MAX_CLK_PERF_LEVEL 32
> -#define NUM_AHB_CLKS 2
> -
> -/**
> - * struct geni_wrapper - Data structure to represent the QUP Wrapper Core
> - * @dev: Device pointer of the QUP wrapper core
> - * @base: Base address of this instance of QUP wrapper core
> - * @ahb_clks: Handle to the primary & secondary AHB clocks
> - * @to_core: Core ICC path
> - */
> -struct geni_wrapper {
> - struct device *dev;
> - void __iomem *base;
> - struct clk_bulk_data ahb_clks[NUM_AHB_CLKS];
> -};
>
> static const char * const icc_path_names[] = {"qup-core", "qup-config",
> "qup-memory"};
> diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h
> index 5114e2144b17..5fda675c5cfe 100644
> --- a/include/linux/qcom-geni-se.h
> +++ b/include/linux/qcom-geni-se.h
> @@ -38,6 +38,20 @@ struct geni_icc_path {
> unsigned int avg_bw;
> };
>
> +#define NUM_AHB_CLKS 2
> +
> +/**
> + * @struct geni_wrapper - Data structure to represent the QUP Wrapper Core
> + * @dev: Device pointer of the QUP wrapper core
> + * @base: Base address of this instance of QUP wrapper core
> + * @ahb_clks: Handle to the primary & secondary AHB clocks
> + */
> +struct geni_wrapper {
> + struct device *dev;
> + void __iomem *base;
> + struct clk_bulk_data ahb_clks[NUM_AHB_CLKS];
> +};
> +
> /**
> * struct geni_se - GENI Serial Engine
> * @base: Base Address of the Serial Engine's register block
> --
> 2.31.1
>