ASoC: tegra-alt: remove shutdown handling

commit b4bc1cf56020("ASoC: tegra-alt: Avoid reg access after shutdown")
avoided device register access after shutdown() has been called. This
otherwise resulted in occasional SError and resulted in crash. The reason
for this was runtime PM does not work after shutdown and it was seen on
vK4.4

Looks like the issue has been fixed from vK4.5 onwards, where PM domain
detach is avoided during shutdown. Following is the upstream commmit.
"platform: Do not detach from PM domains on shutdown"

Bug 200503387

Change-Id: I5f3d18f05e434d5a1ed5b597362a39ec9a9f010b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161809
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sameer Pujar
2019-07-21 14:20:07 +05:30
parent 3f3a331b56
commit b4955d4ea6
30 changed files with 30 additions and 235 deletions

View File

@@ -173,7 +173,6 @@ struct tegra186_asrc {
struct tasklet_struct tasklet; struct tasklet_struct tasklet;
struct list_head task_desc; struct list_head task_desc;
int active_dai_count; int active_dai_count;
bool is_shutdown;
}; };
int tegra186_asrc_set_source(int id, int source); int tegra186_asrc_set_source(int id, int source);
int tegra186_asrc_event(int id, enum asrc_task_event event, int status); int tegra186_asrc_event(int id, enum asrc_task_event event, int status);

View File

@@ -178,7 +178,6 @@ struct tegra186_dspk {
const char *prod_name; const char *prod_name;
unsigned int rx_fifo_th; /* threshold in terms of frames */ unsigned int rx_fifo_th; /* threshold in terms of frames */
unsigned int osr_val; /* osr value */ unsigned int osr_val; /* osr value */
bool is_shutdown;
}; };
#endif #endif

View File

@@ -177,7 +177,6 @@ struct tegra_admaif {
int *override_channels; int *override_channels;
int *tx_mono_to_stereo; int *tx_mono_to_stereo;
int *rx_stereo_to_mono; int *rx_stereo_to_mono;
bool is_shutdown;
int reg_dump_flag; int reg_dump_flag;
void __iomem *base_addr; void __iomem *base_addr;
}; };

View File

@@ -166,7 +166,6 @@ struct tegra210_adx {
unsigned int byte_mask[2]; unsigned int byte_mask[2];
int input_channels; int input_channels;
int output_channels[TEGRA210_ADX_NUM_OUTPUTS]; int output_channels[TEGRA210_ADX_NUM_OUTPUTS];
bool is_shutdown;
}; };
#endif #endif

View File

@@ -100,7 +100,6 @@ enum tegra210_afc_threshold_type {
struct tegra210_afc { struct tegra210_afc {
struct regmap *regmap; struct regmap *regmap;
const struct tegra210_afc_soc_data *soc_data; const struct tegra210_afc_soc_data *soc_data;
bool is_shutdown;
/* mandatory control to be set */ /* mandatory control to be set */
unsigned int dest_module_num; unsigned int dest_module_num;

View File

@@ -190,7 +190,6 @@ struct tegra210_amx {
int input_channels[TEGRA210_AMX_NUM_INPUTS]; int input_channels[TEGRA210_AMX_NUM_INPUTS];
int output_channels; int output_channels;
const struct tegra210_amx_soc_data *soc_data; const struct tegra210_amx_soc_data *soc_data;
bool is_shutdown;
}; };
#endif #endif

View File

@@ -100,7 +100,6 @@ struct tegra210_dmic {
unsigned int channels_via_control; unsigned int channels_via_control;
unsigned int osr_val; /* osr value */ unsigned int osr_val; /* osr value */
int lrsel; int lrsel;
bool is_shutdown;
int format_out; int format_out;
}; };

View File

@@ -221,7 +221,6 @@ struct tegra210_i2s {
unsigned int format; unsigned int format;
bool enable_cya; bool enable_cya;
unsigned int rx_fifo_th; /* should be programmed interms of frames */ unsigned int rx_fifo_th; /* should be programmed interms of frames */
bool is_shutdown;
}; };
#endif #endif

View File

@@ -125,7 +125,6 @@ struct tegra210_mixer {
int gain_coeff[14]; int gain_coeff[14];
int gain_value[TEGRA210_MIXER_AXBAR_RX_MAX]; int gain_value[TEGRA210_MIXER_AXBAR_RX_MAX];
unsigned int channels_via_control[TEGRA210_MIXER_TOTAL_PATH]; unsigned int channels_via_control[TEGRA210_MIXER_TOTAL_PATH];
bool is_shutdown;
}; };
#endif #endif

