From patchwork Thu May 5 15:53:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sperl X-Patchwork-Id: 9025751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5B52B9F372 for ; Thu, 5 May 2016 15:57:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FFD4203AA for ; Thu, 5 May 2016 15:57:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63A82202FF for ; Thu, 5 May 2016 15:57:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ayLbd-0007ba-CH; Thu, 05 May 2016 15:54:25 +0000 Received: from 212-186-180-163.dynamic.surfer.at ([212.186.180.163] helo=cgate.sperl.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ayLbP-0007WQ-J5; Thu, 05 May 2016 15:54:12 +0000 Received: from rasp3a.intern.sperl.org (account martin@sperl.org [10.10.10.43] verified) by sperl.org (CommuniGate Pro SMTP 6.1.2) with ESMTPSA id 6448385; Thu, 05 May 2016 15:53:31 +0000 From: kernel@martin.sperl.org To: Rob Herring , Mark Rutland , Stephen Warren , Lee Jones , Eric Anholt , Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH 2/5] clk: bcm2835: expose the parent clocks via include/dt-bindings Date: Thu, 5 May 2016 15:53:25 +0000 Message-Id: <1462463608-22940-3-git-send-email-kernel@martin.sperl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462463608-22940-1-git-send-email-kernel@martin.sperl.org> References: <1462463608-22940-1-git-send-email-kernel@martin.sperl.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160505_085412_012693_CC65C85C X-CRM114-Status: UNSURE ( 7.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Sperl MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Sperl Expose the parent clocks via include/dt-bindings, so that they can easily get referred to in the device tree. Signed-off-by: Martin Sperl --- drivers/clk/bcm/clk-bcm2835.c | 45 ++++++++++++++++++------------------- include/dt-bindings/clock/bcm2835.h | 26 +++++++++++++++++++++ 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index c19b99c9..1b1657d 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1303,10 +1303,10 @@ struct bcm2835_clk_desc { /* main oscillator parent mux */ static const char *const bcm2835_clock_osc_parents[] = { - "gnd", - "xosc", - "testdebug0", - "testdebug1" + [BCM2835_OSC_PARENT_GND] = "gnd", + [BCM2835_OSC_PARENT_OSC] = "xosc", + [BCM2835_OSC_PARENT_TESTDEBUG0] = "testdebug0", + [BCM2835_OSC_PARENT_TESTDEBUG1] = "testdebug1", }; #define REGISTER_OSC_CLK(...) REGISTER_CLK( \ @@ -1316,14 +1316,14 @@ static const char *const bcm2835_clock_osc_parents[] = { /* main peripherial parent mux */ static const char *const bcm2835_clock_per_parents[] = { - "gnd", - "xosc", - "testdebug0", - "testdebug1", - "plla_per", - "pllc_per", - "plld_per", - "pllh_aux", + [BCM2835_PER_PARENT_GND] = "gnd", + [BCM2835_PER_PARENT_OSC] = "xosc", + [BCM2835_PER_PARENT_TESTDEBUG0] = "testdebug0", + [BCM2835_PER_PARENT_TESTDEBUG1] = "testdebug1", + [BCM2835_PER_PARENT_PLLA_PER] = "plla_per", + [BCM2835_PER_PARENT_PLLC_PER] = "pllc_per", + [BCM2835_PER_PARENT_PLLD_PER] = "plld_per", + [BCM2835_PER_PARENT_PLLH_AUX] = "pllh_aux", }; #define REGISTER_PER_CLK(...) REGISTER_CLK( \ @@ -1333,18 +1333,17 @@ static const char *const bcm2835_clock_per_parents[] = { /* main vpu parent mux */ static const char *const bcm2835_clock_vpu_parents[] = { - "gnd", - "xosc", - "testdebug0", - "testdebug1", - "plla_core", - "pllc_core0", - "plld_core", - "pllh_aux", - "pllc_core1", - "pllc_core2", + [BCM2835_VPU_PARENT_GND] = "gnd", + [BCM2835_VPU_PARENT_OSC] = "xosc", + [BCM2835_VPU_PARENT_TESTDEBUG0] = "testdebug0", + [BCM2835_VPU_PARENT_TESTDEBUG1] = "testdebug1", + [BCM2835_VPU_PARENT_PLLA_CORE] = "plla_core", + [BCM2835_VPU_PARENT_PLLC_CORE0] = "pllc_core0", + [BCM2835_VPU_PARENT_PLLD_CORE] = "plld_core", + [BCM2835_VPU_PARENT_PLLH_AUX] = "pllh_aux", + [BCM2835_VPU_PARENT_PLLC_CORE1] = "pllc_core1", + [BCM2835_VPU_PARENT_PLLC_CORE2] = "pllc_core2", }; - #define REGISTER_VPU_CLK(...) REGISTER_CLK( \ .num_mux_parents = ARRAY_SIZE(bcm2835_clock_vpu_parents), \ .parents = bcm2835_clock_vpu_parents, \ diff --git a/include/dt-bindings/clock/bcm2835.h b/include/dt-bindings/clock/bcm2835.h index 360e00c..e5396fe 100644 --- a/include/dt-bindings/clock/bcm2835.h +++ b/include/dt-bindings/clock/bcm2835.h @@ -64,3 +64,29 @@ #define BCM2835_CLOCK_CAM1 46 #define BCM2835_CLOCK_DSI0E 47 #define BCM2835_CLOCK_DSI1E 48 + +/* the parent clock for different clock types */ +#define BCM2835_OSC_PARENT_GND 0 +#define BCM2835_OSC_PARENT_OSC 1 +#define BCM2835_OSC_PARENT_TESTDEBUG0 2 +#define BCM2835_OSC_PARENT_TESTDEBUG1 3 + +#define BCM2835_PER_PARENT_GND 0 +#define BCM2835_PER_PARENT_OSC 1 +#define BCM2835_PER_PARENT_TESTDEBUG0 2 +#define BCM2835_PER_PARENT_TESTDEBUG1 3 +#define BCM2835_PER_PARENT_PLLA_PER 4 +#define BCM2835_PER_PARENT_PLLC_PER 5 +#define BCM2835_PER_PARENT_PLLD_PER 6 +#define BCM2835_PER_PARENT_PLLH_AUX 7 + +#define BCM2835_VPU_PARENT_GND 0 +#define BCM2835_VPU_PARENT_OSC 1 +#define BCM2835_VPU_PARENT_TESTDEBUG0 2 +#define BCM2835_VPU_PARENT_TESTDEBUG1 3 +#define BCM2835_VPU_PARENT_PLLA_CORE 4 +#define BCM2835_VPU_PARENT_PLLC_CORE0 5 +#define BCM2835_VPU_PARENT_PLLD_CORE 6 +#define BCM2835_VPU_PARENT_PLLH_AUX 7 +#define BCM2835_VPU_PARENT_PLLC_CORE1 8 +#define BCM2835_VPU_PARENT_PLLC_CORE2 9