From patchwork Mon Oct 30 13:04:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 117473 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2564625qgn; Mon, 30 Oct 2017 06:06:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+S6zEImJ+WmrYcDgzhbZF9Hdsbk5F60MzkRRhpe25pRRR1irzL4luJ7+paL0wFBJIdr+thc X-Received: by 10.84.143.195 with SMTP id 61mr7320500plz.277.1509368775485; Mon, 30 Oct 2017 06:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509368775; cv=none; d=google.com; s=arc-20160816; b=bP0hEKkH4eYANZ6aJwzNt8sWk0XFpARrnlfBqwPA6YnGecpL7WypR8bCVJt6Xs92BG pHowNlymIrxVHPWygJehiXUPk7+rVkt2FEqu0bhWaEWm7pOd0w7q2/KIPNHkZkYkyzYj ncHNZmoKLby0Z+nVdxJOdjrBdMf5bkJDZMTNUdlBAtxaldHZy6mb9P+SJP3GpL07dfO8 ndQWvNbLXMj0VBvmR5DahLkEmBe4EPaMH0oJnAp/iNGPUyCcbmid1ohHj2sVDjZmK0V7 q2h0NSLIXB6PE811XX98pcYtpxna3PhK9Vz+F0LY8EyeAi/xUAbPnkSYqjiCW0qJX5YV oXAA== 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=r744JtEhDQoJ4+YzM9lcEgBYtRp3DAzDk7Mlrhw11gM=; b=EddKDceq5FIpsWzNptEhF3B+h5tuxuDVUTVxezOOvKFVfaOoaCSmPSZBjd3FGsKUyp P3Og7sAN3fEZFG3MtJ5LmZh9qyjJIO+DkRustI3O87TSYoGGSX3J7d5AqiG96bb14uzB cPK8lKbFMqOx8cqkgFffuR4YCbnL/iEuXoKSIf6FPF7rww1KnrRRfsNN8WeEJU14T7WB vqGOk2ldtRIw/Dt87t2Q2hbNF31A7d2qI0yM++pm8hGMnxDgBEyMZV+j2NWOK30wjSbY NClu3UXZeq5j2ohQ9RiHmHG4hGNqPyn2+6Tv+YrrbMI8CKCk0YI7sCMe3fYOB4Q2Bx0d TQQQ== 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=eDgqD7x7; 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 s21si2466642plr.463.2017.10.30.06.06.15; Mon, 30 Oct 2017 06:06:15 -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=eDgqD7x7; 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 S1752311AbdJ3NGN (ORCPT + 4 others); Mon, 30 Oct 2017 09:06:13 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:65490 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbdJ3NGM (ORCPT ); Mon, 30 Oct 2017 09:06:12 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v9UD5OfV006579; Mon, 30 Oct 2017 08:05:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1509368724; bh=kAd0vBrmFHZatDWAQrdir/CS+yf1exHo+0HrAXeSYTU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=eDgqD7x7QiY4QCmW+XYcSeT79BtF8OJNQuGbhtzlh9RS4cmbIQ+rKM5sz13cbMvj6 CnZx5uS/49EYwrNcjQ/R9c5j8SPWF3n3IcNVEWyUmx35Ia1H3noWooM1Zmg7P7RMN7 spjDFCj05MCFhjSfEUKoGff1qPC29UHS9tFceS/A= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9UD5IQF016989; Mon, 30 Oct 2017 08:05:18 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE104.ent.ti.com (10.64.6.25) 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:18 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE100.ent.ti.com (10.64.6.21) 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:18 -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 v9UD54wv005221; Mon, 30 Oct 2017 08:05:16 -0500 From: Tero Kristo To: , , CC: , Subject: [PATCH 06/27] clk: ti: clkctrl: fix flags for mux and divider opt clocks Date: Mon, 30 Oct 2017 15:04:24 +0200 Message-ID: <1509368685-29112-7-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 Flag handling was missing for these two, so add it. Signed-off-by: Tero Kristo --- drivers/clk/ti/clkctrl.c | 12 ++++++++++-- drivers/clk/ti/clock.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) -- 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 0f78219..fe44fbe 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -324,6 +324,9 @@ static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec, } mux->mask = num_parents; + if (!(mux->flags & CLK_MUX_INDEX_ONE)) + mux->mask--; + mux->mask = (1 << fls(mux->mask)) - 1; mux->shift = data->bit; @@ -343,6 +346,7 @@ static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec, { struct clk_omap_divider *div; const struct omap_clkctrl_div_data *div_data = data->data; + u8 div_flags = 0; div = kzalloc(sizeof(*div), GFP_KERNEL); if (!div) @@ -350,9 +354,13 @@ static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec, div->reg.ptr = reg; div->shift = data->bit; + div->flags = div_data->flags; + + if (div->flags & CLK_DIVIDER_POWER_OF_TWO) + div_flags |= CLKF_INDEX_POWER_OF_TWO; - if (ti_clk_parse_divider_data((int *)div_data->dividers, - div_data->max_div, 0, 0, + if (ti_clk_parse_divider_data((int *)div_data->dividers, 0, + div_data->max_div, div_flags, &div->width, &div->table)) { pr_err("%s: Data parsing for %pOF:%04x:%d failed\n", __func__, node, offset, data->bit); diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index 169241f..fc754e2 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h @@ -207,6 +207,7 @@ struct ti_dt_clk { struct omap_clkctrl_div_data { const int *dividers; int max_div; + u32 flags; }; struct omap_clkctrl_bit_data {