View File

@@ -139,7 +139,6 @@ struct tegra210_mvc {
unsigned int cif_channels; unsigned int cif_channels;
unsigned int audio_bits; unsigned int audio_bits;
unsigned int format_in; unsigned int format_in;
bool is_shutdown;
}; };
#endif #endif

View File

@@ -76,7 +76,6 @@ struct tegra210_ope {
struct regmap *mbdrc_regmap; struct regmap *mbdrc_regmap;
u32 peq_biquad_gains[TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH]; u32 peq_biquad_gains[TEGRA210_PEQ_GAIN_PARAM_SIZE_PER_CH];
u32 peq_biquad_shifts[TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH]; u32 peq_biquad_shifts[TEGRA210_PEQ_SHIFT_PARAM_SIZE_PER_CH];
bool is_shutdown;
}; };
extern int tegra210_peq_init(struct platform_device *pdev, int id); extern int tegra210_peq_init(struct platform_device *pdev, int id);

View File

@@ -92,7 +92,6 @@ struct tegra210_sfc {
int stereo_conv_input; int stereo_conv_input;
int mono_conv_output; int mono_conv_output;
unsigned int channels_via_control; unsigned int channels_via_control;
bool is_shutdown;
}; };
#endif #endif

View File

@@ -252,7 +252,6 @@ struct tegra210_spdif {
struct clk *clk_pll_p_out0; struct clk *clk_pll_p_out0;
struct regmap *regmap; struct regmap *regmap;
unsigned int loopback; unsigned int loopback;
bool is_shutdown;
}; };
#endif #endif

View File

@@ -196,7 +196,6 @@ struct tegra_xbar {
struct clk *clk_apb2ape; struct clk *clk_apb2ape;
struct regmap *regmap; struct regmap *regmap;
const struct tegra_xbar_soc_data *soc_data; const struct tegra_xbar_soc_data *soc_data;
bool is_shutdown;
}; };
/* Extension of soc_bytes structure defined in sound/soc.h */ /* Extension of soc_bytes structure defined in sound/soc.h */

View File

