From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 15/21] serial_lpuart: add clock enable if CONFIG_CLK is defined
Date: Tue, 28 Jan 2020 19:49:37 +0100 [thread overview]
Message-ID: <79ac0fda-41ec-5f2a-30cb-e6c814af18d3@benettiengineering.com> (raw)
In-Reply-To: <20200128093614.53fa81de@jawa>
Hi Lukasz,
On 1/28/20 9:36 AM, Lukasz Majewski wrote:
> Hi Giulio,
>
>> This driver assumes that lpuart clock is already enabled before
>> probing but using DM only lpuart won't be automatically enabled so add
>> clk_enable() when probing if CONFIG_CLK is defined. If clock is not
>> found, because DM is not used, let's emit a warning and proceed,
>> because serial clock could also be already enabled by non DM code. If
>> clock is found but cna't be enabled then return with error.
> ^^^^ - can't
It's too late now, but...
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> V1->V2:
>> * moved error as warning if clk not found
>> ---
>> drivers/serial/serial_lpuart.c | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/serial/serial_lpuart.c
>> b/drivers/serial/serial_lpuart.c index 4b0a964d1b..b2ec56172e 100644
>> --- a/drivers/serial/serial_lpuart.c
>> +++ b/drivers/serial/serial_lpuart.c
>> @@ -483,6 +483,22 @@ static int lpuart_serial_pending(struct udevice
>> *dev, bool input)
>> static int lpuart_serial_probe(struct udevice *dev)
>> {
>> +#if CONFIG_IS_ENABLED(CLK)
>> + struct clk per_clk;
>> + int ret;
>> +
>> + ret = clk_get_by_name(dev, "per", &per_clk);
>> + if (!ret) {
>> + ret = clk_enable(&per_clk);
>> + if (ret) {
>> + dev_err(dev, "Failed to get per clk: %d\n",
>> ret);
>> + return ret;
>> + }
>> + } else {
>> + dev_warn(dev, "Failed to get per clk: %d\n", ret);
> ^^^^^^ - please change to debug() as some devices may
> enable CONFIG_CLK, but did not yet support (have
> implemented) this clock in CCF.
...not for this, I'm going to send a patch changing this string.
Best regards
--
Giulio Benetti
Benetti Engineering sas
>> + }
>> +#endif
>> +
>> if (is_lpuart32(dev))
>> return _lpuart32_serial_init(dev);
>> else
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
>
next prev parent reply other threads:[~2020-01-28 18:49 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 14:46 [PATCH v2 00/21] Add i.MXRT family support Giulio Benetti
2020-01-10 14:46 ` [PATCH v2 01/21] spl: fix entry_point equal to load_addr Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-28 8:09 ` Lukasz Majewski
2020-01-28 16:37 ` Giulio Benetti
2020-01-29 8:33 ` Lukasz Majewski
2020-01-10 14:46 ` [PATCH v2 02/21] armv7m: cache: add mmu_set_region_dcache_behaviour() stub for compatibility Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-28 8:10 ` Lukasz Majewski
2020-01-28 16:50 ` Giulio Benetti
2020-01-29 8:36 ` Lukasz Majewski
2020-01-10 14:46 ` [PATCH v2 03/21] clk: imx: pllv3: register PLLV3 GENERIC and USB as 2 different clocks Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-10 14:46 ` [PATCH v2 04/21] clk: imx: pllv3: set div_mask differently if PLLV3 is GENERIC or USB Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-10 14:46 ` [PATCH v2 05/21] clk: imx: pllv3: add enable() support Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-28 8:14 ` Lukasz Majewski
2020-01-28 18:46 ` Giulio Benetti
2020-01-10 14:46 ` [PATCH v2 06/21] clk: imx: pllv3: add disable() support Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-10 14:46 ` [PATCH v2 07/21] clk: imx: pllv3: add set_rate() support Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-10 14:46 ` [PATCH v2 08/21] clk: imx: pllv3: add PLLV3_SYS support Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-10 14:46 ` [PATCH v2 09/21] clk: imx: pllv3: add support for PLLV3_AV type Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-28 8:20 ` Lukasz Majewski
2020-01-31 13:50 ` Giulio Benetti
2020-01-10 14:47 ` [PATCH v2 10/21] clk: imx: pfd: add set_rate() Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-10 14:47 ` [PATCH v2 11/21] clk: imx: add i.IMXRT1050 clk driver Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-28 8:23 ` Lukasz Majewski
2020-01-10 14:47 ` [PATCH v2 12/21] pinctrl: add i.MXRT driver Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-28 8:27 ` Lukasz Majewski
2020-01-10 14:47 ` [PATCH v2 13/21] gpio: mxc_gpio: add support for i.MXRT1050 Giulio Benetti
2020-01-15 12:46 ` sbabic at denx.de
2020-01-28 8:27 ` Lukasz Majewski
2020-01-10 14:47 ` [PATCH v2 14/21] ARM: dts: imxrt1050: add dtsi file Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-28 8:31 ` Lukasz Majewski
2020-01-28 18:48 ` Giulio Benetti
2020-01-10 14:47 ` [PATCH v2 15/21] serial_lpuart: add clock enable if CONFIG_CLK is defined Giulio Benetti
2020-01-15 12:47 ` sbabic at denx.de
2020-01-28 8:36 ` Lukasz Majewski
2020-01-28 18:49 ` Giulio Benetti [this message]
2020-01-31 13:39 ` [PATCH] serial_lpuart: make clock failure less verbose Giulio Benetti
2020-01-31 18:14 ` Simon Glass
2020-01-31 20:24 ` Giulio Benetti
2020-02-01 12:48 ` Lukasz Majewski
2020-02-10 22:17 ` Giulio Benetti
2020-03-10 15:31 ` sbabic at denx.de
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=79ac0fda-41ec-5f2a-30cb-e6c814af18d3@benettiengineering.com \
--to=giulio.benetti@benettiengineering.com \
--cc=u-boot@lists.denx.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