diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2016-08-12 17:27:49 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-15 10:14:57 -0400 |
commit | a3f10de1843ab6a37d34d1601cc520498c5d3bc9 (patch) | |
tree | 60696c0c523e03816e50b44c7871045804da1730 | |
parent | 3d240d73df4e3a21d9c2cdc378c192760adcba13 (diff) |
ASoC: Intel: atom: enable configuration of SSP0
Existing code used SSP2, make selection of SSP id
dependent on port name. This is required when the
machine driver uses non-default settings
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/atom/sst-atom-controls.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 28eea127ec33..0838478c4c3f 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c | |||
@@ -935,17 +935,26 @@ void sst_fill_ssp_defaults(struct snd_soc_dai *dai) | |||
935 | int send_ssp_cmd(struct snd_soc_dai *dai, const char *id, bool enable) | 935 | int send_ssp_cmd(struct snd_soc_dai *dai, const char *id, bool enable) |
936 | { | 936 | { |
937 | struct sst_data *drv = snd_soc_dai_get_drvdata(dai); | 937 | struct sst_data *drv = snd_soc_dai_get_drvdata(dai); |
938 | const struct sst_ssp_config *config; | 938 | int ssp_id; |
939 | 939 | ||
940 | dev_info(dai->dev, "Enter: enable=%d port_name=%s\n", enable, id); | 940 | dev_info(dai->dev, "Enter: enable=%d port_name=%s\n", enable, id); |
941 | 941 | ||
942 | if (strcmp(id, "ssp0-port") == 0) | ||
943 | ssp_id = SSP_MODEM; | ||
944 | else if (strcmp(id, "ssp2-port") == 0) | ||
945 | ssp_id = SSP_CODEC; | ||
946 | else { | ||
947 | dev_dbg(dai->dev, "port %s is not supported\n", id); | ||
948 | return -1; | ||
949 | } | ||
950 | |||
942 | SST_FILL_DEFAULT_DESTINATION(drv->ssp_cmd.header.dst); | 951 | SST_FILL_DEFAULT_DESTINATION(drv->ssp_cmd.header.dst); |
943 | drv->ssp_cmd.header.command_id = SBA_HW_SET_SSP; | 952 | drv->ssp_cmd.header.command_id = SBA_HW_SET_SSP; |
944 | drv->ssp_cmd.header.length = sizeof(struct sst_cmd_sba_hw_set_ssp) | 953 | drv->ssp_cmd.header.length = sizeof(struct sst_cmd_sba_hw_set_ssp) |
945 | - sizeof(struct sst_dsp_header); | 954 | - sizeof(struct sst_dsp_header); |
946 | 955 | ||
947 | config = &sst_ssp_configs; | 956 | drv->ssp_cmd.selection = ssp_id; |
948 | dev_dbg(dai->dev, "ssp_id: %u\n", config->ssp_id); | 957 | dev_dbg(dai->dev, "ssp_id: %u\n", ssp_id); |
949 | 958 | ||
950 | if (enable) | 959 | if (enable) |
951 | drv->ssp_cmd.switch_state = SST_SWITCH_ON; | 960 | drv->ssp_cmd.switch_state = SST_SWITCH_ON; |