@@ -173,10 +173,6 @@ static int tegra186_asrc_runtime_resume(struct device *dev)
int lane_id; int lane_id;
regcache_cache_only(asrc->regmap, false); regcache_cache_only(asrc->regmap, false);
if (asrc->is_shutdown)
return 0;
regcache_sync(asrc->regmap); regcache_sync(asrc->regmap);
/* HW needs sw reset to make sure previous /* HW needs sw reset to make sure previous
@@ -1098,7 +1094,6 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
if (!asrc) if (!asrc)
return -ENOMEM; return -ENOMEM;
asrc->is_shutdown = false;
dev_set_drvdata(&pdev->dev, asrc); dev_set_drvdata(&pdev->dev, asrc);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1155,13 +1150,6 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
static void tegra186_asrc_platform_shutdown(struct platform_device *pdev)
{
struct tegra186_asrc *asrc = dev_get_drvdata(&pdev->dev);
asrc->is_shutdown = true;
}
static int tegra186_asrc_platform_remove(struct platform_device *pdev) static int tegra186_asrc_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -1189,7 +1177,6 @@ static struct platform_driver tegra186_asrc_driver = {
}, },
.probe = tegra186_asrc_platform_probe, .probe = tegra186_asrc_platform_probe,
.remove = tegra186_asrc_platform_remove, .remove = tegra186_asrc_platform_remove,
.shutdown = tegra186_asrc_platform_shutdown,
}; };
module_platform_driver(tegra186_asrc_driver) module_platform_driver(tegra186_asrc_driver)

View File

@@ -114,9 +114,8 @@ static int tegra186_dspk_runtime_resume(struct device *dev)
} }
regcache_cache_only(dspk->regmap, false); regcache_cache_only(dspk->regmap, false);
if (!dspk->is_shutdown)
regcache_sync(dspk->regmap); regcache_sync(dspk->regmap);
return 0; return 0;
} }
@@ -426,7 +425,6 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev)
if (!dspk) if (!dspk)
return -ENOMEM; return -ENOMEM;
dspk->is_shutdown = false;
dspk->prod_name = NULL; dspk->prod_name = NULL;
dspk->rx_fifo_th = 0; dspk->rx_fifo_th = 0;
dspk->osr_val = TEGRA186_DSPK_OSR_64; dspk->osr_val = TEGRA186_DSPK_OSR_64;
@@ -491,13 +489,6 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
static void tegra186_dspk_platform_shutdown(struct platform_device *pdev)
{
struct tegra186_dspk *dspk = dev_get_drvdata(&pdev->dev);
dspk->is_shutdown = true;
}
static int tegra186_dspk_platform_remove(struct platform_device *pdev) static int tegra186_dspk_platform_remove(struct platform_device *pdev)
{ {
struct tegra186_dspk *dspk; struct tegra186_dspk *dspk;
@@ -528,7 +519,6 @@ static struct platform_driver tegra186_dspk_driver = {
}, },
.probe = tegra186_dspk_platform_probe, .probe = tegra186_dspk_platform_probe,
.remove = tegra186_dspk_platform_remove, .remove = tegra186_dspk_platform_remove,
.shutdown = tegra186_dspk_platform_shutdown,
}; };
module_platform_driver(tegra186_dspk_driver); module_platform_driver(tegra186_dspk_driver);

View File

@@ -292,7 +292,6 @@ static int tegra_admaif_runtime_resume(struct device *dev)
struct tegra_admaif *admaif = dev_get_drvdata(dev); struct tegra_admaif *admaif = dev_get_drvdata(dev);
regcache_cache_only(admaif->regmap, false); regcache_cache_only(admaif->regmap, false);
if (!admaif->is_shutdown)
regcache_sync(admaif->regmap); regcache_sync(admaif->regmap);
return 0; return 0;
@@ -344,17 +343,6 @@ static int tegra_admaif_prepare(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int tegra_admaif_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct tegra_admaif *admaif = snd_soc_dai_get_drvdata(dai);
if (admaif->is_shutdown)
return -ENODEV;
return 0;
}
static void tegra_admaif_shutdown(struct snd_pcm_substream *substream, static void tegra_admaif_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
@@ -552,7 +540,6 @@ static int tegra_admaif_trigger(struct snd_pcm_substream *substream, int cmd,
static struct snd_soc_dai_ops tegra_admaif_dai_ops = { static struct snd_soc_dai_ops tegra_admaif_dai_ops = {
.hw_params = tegra_admaif_hw_params, .hw_params = tegra_admaif_hw_params,
.trigger = tegra_admaif_trigger, .trigger = tegra_admaif_trigger,
.startup = tegra_admaif_startup,
.shutdown = tegra_admaif_shutdown, .shutdown = tegra_admaif_shutdown,
.prepare = tegra_admaif_prepare, .prepare = tegra_admaif_prepare,
}; };
@@ -1147,7 +1134,6 @@ static int tegra_admaif_probe(struct platform_device *pdev)
admaif->dev = &pdev->dev; admaif->dev = &pdev->dev;
admaif->soc_data = (struct tegra_admaif_soc_data *)match->data; admaif->soc_data = (struct tegra_admaif_soc_data *)match->data;
admaif->is_shutdown = false;
dev_set_drvdata(&pdev->dev, admaif); dev_set_drvdata(&pdev->dev, admaif);
admaif->capture_dma_data = devm_kzalloc(&pdev->dev, admaif->capture_dma_data = devm_kzalloc(&pdev->dev,
@@ -1289,13 +1275,6 @@ pm_disable:
return ret; return ret;
} }
static void tegra_admaif_platform_shutdown(struct platform_device *pdev)
{
struct tegra_admaif *admaif = dev_get_drvdata(&pdev->dev);
admaif->is_shutdown = true;
}
static int tegra_admaif_remove(struct platform_device *pdev) static int tegra_admaif_remove(struct platform_device *pdev)
{ {
struct tegra_admaif *admaif = dev_get_drvdata(&pdev->dev); struct tegra_admaif *admaif = dev_get_drvdata(&pdev->dev);
@@ -1326,7 +1305,6 @@ static const struct dev_pm_ops tegra_admaif_pm_ops = {
static struct platform_driver tegra_admaif_driver = { static struct platform_driver tegra_admaif_driver = {
.probe = tegra_admaif_probe, .probe = tegra_admaif_probe,
.remove = tegra_admaif_remove, .remove = tegra_admaif_remove,
.shutdown = tegra_admaif_platform_shutdown,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@@ -176,7 +176,6 @@ struct tegra210_adsp {
struct mutex mutex; struct mutex mutex;
int init_done; int init_done;
int adsp_started; int adsp_started;
bool is_shutdown;
uint32_t adma_ch_page; uint32_t adma_ch_page;
uint32_t adma_ch_start; uint32_t adma_ch_start;
uint32_t adma_ch_cnt; uint32_t adma_ch_cnt;
@@ -1398,7 +1397,7 @@ static int tegra210_adsp_compr_open(struct snd_compr_stream *cstream)
dev_vdbg(adsp->dev, "%s : DAI ID %d", __func__, rtd->codec_dai->id); dev_vdbg(adsp->dev, "%s : DAI ID %d", __func__, rtd->codec_dai->id);
if (!adsp->init_done || adsp->is_shutdown) if (!adsp->init_done)
return -ENODEV; return -ENODEV;
if (!adsp->pcm_path[fe_reg][cstream->direction].fe_reg || if (!adsp->pcm_path[fe_reg][cstream->direction].fe_reg ||
@@ -1726,9 +1725,6 @@ static int tegra210_adsp_pcm_open(struct snd_pcm_substream *substream)
dev_vdbg(adsp->dev, "%s", __func__); dev_vdbg(adsp->dev, "%s", __func__);
if (adsp->is_shutdown)
return -ENODEV;
if (!adsp->pcm_path[fe_reg][substream->stream].fe_reg || if (!adsp->pcm_path[fe_reg][substream->stream].fe_reg ||
!adsp->pcm_path[fe_reg][substream->stream].be_reg) { !adsp->pcm_path[fe_reg][substream->stream].be_reg) {
dev_err(adsp->dev, "Broken Path%d - FE not linked to BE", fe_reg); dev_err(adsp->dev, "Broken Path%d - FE not linked to BE", fe_reg);
@@ -3895,7 +3891,7 @@ static int tegra210_adsp_set_param(struct snd_kcontrol *kcontrol,
apm_msg_t apm_msg; apm_msg_t apm_msg;
int ret; int ret;
if (!adsp->init_done || adsp->is_shutdown) { if (!adsp->init_done) {
dev_warn(adsp->dev, "ADSP is not booted yet\n"); dev_warn(adsp->dev, "ADSP is not booted yet\n");
return -EPERM; return -EPERM;
} }
@@ -3996,7 +3992,7 @@ static int tegra210_adsp_tlv_callback(struct snd_kcontrol *kcontrol,
unsigned int *tlv_data; unsigned int *tlv_data;
int ret = 0; int ret = 0;
if (!adsp->init_done || adsp->is_shutdown) { if (!adsp->init_done) {
dev_warn(adsp->dev, "ADSP is not booted yet\n"); dev_warn(adsp->dev, "ADSP is not booted yet\n");
return 0; return 0;
} }
@@ -4155,7 +4151,7 @@ static int tegra210_adsp_apm_put(struct snd_kcontrol *kcontrol,
else if (strstr(kcontrol->id.name, "Input Mode")) else if (strstr(kcontrol->id.name, "Input Mode"))
app->input_mode = ucontrol->value.integer.value[0]; app->input_mode = ucontrol->value.integer.value[0];
if (!adsp->init_done || adsp->is_shutdown || !app->plugin) if (!adsp->init_done || !app->plugin)
return 0; return 0;
ret = pm_runtime_get_sync(adsp->dev); ret = pm_runtime_get_sync(adsp->dev);
@@ -4512,7 +4508,6 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev)
} }
dev_set_drvdata(&pdev->dev, adsp); dev_set_drvdata(&pdev->dev, adsp);
adsp->dev = &pdev->dev; adsp->dev = &pdev->dev;
adsp->is_shutdown = false;
adsp->soc_data = (struct adsp_soc_data *)match->data; adsp->soc_data = (struct adsp_soc_data *)match->data;
@@ -4788,15 +4783,6 @@ static int tegra210_adsp_audio_platform_remove(struct platform_device *pdev)
return 0; return 0;
} }
static void tegra210_adsp_audio_platform_shutdown(
struct platform_device *pdev)
{
struct tegra210_adsp *adsp = dev_get_drvdata(&pdev->dev);
tegra210_adsp_deinit(adsp);
adsp->is_shutdown = true;
}
static const struct dev_pm_ops tegra210_adsp_pm_ops = { static const struct dev_pm_ops tegra210_adsp_pm_ops = {
SET_RUNTIME_PM_OPS(tegra210_adsp_runtime_suspend, SET_RUNTIME_PM_OPS(tegra210_adsp_runtime_suspend,
tegra210_adsp_runtime_resume, NULL) tegra210_adsp_runtime_resume, NULL)
@@ -4814,7 +4800,6 @@ static struct platform_driver tegra210_adsp_audio_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
.probe = tegra210_adsp_audio_platform_probe, .probe = tegra210_adsp_audio_platform_probe,
.shutdown = tegra210_adsp_audio_platform_shutdown,
.remove = tegra210_adsp_audio_platform_remove, .remove = tegra210_adsp_audio_platform_remove,
}; };
module_platform_driver(tegra210_adsp_audio_driver); module_platform_driver(tegra210_adsp_audio_driver);

View File

@@ -256,14 +256,10 @@ static int tegra210_adx_runtime_resume(struct device *dev)
struct tegra210_adx *adx = dev_get_drvdata(dev); struct tegra210_adx *adx = dev_get_drvdata(dev);
regcache_cache_only(adx->regmap, false); regcache_cache_only(adx->regmap, false);
if (!adx->is_shutdown) {
regcache_sync(adx->regmap); regcache_sync(adx->regmap);
/* update the map ram */ /* update the map ram */
tegra210_adx_update_map_ram(adx); tegra210_adx_update_map_ram(adx);
tegra210_adx_set_in_byte_mask(adx); tegra210_adx_set_in_byte_mask(adx);
}
return 0; return 0;
} }
@@ -811,7 +807,6 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)
if (!adx) if (!adx)
return -ENOMEM; return -ENOMEM;
adx->is_shutdown = false;
dev_set_drvdata(&pdev->dev, adx); dev_set_drvdata(&pdev->dev, adx);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -847,13 +842,6 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_adx_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -881,7 +869,6 @@ static struct platform_driver tegra210_adx_driver = {
}, },
.probe = tegra210_adx_platform_probe, .probe = tegra210_adx_platform_probe,
.remove = tegra210_adx_platform_remove, .remove = tegra210_adx_platform_remove,
.shutdown = tegra210_adx_platform_shutdown,
}; };
module_platform_driver(tegra210_adx_driver); module_platform_driver(tegra210_adx_driver);

