From patchwork Wed Aug 1 03:39:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 143224 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp345550ljj; Tue, 31 Jul 2018 20:40:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdkwVNPQsVbCp3gthMRc6eu9M9rzU2odvVimSnoKzC2Ue9UUXhSz9/Egh6Aa0Dyhps4qgnH X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr22917524plk.323.1533094823067; Tue, 31 Jul 2018 20:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533094823; cv=none; d=google.com; s=arc-20160816; b=yeltMSJp65domRD8fx7XmtwsS5BRSr22a2FAKPj3FqwbcwZ0Gj+tbe0d8DZC0F7lc7 qyL0mw3LrRkduoSjLncrx9Y8ZuCtgds66ZzCymQvwWZnQYibpwtisVMICq8wNPSREA6/ MgoSXtMM7ePovZohvWaIIU3WWYv2iHn/Pe9jBaIUTpOklREcEKo/t9njXIe2IMvxbyWt U4H/xDTdoJ9Fk9et4qBUcr1a9Lzd2PCCbzRHls7rHdfdNQVc95LnykiavF+3+8fR6iWW d2hvI7fPQMWcdNLJa1PtsRRuyRd9QDlW/JfE2xN3dO0yW1Vklf50nb1k1S4ouNJcErlp EO8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nLg8nF2BVGhHBSt4qBWUxorV5/Diq0j0iCeB6+14Bu0=; b=DQ2Mw9LnAgM4drnntYpXD4J/nYVK8ABCh4I5qatDTPPaHStR1ga09t3sUSY1/SwLYd jjgDcfyJVt5HqMrOUgOY8lmsRWSaXWvdgnSfsjC2PcHaxHhyJLWX4wWLEyaU/LKSh6od 4d/aaT1a2w8ZjKCrdd/PFa9hny8YpDb9cAdBddxiSxP8in0wr7/K/22wljYCH+1nWwHD 1P6HrMCeuirXjFMSRdtWH4S51nozlcmCmlsrBUZ1P+MA0I43mOgT+tWeIPy0GhYtEECx MaDY55qTwhSavyKeQwcDKJTNyhD/mKOVLrLK1f7zfVPKMF3iRWGpxkr392FCkzhChVQ1 iuRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cDpJ2Sg7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21-v6si15778259pgk.206.2018.07.31.20.40.22; Tue, 31 Jul 2018 20:40:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cDpJ2Sg7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732945AbeHAFXq (ORCPT + 31 others); Wed, 1 Aug 2018 01:23:46 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35685 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730957AbeHAFXq (ORCPT ); Wed, 1 Aug 2018 01:23:46 -0400 Received: by mail-pg1-f196.google.com with SMTP id e6-v6so10097965pgv.2 for ; Tue, 31 Jul 2018 20:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nLg8nF2BVGhHBSt4qBWUxorV5/Diq0j0iCeB6+14Bu0=; b=cDpJ2Sg7+xTvhO/XV7boURbpH+hTQpETKhd5CsCXhbGtk37EPIe93+0S8UZeNS2wae mNOV9md7MCmqL21HP/9CfENPIqBQafmHEHGu6aUo6A16jzysJmLCeqYeBuJ/WuGGXtPA bk5FCH3UfQ9249y8GgE+ZIp8XRT3uEj8hQLgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nLg8nF2BVGhHBSt4qBWUxorV5/Diq0j0iCeB6+14Bu0=; b=uXm68eRpMTEZSAw0jRK3/SVVP7w0igPy4WWKdiaLxbCfE/snT9fjihD682qF2mE3on 9Xg/DBr9auSyF9nx2OPExIqh5TymFsMjeVNkUbQyEeaXVfE8EkrPp732BCvg0Bx7fZ3u nCaIHXlkf9JpJmZu7Gk5U4YyvAQpGDXD/zMKBw1JTyGdH+Vrcx7TN1KgGpGxNfbH3QRn byYhKmai/PdOdkACAWNHYbkuV0a2RffGvgXqJ9LFi7ukNSzVINRMXTd4sw2HN1E8LvAB 3WzxLCE3RjFkakNJuzcvuaJhoyDd06Nn+6s7cQeT8q9YEOSwXTduKi+66ry4U/d/+wmh VkWw== X-Gm-Message-State: AOUpUlF5OcvM7ujFOZjOqdUFPS3vrj/ysKIE1UTAYnEjXZG2pKIlymEs 4J4eySTiJBVHX9s4/nh7LxtM X-Received: by 2002:a63:ae02:: with SMTP id q2-v6mr22509271pgf.189.1533094819428; Tue, 31 Jul 2018 20:40:19 -0700 (PDT) Received: from localhost.localdomain ([2405:204:730e:f0ae:ac4e:9cdd:28a2:4bf9]) by smtp.gmail.com with ESMTPSA id d19-v6sm34879545pgi.50.2018.07.31.20.40.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jul 2018 20:40:18 -0700 (PDT) From: Manivannan Sadhasivam To: p.zabel@pengutronix.de, mturquette@baylibre.com, sboyd@kernel.org, afaerber@suse.de, robh+dt@kernel.org, lee.jones@linaro.org, arnd@arndb.de Cc: linux-clk@vger.kernel.org, liuwei@actions-semi.com, mp-cs@actions-semi.com, 96boards@ucrobotics.com, devicetree@vger.kernel.org, daniel.thompson@linaro.org, amit.kucheria@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, hzhang@ucrobotics.com, bdong@ucrobotics.com, manivannanece23@gmail.com, thomas.liau@actions-semi.com, jeff.chen@actions-semi.com, pn@denx.de, edgar.righi@lsitec.org.br, sravanhome@gmail.com, Manivannan Sadhasivam Subject: [PATCH v2 03/10] clk: actions: Add syscon support for Actions Semi Owl SoCs Date: Wed, 1 Aug 2018 09:09:08 +0530 Message-Id: <20180801033915.15880-4-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180801033915.15880-1-manivannan.sadhasivam@linaro.org> References: <20180801033915.15880-1-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the clock and reset management units are sharing the same memory map, convert the Owl common clock driver to support System Controller so that the reset driver can reuse the same memory region. Signed-off-by: Manivannan Sadhasivam --- drivers/clk/actions/owl-common.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) -- 2.17.1 diff --git a/drivers/clk/actions/owl-common.c b/drivers/clk/actions/owl-common.c index 61c1071b5180..080f980b2ec4 100644 --- a/drivers/clk/actions/owl-common.c +++ b/drivers/clk/actions/owl-common.c @@ -8,6 +8,7 @@ // Copyright (c) 2018 Linaro Ltd. // Author: Manivannan Sadhasivam +#include #include #include #include @@ -15,14 +16,6 @@ #include "owl-common.h" -static const struct regmap_config owl_regmap_config = { - .reg_bits = 32, - .reg_stride = 4, - .val_bits = 32, - .max_register = 0x00cc, - .fast_io = true, -}; - static void owl_clk_set_regmap(const struct owl_clk_desc *desc, struct regmap *regmap) { @@ -41,18 +34,11 @@ static void owl_clk_set_regmap(const struct owl_clk_desc *desc, int owl_clk_regmap_init(struct platform_device *pdev, const struct owl_clk_desc *desc) { - void __iomem *base; struct regmap *regmap; - struct resource *res; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); - regmap = devm_regmap_init_mmio(&pdev->dev, base, &owl_regmap_config); + regmap = syscon_node_to_regmap(of_get_parent(pdev->dev.of_node)); if (IS_ERR(regmap)) { - pr_err("failed to init regmap\n"); + dev_err(&pdev->dev, "failed to get regmap\n"); return PTR_ERR(regmap); }