Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbdIAVg7 (ORCPT ); Fri, 1 Sep 2017 17:36:59 -0400 Received: from mail-sn1nam01on0134.outbound.protection.outlook.com ([104.47.32.134]:48736 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752524AbdIAVgO (ORCPT ); Fri, 1 Sep 2017 17:36:14 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=RyanS.Lee@maximintegrated.com; From: Ryan Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ryans.lee@maximintegrated.com, kuninori.morimoto.gx@renesas.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: ryan.lee.maxim@gmail.com Subject: [PATCH 1/3] ASoC: max98927: Added support for DSP_A and DSP_B format Date: Fri, 1 Sep 2017 14:35:06 -0700 Message-Id: <1504301708-24389-1-git-send-email-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [204.17.143.20] X-ClientProxiedBy: MWHPR18CA0034.namprd18.prod.outlook.com (10.175.9.148) To CY1PR11MB0843.namprd11.prod.outlook.com (10.163.237.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1a86900-fff5-440c-11b7-08d4f18176b9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR11MB0843; X-Microsoft-Exchange-Diagnostics: 1;CY1PR11MB0843;3:alsLuS4bcq5WJY1ZTQdiA8aA5M7NOI8qOKG6ibFynDhZ5AMlPj6B/ml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UpTiAsN0TwMGkjwh+/zAfIWRj/rx5rDkpEXKIinHEcluFTVDQhUuoS109ck8P1Ng3NAKZ01QUKBihqYhbiHnl2raxQaP4UDSlafVR7GhiXS56XXWyDUZwPeQKhUkK0k2vh97p8aNJ7SjB6gnuvMFgtpvrkzTnJwZZBTf+8qnEneqnWx4FmNRLxwdLdFtRtUWT4BxS9oU2ooFL33c9Vh36ZzWcaFdTEHnuJ/OwwPrk7HIOuoeef0KKRjFd6USnI8bsL6lputgkauzwu5ju4TXNsEFPN46KY2dKIcVcTvewBwWrlxsl/PPfnj;4:A6CDInWlcxI/T1hwTA5LZdIeBZ8SXTAx44wMKfJ4uS88qpeU02yKl6aeuy/dOk84/XwzKIV40WBgTB+xikFhuE+ZtDGi7esKvhUAdagwkbVCwXgmsAox8X3I5fZLgl35siglFiWZb7tB00sNyutskUGF4eFm2nm7HSchqoDY/Dihj5uQEfuA1OM/XAcfN5OzqXlCqc9Qhw9FrDhQ2T15OO/m9VByPJ11UXk/WL3Bw96h5cL8Pzb3H39j1pCojIUxOPTp2CFwvBzjT4q6lJkPofUme5F4HLerXjev6aWLix4= X-Exchange-Antispam-Report-Test: UriScan:(108721460000369); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR11MB0843;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR11MB0843; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(189002)(199003)(54534003)(7736002)(5003940100001)(2906002)(53936002)(305945005)(3846002)(6116002)(478600001)(66066001)(5660300001)(4326008)(8676002)(33646002)(189998001)(81156014)(81166006)(6666003)(25786009)(50986999)(86362001)(36756003)(69596002)(53416004)(6512007)(8936002)(50226002)(6486002)(39060400002)(110136004)(106356001)(68736007)(42186005)(6506006)(105586002)(97736004)(50466002)(72206003)(101416001)(47776003)(48376002)(2004002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR11MB0843;H:ryan-ThinkPad-T430.maxim-ic.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR11MB0843;23:paSAGCHs6sS57zPDLfsRc/t7AnN8tX75th3PPV69b?= =?us-ascii?Q?qkr+0L8DDhOozg90zvRPM2I2amh2OHwiDS77zXl/2aR0VKyI+sPN39wfbpIh?= =?us-ascii?Q?jl9EOz8LMvzCq4CjquT6gIdIE496PeWsrEbgH2fa9uF2X3cknxmcvOO+kC4a?= =?us-ascii?Q?TeYWjOfayvoAaSzWluX5n2bKioI8v7fEW1SjRx+1wOdjur9enJuP7I0Nl0YI?= =?us-ascii?Q?UloSFBgdpLF2tbCcDxzlS/qmt4elnUpQ2EdrT/9ZAXhEKq2mhwtx8+cEAdSU?= =?us-ascii?Q?5lA5th8Rzqs/n+BZEEnSViAhzTniJ7krfA5vTkQaTIkZTspn6leQdvSBuk4K?= =?us-ascii?Q?bc338A6NplpYDsAE9/swzk8W60tfuchDm8ey2cah+3tdlKtKisrb6vDq8JFG?= =?us-ascii?Q?+d/gyJ1c2BBjpWbuA/1wJqyKbjHYOa8HOJMx9acbPw1cWgL2sVCbOTwO4Kjv?= =?us-ascii?Q?ztsCxFOU2uvhSvsto2u7WbrYcU31Pz5mG5YVYXahep7L8zi44j6iOv2cGOEI?= =?us-ascii?Q?xqV8dt2L+9aqe6BE9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MjsTMhwinWE/hjnbK31mi7GaQq4g9cB2NjH+sPH6hlQ==;5:BLlIzQDDAzXDfT7SbwxlmJPa9fR/b/8Glp3/3RZNjQ5B37hDgrIdmOu/XpD5yHENSjxhuG6cjKSYHTw0UFVqsQdO1ZUDxpiZ8xLdqZ760kP4jGgp6aPoBvlJYFQCZA2srsfBzOIekmPT5fXTvz/KtQ==;24:bguV4JYOo5b4biL/9jOuW9q8DZ6cKEAd3CGRyNd48XUIarO1nV24x/mLvJvM+jCxUrcGFsUTjuQ9BcvH1mmKlkd9fYMe+pdtdjvIKO3bo68=;7:jKhPICjN5qkitFYegLpuffbT52egnr0PRtoh6Q8NSeZMOjz+eFsq9Gd024wPd73QUmxt3Z51rDkZX1/jrJyJ2t1asbRZs7e36d2eWpiYsotXitBughuHltdEMEe4pjxvvvcMq0IlXwIdsGLCFUf2FzetneLF4gs1LkffUuXI64lQb9twaElOChGrR7ZT4ughdGiIWgfjOWEg2MqMNSdJ+I+DAfkEjq+cVmz1tzc2TJM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 21:36:10.5841 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fbd909df-ea69-4788-a554-f24b7854ad03 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR11MB0843 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8565 Lines: 288 Signed-off-by: Ryan Lee --- Changelog: Added support for DSP_A and DSP_B format Added 'max98927_dai_tdm_slot' function to configure for proper slot configuration. Moved max98927->iface out of switch statement to avoid line duplication. Added variable 'tdm_mode' to avoid BCLK overwrite after 'max98927_dai_tdm_slot' configure right BCLK value. sound/soc/codecs/max98927.c | 155 +++++++++++++++++++++++++++++++++++--------- sound/soc/codecs/max98927.h | 7 +- 2 files changed, 129 insertions(+), 33 deletions(-) diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index d9dbbe7..a1d3935 100644 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -1,7 +1,7 @@ /* * max98927.c -- MAX98927 ALSA Soc Audio driver * - * Copyright (C) 2016 Maxim Integrated Products + * Copyright (C) 2016-2017 Maxim Integrated Products * Author: Ryan Lee * * This program is free software; you can redistribute it and/or modify it @@ -146,6 +146,7 @@ static int max98927_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); unsigned int mode = 0; unsigned int format = 0; + bool use_pdm = false; unsigned int invert = 0; dev_dbg(codec->dev, "%s: fmt 0x%08X\n", __func__, fmt); @@ -187,22 +188,27 @@ static int max98927_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) /* interface format */ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: - max98927->iface |= SND_SOC_DAIFMT_I2S; format = MAX98927_PCM_FORMAT_I2S; break; case SND_SOC_DAIFMT_LEFT_J: - max98927->iface |= SND_SOC_DAIFMT_LEFT_J; format = MAX98927_PCM_FORMAT_LJ; break; + case SND_SOC_DAIFMT_DSP_A: + format = MAX98927_PCM_FORMAT_TDM_MODE1; + break; + case SND_SOC_DAIFMT_DSP_B: + format = MAX98927_PCM_FORMAT_TDM_MODE0; + break; case SND_SOC_DAIFMT_PDM: - max98927->iface |= SND_SOC_DAIFMT_PDM; + use_pdm = true; break; default: return -EINVAL; } + max98927->iface = fmt & SND_SOC_DAIFMT_FORMAT_MASK; - /* pcm channel configuration */ - if (max98927->iface & (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_LEFT_J)) { + if (!use_pdm) { + /* pcm channel configuration */ regmap_update_bits(max98927->regmap, MAX98927_R0018_PCM_RX_EN_A, MAX98927_PCM_RX_CH0_EN | MAX98927_PCM_RX_CH1_EN, @@ -217,13 +223,11 @@ static int max98927_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) MAX98927_R003B_SPK_SRC_SEL, MAX98927_SPK_SRC_MASK, 0); - } else regmap_update_bits(max98927->regmap, - MAX98927_R0018_PCM_RX_EN_A, - MAX98927_PCM_RX_CH0_EN | MAX98927_PCM_RX_CH1_EN, 0); - - /* pdm channel configuration */ - if (max98927->iface & SND_SOC_DAIFMT_PDM) { + MAX98927_R0035_PDM_RX_CTRL, + MAX98927_PDM_RX_EN_MASK, 0); + } else { + /* pdm channel configuration */ regmap_update_bits(max98927->regmap, MAX98927_R0035_PDM_RX_CTRL, MAX98927_PDM_RX_EN_MASK, 1); @@ -231,10 +235,11 @@ static int max98927_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) regmap_update_bits(max98927->regmap, MAX98927_R003B_SPK_SRC_SEL, MAX98927_SPK_SRC_MASK, 3); - } else + regmap_update_bits(max98927->regmap, - MAX98927_R0035_PDM_RX_CTRL, - MAX98927_PDM_RX_EN_MASK, 0); + MAX98927_R0018_PCM_RX_EN_A, + MAX98927_PCM_RX_CH0_EN | MAX98927_PCM_RX_CH1_EN, 0); + } return 0; } @@ -245,6 +250,21 @@ static int max98927_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 13000000, 19200000, }; +/* BCLKs per LRCLK */ +static const int bclk_sel_table[] = { + 32, 48, 64, 96, 128, 192, 256, 384, 512, +}; + +static int max98927_get_bclk_sel(int bclk) +{ + int i; + /* match BCLKs per LRCLK */ + for (i = 0; i < ARRAY_SIZE(bclk_sel_table); i++) { + if (bclk_sel_table[i] == bclk) + return i + 2; + } + return 0; +} static int max98927_set_clock(struct max98927_priv *max98927, struct snd_pcm_hw_params *params) { @@ -270,23 +290,20 @@ static int max98927_set_clock(struct max98927_priv *max98927, i << MAX98927_PCM_MASTER_MODE_MCLK_RATE_SHIFT); } - switch (blr_clk_ratio) { - case 32: - value = 2; - break; - case 48: - value = 3; - break; - case 64: - value = 4; - break; - default: - return -EINVAL; + if (!max98927->tdm_mode) { + /* BCLK configuration */ + value = max98927_get_bclk_sel(blr_clk_ratio); + if (!value) { + dev_err(codec->dev, "format unsupported %d\n", + params_format(params)); + return -EINVAL; + } + + regmap_update_bits(max98927->regmap, + MAX98927_R0022_PCM_CLK_SETUP, + MAX98927_PCM_CLK_SETUP_BSEL_MASK, + value); } - regmap_update_bits(max98927->regmap, - MAX98927_R0022_PCM_CLK_SETUP, - MAX98927_PCM_CLK_SETUP_BSEL_MASK, - value); return 0; } @@ -386,6 +403,78 @@ static int max98927_dai_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } +static int max98927_dai_tdm_slot(struct snd_soc_dai *dai, + unsigned int tx_mask, unsigned int rx_mask, + int slots, int slot_width) +{ + struct snd_soc_codec *codec = dai->codec; + struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); + int bsel = 0; + unsigned int chan_sz = 0; + + max98927->tdm_mode = true; + + /* BCLK configuration */ + bsel = max98927_get_bclk_sel(slots * slot_width); + if (bsel == 0) { + dev_err(codec->dev, "BCLK %d not supported\n", + slots * slot_width); + return -EINVAL; + } + + regmap_update_bits(max98927->regmap, + MAX98927_R0022_PCM_CLK_SETUP, + MAX98927_PCM_CLK_SETUP_BSEL_MASK, + bsel); + + /* Channel size configuration */ + switch (slot_width) { + case 16: + chan_sz = MAX98927_PCM_MODE_CFG_CHANSZ_16; + break; + case 24: + chan_sz = MAX98927_PCM_MODE_CFG_CHANSZ_24; + break; + case 32: + chan_sz = MAX98927_PCM_MODE_CFG_CHANSZ_32; + break; + default: + dev_err(codec->dev, "format unsupported %d\n", + slot_width); + return -EINVAL; + } + + regmap_update_bits(max98927->regmap, + MAX98927_R0020_PCM_MODE_CFG, + MAX98927_PCM_MODE_CFG_CHANSZ_MASK, chan_sz); + + /* Rx slot configuration */ + regmap_write(max98927->regmap, + MAX98927_R0018_PCM_RX_EN_A, + rx_mask & 0xFF); + regmap_write(max98927->regmap, + MAX98927_R0019_PCM_RX_EN_B, + (rx_mask & 0xFF00) >> 8); + + /* Tx slot configuration */ + regmap_write(max98927->regmap, + MAX98927_R001A_PCM_TX_EN_A, + tx_mask & 0xFF); + regmap_write(max98927->regmap, + MAX98927_R001B_PCM_TX_EN_B, + (tx_mask & 0xFF00) >> 8); + + /* Tx slot Hi-Z configuration */ + regmap_write(max98927->regmap, + MAX98927_R001C_PCM_TX_HIZ_CTRL_A, + ~tx_mask & 0xFF); + regmap_write(max98927->regmap, + MAX98927_R001D_PCM_TX_HIZ_CTRL_B, + (~tx_mask & 0xFF00) >> 8); + + return 0; +} + #define MAX98927_RATES SNDRV_PCM_RATE_8000_48000 #define MAX98927_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ @@ -405,6 +494,7 @@ static int max98927_dai_set_sysclk(struct snd_soc_dai *dai, .set_sysclk = max98927_dai_set_sysclk, .set_fmt = max98927_dai_set_fmt, .hw_params = max98927_dai_hw_params, + .set_tdm_slot = max98927_dai_tdm_slot, }; static int max98927_dac_event(struct snd_soc_dapm_widget *w, @@ -414,6 +504,9 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w, struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec); switch (event) { + case SND_SOC_DAPM_PRE_PMU: + max98927->tdm_mode = 0; + break; case SND_SOC_DAPM_POST_PMU: regmap_update_bits(max98927->regmap, MAX98927_R003A_AMP_EN, diff --git a/sound/soc/codecs/max98927.h b/sound/soc/codecs/max98927.h index ece6a60..9ea8397 100644 --- a/sound/soc/codecs/max98927.h +++ b/sound/soc/codecs/max98927.h @@ -1,7 +1,7 @@ /* * max98927.h -- MAX98927 ALSA Soc Audio driver * - * Copyright 2013-15 Maxim Integrated Products + * Copyright (C) 2016-2017 Maxim Integrated Products * Author: Ryan Lee * * This program is free software; you can redistribute it and/or modify it @@ -161,7 +161,9 @@ #define MAX98927_PCM_MODE_CFG_FORMAT_SHIFT (3) #define MAX98927_PCM_FORMAT_I2S (0x0 << 0) #define MAX98927_PCM_FORMAT_LJ (0x1 << 0) - +#define MAX98927_PCM_FORMAT_TDM_MODE0 (0x3 << 0) +#define MAX98927_PCM_FORMAT_TDM_MODE1 (0x4 << 0) +#define MAX98927_PCM_FORMAT_TDM_MODE2 (0x5 << 0) #define MAX98927_PCM_MODE_CFG_CHANSZ_MASK (0x3 << 6) #define MAX98927_PCM_MODE_CFG_CHANSZ_16 (0x1 << 6) #define MAX98927_PCM_MODE_CFG_CHANSZ_24 (0x2 << 6) @@ -268,5 +270,6 @@ struct max98927_priv { unsigned int iface; unsigned int master; unsigned int digital_gain; + bool tdm_mode; }; #endif -- 1.9.1