View File

@@ -57,7 +57,6 @@ static const struct reg_default tegra210_afc_reg_defaults[] = {
static void tegra210_afc_init(struct tegra210_afc *afc) static void tegra210_afc_init(struct tegra210_afc *afc)
{ {
afc->is_shutdown = false;
afc->ppm_diff = AFC_CLK_PPM_DIFF; afc->ppm_diff = AFC_CLK_PPM_DIFF;
afc->threshold_type = TH_DEFAULT; afc->threshold_type = TH_DEFAULT;
afc->src_burst = 0; afc->src_burst = 0;
@@ -80,8 +79,6 @@ static int tegra210_afc_runtime_resume(struct device *dev)
struct tegra210_afc *afc = dev_get_drvdata(dev); struct tegra210_afc *afc = dev_get_drvdata(dev);
regcache_cache_only(afc->regmap, false); regcache_cache_only(afc->regmap, false);
if (!afc->is_shutdown)
regcache_sync(afc->regmap); regcache_sync(afc->regmap);
return 0; return 0;
@@ -568,13 +565,6 @@ static int tegra210_afc_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_afc_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -602,7 +592,6 @@ static struct platform_driver tegra210_afc_driver = {
}, },
.probe = tegra210_afc_platform_probe, .probe = tegra210_afc_platform_probe,
.remove = tegra210_afc_platform_remove, .remove = tegra210_afc_platform_remove,
.shutdown = tegra210_afc_platform_shutdown,
}; };
module_platform_driver(tegra210_afc_driver) module_platform_driver(tegra210_afc_driver)

