All of lore.kernel.org
 help / color / mirror / Atom feed
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7] clk: add si5351 i2c common clock driver
Date: Wed, 10 Apr 2013 19:27:25 +0200	[thread overview]
Message-ID: <5165A0FD.5030308@gmail.com> (raw)
In-Reply-To: <14854575.YAd2OMKOy9@ganymedes>

Hooray Google!

Thanks for removing plain text sending from gmail web-frontend.. *sigh*
Sorry for resending this, but HTML mails get rejected by linux mailing lists.

On 04/10/2013 04:48 PM, Michal Bachraty wrote:
> Hi Sebastian,
> This driver doesn't work for me. In my case, u-boot initializes si-5351 and
> power down unused clocks while booting kernel.  there is need for power up
> clocks as was in previous versions of your driver.
> See patch, whre the problem is fixed:
>
> @@ -992,6 +992,10 @@ static long si5351_clkout_round_rate(struct clk_hw *hw,
> unsigned long rate,
>   		} while (1);
>   	}
>   	rate = *parent_rate>>  rdiv;
> +	
> +	/* powerup clkout */
> +	si5351_set_bits(hwdata->drvdata, SI5351_CLK0_CTRL + hwdata->num,
> +			SI5351_CLK_POWERDOWN, 0);
>
>   	dev_dbg(&hwdata->drvdata->client->dev,
>   		"%s - %s: rdiv = %u, parent_rate = %lu, rate = %lu\n",
>
> With this lines, driver works well.

Hmm, is there any driver using the clock output? Does it clk_prepare_enable() the clock?
I tend not to mess with anything the bootloader or eeprom config left disabled. It works
for me, but here the driver will prepare/enable the clock prior use.

> Also,
>
>>> +==Example==
>>> +
>>> +/* 25MHz reference crystal */
>>> +ref25: ref25M {
>>> +	compatible = "fixed-clock";
>>> +	#clock-cells =<0>;
>>> +	clock-frequency =<25000000>;
>>> +};
>>> +
>>> +i2c-master-node {
>>> +
>>> +	/* Si5351a msop10 i2c clock generator */
>>> +	si5351a: clock-generator at 60 {
>>> +		compatible = "silabs,si5351a-msop";
>>> +		reg =<0x60>;
>>> +		#address-cells =<1>;
>>> +		#size-cells =<0>;
>>> +		#clock-cells =<1>;
>>> +
>>> +		/* connect xtal input to 25MHz reference */
>>> +		clocks =<&ref25>;
>>> +
>>> +		/* connect xtal input as source of pll0 and pll1 */
>>> +		silabs,pll-source =<0 0>,<1 0>;
>>> +
>>> +		/*
>>> +		 * overwrite clkout0 configuration with:
>>> +		 * - 8mA output drive strength
>>> +		 * - pll0 as clock source of multisynth0
>>> +		 * - multisynth0 as clock source of output divider
>>> +		 * - multisynth0 can change pll0
>>> +		 * - set initial clock frequency of 74.25MHz
>>> +		 */
>>> +		clkout0 {
>>> +			reg =<0>;
>>> +			silabs,drive-strength =<8>;
>>> +			silabs,multisynth-source =<0>;
>>> +			silabs,clock-source =<0>;
>>> +			silabs,pll-master;
>>> +			clock-frequency =<74250000>;
>>> +		};
>>> +
>>> +		/*
>>> +		 * overwrite clkout1 configuration with:
>>> +		 * - 4mA output drive strength
>>> +		 * - pll1 as clock source of multisynth1
>>> +		 * - multisynth1 as clock source of output divider
>>> +		 * - multisynth1 can change pll1
>>> +		 */
>>> +		clkout1 {
>>> +			reg =<1>;
>>> +			silabs,drive-strength =<4>;
>>> +			silabs,multisynth-source =<1>;
>>> +			silabs,clock-source =<0>;
>>> +			pll-master;
>>> +		};
>>> +
>   Is definition of pll-master in clkout1 correct? should not be silabs,pll-
> master ?

Good catch.

Sebastian

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Michal Bachraty <michal.bachraty@streamunlimited.com>
Cc: linux-doc@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Grant Likely <grant.likely@secretlab.ca>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Stephen Warren <swarren@nvidia.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Mike Turquette <mturquette@linaro.org>,
	Rabeeh Khoury <rabeeh@solid-run.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Pawel Moll <pawel.moll@arm.com>,
	devicetree-discuss@lists.ozlabs.org,
	Rob Herring <rob.herring@calxeda.com>,
	Dom Cobley <popcornmix@gmail.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	Jean-Francois Moine <moinejf@free.fr>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linux-kernel@vger.kernel.org, Daniel Mack <zonque@gmail.com>,
	Rob Landley <rob@landley.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v7] clk: add si5351 i2c common clock driver
Date: Wed, 10 Apr 2013 19:27:25 +0200	[thread overview]
Message-ID: <5165A0FD.5030308@gmail.com> (raw)
In-Reply-To: <14854575.YAd2OMKOy9@ganymedes>

Hooray Google!

Thanks for removing plain text sending from gmail web-frontend.. *sigh*
Sorry for resending this, but HTML mails get rejected by linux mailing lists.

On 04/10/2013 04:48 PM, Michal Bachraty wrote:
> Hi Sebastian,
> This driver doesn't work for me. In my case, u-boot initializes si-5351 and
> power down unused clocks while booting kernel.  there is need for power up
> clocks as was in previous versions of your driver.
> See patch, whre the problem is fixed:
>
> @@ -992,6 +992,10 @@ static long si5351_clkout_round_rate(struct clk_hw *hw,
> unsigned long rate,
>   		} while (1);
>   	}
>   	rate = *parent_rate>>  rdiv;
> +	
> +	/* powerup clkout */
> +	si5351_set_bits(hwdata->drvdata, SI5351_CLK0_CTRL + hwdata->num,
> +			SI5351_CLK_POWERDOWN, 0);
>
>   	dev_dbg(&hwdata->drvdata->client->dev,
>   		"%s - %s: rdiv = %u, parent_rate = %lu, rate = %lu\n",
>
> With this lines, driver works well.

Hmm, is there any driver using the clock output? Does it clk_prepare_enable() the clock?
I tend not to mess with anything the bootloader or eeprom config left disabled. It works
for me, but here the driver will prepare/enable the clock prior use.

> Also,
>
>>> +==Example==
>>> +
>>> +/* 25MHz reference crystal */
>>> +ref25: ref25M {
>>> +	compatible = "fixed-clock";
>>> +	#clock-cells =<0>;
>>> +	clock-frequency =<25000000>;
>>> +};
>>> +
>>> +i2c-master-node {
>>> +
>>> +	/* Si5351a msop10 i2c clock generator */
>>> +	si5351a: clock-generator@60 {
>>> +		compatible = "silabs,si5351a-msop";
>>> +		reg =<0x60>;
>>> +		#address-cells =<1>;
>>> +		#size-cells =<0>;
>>> +		#clock-cells =<1>;
>>> +
>>> +		/* connect xtal input to 25MHz reference */
>>> +		clocks =<&ref25>;
>>> +
>>> +		/* connect xtal input as source of pll0 and pll1 */
>>> +		silabs,pll-source =<0 0>,<1 0>;
>>> +
>>> +		/*
>>> +		 * overwrite clkout0 configuration with:
>>> +		 * - 8mA output drive strength
>>> +		 * - pll0 as clock source of multisynth0
>>> +		 * - multisynth0 as clock source of output divider
>>> +		 * - multisynth0 can change pll0
>>> +		 * - set initial clock frequency of 74.25MHz
>>> +		 */
>>> +		clkout0 {
>>> +			reg =<0>;
>>> +			silabs,drive-strength =<8>;
>>> +			silabs,multisynth-source =<0>;
>>> +			silabs,clock-source =<0>;
>>> +			silabs,pll-master;
>>> +			clock-frequency =<74250000>;
>>> +		};
>>> +
>>> +		/*
>>> +		 * overwrite clkout1 configuration with:
>>> +		 * - 4mA output drive strength
>>> +		 * - pll1 as clock source of multisynth1
>>> +		 * - multisynth1 as clock source of output divider
>>> +		 * - multisynth1 can change pll1
>>> +		 */
>>> +		clkout1 {
>>> +			reg =<1>;
>>> +			silabs,drive-strength =<4>;
>>> +			silabs,multisynth-source =<1>;
>>> +			silabs,clock-source =<0>;
>>> +			pll-master;
>>> +		};
>>> +
>   Is definition of pll-master in clkout1 correct? should not be silabs,pll-
> master ?

Good catch.

Sebastian

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Michal Bachraty <michal.bachraty@streamunlimited.com>
Cc: Daniel Mack <zonque@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Warren <swarren@nvidia.com>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Dom Cobley <popcornmix@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Rabeeh Khoury <rabeeh@solid-run.com>,
	Jean-Francois Moine <moinejf@free.fr>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Guenter Roeck <linux@roeck-us.net>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7] clk: add si5351 i2c common clock driver
Date: Wed, 10 Apr 2013 19:27:25 +0200	[thread overview]
Message-ID: <5165A0FD.5030308@gmail.com> (raw)
In-Reply-To: <14854575.YAd2OMKOy9@ganymedes>

Hooray Google!

Thanks for removing plain text sending from gmail web-frontend.. *sigh*
Sorry for resending this, but HTML mails get rejected by linux mailing lists.

On 04/10/2013 04:48 PM, Michal Bachraty wrote:
> Hi Sebastian,
> This driver doesn't work for me. In my case, u-boot initializes si-5351 and
> power down unused clocks while booting kernel.  there is need for power up
> clocks as was in previous versions of your driver.
> See patch, whre the problem is fixed:
>
> @@ -992,6 +992,10 @@ static long si5351_clkout_round_rate(struct clk_hw *hw,
> unsigned long rate,
>   		} while (1);
>   	}
>   	rate = *parent_rate>>  rdiv;
> +	
> +	/* powerup clkout */
> +	si5351_set_bits(hwdata->drvdata, SI5351_CLK0_CTRL + hwdata->num,
> +			SI5351_CLK_POWERDOWN, 0);
>
>   	dev_dbg(&hwdata->drvdata->client->dev,
>   		"%s - %s: rdiv = %u, parent_rate = %lu, rate = %lu\n",
>
> With this lines, driver works well.

Hmm, is there any driver using the clock output? Does it clk_prepare_enable() the clock?
I tend not to mess with anything the bootloader or eeprom config left disabled. It works
for me, but here the driver will prepare/enable the clock prior use.

> Also,
>
>>> +==Example==
>>> +
>>> +/* 25MHz reference crystal */
>>> +ref25: ref25M {
>>> +	compatible = "fixed-clock";
>>> +	#clock-cells =<0>;
>>> +	clock-frequency =<25000000>;
>>> +};
>>> +
>>> +i2c-master-node {
>>> +
>>> +	/* Si5351a msop10 i2c clock generator */
>>> +	si5351a: clock-generator@60 {
>>> +		compatible = "silabs,si5351a-msop";
>>> +		reg =<0x60>;
>>> +		#address-cells =<1>;
>>> +		#size-cells =<0>;
>>> +		#clock-cells =<1>;
>>> +
>>> +		/* connect xtal input to 25MHz reference */
>>> +		clocks =<&ref25>;
>>> +
>>> +		/* connect xtal input as source of pll0 and pll1 */
>>> +		silabs,pll-source =<0 0>,<1 0>;
>>> +
>>> +		/*
>>> +		 * overwrite clkout0 configuration with:
>>> +		 * - 8mA output drive strength
>>> +		 * - pll0 as clock source of multisynth0
>>> +		 * - multisynth0 as clock source of output divider
>>> +		 * - multisynth0 can change pll0
>>> +		 * - set initial clock frequency of 74.25MHz
>>> +		 */
>>> +		clkout0 {
>>> +			reg =<0>;
>>> +			silabs,drive-strength =<8>;
>>> +			silabs,multisynth-source =<0>;
>>> +			silabs,clock-source =<0>;
>>> +			silabs,pll-master;
>>> +			clock-frequency =<74250000>;
>>> +		};
>>> +
>>> +		/*
>>> +		 * overwrite clkout1 configuration with:
>>> +		 * - 4mA output drive strength
>>> +		 * - pll1 as clock source of multisynth1
>>> +		 * - multisynth1 as clock source of output divider
>>> +		 * - multisynth1 can change pll1
>>> +		 */
>>> +		clkout1 {
>>> +			reg =<1>;
>>> +			silabs,drive-strength =<4>;
>>> +			silabs,multisynth-source =<1>;
>>> +			silabs,clock-source =<0>;
>>> +			pll-master;
>>> +		};
>>> +
>   Is definition of pll-master in clkout1 correct? should not be silabs,pll-
> master ?

Good catch.

Sebastian

  parent reply	other threads:[~2013-04-10 17:27 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 12:59 [PATCH] clk: add si5351 i2c common clock driver Sebastian Hesselbarth
2013-02-09 12:59 ` Sebastian Hesselbarth
2013-02-11  5:46 ` Mike Turquette
2013-02-11  5:46   ` Mike Turquette
2013-02-11  5:46   ` Mike Turquette
2013-02-11  9:52   ` Sebastian Hesselbarth
2013-02-11  9:52     ` Sebastian Hesselbarth
2013-02-18 10:19 ` Daniel Mack
2013-02-18 10:19   ` Daniel Mack
2013-02-19 19:15 ` Daniel Mack
2013-02-19 19:15   ` Daniel Mack
2013-02-19 19:15   ` Daniel Mack
2013-02-27 10:01   ` Sebastian Hesselbarth
2013-02-27 10:01     ` Sebastian Hesselbarth
2013-03-01 15:01     ` Daniel Mack
2013-03-01 15:01       ` Daniel Mack
2013-03-16 13:10 ` [PATCH v2] " Sebastian Hesselbarth
2013-03-16 13:10   ` Sebastian Hesselbarth
2013-03-16 15:10   ` Daniel Mack
2013-03-16 15:10     ` Daniel Mack
2013-03-18 10:43 ` [PATCH v3] " Sebastian Hesselbarth
2013-03-18 10:43   ` Sebastian Hesselbarth
2013-03-18 11:37   ` Daniel Mack
2013-03-18 11:37     ` Daniel Mack
2013-03-20  0:26   ` Mike Turquette
2013-03-20  0:26     ` Mike Turquette
2013-03-20  0:26     ` Mike Turquette
2013-03-20  8:20     ` Sebastian Hesselbarth
2013-03-20  8:20       ` Sebastian Hesselbarth
2013-03-21 18:09   ` Lars-Peter Clausen
2013-03-21 18:09     ` Lars-Peter Clausen
2013-03-21 21:32     ` Sebastian Hesselbarth
2013-03-21 21:32       ` Sebastian Hesselbarth
2013-03-23 10:07       ` Lars-Peter Clausen
2013-03-23 10:07         ` Lars-Peter Clausen
2013-03-23 14:46   ` [PATCH v4] " Sebastian Hesselbarth
2013-03-23 14:46     ` Sebastian Hesselbarth
2013-03-23 14:46     ` Sebastian Hesselbarth
2013-04-02 23:46     ` Mike Turquette
2013-04-02 23:46       ` Mike Turquette
2013-04-02 23:46       ` Mike Turquette
2013-04-03 11:10       ` Sebastian Hesselbarth
2013-04-03 11:10         ` Sebastian Hesselbarth
2013-04-05  5:23     ` [PATCH v5] " Sebastian Hesselbarth
2013-04-05  5:23       ` Sebastian Hesselbarth
2013-04-07 22:50       ` [v5] " Guenter Roeck
2013-04-07 22:50         ` Guenter Roeck
2013-04-07 23:49         ` Sebastian Hesselbarth
2013-04-07 23:49           ` Sebastian Hesselbarth
2013-04-08  0:17           ` Guenter Roeck
2013-04-08  0:17             ` Guenter Roeck
2013-04-08  6:11             ` Sebastian Hesselbarth
2013-04-08  6:11               ` Sebastian Hesselbarth
2013-04-08 14:54               ` Guenter Roeck
2013-04-08 14:54                 ` Guenter Roeck
2013-04-08 14:54                 ` Guenter Roeck
2013-04-08 15:38                 ` Sebastian Hesselbarth
2013-04-08 15:38                   ` Sebastian Hesselbarth
2013-04-08 15:38                   ` Sebastian Hesselbarth
2013-04-08 17:36                   ` Mike Turquette
2013-04-08 17:36                     ` Mike Turquette
2013-04-08 18:32                     ` Sebastian Hesselbarth
2013-04-08 18:32                       ` Sebastian Hesselbarth
2013-04-08 16:46       ` [PATCH v6] " Sebastian Hesselbarth
2013-04-08 16:46         ` Sebastian Hesselbarth
2013-04-08 17:46         ` Guenter Roeck
2013-04-08 17:46           ` Guenter Roeck
2013-04-08 18:24           ` Sebastian Hesselbarth
2013-04-08 18:24             ` Sebastian Hesselbarth
2013-04-10  9:40         ` [PATCH v7] " Sebastian Hesselbarth
2013-04-10  9:40           ` Sebastian Hesselbarth
2013-04-10  9:40           ` Sebastian Hesselbarth
2013-04-10 10:17           ` Daniel Mack
2013-04-10 10:17             ` Daniel Mack
2013-04-10 14:48             ` Michal Bachraty
2013-04-10 14:48               ` Michal Bachraty
2013-04-10 16:34               ` Sebastian Hesselbarth
2013-04-10 17:27               ` Sebastian Hesselbarth [this message]
2013-04-10 17:27                 ` Sebastian Hesselbarth
2013-04-10 17:27                 ` Sebastian Hesselbarth
2013-04-11  7:44                 ` Michal Bachraty
2013-04-11  7:44                   ` Michal Bachraty
2013-04-11  8:22                   ` Sebastian Hesselbarth
2013-04-11  8:22                     ` Sebastian Hesselbarth
2013-04-10 19:34           ` Guenter Roeck
2013-04-10 19:34             ` Guenter Roeck
2013-04-11 19:42           ` [PATCH v8] " Sebastian Hesselbarth
2013-04-11 19:42             ` Sebastian Hesselbarth
2013-04-11 19:42             ` Sebastian Hesselbarth
2013-04-12 11:43             ` Michal Bachraty
2013-04-12 11:43               ` Michal Bachraty
2013-04-12 11:43               ` Michal Bachraty
2013-04-12 18:19             ` Mike Turquette
2013-04-12 18:19               ` Mike Turquette
2013-04-12 18:19               ` Mike Turquette

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=5165A0FD.5030308@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.