Received: by 10.192.165.148 with SMTP id m20csp4146524imm; Mon, 30 Apr 2018 12:38:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoiscRYrg6CBpkEEtPffLUxZaszN3K2pWgPdX1he9lLEOZ2445YbZ09T39Gz0arp5TvW4I1 X-Received: by 2002:a17:902:7082:: with SMTP id z2-v6mr1791833plk.373.1525117080774; Mon, 30 Apr 2018 12:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525117080; cv=none; d=google.com; s=arc-20160816; b=BK66a8luXyAOLnnjAk5MGJ43+SPaLZsuu2QKahHvRllEROVBrDRvcIe//HjRtUhAoT RHhEtMRvAPNMK7VJ3oongCVpw0RlVhm1r3A/nb7Mz+YExlcU5rGqgRjlHX5LZb00tLR+ xatihlGqgnbhlhP/9Iwn6UPJ08Tj2/if8W2e79/CRYhJ0SMyhcjhVK2E36s/TdrUSjaW CoAgdb59ip1YHEP1vHbjN9VN3xX+QK3BZMd2pPJuHlCHZHD1eIqnHkYE6mh5igd3ILD8 hORxT/iA2zMEkdcXDawtxFTSkn6/XIUBCx2cr30qE9Hnwma6UEj18RQypskZLrkCJcIw xUjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=0puzRD1RHswk7MXQcoPF1wdwu5RWU61qZ6DhW/Ok+M0=; b=M6cQtotB1vYXlc/Msz5UZaiW+9Ep/DuHqX97UkhjDkuvEnhu4zmun2N/LoCwZ0/XpH TFgPrTL7aFQi81j1zehGDgUaUgLOEWFL+CLFp2zVUVgxszlVHUzdJvbk5bwHgy7aSms7 Iy/irT8DsLk4xV0WOr5h09ghnTy8cD3ecCP3OmBHqjIoKtEV9dVJ7hDk8z6SWUGghAme lHy30bRWOQawS7nIkToFSZ35B9L/KZf+v/z7twMpodD0iU06W9y4D1xiq6caKLayrhJ+ U460NNALAd0UPjIyTBxAqL9yXvw7YH5oft1y6SaGzlLuH8vidamASOYhiUc88i3gAMvU x8yw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o189si7979950pfo.20.2018.04.30.12.37.46; Mon, 30 Apr 2018 12:38:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756401AbeD3T2n (ORCPT + 99 others); Mon, 30 Apr 2018 15:28:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:36622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756374AbeD3T2j (ORCPT ); Mon, 30 Apr 2018 15:28:39 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A874022DBF; Mon, 30 Apr 2018 19:28:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A874022DBF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tero Kristo , Peter Ujfalusi , Mark Brown Subject: [PATCH 4.16 084/113] ASoC: dmic: Fix clock parenting Date: Mon, 30 Apr 2018 12:24:55 -0700 Message-Id: <20180430184018.745129600@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tero Kristo commit 573eda59c772d11fc2b56d525dfb698b0f87ddb3 upstream. In 4.16 the clock hierarchy got changed by a5c82a09d876 ARM: dts: omap4: add clkctrl nodes The fck of dmic is no longer a mux clock, it's parent is. Signed-off-by: Tero Kristo Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown Cc: stable@vger.kernel.org # 4.16+ Signed-off-by: Greg Kroah-Hartman --- sound/soc/omap/omap-dmic.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -281,7 +281,7 @@ static int omap_dmic_dai_trigger(struct static int omap_dmic_select_fclk(struct omap_dmic *dmic, int clk_id, unsigned int freq) { - struct clk *parent_clk; + struct clk *parent_clk, *mux; char *parent_clk_name; int ret = 0; @@ -329,14 +329,21 @@ static int omap_dmic_select_fclk(struct return -ENODEV; } + mux = clk_get_parent(dmic->fclk); + if (IS_ERR(mux)) { + dev_err(dmic->dev, "can't get fck mux parent\n"); + clk_put(parent_clk); + return -ENODEV; + } + mutex_lock(&dmic->mutex); if (dmic->active) { /* disable clock while reparenting */ pm_runtime_put_sync(dmic->dev); - ret = clk_set_parent(dmic->fclk, parent_clk); + ret = clk_set_parent(mux, parent_clk); pm_runtime_get_sync(dmic->dev); } else { - ret = clk_set_parent(dmic->fclk, parent_clk); + ret = clk_set_parent(mux, parent_clk); } mutex_unlock(&dmic->mutex); @@ -349,6 +356,7 @@ static int omap_dmic_select_fclk(struct dmic->fclk_freq = freq; err_busy: + clk_put(mux); clk_put(parent_clk); return ret;