View File

@@ -281,16 +281,11 @@ static int tegra210_amx_runtime_resume(struct device *dev)
struct tegra210_amx *amx = dev_get_drvdata(dev); struct tegra210_amx *amx = dev_get_drvdata(dev);
regcache_cache_only(amx->regmap, false); regcache_cache_only(amx->regmap, false);
if (!amx->is_shutdown) {
regcache_sync(amx->regmap); regcache_sync(amx->regmap);
/* update map ram */ /* update map ram */
tegra210_amx_set_master_stream(amx, 0, tegra210_amx_set_master_stream(amx, 0, TEGRA210_AMX_WAIT_ON_ANY);
TEGRA210_AMX_WAIT_ON_ANY);
tegra210_amx_update_map_ram(amx); tegra210_amx_update_map_ram(amx);
tegra210_amx_set_out_byte_mask(amx); tegra210_amx_set_out_byte_mask(amx);
}
return 0; return 0;
} }
@@ -894,7 +889,6 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
amx->soc_data = soc_data; amx->soc_data = soc_data;
amx->is_shutdown = false;
memset(amx->map, 0, sizeof(amx->map)); memset(amx->map, 0, sizeof(amx->map));
memset(amx->byte_mask, 0, sizeof(amx->byte_mask)); memset(amx->byte_mask, 0, sizeof(amx->byte_mask));
dev_set_drvdata(&pdev->dev, amx); dev_set_drvdata(&pdev->dev, amx);
@@ -938,13 +932,6 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_amx_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -972,7 +959,6 @@ static struct platform_driver tegra210_amx_driver = {
}, },
.probe = tegra210_amx_platform_probe, .probe = tegra210_amx_platform_probe,
.remove = tegra210_amx_platform_remove, .remove = tegra210_amx_platform_remove,
.shutdown = tegra210_amx_platform_shutdown,
}; };
module_platform_driver(tegra210_amx_driver); module_platform_driver(tegra210_amx_driver);

