From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Sean Anderson <sean.anderson@seco.com>
Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Alvaro Gamez <alvaro.gamez@hazent.com>,
Mubin Usman Sayyed <MUBINUSM@xilinx.com>,
linux-kernel@vger.kernel.org, michal.simek@xilinx.com,
Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH v13 2/2] pwm: Add support for Xilinx AXI Timer
Date: Thu, 3 Mar 2022 23:25:42 +0100 [thread overview]
Message-ID: <20220303222542.6ytwfp3bvm62igyy@pengutronix.de> (raw)
In-Reply-To: <20220204180106.154000-2-sean.anderson@seco.com>
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
Hello,
just a few minor things left for me to criticise:
On Fri, Feb 04, 2022 at 01:01:06PM -0500, Sean Anderson wrote:
> [...]
> + regmap_read(priv->map, TCSR1, &tcsr1);
> + state->period = xilinx_timer_get_period(priv, tlr0, tcsr0);
> + state->duty_cycle = xilinx_timer_get_period(priv, tlr1, tcsr1);
> + state->enabled = xilinx_timer_pwm_enabled(tcsr0, tcsr1);
> + state->polarity = PWM_POLARITY_NORMAL;
> +
> + /*
> + * 100% duty cycle results in constant low output. This may be slightly
> + * wrong if rate >= 1GHz, so fix this if you have such hardware :)
> + */
I'd drop "slightly" here. If the bug happens (e.g. tlr0 = 999999999,
tlr1 = 999999998, clkrate = 1000000001 Hz) then you diagnose a nearly
100% relative duty cycle as 0%. Also s/>= 1GHz/> 1 GHz/.
> [...]
> + if (one_timer)
> + return dev_err_probe(dev, -EINVAL,
> + "Two timers required for PWM mode\n");
> +
> +
One empty line here would be enough.
> diff --git a/include/clocksource/timer-xilinx.h b/include/clocksource/timer-xilinx.h
> new file mode 100644
> index 000000000000..1f7757b84a5e
> --- /dev/null
> +++ b/include/clocksource/timer-xilinx.h
> @@ -0,0 +1,91 @@
> [...]
> +/**
> + * xilinx_timer_common_init() - Perform common initialization for Xilinx
> + * AXI timer drivers.
> + * @priv: The timer's private data
> + * @np: The devicetree node for the timer
> + * @one_timer: Set to %1 if there is only one timer
> + *
> + * This performs common initialization, such as detecting endianness,
> + * and parsing devicetree properties. @priv->regs must be initialized
> + * before calling this function. This function initializes @priv->read,
> + * @priv->write, and @priv->width.
> + *
> + * Return: 0, or negative errno
> + */
> +int xilinx_timer_common_init(struct device_node *np,
> + struct xilinx_timer_priv *priv,
> + u32 *one_timer);
This function is gone, so the prototype should go away, too.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-03-03 22:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 18:01 [PATCH v13 1/2] dt-bindings: pwm: Add " Sean Anderson
2022-02-04 18:01 ` [PATCH v13 2/2] pwm: Add support for " Sean Anderson
2022-03-03 22:16 ` Sean Anderson
2022-03-03 22:25 ` Uwe Kleine-König [this message]
2022-03-03 22:28 ` Sean Anderson
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=20220303222542.6ytwfp3bvm62igyy@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=MUBINUSM@xilinx.com \
--cc=alvaro.gamez@hazent.com \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=sean.anderson@seco.com \
--cc=thierry.reding@gmail.com \
/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
all inboxes | Powered by JetHome®