From patchwork Mon Oct 30 13:04:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 117459 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2563143qgn; Mon, 30 Oct 2017 06:05:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TKvFMGV4jfXSpDW3OX4p04Xq+3siFfkmNCLYDY6shI6Z8zgoKn9WFiRzlI01o/9Bs7eXxh X-Received: by 10.98.197.69 with SMTP id j66mr8626054pfg.135.1509368718362; Mon, 30 Oct 2017 06:05:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509368718; cv=none; d=google.com; s=arc-20160816; b=KirLY6+DCZu4cvncnO75etTIUjg1jEbuhDMyYAbQCutTED1WZDxmpvsTJt2U8/VDaP ZygNw2WHF24o/FhWMM+HpdGmh+zVnt08KVuVB0epCcy9mWiWS9L9I51+m4WiGYmTeuQQ W4kRBV1CYq1ifYd/G3wXfOyHXwSNKjhv6K+5nX8KGGU8H8rC9Vi6Ovb+3Butp1D+4BGk MkdblGDr9Ad2K+OFOX2mzte7lk+Z5Wb22kTVGcFIuwW9WWpUetttgQudRPkQ3OkH+jg4 /QmhhcyFZ9jGRGwjXJCIZKb1/2Bhx6/UfEjoX4wQ0V0YtUOHJo/ouoCrzn4bbN1swnUC l5Yg== 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 :arc-authentication-results; bh=DoTiwy507opAkoOq6d6dHWKHRMTEAnvYJLbX2B43MB8=; b=Bwu2akIAI73VQo3fwwbXCAf8QV6TS/HASna5RbGHEmSEoAO9KsxjJ2TND1vnpCVBku hSMNiZLW++TpUwjrAEBxbs6PqR1ibFWj0nRChSsB6RjK/rAn4zD8diITDlyNxxNKRWiI wTU3Vsfpq6rq2kFje6zmCHwK2feP72tJPgqylj3kFYK+vtX7NDreyd37oVdGnEhdY2Yv hAnECbczEMa0k7cT0pv7Ubcrd0IRYp6rohivF6H24tIzVYEeYi1gIeTM0qqR8Y5OaNKX ThNZWHaFeDwO+AwkjL1rWcLzduwhIwy5PZRrwQiigeGI2HYuenRCSdMeiTGoHGd+7S9E mqsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=OZYUdJ6A; 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=fail (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 h9si10891364pfe.573.2017.10.30.06.05.18; Mon, 30 Oct 2017 06:05:18 -0700 (PDT) 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=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=OZYUdJ6A; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751484AbdJ3NFP (ORCPT + 4 others); Mon, 30 Oct 2017 09:05:15 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:64766 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbdJ3NFO (ORCPT ); Mon, 30 Oct 2017 09:05:14 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v9UD5Al8011919; Mon, 30 Oct 2017 08:05:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1509368710; bh=txXG4WZWDkr6ApC8Xbp7RfSL1kNWV4OUXNNwvi6KPjg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OZYUdJ6AFizb+hiTE/tmY4IqgURA5pQb47o3clgWAlEJE3nL91VTgEs5Ke29mwY54 wT2W/B3F/hnwpam5xx45x91GOiQC6scoHpE968s7f3AaPVaSUx2ooH+gaq1pZQxsM9 ZDW9l1TrBqByU5mR/xnb7MTzhsMRCPkMgPrceUxU= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9UD5ABm016688; Mon, 30 Oct 2017 08:05:10 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Mon, 30 Oct 2017 08:05:10 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Mon, 30 Oct 2017 08:05:10 -0500 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9UD54wr005221; Mon, 30 Oct 2017 08:05:08 -0500 From: Tero Kristo To: , , CC: , Subject: [PATCH 02/27] clk: ti: clkctrl: add support for clkdm init for clkctrl clocks Date: Mon, 30 Oct 2017 15:04:20 +0200 Message-ID: <1509368685-29112-3-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509368685-29112-1-git-send-email-t-kristo@ti.com> References: <1509368685-29112-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 Clkctrl clocks now support clockdomain init also. This will be needed so that hwmod core can drop the support for clockdomain handling. Signed-off-by: Tero Kristo --- drivers/clk/ti/clkctrl.c | 22 ++++++++++++++++++++++ drivers/clk/ti/clock.h | 1 + 2 files changed, 23 insertions(+) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 2db7d40..284ba449 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -46,6 +46,7 @@ struct omap_clkctrl_provider { void __iomem *base; struct list_head clocks; + char *clkdm_name; }; struct omap_clkctrl_clk { @@ -208,6 +209,7 @@ static int _omap4_clkctrl_clk_is_enabled(struct clk_hw *hw) .enable = _omap4_clkctrl_clk_enable, .disable = _omap4_clkctrl_clk_disable, .is_enabled = _omap4_clkctrl_clk_is_enabled, + .init = omap2_init_clk_clkdm, }; static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec, @@ -438,6 +440,21 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) provider->base = of_iomap(node, 0); + provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3, + GFP_KERNEL); + if (!provider->clkdm_name) { + kfree(provider); + return; + } + + /* + * Create default clkdm name, replace _cm from end of parent node + * name with _clkdm + */ + strcpy(provider->clkdm_name, node->parent->name); + provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0; + strcat(provider->clkdm_name, "clkdm"); + INIT_LIST_HEAD(&provider->clocks); /* Generate clocks */ @@ -460,6 +477,11 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) if (reg_data->flags & CLKF_NO_IDLEST) hw->flags |= NO_IDLEST; + if (reg_data->clkdm_name) + hw->clkdm_name = reg_data->clkdm_name; + else + hw->clkdm_name = provider->clkdm_name; + init.parent_names = ®_data->parent; init.num_parents = 1; init.flags = 0; diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index 561dbe9..169241f 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h @@ -221,6 +221,7 @@ struct omap_clkctrl_reg_data { const struct omap_clkctrl_bit_data *bit_data; u16 flags; const char *parent; + const char *clkdm_name; }; struct omap_clkctrl_data {