[PATCH] mci: arasan: rework register_sdclk

Sascha Hauer s.hauer at pengutronix.de
Tue Apr 9 06:06:03 PDT 2024


On Tue, Apr 09, 2024 at 07:57:20AM +0200, Steffen Trumtrar wrote:
> Instead of guarding this at compile time, always call register_sdclk
> with the correct clk_ops, like in linux.
> 
> Currently only ZynqMP and default arasan ops are supported.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
> ---
> Instead of guarding the zynqmp functions at compile time and introducing
> possible run-time problems, copy more of the linux driver and add
> soc-specific clk_ops.
> 
> As the zynqmp_pm_* functions are only defined for ARCH_ZYNQMP we need to
> add stub function definitions for other platforms that might use the
> arasan-sdhci driver.
> ---
>  drivers/mci/arasan-sdhci.c            | 53 ++++++++++++++++++++++++-----------
>  include/mach/zynqmp/firmware-zynqmp.h | 11 ++++++++
>  2 files changed, 47 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mci/arasan-sdhci.c b/drivers/mci/arasan-sdhci.c
> index b7dd98049f..5187dbe468 100644
> --- a/drivers/mci/arasan-sdhci.c
> +++ b/drivers/mci/arasan-sdhci.c
> @@ -65,6 +65,8 @@ struct arasan_sdhci_host {
>  	struct mci_host		mci;
>  	struct sdhci		sdhci;
>  	unsigned int		quirks; /* Arasan deviations from spec */
> +	const struct clk_ops	*sdcardclk_ops;
> +	const struct clk_ops	*sampleclk_ops;
>  	struct sdhci_arasan_clk_data clk_data;
>  /* Controller does not have CD wired and will not function normally without */
>  #define SDHCI_ARASAN_QUIRK_FORCE_CDTEST		BIT(0)
> @@ -352,7 +354,7 @@ static void arasan_dt_read_clk_phase(struct device *dev,
>   *
>   * Return: 0 on success and error value on error
>   */
> -static int arasan_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
> +static __maybe_unused int arasan_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)

Dropped this unnecessary __maybe_unused here...

> -static int arasan_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
> +static __maybe_unused int arasan_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)

...and here while applying.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list