View File

@@ -94,8 +94,6 @@ static int tegra210_dmic_runtime_resume(struct device *dev)
} }
regcache_cache_only(dmic->regmap, false); regcache_cache_only(dmic->regmap, false);
if (!dmic->is_shutdown)
regcache_sync(dmic->regmap); regcache_sync(dmic->regmap);
return 0; return 0;
@@ -543,7 +541,6 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev)
if (!dmic) if (!dmic)
return -ENOMEM; return -ENOMEM;
dmic->is_shutdown = false;
dmic->prod_name = NULL; dmic->prod_name = NULL;
dmic->osr_val = DMIC_OSR_64; dmic->osr_val = DMIC_OSR_64;
dmic->ch_select = DMIC_CH_SELECT_STEREO; dmic->ch_select = DMIC_CH_SELECT_STEREO;
@@ -612,13 +609,6 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_dmic_platform_remove(struct platform_device *pdev)
{ {
struct tegra210_dmic *dmic; struct tegra210_dmic *dmic;
@@ -649,7 +639,6 @@ static struct platform_driver tegra210_dmic_driver = {
}, },
.probe = tegra210_dmic_platform_probe, .probe = tegra210_dmic_platform_probe,
.remove = tegra210_dmic_platform_remove, .remove = tegra210_dmic_platform_remove,
.shutdown = tegra210_dmic_platform_shutdown,
}; };
module_platform_driver(tegra210_dmic_driver) module_platform_driver(tegra210_dmic_driver)

View File

@@ -241,7 +241,6 @@ static int tegra210_i2s_runtime_resume(struct device *dev)
} }
regcache_cache_only(i2s->regmap, false); regcache_cache_only(i2s->regmap, false);
if (!i2s->is_shutdown)
regcache_sync(i2s->regmap); regcache_sync(i2s->regmap);
return 0; return 0;
@@ -1056,7 +1055,6 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev)
i2s->tx_mask = i2s->rx_mask = 0xFFFF; i2s->tx_mask = i2s->rx_mask = 0xFFFF;
i2s->enable_cya = false; i2s->enable_cya = false;
i2s->loopback = 0; i2s->loopback = 0;
i2s->is_shutdown = false;
i2s->prod_name = NULL; i2s->prod_name = NULL;
/* default threshold settings */ /* default threshold settings */
i2s->rx_fifo_th = 3; i2s->rx_fifo_th = 3;
@@ -1168,13 +1166,6 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_i2s_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -1202,7 +1193,6 @@ static struct platform_driver tegra210_i2s_driver = {
}, },
.probe = tegra210_i2s_platform_probe, .probe = tegra210_i2s_platform_probe,
.remove = tegra210_i2s_platform_remove, .remove = tegra210_i2s_platform_remove,
.shutdown = tegra210_i2s_platform_shutdown,
}; };
module_platform_driver(tegra210_i2s_driver) module_platform_driver(tegra210_i2s_driver)

View File

