From patchwork Tue May 30 16:28:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Elwell X-Patchwork-Id: 9754875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0293D602BF for ; Tue, 30 May 2017 16:28:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8A6026E49 for ; Tue, 30 May 2017 16:28:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD5AE27CEA; Tue, 30 May 2017 16:28:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB13726E49 for ; Tue, 30 May 2017 16:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751039AbdE3Q2S (ORCPT ); Tue, 30 May 2017 12:28:18 -0400 Received: from mx08-00252a01.pphosted.com ([91.207.212.211]:43078 "EHLO mx08-00252a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbdE3Q2O (ORCPT ); Tue, 30 May 2017 12:28:14 -0400 Received: from pps.filterd (m0102629.ppops.net [127.0.0.1]) by mx08-00252a01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4UGRp3W014336 for ; Tue, 30 May 2017 17:28:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; h=to : from : subject : message-id : date : mime-version : content-type : content-transfer-encoding; s=pp; bh=G3Z7ok+HH9S5M55tyY/hGU4IMvUD7PVOWeuB1fkSwUA=; b=P/ZJaceLNMl5VlsLOugaH5Y/xzSw6wdu2h6lQicBLYKk0+rQylOQoUyoaX0th29hDEja XAgPKKheU5OOByQ+mj3dE+N7V0wHmQtr5RKBoQODV4j+LYtKbjG6p+8Y3L1sa6FNRi4w hcq+74hhMW6JhSWWhmghph8ozLyHmGC2V/qKR+C7mEB5reeONiwbjgynbwCoV0Ylfh91 CZG9dbEhsrsSk5O+SLPvJ/1Pm2rCLt8DK20Ch7gqODuim8BtSADFOIjxlU0DT4ZLT1wj lXwDdwe3kFpf97BRfY+R99q76vDp3EJ/6YGLI2wT/4kPbFzUtPXYPuGy3PvLhoGMkWt1 wQ== Received: from mail-wr0-f197.google.com (mail-wr0-f197.google.com [209.85.128.197]) by mx08-00252a01.pphosted.com with ESMTP id 2apwxeskx1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Tue, 30 May 2017 17:28:07 +0100 Received: by mail-wr0-f197.google.com with SMTP id g36so818460wrg.4 for ; Tue, 30 May 2017 09:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi-org.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=G3Z7ok+HH9S5M55tyY/hGU4IMvUD7PVOWeuB1fkSwUA=; b=cKrMDXGxXCN1pBROibl+hwrmUNc5XXpD5JsAC56oHuTRlEgCDI4zyYgBWwWYGbbqu9 fpMj5hRd68emnl3vwDxZKqoMCpbc3i4pvY8WzMWaS34BS1sUYZ3fHdiHTe/6LcHYYC19 Tr/J47IiyEXvsXVq366fcI7eEcKn38OXgNPEDDpOtM7hsszCGdQ3ndaAWj7q7rBY0yG9 9zS2G8TR+xprQpvd9ni3Pw9EL/hFNrSmqhONeSnwzyULiF58nfmO4UAQZWphaKmJwoAR GQmGQcuVFpaunROv+ktKtY6Zc8okoIbhbojXYGuOpruRJd2wuDbZcSZDgW5+Zq8PYazx un5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=G3Z7ok+HH9S5M55tyY/hGU4IMvUD7PVOWeuB1fkSwUA=; b=sFbiofbvXeotaWOIFcaLJqL+zOcc8FrGEHUtdL8QBvrLqKr6l4SCoJPRWJd1aglls+ YzOdVduORyQHRa1x8gkP0dMX+3uWdxLuC3ti9/EeTX3h9/Y3wp7D/Zjnt2JfdT20jJPK louseMvyDO1pu47O6aL1+3ItP7M+ZHHQJ71z13N+xmwks5b8SUGcy0u7fD1PLbC4y9zW ETriqGsZsKb/PmEAJUBPBoQFhkcWIvdoErQN/LC19hB0ke0UG8+jYBdmivemxvskUhF6 4GQkc42KF7AWKtNMc+QMGsTeToQcWco6PzOIxJyRCdwbjD3YtiibJpKMSMoY1Ss7jJ2g Hh2A== X-Gm-Message-State: AODbwcAev/9d2yHuX9RqwC0+0mg3hHn0rfWlKfkD7wAuOOrpLoz49IRz 2IkILyt2R2cdfoXdKYe982m+0gJTSmltO/H1sB0rDgaJ2TjzQNX/yi8cqVTulBWM6qZ4uC7V4NV 2XUppD1csj1s= X-Received: by 10.223.141.247 with SMTP id o110mr6344987wrb.69.1496161686704; Tue, 30 May 2017 09:28:06 -0700 (PDT) X-Received: by 10.223.141.247 with SMTP id o110mr6344964wrb.69.1496161686522; Tue, 30 May 2017 09:28:06 -0700 (PDT) Received: from ?IPv6:2a00:2381:fdf7:14:79d0:49c2:6e14:f72b? ([2a00:2381:fdf7:14:79d0:49c2:6e14:f72b]) by smtp.gmail.com with ESMTPSA id j126sm13556066wmd.29.2017.05.30.09.28.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 09:28:05 -0700 (PDT) To: Michael Turquette , Stephen Boyd , Eric Anholt , Stefan Wahren , Florian Fainelli , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Phil Elwell Subject: [PATCH 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER Message-ID: <866b60bb-d1c8-726e-3a2d-11a34f9e8ac7@raspberrypi.org> Date: Tue, 30 May 2017 17:28:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Language: en-GB X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-30_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705300305 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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). 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[] = { + "-", + "xosc", + "-", + "-", + "-", + "-", + "plld_per", +}; + #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, .tcnt_mux = 23), [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( .name = "pwm",