All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lechner <david@lechnology.com>
To: thesven73@gmail.com, svendev@arcx.com, lee.jones@linaro.org,
	robh+dt@kernel.org, mark.rutland@arm.com, afaerber@suse.de,
	treding@nvidia.com, noralf@tronnes.org, johan@kernel.org,
	monstr@monstr.eu, michal.vokac@ysoft.com, arnd@arndb.de,
	gregkh@linuxfoundation.org, john.garry@huawei.com,
	geert+renesas@glider.be, robin.murphy@arm.com,
	paul.gortmaker@windriver.com,
	sebastien.bourdelin@savoirfairelinux.com, icenowy@aosc.io,
	yuanzhichang@hisilicon.com, stuyoder@gmail.com,
	linus.walleij@linaro.org, maxime.ripard@bootlin.com,
	bogdan.purcareata@nxp.com
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH anybus v1 2/4] dt-bindings: anybus-bridge: document devicetree binding.
Date: Thu, 25 Oct 2018 10:30:49 -0500	[thread overview]
Message-ID: <68f2d881-0c22-60e3-e79f-b8c7c2c02d06@lechnology.com> (raw)
In-Reply-To: <20181025135515.8397-1-TheSven73@googlemail.com>

On 10/25/2018 08:55 AM, thesven73@gmail.com wrote:
> Hi Linus, thank you for the patch review !!
> 
>>> +  - pwms : the pwm connected to the bridge's 'pwm input'.
>>
>> That is really unintuitive and needs a detailed explanation. What
>> is a bridge doing with a PWM? Is it 100% certain this is a PWM,
>> it's not just a .... clock? A pwm is a pule WIDTH modulator and
>> I can't for my life understand why a bus bridge needs a signal
>> with variable pulse width, but surprise me! :D
> 
> You are 100% correct, this is a clock !
> The hardware designers attached the bridge's clock input to an iMX pwm output,
> and instructed us to provide a clock with 50% duty cycle and a certain freq.
> 
> The only way I know to activate a pwm is to connect it to a driver in the fdt,
> then inside the driver enable the pwm, like so:
> 
> +       /* PWM */
> +       pwm = devm_pwm_get(dev, NULL);
> +       if (IS_ERR(pwm)) {
> +               dev_err(dev, "pwm not found\n");
> +               return -EINVAL;
> +       }
> +       pwm_get_args(pwm, &pargs);
> +       period = pargs.period;
> +       err = pwm_config(pwm, period/2, period);
> +       if (err)
> +               return err;
> +       err = pwm_enable(pwm);
> +       if (err)
> +               return err;
> 
> This is why the bridge driver has a dependency on a pwm.
> If the pwm could be enabled individually, I could drop this dependency.
> Can you think of a way?


How about using the pwm-clock device tree binding to turn the PWM into
a clock?

Documentation/devicetree/bindings/clock/pwm-clock.txt

  reply	other threads:[~2018-10-25 15:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 13:55 [PATCH anybus v1 2/4] dt-bindings: anybus-bridge: document devicetree binding thesven73
2018-10-25 15:30 ` David Lechner [this message]
2018-10-26 11:28 ` Linus Walleij
2018-10-26 11:28   ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2018-10-25 15:46 thesven73
2018-10-26  6:39 ` Lee Jones
2018-10-25 13:35 thesven73
2018-10-24 14:24 [PATCH anybus v1 0/4] Support HMS Profinet Card over Anybus Sven Van Asbroeck
2018-10-24 14:24 ` [PATCH anybus v1 2/4] dt-bindings: anybus-bridge: document devicetree binding Sven Van Asbroeck
2018-10-24 14:24   ` Sven Van Asbroeck
2018-10-25  0:06   ` Rob Herring
2018-10-25  5:19   ` Lee Jones
2018-10-25 10:16   ` Linus Walleij
2018-10-25 10:16     ` Linus Walleij

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=68f2d881-0c22-60e3-e79f-b8c7c2c02d06@lechnology.com \
    --to=david@lechnology.com \
    --cc=afaerber@suse.de \
    --cc=arnd@arndb.de \
    --cc=bogdan.purcareata@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=icenowy@aosc.io \
    --cc=johan@kernel.org \
    --cc=john.garry@huawei.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=michal.vokac@ysoft.com \
    --cc=monstr@monstr.eu \
    --cc=noralf@tronnes.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sebastien.bourdelin@savoirfairelinux.com \
    --cc=stuyoder@gmail.com \
    --cc=svendev@arcx.com \
    --cc=thesven73@gmail.com \
    --cc=treding@nvidia.com \
    --cc=yuanzhichang@hisilicon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.