/*
* tegra210_admaif_alt.c - Tegra ADMAIF driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(admaif->regmap, false);
- regcache_sync(admaif->regmap);
+ if (!admaif->is_shutdown)
+ regcache_sync(admaif->regmap);
return 0;
}
static int tegra210_admaif_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
+ struct tegra210_admaif *admaif = snd_soc_dai_get_drvdata(dai);
+
+ if (admaif->is_shutdown)
+ return -ENODEV;
+
return 0;
}
admaif->refcnt = 0;
admaif->soc_data = soc_data;
+ admaif->is_shutdown = false;
admaif->capture_dma_data = devm_kzalloc(&pdev->dev,
sizeof(struct tegra_alt_pcm_dma_params) *
return ret;
}
+static void tegra210_admaif_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_admaif *admaif = dev_get_drvdata(&pdev->dev);
+
+ admaif->is_shutdown = true;
+}
+
static int tegra210_admaif_remove(struct platform_device *pdev)
{
tegra_isomgr_adma_unregister();
static struct platform_driver tegra210_admaif_driver = {
.probe = tegra210_admaif_probe,
.remove = tegra210_admaif_remove,
+ .shutdown = tegra210_admaif_platform_shutdown,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
/*
* tegra210_admaif_alt.h - Tegra210 ADMAIF registers
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
int override_channels[TEGRA210_ADMAIF_CHANNEL_COUNT];
int tx_mono_to_stereo[TEGRA210_ADMAIF_CHANNEL_COUNT];
int rx_stereo_to_mono[TEGRA210_ADMAIF_CHANNEL_COUNT];
+ bool is_shutdown;
};
#endif
/*
* tegra210_adx_alt.c - Tegra210 ADX driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(adx->regmap, false);
- regcache_sync(adx->regmap);
- /* update the map ram */
- tegra210_adx_update_map_ram(adx);
- tegra210_adx_set_in_byte_mask(adx);
+ if (!adx->is_shutdown) {
+ regcache_sync(adx->regmap);
+
+ /* update the map ram */
+ tegra210_adx_update_map_ram(adx);
+ tegra210_adx_set_in_byte_mask(adx);
+ }
return 0;
}
}
adx->soc_data = soc_data;
+ adx->is_shutdown = false;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
return ret;
}
+static void tegra210_adx_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_adx *adx = dev_get_drvdata(&pdev->dev);
+
+ adx->is_shutdown = true;
+}
+
static int tegra210_adx_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_adx_platform_probe,
.remove = tegra210_adx_platform_remove,
+ .shutdown = tegra210_adx_platform_shutdown,
};
module_platform_driver(tegra210_adx_driver);
/*
* tegra210_adx_alt.h - Definitions for Tegra210 ADX driver
*
- * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
unsigned int map[16];
unsigned int byte_mask[2];
const struct tegra210_adx_soc_data *soc_data;
+ bool is_shutdown;
};
#endif
/*
* tegra210_afc_alt.c - Tegra210 AFC driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(afc->regmap, false);
- regcache_sync(afc->regmap);
+
+ if (!afc->is_shutdown)
+ regcache_sync(afc->regmap);
return 0;
}
}
afc->soc_data = soc_data;
+ afc->is_shutdown = false;
/* initialize default destination I2S */
afc->destination_i2s = 1;
return ret;
}
+static void tegra210_afc_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_afc *afc = dev_get_drvdata(&pdev->dev);
+
+ afc->is_shutdown = true;
+}
+
static int tegra210_afc_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_afc_platform_probe,
.remove = tegra210_afc_platform_remove,
+ .shutdown = tegra210_afc_platform_shutdown,
};
module_platform_driver(tegra210_afc_driver)
/*
* tegra210_afc_alt.h - Definitions for Tegra210 AFC driver
*
- * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
unsigned int destination_i2s;
struct regmap *regmap;
const struct tegra210_afc_soc_data *soc_data;
+ bool is_shutdown;
};
unsigned int tegra210_afc_get_sfc_id(unsigned int afc_id);
/*
* tegra210_amx_alt.c - Tegra210 AMX driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(amx->regmap, false);
- regcache_sync(amx->regmap);
- /* update map ram */
- tegra210_amx_set_master_stream(amx, 0,
- TEGRA210_AMX_WAIT_ON_ANY);
- tegra210_amx_update_map_ram(amx);
- tegra210_amx_set_out_byte_mask(amx);
+ if (!amx->is_shutdown) {
+ regcache_sync(amx->regmap);
+
+ /* update map ram */
+ tegra210_amx_set_master_stream(amx, 0,
+ TEGRA210_AMX_WAIT_ON_ANY);
+ tegra210_amx_update_map_ram(amx);
+ tegra210_amx_set_out_byte_mask(amx);
+ }
return 0;
}
}
amx->soc_data = soc_data;
+ amx->is_shutdown = false;
memset(amx->map, 0, sizeof(amx->map));
memset(amx->byte_mask, 0, sizeof(amx->byte_mask));
return ret;
}
+static void tegra210_amx_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_amx *amx = dev_get_drvdata(&pdev->dev);
+
+ amx->is_shutdown = true;
+}
+
static int tegra210_amx_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_amx_platform_probe,
.remove = tegra210_amx_platform_remove,
+ .shutdown = tegra210_amx_platform_shutdown,
};
module_platform_driver(tegra210_amx_driver);
/*
* tegra210_amx_alt.h - Definitions for Tegra210 AMX driver
*
- * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
int input_channels[TEGRA210_AMX_NUM_INPUTS];
int output_channels;
const struct tegra210_amx_soc_data *soc_data;
+ bool is_shutdown;
};
#endif
/*
* tegra210_dmic_alt.c - Tegra210 DMIC driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(dmic->regmap, false);
- regcache_sync(dmic->regmap);
+
+ if (!dmic->is_shutdown)
+ regcache_sync(dmic->regmap);
return 0;
}
}
dmic->soc_data = soc_data;
+ dmic->is_shutdown = false;
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
dmic->clk_dmic = devm_clk_get(&pdev->dev, NULL);
return ret;
}
+static void tegra210_dmic_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_dmic *dmic = dev_get_drvdata(&pdev->dev);
+
+ dmic->is_shutdown = true;
+}
+
static int tegra210_dmic_platform_remove(struct platform_device *pdev)
{
struct tegra210_dmic *dmic;
},
.probe = tegra210_dmic_platform_probe,
.remove = tegra210_dmic_platform_remove,
+ .shutdown = tegra210_dmic_platform_shutdown,
};
module_platform_driver(tegra210_dmic_driver)
/*
* tegra210_dmic_alt.h - Definitions for Tegra210 DMIC driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
int boost_gain; /* with 100x factor */
int ch_select;
int tx_mono_to_stereo;
+ bool is_shutdown;
};
#endif
/*
* tegra210_i2s.c - Tegra210 I2S driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(i2s->regmap, false);
- regcache_sync(i2s->regmap);
+
+ if (!i2s->is_shutdown)
+ regcache_sync(i2s->regmap);
return 0;
}
i2s->bclk_ratio = 2;
i2s->enable_cya = false;
i2s->loopback = 0;
+ i2s->is_shutdown = false;
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
i2s->clk_i2s = devm_clk_get(&pdev->dev, NULL);
return ret;
}
+static void tegra210_i2s_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_i2s *i2s = dev_get_drvdata(&pdev->dev);
+
+ i2s->is_shutdown = true;
+}
+
static int tegra210_i2s_platform_remove(struct platform_device *pdev)
{
struct tegra210_i2s *i2s = dev_get_drvdata(&pdev->dev);
},
.probe = tegra210_i2s_platform_probe,
.remove = tegra210_i2s_platform_remove,
+ .shutdown = tegra210_i2s_platform_shutdown,
};
module_platform_driver(tegra210_i2s_driver)
/*
* tegra210_i2s_alt.h - Definitions for Tegra210 I2S driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
unsigned int rx_mask;
unsigned int loopback;
bool enable_cya;
+ bool is_shutdown;
};
#endif
/*
* tegra210_mixer_alt.c - Tegra210 MIXER driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(mixer->regmap, false);
- regcache_sync(mixer->regmap);
+
+ if (!mixer->is_shutdown)
+ regcache_sync(mixer->regmap);
return 0;
}
}
mixer->soc_data = soc_data;
+ mixer->is_shutdown = false;
mixer->gain_coeff[0] = 0;
mixer->gain_coeff[1] = 0;
mixer->gain_coeff[2] = 0;
return ret;
}
+static void tegra210_mixer_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_mixer *mixer = dev_get_drvdata(&pdev->dev);
+
+ mixer->is_shutdown = true;
+}
+
static int tegra210_mixer_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_mixer_platform_probe,
.remove = tegra210_mixer_platform_remove,
+ .shutdown = tegra210_mixer_platform_shutdown,
};
module_platform_driver(tegra210_mixer_driver);
/*
* tegra210_mixer_alt.h - Definitions for Tegra210 MIXER driver
*
- * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
int gain_value[TEGRA210_MIXER_AXBAR_RX_MAX];
const struct tegra210_mixer_soc_data *soc_data;
unsigned int channels_via_control[TEGRA210_MIXER_TOTAL_PATH];
+ bool is_shutdown;
};
#endif
/*
* tegra210_mvc_alt.c - Tegra210 MVC driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(mvc->regmap, false);
- regcache_sync(mvc->regmap);
- regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL,
- TEGRA210_MVC_CURVE_TYPE_MASK,
- mvc->curve_type << TEGRA210_MVC_CURVE_TYPE_SHIFT);
+ if (!mvc->is_shutdown) {
+ regcache_sync(mvc->regmap);
+
+ regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL,
+ TEGRA210_MVC_CURVE_TYPE_MASK,
+ mvc->curve_type << TEGRA210_MVC_CURVE_TYPE_SHIFT);
+ }
return 0;
}
}
mvc->soc_data = soc_data;
+ mvc->is_shutdown = false;
mvc->poly_n1 = 16;
mvc->poly_n2 = 63;
return ret;
}
+static void tegra210_mvc_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_mvc *mvc = dev_get_drvdata(&pdev->dev);
+
+ mvc->is_shutdown = true;
+}
+
static int tegra210_mvc_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_mvc_platform_probe,
.remove = tegra210_mvc_platform_remove,
+ .shutdown = tegra210_mvc_platform_shutdown,
};
module_platform_driver(tegra210_mvc_driver)
/*
* tegra210_mvc_alt.h - Definitions for Tegra210 MVC driver
*
- * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
unsigned int cif_channels;
unsigned int audio_bits;
const struct tegra210_mvc_soc_data *soc_data;
+ bool is_shutdown;
};
#endif
regcache_cache_only(ope->regmap, false);
regcache_cache_only(ope->peq_regmap, false);
regcache_cache_only(ope->mbdrc_regmap, false);
- regcache_sync(ope->regmap);
- regcache_sync(ope->peq_regmap);
- regcache_sync(ope->mbdrc_regmap);
+
+ if (!ope->is_shutdown) {
+ regcache_sync(ope->regmap);
+ regcache_sync(ope->peq_regmap);
+ regcache_sync(ope->mbdrc_regmap);
+ }
return 0;
}
}
ope->soc_data = soc_data;
+ ope->is_shutdown = false;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
return ret;
}
+static void tegra210_ope_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_ope *ope = dev_get_drvdata(&pdev->dev);
+
+ ope->is_shutdown = true;
+}
+
static int tegra210_ope_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_ope_platform_probe,
.remove = tegra210_ope_platform_remove,
+ .shutdown = tegra210_ope_platform_shutdown,
};
module_platform_driver(tegra210_ope_driver)
/*
* tegra210_ope_alt.h - Definitions for Tegra210 OPE driver
*
- * Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
struct regmap *peq_regmap;
struct regmap *mbdrc_regmap;
const struct tegra210_ope_soc_data *soc_data;
+ bool is_shutdown;
};
extern int tegra210_peq_init(struct platform_device *pdev, int id);
/*
* tegra210_sfc_alt.c - Tegra210 SFC driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(sfc->regmap, false);
- regcache_sync(sfc->regmap);
+
+ if (!sfc->is_shutdown)
+ regcache_sync(sfc->regmap);
return 0;
}
}
sfc->soc_data = soc_data;
+ sfc->is_shutdown = false;
/* initialize default output srate */
sfc->srate_out = TEGRA210_SFC_FS48;
return ret;
}
+static void tegra210_sfc_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_sfc *sfc = dev_get_drvdata(&pdev->dev);
+
+ sfc->is_shutdown = true;
+}
+
static int tegra210_sfc_platform_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
},
.probe = tegra210_sfc_platform_probe,
.remove = tegra210_sfc_platform_remove,
+ .shutdown = tegra210_sfc_platform_shutdown,
};
module_platform_driver(tegra210_sfc_driver)
/*
* tegra210_sfc_alt.h - Definitions for Tegra210 SFC driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
int mono_conv_output;
const struct tegra210_sfc_soc_data *soc_data;
unsigned int channels_via_control;
+ bool is_shutdown;
};
/* coeff RAM tables required for SFC */
/*
* tegra210_spdif_alt.c - Tegra210 SPDIF driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(spdif->regmap, false);
- regcache_sync(spdif->regmap);
+
+ if (!spdif->is_shutdown)
+ regcache_sync(spdif->regmap);
return 0;
}
}
spdif->soc_data = soc_data;
+ spdif->is_shutdown = false;
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
#if defined(CONFIG_ARCH_TEGRA_18x_SOC)
spdif->clk_pll_a_out0 = devm_clk_get(&pdev->dev, "pll_a_out0");
return ret;
}
+static void tegra210_spdif_platform_shutdown(struct platform_device *pdev)
+{
+ struct tegra210_spdif *spdif = dev_get_drvdata(&pdev->dev);
+
+ spdif->is_shutdown = true;
+}
+
static int tegra210_spdif_platform_remove(struct platform_device *pdev)
{
struct tegra210_spdif *spdif = dev_get_drvdata(&pdev->dev);
},
.probe = tegra210_spdif_platform_probe,
.remove = tegra210_spdif_platform_remove,
+ .shutdown = tegra210_spdif_platform_shutdown,
};
module_platform_driver(tegra210_spdif_driver);
/*
* tegra210_spdif.h - Definitions for Tegra210 SPDIF driver
*
- * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
struct pinctrl *pinctrl;
struct pinctrl_state *pin_active_state;
struct pinctrl_state *pin_idle_state;
+ bool is_shutdown;
};
#endif
/*
* tegra210_xbar_alt.c - Tegra210 XBAR driver
*
- * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
}
regcache_cache_only(xbar->regmap, false);
- regcache_sync(xbar->regmap);
+
+ if (!xbar->is_shutdown)
+ regcache_sync(xbar->regmap);
return 0;
}
}
xbar->soc_data = soc_data;
+ xbar->is_shutdown = false;
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
xbar->clk = devm_clk_get(&pdev->dev, "ahub");
return ret;
}
+static void tegra210_xbar_shutdown(struct platform_device *pdev)
+{
+ xbar->is_shutdown = true;
+}
+
static int tegra210_xbar_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
static struct platform_driver tegra210_xbar_driver = {
.probe = tegra210_xbar_probe,
.remove = tegra210_xbar_remove,
+ .shutdown = tegra210_xbar_shutdown,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
struct clk *clk_apb2ape;
struct regmap *regmap;
const struct tegra210_xbar_soc_data *soc_data;
+ bool is_shutdown;
};
/* Extension of soc_bytes structure defined in sound/soc.h */