@@ -89,8 +89,6 @@ static int tegra210_mixer_runtime_resume(struct device *dev)
struct tegra210_mixer *mixer = dev_get_drvdata(dev); struct tegra210_mixer *mixer = dev_get_drvdata(dev);
regcache_cache_only(mixer->regmap, false); regcache_cache_only(mixer->regmap, false);
if (!mixer->is_shutdown)
regcache_sync(mixer->regmap); regcache_sync(mixer->regmap);
return 0; return 0;
@@ -694,7 +692,6 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
if (!mixer) if (!mixer)
return -ENOMEM; return -ENOMEM;
mixer->is_shutdown = false;
mixer->gain_coeff[0] = 0; mixer->gain_coeff[0] = 0;
mixer->gain_coeff[1] = 0; mixer->gain_coeff[1] = 0;
mixer->gain_coeff[2] = 0; mixer->gain_coeff[2] = 0;
@@ -747,13 +744,6 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_mixer_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -781,7 +771,6 @@ static struct platform_driver tegra210_mixer_driver = {
}, },
.probe = tegra210_mixer_platform_probe, .probe = tegra210_mixer_platform_probe,
.remove = tegra210_mixer_platform_remove, .remove = tegra210_mixer_platform_remove,
.shutdown = tegra210_mixer_platform_shutdown,
}; };
module_platform_driver(tegra210_mixer_driver); module_platform_driver(tegra210_mixer_driver);

View File

@@ -67,14 +67,10 @@ static int tegra210_mvc_runtime_resume(struct device *dev)
struct tegra210_mvc *mvc = dev_get_drvdata(dev); struct tegra210_mvc *mvc = dev_get_drvdata(dev);
regcache_cache_only(mvc->regmap, false); regcache_cache_only(mvc->regmap, false);
if (!mvc->is_shutdown) {
regcache_sync(mvc->regmap); regcache_sync(mvc->regmap);
regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL, regmap_update_bits(mvc->regmap, TEGRA210_MVC_CTRL,
TEGRA210_MVC_CURVE_TYPE_MASK, TEGRA210_MVC_CURVE_TYPE_MASK,
mvc->curve_type << TEGRA210_MVC_CURVE_TYPE_SHIFT); mvc->curve_type << TEGRA210_MVC_CURVE_TYPE_SHIFT);
}
return 0; return 0;
} }
@@ -632,7 +628,6 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev)
if (!mvc) if (!mvc)
return -ENOMEM; return -ENOMEM;
mvc->is_shutdown = false;
dev_set_drvdata(&pdev->dev, mvc); dev_set_drvdata(&pdev->dev, mvc);
mvc->poly_n1 = 16; mvc->poly_n1 = 16;
@@ -684,13 +679,6 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_mvc_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -718,7 +706,6 @@ static struct platform_driver tegra210_mvc_driver = {
}, },
.probe = tegra210_mvc_platform_probe, .probe = tegra210_mvc_platform_probe,
.remove = tegra210_mvc_platform_remove, .remove = tegra210_mvc_platform_remove,
.shutdown = tegra210_mvc_platform_shutdown,
}; };
module_platform_driver(tegra210_mvc_driver) module_platform_driver(tegra210_mvc_driver)

View File

@@ -66,14 +66,10 @@ static int tegra210_ope_runtime_resume(struct device *dev)
regcache_cache_only(ope->regmap, false); regcache_cache_only(ope->regmap, false);
regcache_cache_only(ope->peq_regmap, false); regcache_cache_only(ope->peq_regmap, false);
regcache_cache_only(ope->mbdrc_regmap, false); regcache_cache_only(ope->mbdrc_regmap, false);
if (!ope->is_shutdown) {
regcache_sync(ope->regmap); regcache_sync(ope->regmap);
regcache_sync(ope->peq_regmap); regcache_sync(ope->peq_regmap);
regcache_sync(ope->mbdrc_regmap); regcache_sync(ope->mbdrc_regmap);
tegra210_peq_restore(ope); tegra210_peq_restore(ope);
}
return 0; return 0;
} }
@@ -331,8 +327,6 @@ static int tegra210_ope_platform_probe(struct platform_device *pdev)
if (!ope) if (!ope)
return -ENOMEM; return -ENOMEM;
ope->is_shutdown = false;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, mem); regs = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(regs)) if (IS_ERR(regs))
@@ -384,13 +378,6 @@ static int tegra210_ope_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_ope_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -418,7 +405,6 @@ static struct platform_driver tegra210_ope_driver = {
}, },
.probe = tegra210_ope_platform_probe, .probe = tegra210_ope_platform_probe,
.remove = tegra210_ope_platform_remove, .remove = tegra210_ope_platform_remove,
.shutdown = tegra210_ope_platform_shutdown,
}; };
module_platform_driver(tegra210_ope_driver) module_platform_driver(tegra210_ope_driver)

