devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH v3 3/3] mfd: madera: Add support for requesting the supply clocks
Date: Fri, 4 Oct 2019 15:34:10 +0100	[thread overview]
Message-ID: <20191004143410.GJ18429@dell> (raw)
In-Reply-To: <20191001134617.12093-3-ckeepax@opensource.cirrus.com>

On Tue, 01 Oct 2019, Charles Keepax wrote:

> Add the ability to get the clock for each clock input pin of the chip
> and enable MCLK2 since that is expected to be a permanently enabled
> 32kHz clock.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> 
> Changes since v2:
>  - Use new devm_clk_bulk_get_optional API
> 
> Thanks,
> Charles
> 
>  drivers/mfd/madera-core.c       | 27 ++++++++++++++++++++++++++-
>  include/linux/mfd/madera/core.h | 11 +++++++++++
>  2 files changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c
> index 29540cbf75934..88d904eb016ea 100644
> --- a/drivers/mfd/madera-core.c
> +++ b/drivers/mfd/madera-core.c
> @@ -450,6 +450,21 @@ int madera_dev_init(struct madera *madera)
>  		       sizeof(madera->pdata));
>  	}
>  
> +	madera->mclk[MADERA_MCLK1].id = "mclk1";
> +	madera->mclk[MADERA_MCLK2].id = "mclk2";
> +	madera->mclk[MADERA_MCLK3].id = "mclk3";
> +
> +	ret = devm_clk_bulk_get_optional(madera->dev, ARRAY_SIZE(madera->mclk),
> +					 madera->mclk);
> +	if (ret) {
> +		dev_err(madera->dev, "Failed to get clocks: %d\n", ret);
> +		return ret;
> +	}
> +
> +	/* Not using devm_clk_get to prevent breakage of existing DTs */
> +	if (!madera->mclk[MADERA_MCLK2].clk)
> +		dev_warn(madera->dev, "Missing MCLK2, requires 32kHz clock\n");
> +
>  	ret = madera_get_reset_gpio(madera);
>  	if (ret)
>  		return ret;
> @@ -660,13 +675,19 @@ int madera_dev_init(struct madera *madera)
>  	}
>  
>  	/* Init 32k clock sourced from MCLK2 */
> +	ret = clk_prepare_enable(madera->mclk[MADERA_MCLK2].clk);
> +	if (ret != 0) {

Nit: Why is this not 'if (ret)' like in the rest of the file?

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2019-10-04 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 13:46 [PATCH 1/3] mfd: wm8998: Remove some unused registers Charles Keepax
2019-10-01 13:46 ` [PATCH v3 2/3] mfd: madera: Update DT binding document to support clock supplies Charles Keepax
2019-10-01 13:46 ` [PATCH v3 3/3] mfd: madera: Add support for requesting the supply clocks Charles Keepax
2019-10-04 14:34   ` Lee Jones [this message]
2019-10-04 15:21     ` Charles Keepax
2019-10-04 14:47 ` [PATCH 1/3] mfd: wm8998: Remove some unused registers Andrew F. Davis

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=20191004143410.GJ18429@dell \
    --to=lee.jones@linaro.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=patches@opensource.cirrus.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).