Skip to content
Snippets Groups Projects
Commit 6c7e526f authored by Gianfranco Mariotti's avatar Gianfranco Mariotti
Browse files

[DRIVER] add MAX98357A codec support

Add support over I2S for i.MX8 SoCs.
Also, make it possible to use GPIO from expanders to enable the codec.
parent 39790fe0
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
struct max98357a_priv {
struct gpio_desc *sdmode;
bool gpio_probe_only;
unsigned int sdmode_delay;
int sdmode_switch;
};
......@@ -33,7 +34,7 @@ static int max98357a_daiops_trigger(struct snd_pcm_substream *substream,
struct max98357a_priv *max98357a =
snd_soc_component_get_drvdata(component);
if (!max98357a->sdmode)
if (!max98357a->sdmode || max98357a->gpio_probe_only)
return 0;
switch (cmd) {
......@@ -131,8 +132,10 @@ static int max98357a_platform_probe(struct platform_device *pdev)
if (!max98357a)
return -ENOMEM;
max98357a->sdmode = devm_gpiod_get_optional(&pdev->dev,
"sdmode", GPIOD_OUT_LOW);
max98357a->gpio_probe_only = device_property_read_bool(&pdev->dev,
"sdmode,gpio-probe-only");
max98357a->sdmode = devm_gpiod_get_optional(&pdev->dev, "sdmode",
max98357a->gpio_probe_only? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
if (IS_ERR(max98357a->sdmode))
return PTR_ERR(max98357a->sdmode);
......
......@@ -317,11 +317,22 @@ config SND_SOC_SECO_TLV320
select SND_SOC_TLV320AIC32X4_I2C
select SND_SOC_FSL_SAI
select SND_SOC_IMX_PCM_DMA
select CONFIG_SND_SIMPLE_CARD
select SND_SIMPLE_CARD
help
Enable I2S based access to the TLV320AIC32x4 codec attached
to the SAI interface
config SND_SOC_SECO_MAX98357A
tristate "Seco MAX98357A"
depends on OF
select SND_SOC_MAX98357A
select SND_SIMPLE_CARD
select SND_SOC_FSL_SAI
select SND_SOC_IMX_PCM_DMA
help
Enable I2S based access to the MAX98357A codec attached
to the i.MX8M SAI interface
config SND_SOC_PHYCORE_AC97
tristate "SoC Audio support for Phytec phyCORE (and phyCARD) boards"
depends on MACH_PCM043 || MACH_PCA100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment