From patchwork Tue Jan 15 09:15:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 155645 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4650656jaa; Tue, 15 Jan 2019 01:15:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN64yald9U5tAPF/HxpF9RC73sRbbFPbgOuJ64A67KeG1K9bQFWMC/J62YpWyUDVy+aAPwZ4 X-Received: by 2002:a63:8c6:: with SMTP id 189mr2947174pgi.322.1547543740161; Tue, 15 Jan 2019 01:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547543740; cv=none; d=google.com; s=arc-20160816; b=qLz8S12bGBYUa5IXTLPQhA9Zyfag6rXd9mUrcRdwV2/xUkMNWiK8VrJ6DMQ53KBbu2 lL3VhdYMacbzKsVJk3DV3+QUUz2OtgJ+UgfcZH/qiUJ1W8hCP/Zqu6GbVovNQ3Z60xns vA1pKuPyzf9feuxJHnehGAbsYyjx3f8ecjkNbgqokrCSEnrBdOV3eNECMLfBNGO3f2bI +Q5RFPUAMu4X80tPyzlgSADO5WgG3cRQ4fHHV7DGUq3b3mzJDp+Bvq88zbuFVMVjJ1I8 bvcxY7+ElS+WY7Rezpji1RuVxhS9fkgfRmihVKLgEp3+ErLyRxzda+PfOHUceIqndF77 NT1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AUjqUXTUv6t7jIPtmRhlTHS2oJ7GrPvxwSKt3tsz4oI=; b=v0jwioQlIv8EARwYYAgdxs83nytE+YfxpaCFRtWPlTe6FWZH4ZZaJV1rdopqtHWATa PqgN/Fd81HCrGdXgzJeRoFD1LF4RfZunPBabEfaHmPjMgw0uqnty2XaBd6FW0VF1JVPm ywWyo3OxDrugdt1GBHmvlQyQxJD2VEx7YIXqMCK7ilgrD+uGnQt6jhp7WI+4v65NmfY3 FochZFduxxsS4/WTShONM7rfGDBcvzIGgsQcZYFiVBbBa5TuonR7HBS5pOajt6vbo7SA ghqz0y0ioCrA+Gwshbm50d3p6G448QDiq9+HAS9Gwzt0KSlJwjU0wTnyJ4mfiI9xGeKK meZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=t5MGrblB; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e37si2812235plb.172.2019.01.15.01.15.39; Tue, 15 Jan 2019 01:15:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=t5MGrblB; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728456AbfAOJPj (ORCPT + 5 others); Tue, 15 Jan 2019 04:15:39 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:40890 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbfAOJPj (ORCPT ); Tue, 15 Jan 2019 04:15:39 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0F9FW27015989; Tue, 15 Jan 2019 03:15:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547543732; bh=AUjqUXTUv6t7jIPtmRhlTHS2oJ7GrPvxwSKt3tsz4oI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=t5MGrblBo4oZYYKF44/Ag32i+B/f4kwRMuY/uhJww/sbqyCjMgc6wV4Mqr1CEyGTi wCkqc2F9cCVdQVF7ia5bpifp63RRN4jq4WafPtCMpRPysMb38dRIvs9IhpG6NKFZQy ybPWDOCDrZIu31oK2Kb4f+jLGTrqEfMMf177iNBg= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0F9FWWK007623 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 15 Jan 2019 03:15:32 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 15 Jan 2019 03:15:31 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Tue, 15 Jan 2019 03:15:31 -0600 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0F9FNLi016112; Tue, 15 Jan 2019 03:15:30 -0600 From: Tero Kristo To: , , CC: , Subject: [PATCH 2/4] clk: ti: add new API for checking if a provided clock is an OMAP clock Date: Tue, 15 Jan 2019 11:15:13 +0200 Message-ID: <1547543715-16467-3-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1547543715-16467-1-git-send-email-t-kristo@ti.com> References: <1547543715-16467-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org omap2_clk_is_hw_omap can now be used to verify if the provided clk_hw is an omap HW clock or not. This is done to replace the usage of CLK_IS_BASIC flag within the TI clock drivers. Signed-off-by: Tero Kristo --- drivers/clk/ti/clk.c | 18 ++++++++++++++++++ drivers/clk/ti/clock.h | 1 + 2 files changed, 19 insertions(+) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 8172843..05f9d1a 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c @@ -559,3 +559,22 @@ int omap2_clk_for_each(int (*fn)(struct clk_hw_omap *hw)) return ret; } + +/** + * omap2_clk_is_hw_omap - check if the provided clk_hw is OMAP clock + * @hw: clk_hw to check if it is an omap clock or not + * + * Checks if the provided clk_hw is OMAP clock or not. Returns true if + * it is, false otherwise. + */ +bool omap2_clk_is_hw_omap(struct clk_hw *hw) +{ + struct clk_hw_omap *oclk; + + list_for_each_entry(oclk, &clk_hw_omap_clocks, node) { + if (&oclk->hw == hw) + return true; + } + + return false; +} diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index e5b8af3..034ff6a 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h @@ -302,6 +302,7 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw, int omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw, struct clk_rate_request *req); int omap2_clk_for_each(int (*fn)(struct clk_hw_omap *hw)); +bool omap2_clk_is_hw_omap(struct clk_hw *hw); extern struct ti_clk_ll_ops *ti_clk_ll_ops;