From patchwork Mon Feb 5 15:43:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10200797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 434776056A for ; Mon, 5 Feb 2018 15:45:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 342712877C for ; Mon, 5 Feb 2018 15:45:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28CC328782; Mon, 5 Feb 2018 15:45:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C2B2877C for ; Mon, 5 Feb 2018 15:45:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314AbeBEPpg (ORCPT ); Mon, 5 Feb 2018 10:45:36 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:35725 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753296AbeBEPpZ (ORCPT ); Mon, 5 Feb 2018 10:45:25 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180205154522epoutp04e2a3eabbd366d8b23345243be638a8ce~QeHYTSrf53104731047epoutp04S; Mon, 5 Feb 2018 15:45:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180205154522epoutp04e2a3eabbd366d8b23345243be638a8ce~QeHYTSrf53104731047epoutp04S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1517845523; bh=r4QndHof83WOv9HSOecjFpFezO7TBQf1lgBTTtZaLd0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=gl0sIenBb9CD5o7EnALi3MhYhPZGShvcztsSl9KLlu9fuaSQRiDiPv8o0O+UEk+wU WgdfB7QvGYIgidJZ81oWC24RckQHO6NB1+mn2VKe/5cTHC+pEFA39enfu6icj2SkL0 QjITC0qWNuLyUbiuTemu3Pz2Uaywa7tHIlhFXJgc= Received: from epsmges1p2.samsung.com (unknown [182.195.42.54]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180205154521epcas1p4b482d5e02eebdcce3a45ccb5191804b4~QeHXQ-W3f0389203892epcas1p4X; Mon, 5 Feb 2018 15:45:21 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 98.AB.04136.11C787A5; Tue, 6 Feb 2018 00:45:21 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180205154520epcas1p4132421a187a4d767a2f75badfef5eec4~QeHV9Repp0389203892epcas1p4T; Mon, 5 Feb 2018 15:45:20 +0000 (GMT) X-AuditID: b6c32a36-c91ff70000001028-bb-5a787c112fb8 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 92.92.03826.01C787A5; Tue, 6 Feb 2018 00:45:20 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P3O00399P1LBQ40@mmp1.samsung.com>; Tue, 06 Feb 2018 00:45:20 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, krzk@kernel.org, jcsing.lee@samsung.com, sbkim73@samsung.com, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Sylwester Nawrocki Subject: [PATCH 4/8] ASoC: samsung: i2s: Define the parameters list for SAMSUNG_I2S_OPCLK Date: Mon, 05 Feb 2018 16:43:59 +0100 Message-id: <20180205154403.13520-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20180205154403.13520-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWy7bCmrq5gTUWUwZ8j+hZXLh5istg4Yz2r xdSHT9gs5h85x2rxdn83s8X58xvYLb5d6WCyuLxrDpvFjPP7mCzWHrnLbtG69wi7xeE37awW F1d8YXLg9djwuYnNY+esu+wem1Z1snn0bVnF6PF5k1wAaxSXTUpqTmZZapG+XQJXxt295QWd ohX/Vt5nbWA8LdjFyMkhIWAi8XPWW/YuRi4OIYEdjBITvs9ngnC+M0p8bl/C3MXIAVb145Qf RHw3o0Tbvf2MEM4vRonWlVeYQUaxCRhK9B7tYwSxRQTEJG7P6WQGKWIWOMMkMX3fGiaQhLBA tETD/JUsIDaLgKrEpRW3WEE28ApYS7xaJAtxkrzE+wX3weZwCthI7Lm3DGyZhMAeNom1Hy6y QxS5SEw+f5QRwhaWeHV8CzvEpdISl47aQtT3M0qcWNMM1TyDUeJO+wQmiAZricPHL7KC2MwC fBLvvvawQjTzSnS0CUGYHhIz+0wgqh0llh/6DvajEMjMQ1+CJzBKLWBkWMUollpQnJueWmxY YKRXnJhbXJqXrpecn7uJERzNWmY7GBed8znEKMDBqMTDK5BRESXEmlhWXJl7iFGCg1lJhNfp enm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20180205154520epcas1p4132421a187a4d767a2f75badfef5eec4 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180205154520epcas1p4132421a187a4d767a2f75badfef5eec4 X-RootMTR: 20180205154520epcas1p4132421a187a4d767a2f75badfef5eec4 References: <20180205154403.13520-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SAMSUNG_I2S_OPCLK is not currently used by any card driver thus we can safely change semantics of 'dir' argument of the I2S set_sysclk() callback. Now an anumeration is exported instead of directly using register bitfield values. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s-regs.h | 11 ++++++----- sound/soc/samsung/i2s.c | 2 +- sound/soc/samsung/i2s.h | 11 ++++++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sound/soc/samsung/i2s-regs.h b/sound/soc/samsung/i2s-regs.h index fe6914005494..964985ea2e80 100644 --- a/sound/soc/samsung/i2s-regs.h +++ b/sound/soc/samsung/i2s-regs.h @@ -65,11 +65,12 @@ #define CON_RXDMA_ACTIVE (1 << 1) #define CON_ACTIVE (1 << 0) -#define MOD_OPCLK_CDCLK_OUT (0 << 30) -#define MOD_OPCLK_CDCLK_IN (1 << 30) -#define MOD_OPCLK_BCLK_OUT (2 << 30) -#define MOD_OPCLK_PCLK (3 << 30) -#define MOD_OPCLK_MASK (3 << 30) +#define MOD_OPCLK_SHIFT 30 +#define MOD_OPCLK_CDCLK_OUT (0 << MOD_OPCLK_SHIFT) +#define MOD_OPCLK_CDCLK_IN (1 << MOD_OPCLK_SHIFT) +#define MOD_OPCLK_BCLK_OUT (2 << MOD_OPCLK_SHIFT) +#define MOD_OPCLK_PCLK (3 << MOD_OPCLK_SHIFT) +#define MOD_OPCLK_MASK (3 << MOD_OPCLK_SHIFT) #define MOD_TXS_IDMA (1 << 28) /* Sec_TXFIFO use I-DMA */ #define MOD_BLCS_SHIFT 26 diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 1c05170e4999..6d768cdb4326 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -489,7 +489,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, switch (clk_id) { case SAMSUNG_I2S_OPCLK: mask = MOD_OPCLK_MASK; - val = dir; + val = (dir << MOD_OPCLK_SHIFT) & MOD_OPCLK_MASK; break; case SAMSUNG_I2S_CDCLK: mask = 1 << i2s_regs->cdclkcon_off; diff --git a/sound/soc/samsung/i2s.h b/sound/soc/samsung/i2s.h index 79781de2f247..a9832a9555cb 100644 --- a/sound/soc/samsung/i2s.h +++ b/sound/soc/samsung/i2s.h @@ -16,11 +16,16 @@ #define SAMSUNG_I2S_DAI "samsung-i2s" #define SAMSUNG_I2S_DAI_SEC "samsung-i2s-sec" -#define SAMSUNG_I2S_DIV_BCLK 1 +#define SAMSUNG_I2S_DIV_BCLK 1 -#define SAMSUNG_I2S_RCLKSRC_0 0 -#define SAMSUNG_I2S_RCLKSRC_1 1 +#define SAMSUNG_I2S_RCLKSRC_0 0 +#define SAMSUNG_I2S_RCLKSRC_1 1 #define SAMSUNG_I2S_CDCLK 2 +/* Operation clock for IIS logic */ #define SAMSUNG_I2S_OPCLK 3 +#define SAMSUNG_I2S_OPCLK_CDCLK_OUT 0 /* CODEC clock out */ +#define SAMSUNG_I2S_OPCLK_CDCLK_IN 1 /* CODEC clock in */ +#define SAMSUNG_I2S_OPCLK_BCLK_OUT 2 /* Bit clock out */ +#define SAMSUNG_I2S_OPCLK_PCLK 3 /* Audio bus clock */ #endif /* __SND_SOC_SAMSUNG_I2S_H */