Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/es8328', 'asoc/fix/fsl...
authorMark Brown <broonie@kernel.org>
Wed, 25 Nov 2015 17:57:49 +0000 (17:57 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 25 Nov 2015 17:57:49 +0000 (17:57 +0000)
1  2  3  4  5  6 
sound/soc/fsl/fsl_sai.c

diff --combined sound/soc/fsl/fsl_sai.c
      #define FSL_SAI_FLAGS (FSL_SAI_CSR_SEIE |\
                       FSL_SAI_CSR_FEIE)
      
    - static u32 fsl_sai_rates[] = {
    + static const unsigned int fsl_sai_rates[] = {
        8000, 11025, 12000, 16000, 22050,
        24000, 32000, 44100, 48000, 64000,
        88200, 96000, 176400, 192000
      };
      
    - static struct snd_pcm_hw_constraint_list fsl_sai_rate_constraints = {
    + static const struct snd_pcm_hw_constraint_list fsl_sai_rate_constraints = {
        .count = ARRAY_SIZE(fsl_sai_rates),
        .list = fsl_sai_rates,
      };
@@@@@@@ -454,7 -454,7 -454,7 -454,7 -454,8 -454,7 +454,8 @@@@@@@ static int fsl_sai_trigger(struct snd_p
         * Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx.
         * Tx sync with Rx clocks: Clear SYNC for Rx, set it for Tx.
         */
---- -  regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, 0);
++++ +  regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC,
++++ +                     sai->synchronous[TX] ? FSL_SAI_CR2_SYNC : 0);
        regmap_update_bits(sai->regmap, FSL_SAI_RCR2, FSL_SAI_CR2_SYNC,
                           sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0);
      
@@@@@@@ -637,8 -637,8 -637,8 -637,8 -638,6 -637,8 +638,8 @@@@@@@ static bool fsl_sai_readable_reg(struc
      static bool fsl_sai_volatile_reg(struct device *dev, unsigned int reg)
      {
        switch (reg) {
    +   case FSL_SAI_TCSR:
    +   case FSL_SAI_RCSR:
        case FSL_SAI_TFR:
        case FSL_SAI_RFR:
        case FSL_SAI_TDR:
@@@@@@@ -683,7 -683,7 -683,7 -683,7 -682,6 -683,7 +684,7 @@@@@@@ static const struct regmap_config fsl_s
        .readable_reg = fsl_sai_readable_reg,
        .volatile_reg = fsl_sai_volatile_reg,
        .writeable_reg = fsl_sai_writeable_reg,
    +   .cache_type = REGCACHE_FLAT,
      };
      
      static int fsl_sai_probe(struct platform_device *pdev)
@@@@@@@ -804,42 -804,42 -804,42 -804,42 -802,11 -804,42 +805,42 @@@@@@@ static const struct of_device_id fsl_sa
        { .compatible = "fsl,imx6sx-sai", },
        { /* sentinel */ }
      };
    + MODULE_DEVICE_TABLE(of, fsl_sai_ids);
    + 
    + #ifdef CONFIG_PM_SLEEP
    + static int fsl_sai_suspend(struct device *dev)
    + {
    +   struct fsl_sai *sai = dev_get_drvdata(dev);
    + 
    +   regcache_cache_only(sai->regmap, true);
    +   regcache_mark_dirty(sai->regmap);
    + 
    +   return 0;
    + }
    + 
    + static int fsl_sai_resume(struct device *dev)
    + {
    +   struct fsl_sai *sai = dev_get_drvdata(dev);
    + 
    +   regcache_cache_only(sai->regmap, false);
    +   regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR);
    +   regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR);
    +   msleep(1);
    +   regmap_write(sai->regmap, FSL_SAI_TCSR, 0);
    +   regmap_write(sai->regmap, FSL_SAI_RCSR, 0);
    +   return regcache_sync(sai->regmap);
    + }
    + #endif /* CONFIG_PM_SLEEP */
    + 
    + static const struct dev_pm_ops fsl_sai_pm_ops = {
    +   SET_SYSTEM_SLEEP_PM_OPS(fsl_sai_suspend, fsl_sai_resume)
    + };
      
      static struct platform_driver fsl_sai_driver = {
        .probe = fsl_sai_probe,
        .driver = {
                .name = "fsl-sai",
    +           .pm = &fsl_sai_pm_ops,
                .of_match_table = fsl_sai_ids,
        },
      };