From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbdEaJAo (ORCPT ); Wed, 31 May 2017 05:00:44 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57753 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbdEaJAl (ORCPT ); Wed, 31 May 2017 05:00:41 -0400 Subject: Re: [PATCH 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER To: Phil Elwell , linux-clk@vger.kernel.org, Eric Anholt , linux-kernel@vger.kernel.org, Michael Turquette , Stephen Boyd , Florian Fainelli , linux-rpi-kernel@lists.infradead.org References: <866b60bb-d1c8-726e-3a2d-11a34f9e8ac7@raspberrypi.org> <684006892.45085.1496169665454@email.1und1.de> <56d5f9c5-ba15-4d3e-7956-fb697fe12114@raspberrypi.org> From: Stefan Wahren Message-ID: <6741c61b-e557-5063-2bad-2464eccfc639@i2se.com> Date: Wed, 31 May 2017 10:59:46 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <56d5f9c5-ba15-4d3e-7956-fb697fe12114@raspberrypi.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: de-DE X-Provags-ID: V03:K0:CYgVKCpktZN47DKoyvL6QdDJIbPTcy/xkYOQUpLngZw/D/eYvhM 8nhUJR40MXXwDszKZORm/kT3Z0EXXrDaOxdjKel+mKkOM1v1ZNeCUGhO+4snzLqBIjJJJRB h06Pfm/TroWqZ9ui1z4lmNIiHU4KyyiV/Lq9EMo3Dju2YgY4Np2HsTtiQJHMviJsnnEcvxW GvXFosDbyI9wIk5IEK/yA== X-UI-Out-Filterresults: notjunk:1;V01:K0:5lem4p2hiUQ=:UJh+QaP5xE3jg/IJ/+tsrP yY6CE610eA4IQRYD7MnA5hYJ9bsdBI9YJ01SN+cuxV3R0Fei288Wy+95fl7eYWUBEIPBofXoz Vi3/kpHMpKZwK5zXYSdInrb1SzDTqbQbGmqmj+4JRhqxRnngKTncWiVe1mHZJnt+/NsVh38ej sH9v634PgvvCLjim+5YQnoV4yCnOU9EI6uQwWGexebSKCjn7mtSipXCqng40yYNn53QVcGd79 WwWC8mYcATu27DPxjsDO5T4B/kdroZV3zFc9wQQpxCvmOdY/L1x6HnRolrruDjBz3Dc+JP+1a Z6+gN4n2SJtScGXVd+RdF+1+Pb+zskpaPAF9brHAsGRFNnHaUwlYFkyRq0aBXWOKHJGmh1xXn afkWUpnm96Frl3mzBLLCVwUEiNyWj//QGMQ2Z/EvyWJsW3k0okyWVgzZTHi7f1Qd0RXoPgnbB DgXBLLrKNLWxfsoYT/sqwnLZSKS8gi3xEYS89z8vnPSrRisQwh7cVx0SGmTQJfmR4yV3eiPiw 45liXqXQ44YEshJT0EkEBXKBMa8WFu3yeb4g4Jl9dw4V45EUI8CBdIclQQy5wGzPbtSQulwTb HHuMgt21+bBM9zufF/QSikFmsLP1rxY0rDozZaq+ER61wTHVlwpn+f8z99p2JwvtwAt61WLqI NUQsUXcbrUGsXjpV/6uMS1tAOXKYqkf3EjMjRUUeweQoztxnYJsLMVrFxgc8Sf3HQOhMiCZB1 LwmZYbZ1KrxDCNgh Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 31.05.2017 um 10:28 schrieb Phil Elwell: > Hi Stefan, > > On 30/05/2017 19:41, Stefan Wahren wrote: >> Hi Phil, >> >>> Phil Elwell hat am 30. Mai 2017 um 18:28 geschrieben: >>> >>> >>> Restrict clock sources for the PCM peripheral to the oscillator and >>> PLLD_PER because other source may have varying rates or be switched off. >>> Prevent other sources from being selected by replacing their names in >>> the list of potential parents with dummy entries (entry index is >>> significant). >> i like to have this as a comment above the definition of bcm2835_pcm_per_parents. > Sure - good idea. > >>> Signed-off-by: Phil Elwell >>> --- >>> drivers/clk/bcm/clk-bcm2835.c | 11 +++++++++++ >>> 1 file changed, 11 insertions(+) >>> >>> diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c >>> index 0258538..facc346 100644 >>> --- a/drivers/clk/bcm/clk-bcm2835.c >>> +++ b/drivers/clk/bcm/clk-bcm2835.c >>> @@ -1511,6 +1511,16 @@ struct bcm2835_clk_desc { >>> "pllh_aux", >>> }; >>> >>> +static const char *const bcm2835_pcm_per_parents[] = { >> As mentioned above, there should be a comment like all the others. > Yes, will do. > >>> + "-", >>> + "xosc", >>> + "-", >>> + "-", >>> + "-", >>> + "-", >>> + "plld_per", >>> +}; >> Is there a dummy entry for "pllh_aux" missing? > Yes and no - adding it will cause an extra iteration around the loop, but > perhaps it's less confusing. I'll add one. In case you want to save an iteration, you could add short comment instead of a dummy entry. > >>> + >>> #define REGISTER_PER_CLK(...) REGISTER_CLK( \ >>> .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents), \ >>> .parents = bcm2835_clock_per_parents, \ >>> @@ -2000,6 +2010,7 @@ struct bcm2835_clk_desc { >>> .int_bits = 12, >>> .frac_bits = 12, >>> .is_mash_clock = true, >>> + .parents = bcm2835_pcm_per_parents, >> This looks a little bit hacky to me. Not sure, but can we do something like this? >> >> #define REGISTER_PCM_CLK(...) REGISTER_CLK( \ >> .num_mux_parents = ARRAY_SIZE(bcm2835_pcm_per_parents), \ >> .parents = bcm2835_pcm_per_parents, \ >> __VA_ARGS__) > Of course - no problem. > > Thanks for the feedback - it will be incorporated into V2. > > Phil