Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1894554ybi; Thu, 4 Jul 2019 01:32:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8zj595E4aiBW6qz05ECjcEhmC1oYhgWAuzE/8KdQkh5+zq2agKXTNRiMttReuVuYNFLBn X-Received: by 2002:a63:4105:: with SMTP id o5mr43603387pga.308.1562229140391; Thu, 04 Jul 2019 01:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562229140; cv=none; d=google.com; s=arc-20160816; b=gY+/16bkpLdIQ4z7DM81psdNkxGWRRebZ/88haMfndZxc2loopzAnzzkwSn9ki+zkw NhihvEvsqnngzkLLoh5CIubfAqLjSH2S+ih7+bFA2OmhpxJLJ45Sgsp6E4lvobndTQ6b cayhNMecpn8Y1gd0Iy/ycvrID96gwvSNOoL4gj35z2/4QCUvXZudv62a/LVaAmYmkyX6 IUiwYBa8pnTCe5bby+sapqOsj0sQ1Lxg1NwYBmnEZH7JRA13v+crvjySwQ2tpyidBKGX gjBhSW/kbvZfOzA6gmm0ZjWyHGKt5JF35Oq6AEnU6vKqnQgkEvGzwE7vdv2LofAk9gh0 Iv5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject :dkim-signature; bh=3egXhDb+0BEGsc9z+jUYoOJnG4f+8TqOeWKQ9O3F6XQ=; b=dXnjlyqN7WvrciM8aDkqRlfF1Da1eSS5+EZUfyELgl4781QSZ06gIMoQ5+gFVnGKiM fvYpIC8K32bKx6ZAroCgmTUCxIePD5At5BhjHklvELW2Kgi4LAocvLfhqHq13+DVcpc4 59olfyHC1e+MrlvBNPco0WfyDKli/CUfOEb4+qOcsbXhQHOITVcCUx4pIoNcrAqC7/nL oQ8wYzGET9if5Jxmbxms9LikjBFyH4JxDRWAVPyxDV1J0rMnpoqvf+59DLw861hm99a1 uI4QFi4fkhGFJudZktxiRD9vP4fTP6fIREQlPI/z5aKXtNtDRLjvHmdgZhIVjv9xfsyS 28+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=rKllUdZG; 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=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 q23si5041379pff.103.2019.07.04.01.32.03; Thu, 04 Jul 2019 01:32:20 -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=@ti.com header.s=ti-com-17Q1 header.b=rKllUdZG; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbfGDI3w (ORCPT + 99 others); Thu, 4 Jul 2019 04:29:52 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:44540 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbfGDI3w (ORCPT ); Thu, 4 Jul 2019 04:29:52 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x648TWe8122314; Thu, 4 Jul 2019 03:29:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1562228972; bh=3egXhDb+0BEGsc9z+jUYoOJnG4f+8TqOeWKQ9O3F6XQ=; h=Subject:To:References:From:Date:In-Reply-To; b=rKllUdZGg7Y450IMxaVlJuNDJ41h3AOnnoxU+sk8hJhLSXRwRB2pmJSUkDomzG1hB /TUcbmAjmpwgOvF+LRgkqD74YnTmjSrIIOEi4O0kPF7YLvXk/vxIpNy5qjnWydybAa xsqYnWV2yrAOVdZPsOjL7iEYFjtZ16SKcfXiNpgM= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x648TWg2016906 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Jul 2019 03:29:32 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 4 Jul 2019 03:29:29 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 4 Jul 2019 03:29:30 -0500 Received: from [10.1.3.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x648TQhG094955; Thu, 4 Jul 2019 03:29:27 -0500 Subject: Re: [PATCH 3/3] drm/bridge: sii902x: make audio mclk optional To: Olivier Moysan , , , , , , , , , , , , , , , , References: <1562082426-14876-1-git-send-email-olivier.moysan@st.com> <1562082426-14876-4-git-send-email-olivier.moysan@st.com> From: Jyri Sarha Openpgp: preference=signencrypt Autocrypt: addr=jsarha@ti.com; prefer-encrypt=mutual; keydata= mQINBFbdWt8BEADnCIkQrHIvAmuDcDzp1h2pO9s22nacEffl0ZyzIS//ruiwjMfSnuzhhB33 fNEWzMjm7eqoUBi1BUA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wA CgkQkDazUNfWGUFOfRAA5K/z9DXVEl2kkuMuIWkgtuuLQ7ZwqgxGP3dMA5z3Iv/N+VNRGbaw oxf+ZkTbJHEE/dWclj1TDtpET/t6BJNLaldLtJ1PborQH+0jTmGbsquemKPgaHeSU8vYLCdc GV/Rz+3FN0/fRdmoq2+bIHght4T6KZJ6jsrnBhm7y6gzjMOiftH6M5GXPjU0/FsU09qsk/af jbwLETaea0mlWMrLd9FC2KfVITA/f/YG2gqtUUF9WlizidyctWJqSTZn08MdzaoPItIkRUTv 6Bv6rmFn0daWkHt23BLd0ZP7e7pON1rqNVljWjWQ/b/E/SzeETrehgiyDr8pP+CLlC+vSQxi XtjhWjt1ItFLXxb4/HLZbb/L4gYX7zbZ3NwkON6Ifn3VU7UwqxGLmKfUwu/mFV+DXif1cKSS v6vWkVQ6Go9jPsSMFxMXPA5317sZZk/v18TAkIiwFqda3/SSjwc3e8Y76/DwPvUQd36lEbva uBrUXDDhCoiZnjQaNz/J+o9iYjuMTpY1Wp+igjIretYr9+kLvGsoPo/kTPWyiuh/WiFU2d6J PMCGFGhodTS5qmQA6IOuazek1qSZIl475u3E2uG98AEX/kRhSzgpsbvADPEUPaz75uvlmOCX tv+Sye9QT4Z1QCh3lV/Zh4GlY5lt4MwYnqFCxroK/1LpkLgdyQ4rRVw= Message-ID: Date: Thu, 4 Jul 2019 11:29:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <1562082426-14876-4-git-send-email-olivier.moysan@st.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-GB Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/07/2019 18:47, Olivier Moysan wrote: > The master clock on i2s bus is not mandatory, > as sii902X internal PLL can be used instead. > Make use of mclk optional. > > Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") > > Signed-off-by: Olivier Moysan Reviewed-by: Jyri Sarha > --- > drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++---------------- > 1 file changed, 23 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c > index 36acc256e67e..a08bd9fdc046 100644 > --- a/drivers/gpu/drm/bridge/sii902x.c > +++ b/drivers/gpu/drm/bridge/sii902x.c > @@ -562,19 +562,21 @@ static int sii902x_audio_hw_params(struct device *dev, void *data, > } > } > > - ret = clk_prepare_enable(sii902x->audio.mclk); > - if (ret) { > - dev_err(dev, "Enabling mclk failed: %d\n", ret); > - return ret; > - } > + if (sii902x->audio.mclk) { > + ret = clk_prepare_enable(sii902x->audio.mclk); > + if (ret) { > + dev_err(dev, "Enabling mclk failed: %d\n", ret); > + return ret; > + } > > - mclk_rate = clk_get_rate(sii902x->audio.mclk); > + mclk_rate = clk_get_rate(sii902x->audio.mclk); > > - ret = sii902x_select_mclk_div(&i2s_config_reg, params->sample_rate, > - mclk_rate); > - if (mclk_rate != ret * params->sample_rate) > - dev_dbg(dev, "Inaccurate reference clock (%ld/%d != %u)\n", > - mclk_rate, ret, params->sample_rate); > + ret = sii902x_select_mclk_div(&i2s_config_reg, > + params->sample_rate, mclk_rate); > + if (mclk_rate != ret * params->sample_rate) > + dev_dbg(dev, "Inaccurate reference clock (%ld/%d != %u)\n", > + mclk_rate, ret, params->sample_rate); > + } > > mutex_lock(&sii902x->mutex); > > @@ -640,7 +642,8 @@ static int sii902x_audio_hw_params(struct device *dev, void *data, > mutex_unlock(&sii902x->mutex); > > if (ret) { > - clk_disable_unprepare(sii902x->audio.mclk); > + if (sii902x->audio.mclk) > + clk_disable_unprepare(sii902x->audio.mclk); > dev_err(dev, "%s: hdmi audio enable failed: %d\n", __func__, > ret); > } > @@ -659,7 +662,8 @@ static void sii902x_audio_shutdown(struct device *dev, void *data) > > mutex_unlock(&sii902x->mutex); > > - clk_disable_unprepare(sii902x->audio.mclk); > + if (sii902x->audio.mclk) > + clk_disable_unprepare(sii902x->audio.mclk); > } > > int sii902x_audio_digital_mute(struct device *dev, void *data, bool enable) > @@ -752,9 +756,12 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, > > sii902x->audio.mclk = devm_clk_get(dev, "mclk"); > if (IS_ERR(sii902x->audio.mclk)) { > - dev_err(dev, "%s: No clock (audio mclk) found: %ld\n", > - __func__, PTR_ERR(sii902x->audio.mclk)); > - return 0; > + if (PTR_ERR(sii902x->audio.mclk) != -ENOENT) { > + dev_err(dev, "%s: No clock (audio mclk) found: %ld\n", > + __func__, PTR_ERR(sii902x->audio.mclk)); > + return PTR_ERR(sii902x->audio.mclk); > + } > + sii902x->audio.mclk = NULL; > } > > sii902x->audio.pdev = platform_device_register_data( > -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki