~ubuntu-branches/ubuntu/precise/alsa-driver/precise

« back to all changes in this revision

Viewing changes to alsa-kernel/soc/codecs/wm8753.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-11-04 16:28:58 UTC
  • mfrom: (1.1.12 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091104162858-7ky0tu33d7mn6oys
Tags: 1.0.21+dfsg-3ubuntu1
* Merge from debian unstable, remaining changes:
  - Script paths (/usr/sbin -> /sbin, /usr/bin -> /bin);
  - debian/rules:
    + Don't install snddevices and program-wrapper
    + install alsa-base apport hook
    + Package separate USB card list file
  - Vcs and maintainer fields mangling
  - Rename blacklist files in /etc/modprobe.d to be consistant with the rest
    of the distro
  - debian/alsa-base.init:
    + create /var/run/alsa if it doesn't exist
    + Run alsactl store before force unloading modules
    + Run alsactl restore after reloading unloaded modules
  - debian/linux-sound-base.postrm: Remove /etc/modprobe.d/blacklist* files
    on package removal
  - Add missing $CMDLINE_OPTS to all install rules.
  - Replace -Q with --quiet.
  - Add --use-blacklist to all rules so the blacklist still takes effect.
  - debian/alsa-base.postinst: Do not run snddevices
  - retain patches:
    + add_suspend_quirk_hp_nc6220_nw8240.patch,
    + refix_lp_68659_by_disabling_dxs_for_0x1458a002.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        0x0097, 0x0097, 0x0000, 0x0004,
80
80
        0x0000, 0x0083, 0x0024, 0x01ba,
81
81
        0x0000, 0x0083, 0x0024, 0x01ba,
82
 
        0x0000, 0x0000
 
82
        0x0000, 0x0000, 0x0000
83
83
};
84
84
 
85
85
/* codec private data */
703
703
 
704
704
        if ((Ndiv < 6) || (Ndiv > 12))
705
705
                printk(KERN_WARNING
706
 
                        "wm8753: unsupported N = %d\n", Ndiv);
 
706
                        "wm8753: unsupported N = %u\n", Ndiv);
707
707
 
708
708
        pll_div->n = Ndiv;
709
709
        Nmod = target % source;
1660
1660
        codec->set_bias_level = wm8753_set_bias_level;
1661
1661
        codec->dai = wm8753_dai;
1662
1662
        codec->num_dai = 2;
1663
 
        codec->reg_cache_size = ARRAY_SIZE(wm8753->reg_cache);
 
1663
        codec->reg_cache_size = ARRAY_SIZE(wm8753->reg_cache) + 1;
1664
1664
        codec->reg_cache = &wm8753->reg_cache;
1665
1665
        codec->private_data = wm8753;
1666
1666
 
1667
 
        memcpy(codec->reg_cache, wm8753_reg, sizeof(codec->reg_cache));
 
1667
        memcpy(codec->reg_cache, wm8753_reg, sizeof(wm8753->reg_cache));
1668
1668
        INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
1669
1669
 
1670
1670
        ret = wm8753_reset(codec);
1766
1766
        return 0;
1767
1767
}
1768
1768
 
 
1769
#ifdef CONFIG_PM
 
1770
static int wm8753_i2c_suspend(struct i2c_client *client, pm_message_t msg)
 
1771
{
 
1772
        return snd_soc_suspend_device(&client->dev);
 
1773
}
 
1774
 
 
1775
static int wm8753_i2c_resume(struct i2c_client *client)
 
1776
{
 
1777
        return snd_soc_resume_device(&client->dev);
 
1778
}
 
1779
#else
 
1780
#define wm8753_i2c_suspend NULL
 
1781
#define wm8753_i2c_resume NULL
 
1782
#endif
 
1783
 
1769
1784
static const struct i2c_device_id wm8753_i2c_id[] = {
1770
1785
        { "wm8753", 0 },
1771
1786
        { }
1779
1794
        },
1780
1795
        .probe =    wm8753_i2c_probe,
1781
1796
        .remove =   wm8753_i2c_remove,
 
1797
        .suspend =  wm8753_i2c_suspend,
 
1798
        .resume =   wm8753_i2c_resume,
1782
1799
        .id_table = wm8753_i2c_id,
1783
1800
};
1784
1801
#endif
1822
1839
        codec->hw_write = (hw_write_t)wm8753_spi_write;
1823
1840
        codec->dev = &spi->dev;
1824
1841
 
1825
 
        spi->dev.driver_data = wm8753;
 
1842
        dev_set_drvdata(&spi->dev, wm8753);
1826
1843
 
1827
1844
        return wm8753_register(wm8753);
1828
1845
}
1829
1846
 
1830
1847
static int __devexit wm8753_spi_remove(struct spi_device *spi)
1831
1848
{
1832
 
        struct wm8753_priv *wm8753 = spi->dev.driver_data;
 
1849
        struct wm8753_priv *wm8753 = dev_get_drvdata(&spi->dev);
1833
1850
        wm8753_unregister(wm8753);
1834
1851
        return 0;
1835
1852
}
1836
1853
 
 
1854
#ifdef CONFIG_PM
 
1855
static int wm8753_spi_suspend(struct spi_device *spi, pm_message_t msg)
 
1856
{
 
1857
        return snd_soc_suspend_device(&spi->dev);
 
1858
}
 
1859
 
 
1860
static int wm8753_spi_resume(struct spi_device *spi)
 
1861
{
 
1862
        return snd_soc_resume_device(&spi->dev);
 
1863
}
 
1864
 
 
1865
#else
 
1866
#define wm8753_spi_suspend NULL
 
1867
#define wm8753_spi_resume NULL
 
1868
#endif
 
1869
 
1837
1870
static struct spi_driver wm8753_spi_driver = {
1838
1871
        .driver = {
1839
1872
                .name   = "wm8753",
1842
1875
        },
1843
1876
        .probe          = wm8753_spi_probe,
1844
1877
        .remove         = __devexit_p(wm8753_spi_remove),
 
1878
        .suspend        = wm8753_spi_suspend,
 
1879
        .resume         = wm8753_spi_resume,
1845
1880
};
1846
1881
#endif
1847
1882