devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Mike Turquette <mturquette@linaro.org>
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
	"Janusz Użycki" <j.uzycki@elproma.com.pl>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v2] clk: Add PWM clock driver
Date: Tue, 25 Nov 2014 08:56:35 +0100	[thread overview]
Message-ID: <1416902195.3166.1.camel@pengutronix.de> (raw)
In-Reply-To: <20141125070720.12298.46343@quantum>

Hi Mike,

Am Montag, den 24.11.2014, 23:07 -0800 schrieb Mike Turquette:
> Quoting Philipp Zabel (2014-11-03 01:31:18)
> > Some board designers, when running out of clock output pads, decide to
> > (mis)use PWM output pads to provide a clock to external components.
> > This driver supports this practice by providing an adapter between the
> > PWM and clock bindings in the device tree. As the PWM bindings specify
> > the period in the device tree, this is a fixed clock.
> > 
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > ---
> > I'm resending this because last time the linux-pwm list was not in Cc:
> > So far I have not received any comments on the patch itself. I have used
> > it on a BoundaryDevices Nitrogen6X board to produce a master clock for
> > the OV5640 MIPI CSI-2 camera module.
> > 
> > Changes since v1:
> >  - none (rebased onto v3.18-rc3)
> 
> Hi Philipp,
> 
> Thanks for testing this. Is the Nitrogen6X board merged upstream? I'm OK
> with the patch but prefer to merge things when a consumer is ready to
> use it. I guess you are missing a patch to add the pwm-clock bits to the
> Nitrogen6X dts?

The Nitrogen6X board is merged upstream already, I used this dts patch
to register the clock:

diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
index 7628049..e2e7a22 100644
--- a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
@@ -130,6 +130,18 @@
 		power-supply = <&reg_3p3v>;
 		status = "okay";
 	};
+
+	mipi_mclk: mipi-mclk {
+		compatible = "pwm-clock";
+		clock-output-names = "mipi-mclk";
+		/* Note: since the PWM reference clock is 66 MHz, the highest
+		 * possible frequency with 50% duty cycle smaller than 27 MHz
+		 * is 16.5 MHz: <&pwm3 0 61>;
+		 * But we can also do 22 MHz with 33% duty cycle:
+		 */
+		pwms = <&pwm3 0 46>; /* 22 MHz */
+		#clock-cells = <0>;
+	};
 };
 
 &audmux {
-- 
2.1.1

regards
Philipp


  reply	other threads:[~2014-11-25  7:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03  9:31 [PATCH v2] clk: Add PWM clock driver Philipp Zabel
     [not found] ` <1415007078-7947-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-11-25  7:07   ` Mike Turquette
2014-11-25  7:56     ` Philipp Zabel [this message]
2014-12-04 18:00 ` Janusz Użycki
2014-12-08 20:03   ` Janusz Użycki
     [not found]     ` <54860426.3020400-9tnw74Q4ehaHKKo6LODCOg@public.gmane.org>
2014-12-09  9:15       ` Philipp Zabel
2014-12-09 13:09         ` Janusz Użycki

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=1416902195.3166.1.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=j.uzycki@elproma.com.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).