From patchwork Mon Oct 5 23:28:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 54511 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 61B3D22B0F for ; Mon, 5 Oct 2015 23:29:06 +0000 (UTC) Received: by lahq5 with SMTP id q5sf11888075lah.2 for ; Mon, 05 Oct 2015 16:29:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=F03Kf6eUgawtYfYo3ihoDdqSYjYctZwRs0guv3/Q+hM=; b=eZLIhkYMoggkFjBqKewrPDNrhCgNFqaCFmf6Aep2fzpUwiX1pOr4r9FV5s8AMuuYGi KBXoo5Gv2xTDjrUbzg2txa3XaXacIzYjL9zNDgVR/ON0LNI7OcTTqQkQkMCIuHK4B2qy 7D9yykHTVlkLsgTszm4KmMzt/5ODlCs9u8P0EYC78mtLC/+095OQL9rXg8zUDz9XK6VB I6mONugI4aQ1el62BvVqpyIrQ7JK1Gp6xIst+7HgWWlFIfEv9PiYcbIlRg5eLSIT8i7H 2+IgsXDz9Ah7md+s/WkNobTTpUzHH24UiSvAq46Xlgr0HxnFWqkUJ2Y7xCmstnsMjQFX xJKw== X-Gm-Message-State: ALoCoQmrVrNepoiMHj5gJpL3G6s5nZ+r8b6bk5nmReIFqPIh4DrWA/bFCkx1iigkJ1PpJE1yu0mF X-Received: by 10.25.149.203 with SMTP id x194mr141659lfd.6.1444087745318; Mon, 05 Oct 2015 16:29:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.17.70 with SMTP id g67ls518363lfi.13.gmail; Mon, 05 Oct 2015 16:29:05 -0700 (PDT) X-Received: by 10.112.128.168 with SMTP id np8mr12439122lbb.85.1444087745171; Mon, 05 Oct 2015 16:29:05 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id wq1si18683247lbb.75.2015.10.05.16.29.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 16:29:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lafb9 with SMTP id b9so45932098laf.0 for ; Mon, 05 Oct 2015 16:29:05 -0700 (PDT) X-Received: by 10.25.145.132 with SMTP id t126mr8407089lfd.88.1444087745052; Mon, 05 Oct 2015 16:29:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1523655lbq; Mon, 5 Oct 2015 16:29:04 -0700 (PDT) X-Received: by 10.68.190.105 with SMTP id gp9mr42824670pbc.152.1444087739191; Mon, 05 Oct 2015 16:28:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ie4si43846469pbb.168.2015.10.05.16.28.58; Mon, 05 Oct 2015 16:28:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751771AbbJEX25 (ORCPT + 7 others); Mon, 5 Oct 2015 19:28:57 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:49970 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbbJEX2z (ORCPT ); Mon, 5 Oct 2015 19:28:55 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t95NSQnW001582; Mon, 5 Oct 2015 18:28:26 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t95NSQKH028109; Mon, 5 Oct 2015 18:28:26 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 5 Oct 2015 18:28:26 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t95NSPtK008987; Mon, 5 Oct 2015 18:28:25 -0500 Received: from localhost (irmo.am.dhcp.ti.com [128.247.9.166]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id t95NSP908795; Mon, 5 Oct 2015 18:28:25 -0500 (CDT) From: Suman Anna To: Tony Lindgren CC: Paul Walmsley , , , , Suman Anna Subject: [PATCH v2 1/4] ARM: OMAP: dmtimer: check for fixed timers during config Date: Mon, 5 Oct 2015 18:28:21 -0500 Message-ID: <1444087704-1429-2-git-send-email-s-anna@ti.com> X-Mailer: git-send-email 2.6.0 In-Reply-To: <1444087704-1429-1-git-send-email-s-anna@ti.com> References: <1444087704-1429-1-git-send-email-s-anna@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: s-anna@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The omap_dm_timer_set_source() function provides a means for client users to configure the mux parent for a GPTimer's functional clock. However, not all timers are configurable (Eg: Timer12 on DRA7 is fed by an internal 32k oscillator clock, and does not have configurable parent clocks). So, check for such cases and proceed with out throwing an error. Signed-off-by: Suman Anna --- arch/arm/plat-omap/dmtimer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 8ca94d379bc3..4c48b52c4a7c 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -36,6 +36,7 @@ */ #include +#include #include #include #include @@ -504,6 +505,12 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) if (IS_ERR(timer->fclk)) return -EINVAL; +#if defined(CONFIG_COMMON_CLK) + /* Check if the clock has configurable parents */ + if (clk_hw_get_num_parents(__clk_get_hw(timer->fclk)) < 2) + return 0; +#endif + switch (source) { case OMAP_TIMER_SRC_SYS_CLK: parent_name = "timer_sys_ck";