mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: tegra-alt: remove Mystique support from DMIC
As part of support to Mystique platform DMIC enable/disable and a callback
helpers were provided (bug 200404157 and bug 200391366). Following commits
were pushed related to this.
commit b48f5902966a ("ASoC: tegra_alt: add DMIC enable/disable functions")
commit aac60cf54481 ("tegra-alt: dmic: add start callback support")
This patch removes references to above for following reasons,
* Mystqiue support is dropped
* Cleanup is required as part of DMIC upstream work
Bug 200520821
Bug 200503387
Change-Id: I626f65b06fce0d1cec916eb8d4a495d864256f62
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2143613
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -132,11 +132,6 @@ struct tegra210_dmic {
|
|||||||
bool is_shutdown;
|
bool is_shutdown;
|
||||||
int format_out;
|
int format_out;
|
||||||
bool set_parent_rate;
|
bool set_parent_rate;
|
||||||
void (*start_capture_cb)(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* exported functions to enable DMIC from other driver */
|
|
||||||
int tegra210_dmic_enable(int id);
|
|
||||||
int tegra210_dmic_disable(int id);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,8 +40,6 @@
|
|||||||
|
|
||||||
#define DRV_NAME "tegra210-dmic"
|
#define DRV_NAME "tegra210-dmic"
|
||||||
|
|
||||||
static struct platform_device *pdev_bkp[5];
|
|
||||||
|
|
||||||
static const struct reg_default tegra210_dmic_reg_defaults[] = {
|
static const struct reg_default tegra210_dmic_reg_defaults[] = {
|
||||||
{ TEGRA210_DMIC_TX_INT_MASK, 0x00000001},
|
{ TEGRA210_DMIC_TX_INT_MASK, 0x00000001},
|
||||||
{ TEGRA210_DMIC_TX_CIF_CTRL, 0x00007700},
|
{ TEGRA210_DMIC_TX_CIF_CTRL, 0x00007700},
|
||||||
@@ -118,95 +116,6 @@ static const int tegra210_dmic_fmt_values[] = {
|
|||||||
TEGRA210_AUDIOCIF_BITS_32,
|
TEGRA210_AUDIOCIF_BITS_32,
|
||||||
};
|
};
|
||||||
|
|
||||||
int tegra210_dmic_enable(int id)
|
|
||||||
{
|
|
||||||
struct tegra210_dmic *dmic;
|
|
||||||
struct platform_device *pdev = pdev_bkp[id];
|
|
||||||
int ret = 0;
|
|
||||||
int dmic_clk;
|
|
||||||
|
|
||||||
if (!pdev) {
|
|
||||||
pr_err("No dmic registered for id %d\n", id);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
dmic = dev_get_drvdata(&pdev->dev);
|
|
||||||
if (!dmic)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
dmic_clk = (1 << (6 + dmic->osr_val)) * 48000;
|
|
||||||
|
|
||||||
if (dmic->set_parent_rate) {
|
|
||||||
ret = clk_set_rate(dmic->clk_pll_a_out0, dmic_clk);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"Can't set dmic parent clock rate: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = clk_set_rate(dmic->clk_dmic, dmic_clk);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev, "Can't set dmic clock rate: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
pm_runtime_get_sync(&pdev->dev);
|
|
||||||
|
|
||||||
ret = clk_prepare_enable(dmic->clk_dmic);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev, "clk_enable failed: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
regmap_write(dmic->regmap, TEGRA210_DMIC_ENABLE, 1);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(tegra210_dmic_enable);
|
|
||||||
|
|
||||||
int tegra210_dmic_disable(int id)
|
|
||||||
{
|
|
||||||
struct tegra210_dmic *dmic;
|
|
||||||
struct platform_device *pdev = pdev_bkp[id];
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (!pdev) {
|
|
||||||
pr_err("No dmic registered for id %d\n", id);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
dmic = dev_get_drvdata(&pdev->dev);
|
|
||||||
if (!dmic)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
clk_disable_unprepare(dmic->clk_dmic);
|
|
||||||
|
|
||||||
regmap_write(dmic->regmap, TEGRA210_DMIC_ENABLE, 0);
|
|
||||||
|
|
||||||
pm_runtime_put(&pdev->dev);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(tegra210_dmic_disable);
|
|
||||||
|
|
||||||
int tegra210_dmic_set_start_callback(int id, void (*callback)(void))
|
|
||||||
{
|
|
||||||
struct tegra210_dmic *dmic;
|
|
||||||
struct platform_device *pdev = pdev_bkp[id];
|
|
||||||
|
|
||||||
if (!pdev) {
|
|
||||||
pr_err("No dmic registered for id %d\n", id);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!callback)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
dmic = dev_get_drvdata(&pdev->dev);
|
|
||||||
dmic->start_capture_cb = callback;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(tegra210_dmic_set_start_callback);
|
|
||||||
|
|
||||||
static int tegra210_dmic_startup(struct snd_pcm_substream *substream,
|
static int tegra210_dmic_startup(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *dai)
|
struct snd_soc_dai *dai)
|
||||||
{
|
{
|
||||||
@@ -267,9 +176,6 @@ static int tegra210_dmic_hw_params(struct snd_pcm_substream *substream,
|
|||||||
|
|
||||||
memset(&cif_conf, 0, sizeof(struct tegra210_xbar_cif_conf));
|
memset(&cif_conf, 0, sizeof(struct tegra210_xbar_cif_conf));
|
||||||
|
|
||||||
if (dmic->start_capture_cb && !strcmp(dai->name, "DAP"))
|
|
||||||
dmic->start_capture_cb();
|
|
||||||
|
|
||||||
srate = params_rate(params);
|
srate = params_rate(params);
|
||||||
if (dmic->sample_rate_via_control)
|
if (dmic->sample_rate_via_control)
|
||||||
srate = dmic->sample_rate_via_control;
|
srate = dmic->sample_rate_via_control;
|
||||||
@@ -813,8 +719,6 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
err_dap:
|
err_dap:
|
||||||
pdev_bkp[pdev->dev.id] = pdev;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_suspend:
|
err_suspend:
|
||||||
|
|||||||
Reference in New Issue
Block a user