aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/es1938.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/es1938.c')
-rw-r--r--sound/pci/es1938.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 82c8d8c5c52..dbb81807bc1 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1321,35 +1321,30 @@ static int snd_es1938_put_double(struct snd_kcontrol *kcontrol,
1321 return change; 1321 return change;
1322} 1322}
1323 1323
1324static unsigned int db_scale_master[] = { 1324static const DECLARE_TLV_DB_RANGE(db_scale_master,
1325 TLV_DB_RANGE_HEAD(2),
1326 0, 54, TLV_DB_SCALE_ITEM(-3600, 50, 1), 1325 0, 54, TLV_DB_SCALE_ITEM(-3600, 50, 1),
1327 54, 63, TLV_DB_SCALE_ITEM(-900, 100, 0), 1326 54, 63, TLV_DB_SCALE_ITEM(-900, 100, 0),
1328}; 1327);
1329 1328
1330static unsigned int db_scale_audio1[] = { 1329static const DECLARE_TLV_DB_RANGE(db_scale_audio1,
1331 TLV_DB_RANGE_HEAD(2),
1332 0, 8, TLV_DB_SCALE_ITEM(-3300, 300, 1), 1330 0, 8, TLV_DB_SCALE_ITEM(-3300, 300, 1),
1333 8, 15, TLV_DB_SCALE_ITEM(-900, 150, 0), 1331 8, 15, TLV_DB_SCALE_ITEM(-900, 150, 0),
1334}; 1332);
1335 1333
1336static unsigned int db_scale_audio2[] = { 1334static const DECLARE_TLV_DB_RANGE(db_scale_audio2,
1337 TLV_DB_RANGE_HEAD(2),
1338 0, 8, TLV_DB_SCALE_ITEM(-3450, 300, 1), 1335 0, 8, TLV_DB_SCALE_ITEM(-3450, 300, 1),
1339 8, 15, TLV_DB_SCALE_ITEM(-1050, 150, 0), 1336 8, 15, TLV_DB_SCALE_ITEM(-1050, 150, 0),
1340}; 1337);
1341 1338
1342static unsigned int db_scale_mic[] = { 1339static const DECLARE_TLV_DB_RANGE(db_scale_mic,
1343 TLV_DB_RANGE_HEAD(2),
1344 0, 8, TLV_DB_SCALE_ITEM(-2400, 300, 1), 1340 0, 8, TLV_DB_SCALE_ITEM(-2400, 300, 1),
1345 8, 15, TLV_DB_SCALE_ITEM(0, 150, 0), 1341 8, 15, TLV_DB_SCALE_ITEM(0, 150, 0),
1346}; 1342);
1347 1343
1348static unsigned int db_scale_line[] = { 1344static const DECLARE_TLV_DB_RANGE(db_scale_line,
1349 TLV_DB_RANGE_HEAD(2),
1350 0, 8, TLV_DB_SCALE_ITEM(-3150, 300, 1), 1345 0, 8, TLV_DB_SCALE_ITEM(-3150, 300, 1),
1351 8, 15, TLV_DB_SCALE_ITEM(-750, 150, 0), 1346 8, 15, TLV_DB_SCALE_ITEM(-750, 150, 0),
1352}; 1347);
1353 1348
1354static const DECLARE_TLV_DB_SCALE(db_scale_capture, 0, 150, 0); 1349static const DECLARE_TLV_DB_SCALE(db_scale_capture, 0, 150, 0);
1355 1350
@@ -1474,9 +1469,10 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = {
1474}; 1469};
1475 1470
1476 1471
1477static int es1938_suspend(struct pci_dev *pci, pm_message_t state) 1472static int es1938_suspend(struct device *dev)
1478{ 1473{
1479 struct snd_card *card = pci_get_drvdata(pci); 1474 struct pci_dev *pci = to_pci_dev(dev);
1475 struct snd_card *card = dev_get_drvdata(dev);
1480 struct es1938 *chip = card->private_data; 1476 struct es1938 *chip = card->private_data;
1481 unsigned char *s, *d; 1477 unsigned char *s, *d;
1482 1478
@@ -1494,13 +1490,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state)
1494 } 1490 }
1495 pci_disable_device(pci); 1491 pci_disable_device(pci);
1496 pci_save_state(pci); 1492 pci_save_state(pci);
1497 pci_set_power_state(pci, pci_choose_state(pci, state)); 1493 pci_set_power_state(pci, PCI_D3hot);
1498 return 0; 1494 return 0;
1499} 1495}
1500 1496
1501static int es1938_resume(struct pci_dev *pci) 1497static int es1938_resume(struct device *dev)
1502{ 1498{
1503 struct snd_card *card = pci_get_drvdata(pci); 1499 struct pci_dev *pci = to_pci_dev(dev);
1500 struct snd_card *card = dev_get_drvdata(dev);
1504 struct es1938 *chip = card->private_data; 1501 struct es1938 *chip = card->private_data;
1505 unsigned char *s, *d; 1502 unsigned char *s, *d;
1506 1503
@@ -1534,6 +1531,11 @@ static int es1938_resume(struct pci_dev *pci)
1534 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 1531 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
1535 return 0; 1532 return 0;
1536} 1533}
1534
1535static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume);
1536#define ES1938_PM_OPS &es1938_pm
1537#else
1538#define ES1938_PM_OPS NULL
1537#endif /* CONFIG_PM */ 1539#endif /* CONFIG_PM */
1538 1540
1539#ifdef SUPPORT_JOYSTICK 1541#ifdef SUPPORT_JOYSTICK
@@ -1887,10 +1889,9 @@ static struct pci_driver es1938_driver = {
1887 .id_table = snd_es1938_ids, 1889 .id_table = snd_es1938_ids,
1888 .probe = snd_es1938_probe, 1890 .probe = snd_es1938_probe,
1889 .remove = __devexit_p(snd_es1938_remove), 1891 .remove = __devexit_p(snd_es1938_remove),
1890#ifdef CONFIG_PM 1892 .driver = {
1891 .suspend = es1938_suspend, 1893 .pm = ES1938_PM_OPS,
1892 .resume = es1938_resume, 1894 },
1893#endif
1894}; 1895};
1895 1896
1896module_pci_driver(es1938_driver); 1897module_pci_driver(es1938_driver);