Merge remote-tracking branches 'asoc/topic/rl6231' and 'asoc/topic/rt5514' into asoc...
authorMark Brown <broonie@kernel.org>
Fri, 26 Jan 2018 15:27:28 +0000 (15:27 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jan 2018 15:27:28 +0000 (15:27 +0000)
1  2  3 
sound/soc/codecs/rt5514-spi.c
sound/soc/codecs/rt5514.c

@@@@ -461,43 -459,42 -451,6 +462,43 @@@@ static int rt5514_spi_probe(struct spi_
        return 0;
   }
   
 -      if (rt5514_dsp->substream) {
 -              rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
 -              if (buf[0] & RT5514_IRQ_STATUS_BIT)
 -                      rt5514_schedule_copy(rt5514_dsp);
  +static int __maybe_unused rt5514_suspend(struct device *dev)
  +{
  +     int irq = to_spi_device(dev)->irq;
  +
  +     if (device_may_wakeup(dev))
  +             enable_irq_wake(irq);
  +
  +     return 0;
  +}
  +
  +static int __maybe_unused rt5514_resume(struct device *dev)
  +{
  +     struct snd_soc_platform *platform = snd_soc_lookup_platform(dev);
  +     struct rt5514_dsp *rt5514_dsp =
  +             snd_soc_platform_get_drvdata(platform);
  +     int irq = to_spi_device(dev)->irq;
  +     u8 buf[8];
  +
  +     if (device_may_wakeup(dev))
  +             disable_irq_wake(irq);
  +
 ++     if (rt5514_dsp) {
 ++             if (rt5514_dsp->substream) {
 ++                     rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf,
 ++                             sizeof(buf));
 ++                     if (buf[0] & RT5514_IRQ_STATUS_BIT)
 ++                             rt5514_schedule_copy(rt5514_dsp);
 ++             }
  +     }
  +
  +     return 0;
  +}
  +
  +static const struct dev_pm_ops rt5514_pm_ops = {
  +     SET_SYSTEM_SLEEP_PM_OPS(rt5514_suspend, rt5514_resume)
  +};
  +
   static const struct of_device_id rt5514_of_match[] = {
        { .compatible = "realtek,rt5514", },
        {},
Simple merge