View File

@@ -2928,8 +2928,6 @@ static int tegra210_sfc_runtime_resume(struct device *dev)
struct tegra210_sfc *sfc = dev_get_drvdata(dev); struct tegra210_sfc *sfc = dev_get_drvdata(dev);
regcache_cache_only(sfc->regmap, false); regcache_cache_only(sfc->regmap, false);
if (!sfc->is_shutdown)
regcache_sync(sfc->regmap); regcache_sync(sfc->regmap);
return 0; return 0;
@@ -3541,8 +3539,6 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev)
if (!sfc) if (!sfc)
return -ENOMEM; return -ENOMEM;
sfc->is_shutdown = false;
dev_set_drvdata(&pdev->dev, sfc); dev_set_drvdata(&pdev->dev, sfc);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -3578,13 +3574,6 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_sfc_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -3612,7 +3601,6 @@ static struct platform_driver tegra210_sfc_driver = {
}, },
.probe = tegra210_sfc_platform_probe, .probe = tegra210_sfc_platform_probe,
.remove = tegra210_sfc_platform_remove, .remove = tegra210_sfc_platform_remove,
.shutdown = tegra210_sfc_platform_shutdown,
}; };
module_platform_driver(tegra210_sfc_driver) module_platform_driver(tegra210_sfc_driver)

View File

@@ -90,8 +90,6 @@ static int tegra210_spdif_runtime_resume(struct device *dev)
} }
regcache_cache_only(spdif->regmap, false); regcache_cache_only(spdif->regmap, false);
if (!spdif->is_shutdown)
regcache_sync(spdif->regmap); regcache_sync(spdif->regmap);
return 0; return 0;
@@ -413,7 +411,6 @@ static int tegra210_spdif_platform_probe(struct platform_device *pdev)
if (!spdif) if (!spdif)
return -ENOMEM; return -ENOMEM;
spdif->is_shutdown = false;
dev_set_drvdata(&pdev->dev, spdif); dev_set_drvdata(&pdev->dev, spdif);
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
@@ -481,13 +478,6 @@ static int tegra210_spdif_platform_probe(struct platform_device *pdev)
return 0; return 0;
} }
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) static int tegra210_spdif_platform_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -515,7 +505,6 @@ static struct platform_driver tegra210_spdif_driver = {
}, },
.probe = tegra210_spdif_platform_probe, .probe = tegra210_spdif_platform_probe,
.remove = tegra210_spdif_platform_remove, .remove = tegra210_spdif_platform_remove,
.shutdown = tegra210_spdif_platform_shutdown,
}; };
module_platform_driver(tegra210_spdif_driver); module_platform_driver(tegra210_spdif_driver);

View File

@@ -1401,7 +1401,6 @@ static const struct dev_pm_ops tegra_xbar_pm_ops = {
static struct platform_driver tegra_xbar_driver = { static struct platform_driver tegra_xbar_driver = {
.probe = tegra_dev_xbar_probe, .probe = tegra_dev_xbar_probe,
.remove = tegra_xbar_remove, .remove = tegra_xbar_remove,
.shutdown = tegra_xbar_shutdown,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,

View File

@@ -265,20 +265,12 @@ int tegra_xbar_runtime_resume(struct device *dev)
tegra186_setup_ahc_interrupts(); tegra186_setup_ahc_interrupts();
#endif #endif
regcache_cache_only(xbar->regmap, false); regcache_cache_only(xbar->regmap, false);
if (!xbar->is_shutdown)
regcache_sync(xbar->regmap); regcache_sync(xbar->regmap);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(tegra_xbar_runtime_resume); EXPORT_SYMBOL_GPL(tegra_xbar_runtime_resume);
void tegra_xbar_shutdown(struct platform_device *pdev)
{
xbar->is_shutdown = true;
}
EXPORT_SYMBOL_GPL(tegra_xbar_shutdown);
int tegra_xbar_remove(struct platform_device *pdev) int tegra_xbar_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
@@ -304,8 +296,6 @@ int tegra_xbar_probe(struct platform_device *pdev,
return -ENOMEM; return -ENOMEM;
xbar->soc_data = soc_data; xbar->soc_data = soc_data;
xbar->is_shutdown = false;
platform_set_drvdata(pdev, xbar); platform_set_drvdata(pdev, xbar);
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) { if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {