From patchwork Fri May 18 08:57:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei YU X-Patchwork-Id: 916130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nMWM0pKBz9s37 for ; Fri, 18 May 2018 18:57:35 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E2s2e8dE"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40nMWL4qgYzF29T for ; Fri, 18 May 2018 18:57:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E2s2e8dE"; dkim-atps=neutral X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::243; helo=mail-pg0-x243.google.com; envelope-from=mine260309@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E2s2e8dE"; dkim-atps=neutral Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40nMWG0SDzzF24p for ; Fri, 18 May 2018 18:57:29 +1000 (AEST) Received: by mail-pg0-x243.google.com with SMTP id a13-v6so3043943pgu.4 for ; Fri, 18 May 2018 01:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=In/rAxssEniz8nyglrw0kplwiD7IyDZ4JEz4TkFeRTs=; b=E2s2e8dEMPQNbfzxtopk2bG/XiZH5lN7Zyt3i+l7d7kPHH0fETuALEV1MxgUa25CTh fYI1nqjeZviJbBP1BKiKFZPfmhyXS9sTeq6VXzwahUFbPvwLZIWrtEoaYGmoxuDqFJym WXz6fQYkqmXF0/MHJOAU4TffRNSlxxZ2LZWPgrmAItU0vRjVrYy5xMm+9noRCQCCNaXP 8aDipKmAYbAxuUm/zabCFxktVDuwly7z9EteFgWc2FFjWJ372bYpgLIdJmaRR/6oKFev BsP8ancZmjbzB7DRwmS131x4FYfbYqZmvg+r5jQaloJ+iVU5Mzga+e3BmQN6RnwE4Kk4 HLsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=In/rAxssEniz8nyglrw0kplwiD7IyDZ4JEz4TkFeRTs=; b=gBdwlibdpjxVPS0XY9YWUdCq7LvDLUp+Klvs1I786HoRgm5eKRxHzqzA7/oq1M476X rusSPEq3fr/bB0KKNwlA/Ss6TbIl22fyfGu3gI3GiRDIZdydS51pR6xBVPah4NuvJqUR gBxTcbD5LxmQXAkzu3yGn8a865hyP3GwivnMFXnedlomsXsIY5YefjcEff3Znmhw7IPg JUPhvsrdA7j1d9eBuw+vWSVXjk9KMz/dq5js8fmgK+vrgrO9B7M8rPaMZGiXjnQKIQ53 BqQkWCV07kNaFXencErkSUrtHNjtoi2DmNYGvolnBDixhFFXiAY4cBFn+6RkoIL9u6SJ nK2w== X-Gm-Message-State: ALKqPwdhk2eYYm/nZJWfB6a4wGLn79NlSDEdOoU0yV/Nijr8hSV06VrE BQmXuic/mgt1q9SzcUHzvzE= X-Google-Smtp-Source: AB8JxZq0hOVGItC/jsH1cCdaJ7bnKo+QZHlDjnkvvCF3sSgtrLRGrBUE+GIMJLxm6OMvtvYVAfPKMw== X-Received: by 2002:a65:6489:: with SMTP id e9-v6mr6822362pgv.44.1526633847554; Fri, 18 May 2018 01:57:27 -0700 (PDT) Received: from localhost (45.62.100.246.16clouds.com. [45.62.100.246]) by smtp.gmail.com with ESMTPSA id x88-v6sm19773430pfj.126.2018.05.18.01.57.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 01:57:26 -0700 (PDT) From: Lei YU To: Michael Turquette , Stephen Boyd , Joel Stanley , Andrew Jeffery , Rob Herring , Mark Rutland , Lei YU , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH] clk: aspeed: Add 24MHz fixed clock Date: Fri, 18 May 2018 16:57:02 +0800 Message-Id: <1526633822-17138-1-git-send-email-mine260309@gmail.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" Add a 24MHz fixed clock. This clock will be used for certain devices, e.g. pwm. Signed-off-by: Lei YU Reviewed-by: Joel Stanley Acked-by: Rob Herring --- drivers/clk/clk-aspeed.c | 9 ++++++++- include/dt-bindings/clock/aspeed-clock.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c index 5eb50c3..4664088 100644 --- a/drivers/clk/clk-aspeed.c +++ b/drivers/clk/clk-aspeed.c @@ -14,7 +14,7 @@ #include -#define ASPEED_NUM_CLKS 35 +#define ASPEED_NUM_CLKS 36 #define ASPEED_RESET_CTRL 0x04 #define ASPEED_CLK_SELECTION 0x08 @@ -474,6 +474,13 @@ static int aspeed_clk_probe(struct platform_device *pdev) return PTR_ERR(hw); aspeed_clk_data->hws[ASPEED_CLK_BCLK] = hw; + /* Fixed 24MHz clock */ + hw = clk_hw_register_fixed_rate(NULL, "fixed-24m", "clkin", + 0, 24000000); + if (IS_ERR(hw)) + return PTR_ERR(hw); + aspeed_clk_data->hws[ASPEED_CLK_24M] = hw; + /* * TODO: There are a number of clocks that not included in this driver * as more information is required: diff --git a/include/dt-bindings/clock/aspeed-clock.h b/include/dt-bindings/clock/aspeed-clock.h index d3558d8..ff29d8e 100644 --- a/include/dt-bindings/clock/aspeed-clock.h +++ b/include/dt-bindings/clock/aspeed-clock.h @@ -38,6 +38,7 @@ #define ASPEED_CLK_MAC 32 #define ASPEED_CLK_BCLK 33 #define ASPEED_CLK_MPLL 34 +#define ASPEED_CLK_24M 35 #define ASPEED_RESET_XDMA 0 #define ASPEED_RESET_MCTP 1