From patchwork Sat Jan 9 09:25:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sperl X-Patchwork-Id: 8017101 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17E14BEEE5 for ; Tue, 12 Jan 2016 13:19:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49666203C3 for ; Tue, 12 Jan 2016 13:19:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0CBE6203C2 for ; Tue, 12 Jan 2016 13:19:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 135DD265DC8; Tue, 12 Jan 2016 14:18:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B99E92654C9; Tue, 12 Jan 2016 14:15:19 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A0AE626051D; Sat, 9 Jan 2016 10:26:46 +0100 (CET) Received: from cgate.sperl.org (212-186-180-163.dynamic.surfer.at [212.186.180.163]) by alsa0.perex.cz (Postfix) with ESMTP id 8A5A026051B for ; Sat, 9 Jan 2016 10:26:31 +0100 (CET) Received: from raspcm.intern.sperl.org (account martin@sperl.org [10.10.10.41] verified) by sperl.org (CommuniGate Pro SMTP 6.1.2) with ESMTPSA id 6391186; Sat, 09 Jan 2016 09:26:29 +0000 From: kernel@martin.sperl.org To: Stephen Warren , Lee Jones , Eric Anholt , Russell King , Michael Turquette , Remi Pommarel , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, alsa-devel@alsa-project.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Reichl , lFlorian Meier Date: Sat, 9 Jan 2016 09:25:54 +0000 Message-Id: <1452331558-2520-3-git-send-email-kernel@martin.sperl.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1452331558-2520-1-git-send-email-kernel@martin.sperl.org> References: <1452331558-2520-1-git-send-email-kernel@martin.sperl.org> X-Mailman-Approved-At: Tue, 12 Jan 2016 14:15:09 +0100 Cc: Martin Sperl Subject: [alsa-devel] [PATCH 2/5] clk: bcm2835: enable management of PCM clock X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Sperl Enable the PCM clock in the SOC, which is used by the bcm2835-i2s driver. Signed-off-by: Martin Sperl --- drivers/clk/bcm/clk-bcm2835.c | 15 +++++++++++++++ include/dt-bindings/clock/bcm2835.h | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 015e687..5d45457 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -88,6 +88,8 @@ #define CM_HSMDIV 0x08c #define CM_OTPCTL 0x090 #define CM_OTPDIV 0x094 +#define CM_PCMCTL 0x098 +#define CM_PCMDIV 0x09c #define CM_PWMCTL 0x0a0 #define CM_PWMDIV 0x0a4 #define CM_SMICTL 0x0b0 @@ -817,6 +819,16 @@ static const struct bcm2835_clock_data bcm2835_clock_pwm_data = { .frac_bits = 12, }; +static const struct bcm2835_clock_data bcm2835_clock_pcm_data = { + .name = "pcm", + .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents), + .parents = bcm2835_clock_per_parents, + .ctl_reg = CM_PCMCTL, + .div_reg = CM_PCMDIV, + .int_bits = 12, + .frac_bits = 12, +}; + struct bcm2835_pll { struct clk_hw hw; struct bcm2835_cprman *cprman; @@ -1515,6 +1527,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev) cprman->regs = devm_ioremap_resource(dev, res); if (IS_ERR(cprman->regs)) return PTR_ERR(cprman->regs); + pr_info("CLK: %pK %zx\n", cprman->regs, res->start); cprman->osc_name = of_clk_get_parent_name(dev->of_node, 0); if (!cprman->osc_name) @@ -1581,6 +1594,8 @@ static int bcm2835_clk_probe(struct platform_device *pdev) bcm2835_register_clock(cprman, &bcm2835_clock_hsm_data); clks[BCM2835_CLOCK_EMMC] = bcm2835_register_clock(cprman, &bcm2835_clock_emmc_data); + clks[BCM2835_CLOCK_PCM] = + bcm2835_register_clock(cprman, &bcm2835_clock_pcm_data); /* * CM_PERIICTL (and CM_PERIACTL, CM_SYSCTL and CM_VPUCTL if diff --git a/include/dt-bindings/clock/bcm2835.h b/include/dt-bindings/clock/bcm2835.h index 61f1d20..0ec850e 100644 --- a/include/dt-bindings/clock/bcm2835.h +++ b/include/dt-bindings/clock/bcm2835.h @@ -44,5 +44,6 @@ #define BCM2835_CLOCK_EMMC 28 #define BCM2835_CLOCK_PERI_IMAGE 29 #define BCM2835_CLOCK_PWM 30 +#define BCM2835_CLOCK_PCM 31 -#define BCM2835_CLOCK_COUNT 31 +#define BCM2835_CLOCK_COUNT 32