mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mci: arasan: rework register_sdclk
Date: Tue, 9 Apr 2024 15:06:03 +0200	[thread overview]
Message-ID: <ZhU9OyY4Tl_RCLbX@pengutronix.de> (raw)
In-Reply-To: <20240409-v2024-03-0-topic-arasan-fixes-v1-1-abdd8501b311@pengutronix.de>

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@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 |



      parent reply	other threads:[~2024-04-09 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09  5:57 Steffen Trumtrar
2024-04-09 13:04 ` Sascha Hauer
2024-04-09 13:06 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZhU9OyY4Tl_RCLbX@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox