"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "sound/soc/codecs/max98357a.c" between
linux-5.3-rc3.tar.gz and linux-5.3-rc4.tar.gz

About: The full source of the development Linux kernel 5.3 (release candidate).

max98357a.c  (linux-5.3-rc3):max98357a.c  (linux-5.3-rc4)
skipping to change at line 23 skipping to change at line 23
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/soc-dai.h> #include <sound/soc-dai.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
struct max98357a_priv { struct max98357a_priv {
struct delayed_work enable_sdmode_work;
struct gpio_desc *sdmode; struct gpio_desc *sdmode;
unsigned int sdmode_delay; unsigned int sdmode_delay;
}; };
static void max98357a_enable_sdmode_work(struct work_struct *work)
{
struct max98357a_priv *max98357a =
container_of(work, struct max98357a_priv,
enable_sdmode_work.work);
gpiod_set_value(max98357a->sdmode, 1);
}
static int max98357a_daiops_trigger(struct snd_pcm_substream *substream, static int max98357a_daiops_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai) int cmd, struct snd_soc_dai *dai)
{ {
struct max98357a_priv *max98357a = snd_soc_dai_get_drvdata(dai); struct max98357a_priv *max98357a = snd_soc_dai_get_drvdata(dai);
if (!max98357a->sdmode) if (!max98357a->sdmode)
return 0; return 0;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
queue_delayed_work(system_power_efficient_wq, mdelay(max98357a->sdmode_delay);
&max98357a->enable_sdmode_work, gpiod_set_value(max98357a->sdmode, 1);
msecs_to_jiffies(max98357a->sdmode_delay));
break; break;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
cancel_delayed_work_sync(&max98357a->enable_sdmode_work);
gpiod_set_value(max98357a->sdmode, 0); gpiod_set_value(max98357a->sdmode, 0);
break; break;
} }
return 0; return 0;
} }
static const struct snd_soc_dapm_widget max98357a_dapm_widgets[] = { static const struct snd_soc_dapm_widget max98357a_dapm_widgets[] = {
SND_SOC_DAPM_OUTPUT("Speaker"), SND_SOC_DAPM_OUTPUT("Speaker"),
}; };
skipping to change at line 115 skipping to change at line 103
}, },
.ops = &max98357a_dai_ops, .ops = &max98357a_dai_ops,
}; };
static int max98357a_platform_probe(struct platform_device *pdev) static int max98357a_platform_probe(struct platform_device *pdev)
{ {
struct max98357a_priv *max98357a; struct max98357a_priv *max98357a;
int ret; int ret;
max98357a = devm_kzalloc(&pdev->dev, sizeof(*max98357a), GFP_KERNEL); max98357a = devm_kzalloc(&pdev->dev, sizeof(*max98357a), GFP_KERNEL);
if (!max98357a) if (!max98357a)
return -ENOMEM; return -ENOMEM;
max98357a->sdmode = devm_gpiod_get_optional(&pdev->dev, max98357a->sdmode = devm_gpiod_get_optional(&pdev->dev,
"sdmode", GPIOD_OUT_LOW); "sdmode", GPIOD_OUT_LOW);
if (IS_ERR(max98357a->sdmode)) if (IS_ERR(max98357a->sdmode))
return PTR_ERR(max98357a->sdmode); return PTR_ERR(max98357a->sdmode);
ret = device_property_read_u32(&pdev->dev, "sdmode-delay", ret = device_property_read_u32(&pdev->dev, "sdmode-delay",
&max98357a->sdmode_delay); &max98357a->sdmode_delay);
if (ret) { if (ret) {
max98357a->sdmode_delay = 0; max98357a->sdmode_delay = 0;
dev_dbg(&pdev->dev, dev_dbg(&pdev->dev,
"no optional property 'sdmode-delay' found, default: no d "no optional property 'sdmode-delay' found, "
elay\n"); "default: no delay\n");
} }
dev_set_drvdata(&pdev->dev, max98357a); dev_set_drvdata(&pdev->dev, max98357a);
INIT_DELAYED_WORK(&max98357a->enable_sdmode_work,
max98357a_enable_sdmode_work);
return devm_snd_soc_register_component(&pdev->dev, return devm_snd_soc_register_component(&pdev->dev,
&max98357a_component_driver, &max98357a_component_driver,
&max98357a_dai_driver, 1); &max98357a_dai_driver, 1);
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id max98357a_device_id[] = { static const struct of_device_id max98357a_device_id[] = {
{ .compatible = "maxim,max98357a" }, { .compatible = "maxim,max98357a" },
{} {}
}; };
 End of changes. 9 change blocks. 
22 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)