Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp779864ybe; Wed, 4 Sep 2019 07:39:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp0sGA3ywtL65ttSEOK9k2kvTeddwiiKb/gDgKGW3sXfMZJEtj2HMlIJ02iTclbzaKwCGW X-Received: by 2002:a17:902:9347:: with SMTP id g7mr5978596plp.0.1567607968463; Wed, 04 Sep 2019 07:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567607968; cv=none; d=google.com; s=arc-20160816; b=GeKuiPZgBWR+adwG7Y0yoRoaK8nxh5YglMPMVNhip0NAyL0Qb5rTYkFqyZ+ZrIa9w1 a1zzvDvXDYoq58YFUC7k1RSODgC+4JUDO6vny3gOhBe4AxAz6gthvD1XqNoriyoV8xMk i4TNoTN5iZ/B4YZ/yCucmhSOnmQtVfESwiWS8Hc9gWlbFQv9ntPaEBVSuHCQs9NuY+hJ WAGXqj1gdy8xU4eD6plIDTZf+p+/t+Z9G/O/0TVg5iz0tjLFZdg/wEAH5H1eFos+kjXd 9DDhkKlaz0aE9YxJMUPxxRyhPcdtAXsHurrgzBlHHWZqHaLLoJm0m9cRdXHmhBcEbx6u pzQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9CaC26YQBbs++2LlEGrT8hc5InQ6jt1lO4oP+jQbo+4=; b=kbw+8aDP0iLEAp68LkCnO7+0wF4xq6fhKWfHz0pnWozVoORWPf4Ew/yXO6OOEayJAw 3F4A9IWIZ87XtkppvzC9WCE37zQTrhfI03ffGQDQvYFkO5jFRvV02+6Vih7ioBy8+aMf vieSCasI06FhiecXav3pMORZ4xpRuUMR2C4fYNDmywjX+Bn3UMR7qkJVglb3azGHtTAZ vJx4+zpwFoAWfv8wKa1ylULSPGrnKE3Pd7Nd5wBxnsZuE1WKxiGK/pABVRG/eNVWAqqI vVeFwT1SYcH3dU0yFjEEFjkAe9q5YpQByAS+FY608LeAxQ7oJluP3NQ9Fua/Q+TJAG28 vumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lhRvMHhK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j63si16895686pgd.493.2019.09.04.07.39.11; Wed, 04 Sep 2019 07:39:28 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lhRvMHhK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731059AbfIDOhj (ORCPT + 99 others); Wed, 4 Sep 2019 10:37:39 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42168 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfIDOhi (ORCPT ); Wed, 4 Sep 2019 10:37:38 -0400 Received: by mail-pg1-f193.google.com with SMTP id p3so11348463pgb.9 for ; Wed, 04 Sep 2019 07:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9CaC26YQBbs++2LlEGrT8hc5InQ6jt1lO4oP+jQbo+4=; b=lhRvMHhKgBm1PhW5YBzZk3QZWD0LIQg6cOaGJFKLMq8Mnd6w4KgZIiAHf50nbo9xhi SuoO6m+VMe3I9zG3rJp1TrqOstdiv5kf5JLs9VGrscoB/IPlo1WEdupFrLa4CI9wfp05 tm/5Yusnpdj+eJVLa0gxHihikGCgaKT/WeZ4I27xXatqSniZQJn95Y6Cu4l/7CPN1kNw 4mnbBQQQihbtiA2Amj5vfI+QxFxsbGZCsZpn5AXQmlwnX880YB0EIT5r/aZBGZNb6+a2 KI8h15rroiib8t4s0NwkdF+RGHJY5AkYNCT9JzXU1sAYdGvEncmWSWBe8g2MgaN60+wF rFSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9CaC26YQBbs++2LlEGrT8hc5InQ6jt1lO4oP+jQbo+4=; b=BSiEf6WODKxoasZqXZB9K0ofF0O/cNEJK/BfoacMc/J9TCgqoVyGF/x+rQHp+WQVR9 yYgRwr0tmISyo+ud4/R3x+nHG+Bl4KQhPKBAXs2Mo1PZKNBmvqFA7c2SAfzymCKwdyom V6vZRgqwSvN3NCiXyPVHr6+WmZemPElRMJ7fukrks51qNCqUJPrraxItC/Sl8AuRd3KE fXpHV+ZgqKxxuTYuzW3SynUTZocmoLGCiCrlEA1bxuGXcYFCkhYokDfUWA+V4sUdsDMi 0uIAR6aeCPaK1k9+fPSzzxcoKy5yeDC447D1ybuVoiqXu9f/7f1ieEvSqDcNldI1KsRZ CMZA== X-Gm-Message-State: APjAAAXmMtW06t0xGaVffKUfs2PX9Wum5XrQYYoUiZaTwk6I66RO+blg 9CFsu/AWTAUlLtrLDGNDMe3bpuVxNQzQbqquGLF/HZH1 X-Received: by 2002:a17:90a:bf01:: with SMTP id c1mr5430039pjs.30.1567607858001; Wed, 04 Sep 2019 07:37:38 -0700 (PDT) MIME-Version: 1.0 References: <20190903165322.20791-1-katsuhiro@katsuster.net> <20190903165322.20791-2-katsuhiro@katsuster.net> In-Reply-To: <20190903165322.20791-2-katsuhiro@katsuster.net> From: Andy Shevchenko Date: Wed, 4 Sep 2019 17:37:26 +0300 Message-ID: Subject: Re: [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK To: Katsuhiro Suzuki Cc: Mark Brown , David Yang , Daniel Drake , Hans de Goede , ALSA Development Mailing List , Linux Kernel Mailing List 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 On Tue, Sep 3, 2019 at 7:54 PM Katsuhiro Suzuki wrote: > > This patch introduce clock property for MCLK master freq control. > Driver will set rate of MCLK master if set_sysclk is called and > changing sysclk by board driver. > > Signed-off-by: Katsuhiro Suzuki > + if (es8316->mclk) { You don't need this if clock has been requested as optional (clk_get_optional() or so). > + ret = clk_set_rate(es8316->mclk, freq); > + if (ret) > + return ret; > + } > + es8316->mclk = devm_clk_get(component->dev, "mclk"); > + if (PTR_ERR(es8316->mclk) == -EPROBE_DEFER) > + return -EPROBE_DEFER; > + if (IS_ERR(es8316->mclk)) { > + dev_err(component->dev, "clock is invalid, ignored\n"); > + es8316->mclk = NULL; > + } devm_clk_get_optional() > + if (es8316->mclk) { Ditto as above. > + ret = clk_prepare_enable(es8316->mclk); > + if (ret) { > + dev_err(component->dev, "unable to enable clock\n"); > + return ret; > + } > + } > + if (es8316->mclk) Ditto. > + clk_disable_unprepare(es8316->mclk); > +} -- With Best Regards, Andy Shevchenko