From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753110AbbDFJrE (ORCPT ); Mon, 6 Apr 2015 05:47:04 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:50521 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbbDFJrA (ORCPT ); Mon, 6 Apr 2015 05:47:00 -0400 Date: Mon, 6 Apr 2015 10:46:36 +0100 From: Mark Brown To: Florian Fainelli Cc: Jonathan Richardson , Dmitry Torokhov , Anatol Pomazau , Scott Branden , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, bcm-kernel-feedback-list , devicetree@vger.kernel.org, Rafal Milecki , Brian Norris , Kevin Cernekee Message-ID: <20150406094636.GC6023@sirena.org.uk> References: <1428002603-21892-1-git-send-email-jonathar@broadcom.com> <1428002603-21892-5-git-send-email-jonathar@broadcom.com> <552037BB.7050803@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dOtxUVmLoGkyu1PA" Content-Disposition: inline In-Reply-To: <552037BB.7050803@gmail.com> X-Cookie: I've been there. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 4/4] spi: bcm-mspi: Add support to set serial baud clock rate X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dOtxUVmLoGkyu1PA Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 04, 2015 at 12:12:59PM -0700, Florian Fainelli wrote: > Le 02/04/2015 12:23, Jonathan Richardson a =E9crit : > > + /* Calculate SPBR if clock-frequency provided. */ > > + if (of_property_read_u32(dev->of_node, "clock-frequency", > > + &desired_rate) >=3D 0) { > > + u32 spbr =3D clk_get_rate(data->clk) / (2 * desired_rate); > Usually, specifying a "clock-frequency" property is done when there is > no clock provider available, yet we take this code path only if we could > find a "mspi_clk" which sounds a litle weird. > Once there is a proper "mspi_clk" clock, I would make it mandatory for > the clock provider to be able to provide the rate as well? As far as I can tell it's already mandatory if the property is present - it's taking the clock presented to the block and then using an internal divider to bring that down to the desired rate. We are missing error handling though. --dOtxUVmLoGkyu1PA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVIlX7AAoJECTWi3JdVIfQThUH/R+N431/FW64SW9FYGRYdUBW mmPexicfM/zDQkl+zrw54yNUtWwUE/h4GcqVle1uU7J4dARbvBI0AeEXMjZfA6Fa 4fI8YnDE67YHkvl6bqmnSyHcw4V4b9zUuMtxOmOLDi0A4zILsVodbPkJbo5SYu6B xKVmgFAhRw/MdxdxxiYt0CLQ8GIu6O635IX6Cfcf0IBNc8uICFf4MdrWi2HG4xOF RrAke52eHmiK9skR67VAH9Vm2sh8iyKJeE++ewbWo+7fYot1gpmF2HPkpcPtW1cQ EoY3ShjogBbxfpKfuH6yyfX/w5rYPT9Y6sjdbWaUjfOZ/VgPhD6a/ioNVaDaUK8= =gcDB -----END PGP SIGNATURE----- --dOtxUVmLoGkyu1PA--