summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-sii902x.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2019-07-19 15:59:36 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:50:58 +0800
commitcdb2a067d955470095d4a36589561eaf881ac6fa (patch)
tree9fb6e2de66ebc043b17ee43dcdf9eb00d96121aa /sound/soc/fsl/imx-sii902x.c
parentc65041ddba3470615df3f32241d94c928673b46a (diff)
MLK-21697-2: ASoC: imx-sii902x: Remove the operation for sii902x
Move the operation for sii902x module to mxsfb_sii902x_audio.c platform driver. change codec from dummy to hdmi-codec Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-sii902x.c')
-rw-r--r--sound/soc/fsl/imx-sii902x.c71
1 files changed, 2 insertions, 69 deletions
diff --git a/sound/soc/fsl/imx-sii902x.c b/sound/soc/fsl/imx-sii902x.c
index b9059920415f..a282fb684e05 100644
--- a/sound/soc/fsl/imx-sii902x.c
+++ b/sound/soc/fsl/imx-sii902x.c
@@ -29,7 +29,6 @@
struct imx_sii902x_data {
struct snd_soc_dai_link dai;
struct snd_soc_card card;
- struct i2c_client *sii902x;
bool is_stream_opened[2];
};
@@ -80,9 +79,7 @@ static int imx_sii902x_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct snd_soc_card *card = rtd->card;
struct device *dev = card->dev;
- struct imx_sii902x_data *data = snd_soc_card_get_drvdata(card);
int ret;
- unsigned char reg;
/* set cpu DAI configuration */
ret = snd_soc_dai_set_fmt(cpu_dai,
@@ -106,55 +103,6 @@ static int imx_sii902x_hw_params(struct snd_pcm_substream *substream,
return ret;
}
- /* sii90sx hdmi audio setup */
- i2c_smbus_write_byte_data(data->sii902x, 0x26, 0x90);
- i2c_smbus_write_byte_data(data->sii902x, 0x20, 0x2d);
- i2c_smbus_write_byte_data(data->sii902x, 0x1f, 0x88);
- i2c_smbus_write_byte_data(data->sii902x, 0x1f, 0x91);
- i2c_smbus_write_byte_data(data->sii902x, 0x1f, 0xa2);
- i2c_smbus_write_byte_data(data->sii902x, 0x1f, 0xb3);
- i2c_smbus_write_byte_data(data->sii902x, 0x27, 0);
- switch (params_rate(params)) {
- case 44100:
- reg = 0;
- break;
- case 48000:
- reg = 0x2;
- break;
- case 32000:
- reg = 0x3;
- break;
- case 88200:
- reg = 0x8;
- break;
- case 96000:
- reg = 0xa;
- break;
- case 176400:
- reg = 0xc;
- break;
- case 192000:
- reg = 0xe;
- break;
- default:
- reg = 0x1;
- break;
- }
- i2c_smbus_write_byte_data(data->sii902x, 0x24, reg);
- i2c_smbus_write_byte_data(data->sii902x, 0x25, 0x0b);
- i2c_smbus_write_byte_data(data->sii902x, 0x26, 0x80);
-
- return 0;
-}
-
-static int imx_sii902x_hw_free(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct snd_soc_card *card = rtd->card;
- struct imx_sii902x_data *data = snd_soc_card_get_drvdata(card);
-
- i2c_smbus_write_byte_data(data->sii902x, 0x26, 0x10);
-
return 0;
}
@@ -172,7 +120,6 @@ static struct snd_soc_ops imx_sii902x_ops = {
.startup = imx_sii902x_startup,
.shutdown = imx_sii902x_shutdown,
.hw_params = imx_sii902x_hw_params,
- .hw_free = imx_sii902x_hw_free,
};
static int imx_sii902x_probe(struct platform_device *pdev)
@@ -189,13 +136,6 @@ static int imx_sii902x_probe(struct platform_device *pdev)
goto fail;
}
- sii902x_np = of_parse_phandle(pdev->dev.of_node, "hdmi-controler", 0);
- if (!sii902x_np) {
- dev_err(&pdev->dev, "sii902x phandle missing or invalid\n");
- ret = -EINVAL;
- goto fail;
- }
-
cpu_pdev = of_find_device_by_node(cpu_np);
if (!cpu_pdev) {
dev_err(&pdev->dev, "failed to find SAI platform device\n");
@@ -209,17 +149,10 @@ static int imx_sii902x_probe(struct platform_device *pdev)
goto fail;
}
- data->sii902x = of_find_i2c_device_by_node(sii902x_np);
- if (!data->sii902x) {
- dev_err(&pdev->dev, "failed to find sii902x i2c client\n");
- ret = -EPROBE_DEFER;
- goto fail;
- }
-
data->dai.name = "sii902x hdmi";
data->dai.stream_name = "sii902x hdmi";
- data->dai.codec_dai_name = "snd-soc-dummy-dai";
- data->dai.codec_name = "snd-soc-dummy";
+ data->dai.codec_dai_name = "i2s-hifi";
+ data->dai.codec_name = "hdmi-audio-codec.1";
data->dai.cpu_dai_name = dev_name(&cpu_pdev->dev);
data->dai.platform_of_node = cpu_np;
data->dai.ops = &imx_sii902x_ops;