提交 66dc918d 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (348 commits)
  ALSA: hda - Fix NULL-derefence with a single mic in STAC auto-mic detection
  ALSA: hda - Add missing NID 0x19 fixup for Sony VAIO
  ALSA: hda - Fix ALC275 enable hardware EQ for SONY VAIO
  ALSA: oxygen: fix Xonar DG input
  ALSA: hda - Fix EAPD on Lenovo NB ALC269 to low
  ALSA: hda - Fix missing EAPD for Acer 4930G
  ALSA: hda: Disable 4/6 channels on some NVIDIA GPUs.
  ALSA: hda - Add static_hdmi_pcm option to HDMI codec parser
  ALSA: hda - Don't refer ELD when unplugged
  ASoC: tpa6130a2: Fix compiler warning
  ASoC: tlv320dac33: Add DAPM selection for LOM invert
  ASoC: DMIC codec: Adding a generic DMIC codec
  ALSA: snd-usb-us122l: Fix missing NULL checks
  ALSA: snd-usb-us122l: Fix MIDI output
  ASoC: soc-cache: Fix invalid memory access during snd_soc_lzo_cache_sync()
  ASoC: Fix section mismatch in wm8995.c
  ALSA: oxygen: add S/PDIF source selection for Claro cards
  ALSA: oxygen: fix CD/MIDI for X-Meridian (2G)
  ASoC: fix migor audio build
  ALSA: include delay.h for msleep in Xonar DG support
  ...
...@@ -974,13 +974,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ...@@ -974,13 +974,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
See hdspm.txt for details. See hdspm.txt for details.
Module snd-hifier
-----------------
Module for the MediaTek/TempoTec HiFier Fantasia sound card.
This module supports autoprobe and multiple cards.
Module snd-ice1712 Module snd-ice1712
------------------ ------------------
...@@ -1531,15 +1524,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ...@@ -1531,15 +1524,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
Module snd-oxygen Module snd-oxygen
----------------- -----------------
Module for sound cards based on the C-Media CMI8788 chip: Module for sound cards based on the C-Media CMI8786/8787/8788 chip:
* Asound A-8788 * Asound A-8788
* Asus Xonar DG
* AuzenTech X-Meridian * AuzenTech X-Meridian
* AuzenTech X-Meridian 2G
* Bgears b-Enspirer * Bgears b-Enspirer
* Club3D Theatron DTS * Club3D Theatron DTS
* HT-Omega Claro (plus) * HT-Omega Claro (plus)
* HT-Omega Claro halo (XT) * HT-Omega Claro halo (XT)
* Kuroutoshikou CMI8787-HG2PCI
* Razer Barracuda AC-1 * Razer Barracuda AC-1
* Sondigo Inferno * Sondigo Inferno
* TempoTec HiFier Fantasia
* TempoTec HiFier Serenade
This module supports autoprobe and multiple cards. This module supports autoprobe and multiple cards.
...@@ -2006,9 +2004,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ...@@ -2006,9 +2004,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
Module snd-virtuoso Module snd-virtuoso
------------------- -------------------
Module for sound cards based on the Asus AV100/AV200 chips, Module for sound cards based on the Asus AV66/AV100/AV200 chips,
i.e., Xonar D1, DX, D2, D2X, DS, HDAV1.3 (Deluxe), Essence ST i.e., Xonar D1, DX, D2, D2X, DS, Essence ST (Deluxe), Essence STX,
(Deluxe) and Essence STX. HDAV1.3 (Deluxe), and HDAV1.3 Slim.
This module supports autoprobe and multiple cards. This module supports autoprobe and multiple cards.
......
...@@ -149,7 +149,6 @@ ALC882/883/885/888/889 ...@@ -149,7 +149,6 @@ ALC882/883/885/888/889
acer-aspire-7730g Acer Aspire 7730G acer-aspire-7730g Acer Aspire 7730G
acer-aspire-8930g Acer Aspire 8930G acer-aspire-8930g Acer Aspire 8930G
medion Medion Laptops medion Medion Laptops
medion-md2 Medion MD2
targa-dig Targa/MSI targa-dig Targa/MSI
targa-2ch-dig Targa/MSI with 2-channel targa-2ch-dig Targa/MSI with 2-channel
targa-8ch-dig Targa/MSI with 8-channel (MSI GX620) targa-8ch-dig Targa/MSI with 8-channel (MSI GX620)
......
...@@ -1523,6 +1523,14 @@ S: Supported ...@@ -1523,6 +1523,14 @@ S: Supported
F: block/bsg.c F: block/bsg.c
F: include/linux/bsg.h F: include/linux/bsg.h
BT87X AUDIO DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
T: git git://git.alsa-project.org/alsa-kernel.git
S: Maintained
F: Documentation/sound/alsa/Bt87x.txt
F: sound/pci/bt87x.c
BT8XXGPIO DRIVER BT8XXGPIO DRIVER
M: Michael Buesch <mb@bu3sch.de> M: Michael Buesch <mb@bu3sch.de>
W: http://bu3sch.de/btgpio.php W: http://bu3sch.de/btgpio.php
...@@ -1548,6 +1556,13 @@ S: Maintained ...@@ -1548,6 +1556,13 @@ S: Maintained
F: Documentation/video4linux/bttv/ F: Documentation/video4linux/bttv/
F: drivers/media/video/bt8xx/bttv* F: drivers/media/video/bt8xx/bttv*
C-MEDIA CMI8788 DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
T: git git://git.alsa-project.org/alsa-kernel.git
S: Maintained
F: sound/pci/oxygen/
CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
M: David Howells <dhowells@redhat.com> M: David Howells <dhowells@redhat.com>
L: linux-cachefs@redhat.com L: linux-cachefs@redhat.com
...@@ -2339,6 +2354,13 @@ W: bluesmoke.sourceforge.net ...@@ -2339,6 +2354,13 @@ W: bluesmoke.sourceforge.net
S: Maintained S: Maintained
F: drivers/edac/r82600_edac.c F: drivers/edac/r82600_edac.c
EDIROL UA-101/UA-1000 DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
T: git git://git.alsa-project.org/alsa-kernel.git
S: Maintained
F: sound/usb/misc/ua101.c
EEEPC LAPTOP EXTRAS DRIVER EEEPC LAPTOP EXTRAS DRIVER
M: Corentin Chary <corentincj@iksaif.net> M: Corentin Chary <corentincj@iksaif.net>
L: acpi4asus-user@lists.sourceforge.net L: acpi4asus-user@lists.sourceforge.net
...@@ -3507,6 +3529,13 @@ L: linux-serial@vger.kernel.org ...@@ -3507,6 +3529,13 @@ L: linux-serial@vger.kernel.org
S: Maintained S: Maintained
F: drivers/serial/jsm/ F: drivers/serial/jsm/
K10TEMP HARDWARE MONITORING DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
L: lm-sensors@lm-sensors.org
S: Maintained
F: Documentation/hwmon/k10temp
F: drivers/hwmon/k10temp.c
K8TEMP HARDWARE MONITORING DRIVER K8TEMP HARDWARE MONITORING DRIVER
M: Rudolf Marek <r.marek@assembler.cz> M: Rudolf Marek <r.marek@assembler.cz>
L: lm-sensors@lm-sensors.org L: lm-sensors@lm-sensors.org
...@@ -4537,6 +4566,13 @@ F: drivers/of ...@@ -4537,6 +4566,13 @@ F: drivers/of
F: include/linux/of*.h F: include/linux/of*.h
K: of_get_property K: of_get_property
OPL4 DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
T: git git://git.alsa-project.org/alsa-kernel.git
S: Maintained
F: sound/drivers/opl4/
OPROFILE OPROFILE
M: Robert Richter <robert.richter@amd.com> M: Robert Richter <robert.richter@amd.com>
L: oprofile-list@lists.sf.net L: oprofile-list@lists.sf.net
...@@ -5283,7 +5319,7 @@ SAMSUNG AUDIO (ASoC) DRIVERS ...@@ -5283,7 +5319,7 @@ SAMSUNG AUDIO (ASoC) DRIVERS
M: Jassi Brar <jassi.brar@samsung.com> M: Jassi Brar <jassi.brar@samsung.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported S: Supported
F: sound/soc/s3c24xx F: sound/soc/samsung
TIMEKEEPING, NTP TIMEKEEPING, NTP
M: John Stultz <johnstul@us.ibm.com> M: John Stultz <johnstul@us.ibm.com>
...@@ -6291,6 +6327,13 @@ S: Maintained ...@@ -6291,6 +6327,13 @@ S: Maintained
W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ W: http://www.one-eyed-alien.net/~mdharm/linux-usb/
F: drivers/usb/storage/ F: drivers/usb/storage/
USB MIDI DRIVER
M: Clemens Ladisch <clemens@ladisch.de>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
T: git git://git.alsa-project.org/alsa-kernel.git
S: Maintained
F: sound/usb/midi.*
USB OHCI DRIVER USB OHCI DRIVER
M: David Brownell <dbrownell@users.sourceforge.net> M: David Brownell <dbrownell@users.sourceforge.net>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
......
...@@ -171,7 +171,7 @@ static void __init openrd_init(void) ...@@ -171,7 +171,7 @@ static void __init openrd_init(void)
kirkwood_i2c_init(); kirkwood_i2c_init();
if (machine_is_openrd_client()) { if (machine_is_openrd_client() || machine_is_openrd_ultimate()) {
i2c_register_board_info(0, i2c_board_info, i2c_register_board_info(0, i2c_board_info,
ARRAY_SIZE(i2c_board_info)); ARRAY_SIZE(i2c_board_info));
kirkwood_audio_init(); kirkwood_audio_init();
......
...@@ -387,7 +387,7 @@ static struct platform_device *h1940_devices[] __initdata = { ...@@ -387,7 +387,7 @@ static struct platform_device *h1940_devices[] __initdata = {
&s3c_device_wdt, &s3c_device_wdt,
&s3c_device_i2c0, &s3c_device_i2c0,
&s3c_device_iis, &s3c_device_iis,
&s3c_device_pcm, &samsung_asoc_dma,
&s3c_device_usbgadget, &s3c_device_usbgadget,
&h1940_device_leds, &h1940_device_leds,
&h1940_device_bluetooth, &h1940_device_bluetooth,
......
...@@ -692,7 +692,7 @@ static struct platform_device *rx1950_devices[] __initdata = { ...@@ -692,7 +692,7 @@ static struct platform_device *rx1950_devices[] __initdata = {
&s3c_device_wdt, &s3c_device_wdt,
&s3c_device_i2c0, &s3c_device_i2c0,
&s3c_device_iis, &s3c_device_iis,
&s3c_device_pcm, &samsung_asoc_dma,
&s3c_device_usbgadget, &s3c_device_usbgadget,
&s3c_device_rtc, &s3c_device_rtc,
&s3c_device_nand, &s3c_device_nand,
......
...@@ -695,7 +695,7 @@ static struct clksrc_clk clksrcs[] = { ...@@ -695,7 +695,7 @@ static struct clksrc_clk clksrcs[] = {
}, { }, {
.clk = { .clk = {
.name = "audio-bus", .name = "audio-bus",
.id = -1, /* There's only one IISv4 port */ .id = 2,
.ctrlbit = S3C6410_CLKCON_SCLK_AUDIO2, .ctrlbit = S3C6410_CLKCON_SCLK_AUDIO2,
.enable = s3c64xx_sclk_ctrl, .enable = s3c64xx_sclk_ctrl,
}, },
......
...@@ -22,7 +22,12 @@ ...@@ -22,7 +22,12 @@
#include <plat/audio.h> #include <plat/audio.h>
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) static const char *rclksrc[] = {
[0] = "iis",
[1] = "audio-bus",
};
static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
{ {
unsigned int base; unsigned int base;
...@@ -33,6 +38,12 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) ...@@ -33,6 +38,12 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
case 1: case 1:
base = S3C64XX_GPE(0); base = S3C64XX_GPE(0);
break; break;
case 2:
s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
return 0;
default: default:
printk(KERN_DEBUG "Invalid I2S Controller number: %d\n", printk(KERN_DEBUG "Invalid I2S Controller number: %d\n",
pdev->id); pdev->id);
...@@ -44,16 +55,6 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev) ...@@ -44,16 +55,6 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
return 0; return 0;
} }
static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
{
s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
return 0;
}
static struct resource s3c64xx_iis0_resource[] = { static struct resource s3c64xx_iis0_resource[] = {
[0] = { [0] = {
.start = S3C64XX_PA_IIS0, .start = S3C64XX_PA_IIS0,
...@@ -72,17 +73,22 @@ static struct resource s3c64xx_iis0_resource[] = { ...@@ -72,17 +73,22 @@ static struct resource s3c64xx_iis0_resource[] = {
}, },
}; };
static struct s3c_audio_pdata s3c_i2s0_pdata = { static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s3c64xx_i2sv3_cfg_gpio, .cfg_gpio = s3c64xx_i2s_cfg_gpio,
.type = {
.i2s = {
.src_clk = rclksrc,
},
},
}; };
struct platform_device s3c64xx_device_iis0 = { struct platform_device s3c64xx_device_iis0 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 0, .id = 0,
.num_resources = ARRAY_SIZE(s3c64xx_iis0_resource), .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
.resource = s3c64xx_iis0_resource, .resource = s3c64xx_iis0_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s0_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
EXPORT_SYMBOL(s3c64xx_device_iis0); EXPORT_SYMBOL(s3c64xx_device_iis0);
...@@ -105,17 +111,13 @@ static struct resource s3c64xx_iis1_resource[] = { ...@@ -105,17 +111,13 @@ static struct resource s3c64xx_iis1_resource[] = {
}, },
}; };
static struct s3c_audio_pdata s3c_i2s1_pdata = {
.cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
};
struct platform_device s3c64xx_device_iis1 = { struct platform_device s3c64xx_device_iis1 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 1, .id = 1,
.num_resources = ARRAY_SIZE(s3c64xx_iis1_resource), .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
.resource = s3c64xx_iis1_resource, .resource = s3c64xx_iis1_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s1_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
EXPORT_SYMBOL(s3c64xx_device_iis1); EXPORT_SYMBOL(s3c64xx_device_iis1);
...@@ -138,17 +140,23 @@ static struct resource s3c64xx_iisv4_resource[] = { ...@@ -138,17 +140,23 @@ static struct resource s3c64xx_iisv4_resource[] = {
}, },
}; };
static struct s3c_audio_pdata s3c_i2sv4_pdata = { static struct s3c_audio_pdata i2sv4_pdata = {
.cfg_gpio = s3c64xx_i2sv4_cfg_gpio, .cfg_gpio = s3c64xx_i2s_cfg_gpio,
.type = {
.i2s = {
.quirks = QUIRK_PRI_6CHAN,
.src_clk = rclksrc,
},
},
}; };
struct platform_device s3c64xx_device_iisv4 = { struct platform_device s3c64xx_device_iisv4 = {
.name = "s3c64xx-iis-v4", .name = "samsung-i2s",
.id = -1, .id = 2,
.num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource), .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource),
.resource = s3c64xx_iisv4_resource, .resource = s3c64xx_iisv4_resource,
.dev = { .dev = {
.platform_data = &s3c_i2sv4_pdata, .platform_data = &i2sv4_pdata,
}, },
}; };
EXPORT_SYMBOL(s3c64xx_device_iisv4); EXPORT_SYMBOL(s3c64xx_device_iisv4);
...@@ -288,7 +296,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata; ...@@ -288,7 +296,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata;
static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32); static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);
struct platform_device s3c64xx_device_ac97 = { struct platform_device s3c64xx_device_ac97 = {
.name = "s3c-ac97", .name = "samsung-ac97",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(s3c64xx_ac97_resource), .num_resources = ARRAY_SIZE(s3c64xx_ac97_resource),
.resource = s3c64xx_ac97_resource, .resource = s3c64xx_ac97_resource,
...@@ -307,16 +315,3 @@ void __init s3c64xx_ac97_setup_gpio(int num) ...@@ -307,16 +315,3 @@ void __init s3c64xx_ac97_setup_gpio(int num)
else else
s3c_ac97_pdata.cfg_gpio = s3c64xx_ac97_cfg_gpe; s3c_ac97_pdata.cfg_gpio = s3c64xx_ac97_cfg_gpe;
} }
static u64 s3c_device_audio_dmamask = 0xffffffffUL;
struct platform_device s3c_device_pcm = {
.name = "s3c24xx-pcm-audio",
.id = -1,
.dev = {
.dma_mask = &s3c_device_audio_dmamask,
.coherent_dma_mask = 0xffffffffUL
}
};
EXPORT_SYMBOL(s3c_device_pcm);
...@@ -283,7 +283,7 @@ static struct platform_device *smdk6410_devices[] __initdata = { ...@@ -283,7 +283,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
&s3c_device_fb, &s3c_device_fb,
&s3c_device_ohci, &s3c_device_ohci,
&s3c_device_usb_hsotg, &s3c_device_usb_hsotg,
&s3c_device_pcm, &samsung_asoc_dma,
&s3c64xx_device_iisv4, &s3c64xx_device_iisv4,
&samsung_device_keypad, &samsung_device_keypad,
......
...@@ -29,7 +29,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev) ...@@ -29,7 +29,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
base = S5P6442_GPC1(0); base = S5P6442_GPC1(0);
break; break;
case -1: case 0:
base = S5P6442_GPC0(0); base = S5P6442_GPC0(0);
break; break;
...@@ -42,8 +42,19 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev) ...@@ -42,8 +42,19 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
return 0; return 0;
} }
static struct s3c_audio_pdata s3c_i2s_pdata = { static const char *rclksrc_v35[] = {
[0] = "busclk",
[1] = "i2sclk",
};
static struct s3c_audio_pdata i2sv35_pdata = {
.cfg_gpio = s5p6442_cfg_i2s, .cfg_gpio = s5p6442_cfg_i2s,
.type = {
.i2s = {
.quirks = QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR,
.src_clk = rclksrc_v35,
},
},
}; };
static struct resource s5p6442_iis0_resource[] = { static struct resource s5p6442_iis0_resource[] = {
...@@ -62,15 +73,34 @@ static struct resource s5p6442_iis0_resource[] = { ...@@ -62,15 +73,34 @@ static struct resource s5p6442_iis0_resource[] = {
.end = DMACH_I2S0_RX, .end = DMACH_I2S0_RX,
.flags = IORESOURCE_DMA, .flags = IORESOURCE_DMA,
}, },
[3] = {
.start = DMACH_I2S0S_TX,
.end = DMACH_I2S0S_TX,
.flags = IORESOURCE_DMA,
},
}; };
struct platform_device s5p6442_device_iis0 = { struct platform_device s5p6442_device_iis0 = {
.name = "s3c64xx-iis-v4", .name = "samsung-i2s",
.id = -1, .id = 0,
.num_resources = ARRAY_SIZE(s5p6442_iis0_resource), .num_resources = ARRAY_SIZE(s5p6442_iis0_resource),
.resource = s5p6442_iis0_resource, .resource = s5p6442_iis0_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv35_pdata,
},
};
static const char *rclksrc_v3[] = {
[0] = "iis",
[1] = "sclk_audio",
};
static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s5p6442_cfg_i2s,
.type = {
.i2s = {
.src_clk = rclksrc_v3,
},
}, },
}; };
...@@ -93,12 +123,12 @@ static struct resource s5p6442_iis1_resource[] = { ...@@ -93,12 +123,12 @@ static struct resource s5p6442_iis1_resource[] = {
}; };
struct platform_device s5p6442_device_iis1 = { struct platform_device s5p6442_device_iis1 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 1, .id = 1,
.num_resources = ARRAY_SIZE(s5p6442_iis1_resource), .num_resources = ARRAY_SIZE(s5p6442_iis1_resource),
.resource = s5p6442_iis1_resource, .resource = s5p6442_iis1_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
......
...@@ -261,7 +261,7 @@ static struct clk init_clocks_disable[] = { ...@@ -261,7 +261,7 @@ static struct clk init_clocks_disable[] = {
.enable = s5p64x0_pclk_ctrl, .enable = s5p64x0_pclk_ctrl,
.ctrlbit = (1 << 25), .ctrlbit = (1 << 25),
}, { }, {
.name = "i2s_v40", .name = "iis",
.id = 0, .id = 0,
.parent = &clk_pclk_low.clk, .parent = &clk_pclk_low.clk,
.enable = s5p64x0_pclk_ctrl, .enable = s5p64x0_pclk_ctrl,
......
...@@ -256,7 +256,7 @@ static struct clk init_clocks_disable[] = { ...@@ -256,7 +256,7 @@ static struct clk init_clocks_disable[] = {
.ctrlbit = (1 << 22), .ctrlbit = (1 << 22),
}, { }, {
.name = "iis", .name = "iis",
.id = -1, .id = 0,
.parent = &clk_pclk_low.clk, .parent = &clk_pclk_low.clk,
.enable = s5p64x0_pclk_ctrl, .enable = s5p64x0_pclk_ctrl,
.ctrlbit = (1 << 26), .ctrlbit = (1 << 26),
......
...@@ -19,15 +19,19 @@ ...@@ -19,15 +19,19 @@
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/irqs.h> #include <mach/irqs.h>
static int s5p6440_cfg_i2s(struct platform_device *pdev) static const char *rclksrc[] = {
[0] = "iis",
[1] = "sclk_audio2",
};
static int s5p64x0_cfg_i2s(struct platform_device *pdev)
{ {
/* configure GPIO for i2s port */ /* configure GPIO for i2s port */
switch (pdev->id) { switch (pdev->id) {
case -1: case 0:
s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5)); s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5));
s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5)); s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5));
break; break;
default: default:
printk(KERN_ERR "Invalid Device %d\n", pdev->id); printk(KERN_ERR "Invalid Device %d\n", pdev->id);
return -EINVAL; return -EINVAL;
...@@ -36,31 +40,14 @@ static int s5p6440_cfg_i2s(struct platform_device *pdev) ...@@ -36,31 +40,14 @@ static int s5p6440_cfg_i2s(struct platform_device *pdev)
return 0; return 0;
} }
static int s5p6450_cfg_i2s(struct platform_device *pdev) static struct s3c_audio_pdata s5p64x0_i2s_pdata = {
{ .cfg_gpio = s5p64x0_cfg_i2s,
/* configure GPIO for i2s port */ .type = {
switch (pdev->id) { .i2s = {
case -1: .quirks = QUIRK_PRI_6CHAN,
s3c_gpio_cfgpin(S5P6450_GPB(4), S3C_GPIO_SFN(5)); .src_clk = rclksrc,
s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5)); },
s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5)); },
break;
default:
printk(KERN_ERR "Invalid Device %d\n", pdev->id);
return -EINVAL;
}
return 0;
}
static struct s3c_audio_pdata s5p6440_i2s_pdata = {
.cfg_gpio = s5p6440_cfg_i2s,
};
static struct s3c_audio_pdata s5p6450_i2s_pdata = {
.cfg_gpio = s5p6450_cfg_i2s,
}; };
static struct resource s5p64x0_iis0_resource[] = { static struct resource s5p64x0_iis0_resource[] = {
...@@ -82,22 +69,22 @@ static struct resource s5p64x0_iis0_resource[] = { ...@@ -82,22 +69,22 @@ static struct resource s5p64x0_iis0_resource[] = {
}; };
struct platform_device s5p6440_device_iis = { struct platform_device s5p6440_device_iis = {
.name = "s3c64xx-iis-v4", .name = "samsung-i2s",
.id = -1, .id = 0,
.num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource),
.resource = s5p64x0_iis0_resource, .resource = s5p64x0_iis0_resource,
.dev = { .dev = {
.platform_data = &s5p6440_i2s_pdata, .platform_data = &s5p64x0_i2s_pdata,
}, },
}; };
struct platform_device s5p6450_device_iis0 = { struct platform_device s5p6450_device_iis0 = {
.name = "s3c64xx-iis-v4", .name = "samsung-i2s",
.id = -1, .id = 0,
.num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource),
.resource = s5p64x0_iis0_resource, .resource = s5p64x0_iis0_resource,
.dev = { .dev = {
.platform_data = &s5p6450_i2s_pdata, .platform_data = &s5p64x0_i2s_pdata,
}, },
}; };
......
...@@ -23,17 +23,14 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev) ...@@ -23,17 +23,14 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev)
{ {
/* configure GPIO for i2s port */ /* configure GPIO for i2s port */
switch (pdev->id) { switch (pdev->id) {
case 0: /* Dedicated pins */
break;
case 1: case 1:
s3c_gpio_cfgpin_range(S5PC100_GPC(0), 5, S3C_GPIO_SFN(2)); s3c_gpio_cfgpin_range(S5PC100_GPC(0), 5, S3C_GPIO_SFN(2));
break; break;
case 2: case 2:
s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 5, S3C_GPIO_SFN(4)); s3c_gpio_cfgpin_range(S5PC100_GPG3(0), 5, S3C_GPIO_SFN(4));
break; break;
case -1: /* Dedicated pins */
break;
default: default:
printk(KERN_ERR "Invalid Device %d\n", pdev->id); printk(KERN_ERR "Invalid Device %d\n", pdev->id);
return -EINVAL; return -EINVAL;
...@@ -42,8 +39,20 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev) ...@@ -42,8 +39,20 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev)
return 0; return 0;
} }
static struct s3c_audio_pdata s3c_i2s_pdata = { static const char *rclksrc_v5[] = {
[0] = "iis",
[1] = "i2sclkd2",
};
static struct s3c_audio_pdata i2sv5_pdata = {
.cfg_gpio = s5pc100_cfg_i2s, .cfg_gpio = s5pc100_cfg_i2s,
.type = {
.i2s = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
| QUIRK_NEED_RSTCLR,
.src_clk = rclksrc_v5,
},
},
}; };
static struct resource s5pc100_iis0_resource[] = { static struct resource s5pc100_iis0_resource[] = {
...@@ -62,15 +71,34 @@ static struct resource s5pc100_iis0_resource[] = { ...@@ -62,15 +71,34 @@ static struct resource s5pc100_iis0_resource[] = {
.end = DMACH_I2S0_RX, .end = DMACH_I2S0_RX,
.flags = IORESOURCE_DMA, .flags = IORESOURCE_DMA,
}, },
[3] = {
.start = DMACH_I2S0S_TX,
.end = DMACH_I2S0S_TX,
.flags = IORESOURCE_DMA,
},
}; };
struct platform_device s5pc100_device_iis0 = { struct platform_device s5pc100_device_iis0 = {
.name = "s3c64xx-iis-v4", .name = "samsung-i2s",
.id = -1, .id = 0,
.num_resources = ARRAY_SIZE(s5pc100_iis0_resource), .num_resources = ARRAY_SIZE(s5pc100_iis0_resource),
.resource = s5pc100_iis0_resource, .resource = s5pc100_iis0_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv5_pdata,
},
};
static const char *rclksrc_v3[] = {
[0] = "iis",
[1] = "sclk_audio",
};
static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s5pc100_cfg_i2s,
.type = {
.i2s = {
.src_clk = rclksrc_v3,
},
}, },
}; };
...@@ -93,12 +121,12 @@ static struct resource s5pc100_iis1_resource[] = { ...@@ -93,12 +121,12 @@ static struct resource s5pc100_iis1_resource[] = {
}; };
struct platform_device s5pc100_device_iis1 = { struct platform_device s5pc100_device_iis1 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 1, .id = 1,
.num_resources = ARRAY_SIZE(s5pc100_iis1_resource), .num_resources = ARRAY_SIZE(s5pc100_iis1_resource),
.resource = s5pc100_iis1_resource, .resource = s5pc100_iis1_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
...@@ -121,12 +149,12 @@ static struct resource s5pc100_iis2_resource[] = { ...@@ -121,12 +149,12 @@ static struct resource s5pc100_iis2_resource[] = {
}; };
struct platform_device s5pc100_device_iis2 = { struct platform_device s5pc100_device_iis2 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 2, .id = 2,
.num_resources = ARRAY_SIZE(s5pc100_iis2_resource), .num_resources = ARRAY_SIZE(s5pc100_iis2_resource),
.resource = s5pc100_iis2_resource, .resource = s5pc100_iis2_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
...@@ -253,7 +281,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata = { ...@@ -253,7 +281,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata = {
static u64 s5pc100_ac97_dmamask = DMA_BIT_MASK(32); static u64 s5pc100_ac97_dmamask = DMA_BIT_MASK(32);
struct platform_device s5pc100_device_ac97 = { struct platform_device s5pc100_device_ac97 = {
.name = "s3c-ac97", .name = "samsung-ac97",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(s5pc100_ac97_resource), .num_resources = ARRAY_SIZE(s5pc100_ac97_resource),
.resource = s5pc100_ac97_resource, .resource = s5pc100_ac97_resource,
......
...@@ -96,6 +96,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { ...@@ -96,6 +96,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
/* I2C0 */ /* I2C0 */
static struct i2c_board_info i2c_devs0[] __initdata = { static struct i2c_board_info i2c_devs0[] __initdata = {
{I2C_BOARD_INFO("wm8580", 0x1b),},
}; };
/* I2C1 */ /* I2C1 */
...@@ -190,6 +191,7 @@ static struct platform_device *smdkc100_devices[] __initdata = { ...@@ -190,6 +191,7 @@ static struct platform_device *smdkc100_devices[] __initdata = {
&s3c_device_ts, &s3c_device_ts,
&s3c_device_wdt, &s3c_device_wdt,
&smdkc100_lcd_powerdev, &smdkc100_lcd_powerdev,
&samsung_asoc_dma,
&s5pc100_device_iis0, &s5pc100_device_iis0,
&samsung_device_keypad, &samsung_device_keypad,
&s5pc100_device_ac97, &s5pc100_device_ac97,
......
...@@ -467,20 +467,20 @@ static struct clk init_clocks_disable[] = { ...@@ -467,20 +467,20 @@ static struct clk init_clocks_disable[] = {
.enable = s5pv210_clk_ip3_ctrl, .enable = s5pv210_clk_ip3_ctrl,
.ctrlbit = (1<<21), .ctrlbit = (1<<21),
}, { }, {
.name = "i2s_v50", .name = "iis",
.id = 0, .id = 0,
.parent = &clk_p, .parent = &clk_p,
.enable = s5pv210_clk_ip3_ctrl, .enable = s5pv210_clk_ip3_ctrl,
.ctrlbit = (1<<4), .ctrlbit = (1<<4),
}, { }, {
.name = "i2s_v32", .name = "iis",
.id = 0, .id = 1,
.parent = &clk_p, .parent = &clk_p,
.enable = s5pv210_clk_ip3_ctrl, .enable = s5pv210_clk_ip3_ctrl,
.ctrlbit = (1 << 5), .ctrlbit = (1 << 5),
}, { }, {
.name = "i2s_v32", .name = "iis",
.id = 1, .id = 2,
.parent = &clk_p, .parent = &clk_p,
.enable = s5pv210_clk_ip3_ctrl, .enable = s5pv210_clk_ip3_ctrl,
.ctrlbit = (1 << 6), .ctrlbit = (1 << 6),
......
...@@ -19,22 +19,24 @@ ...@@ -19,22 +19,24 @@
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/irqs.h> #include <mach/irqs.h>
static const char *rclksrc[] = {
[0] = "busclk",
[1] = "i2sclk",
};
static int s5pv210_cfg_i2s(struct platform_device *pdev) static int s5pv210_cfg_i2s(struct platform_device *pdev)
{ {
/* configure GPIO for i2s port */ /* configure GPIO for i2s port */
switch (pdev->id) { switch (pdev->id) {
case 0:
s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2));
break;
case 1: case 1:
s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2)); s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2));
break; break;
case 2: case 2:
s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4)); s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4));
break; break;
case -1:
s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2));
break;
default: default:
printk(KERN_ERR "Invalid Device %d\n", pdev->id); printk(KERN_ERR "Invalid Device %d\n", pdev->id);
return -EINVAL; return -EINVAL;
...@@ -43,8 +45,15 @@ static int s5pv210_cfg_i2s(struct platform_device *pdev) ...@@ -43,8 +45,15 @@ static int s5pv210_cfg_i2s(struct platform_device *pdev)
return 0; return 0;
} }
static struct s3c_audio_pdata s3c_i2s_pdata = { static struct s3c_audio_pdata i2sv5_pdata = {
.cfg_gpio = s5pv210_cfg_i2s, .cfg_gpio = s5pv210_cfg_i2s,
.type = {
.i2s = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
| QUIRK_NEED_RSTCLR,
.src_clk = rclksrc,
},
},
}; };
static struct resource s5pv210_iis0_resource[] = { static struct resource s5pv210_iis0_resource[] = {
...@@ -63,15 +72,34 @@ static struct resource s5pv210_iis0_resource[] = { ...@@ -63,15 +72,34 @@ static struct resource s5pv210_iis0_resource[] = {
.end = DMACH_I2S0_RX, .end = DMACH_I2S0_RX,
.flags = IORESOURCE_DMA, .flags = IORESOURCE_DMA,
}, },
[3] = {
.start = DMACH_I2S0S_TX,
.end = DMACH_I2S0S_TX,
.flags = IORESOURCE_DMA,
},
}; };
struct platform_device s5pv210_device_iis0 = { struct platform_device s5pv210_device_iis0 = {
.name = "s3c64xx-iis-v4", .name = "samsung-i2s",
.id = -1, .id = 0,
.num_resources = ARRAY_SIZE(s5pv210_iis0_resource), .num_resources = ARRAY_SIZE(s5pv210_iis0_resource),
.resource = s5pv210_iis0_resource, .resource = s5pv210_iis0_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv5_pdata,
},
};
static const char *rclksrc_v3[] = {
[0] = "iis",
[1] = "audio-bus",
};
static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s5pv210_cfg_i2s,
.type = {
.i2s = {
.src_clk = rclksrc_v3,
},
}, },
}; };
...@@ -94,12 +122,12 @@ static struct resource s5pv210_iis1_resource[] = { ...@@ -94,12 +122,12 @@ static struct resource s5pv210_iis1_resource[] = {
}; };
struct platform_device s5pv210_device_iis1 = { struct platform_device s5pv210_device_iis1 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 1, .id = 1,
.num_resources = ARRAY_SIZE(s5pv210_iis1_resource), .num_resources = ARRAY_SIZE(s5pv210_iis1_resource),
.resource = s5pv210_iis1_resource, .resource = s5pv210_iis1_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
...@@ -122,12 +150,12 @@ static struct resource s5pv210_iis2_resource[] = { ...@@ -122,12 +150,12 @@ static struct resource s5pv210_iis2_resource[] = {
}; };
struct platform_device s5pv210_device_iis2 = { struct platform_device s5pv210_device_iis2 = {
.name = "s3c64xx-iis", .name = "samsung-i2s",
.id = 2, .id = 2,
.num_resources = ARRAY_SIZE(s5pv210_iis2_resource), .num_resources = ARRAY_SIZE(s5pv210_iis2_resource),
.resource = s5pv210_iis2_resource, .resource = s5pv210_iis2_resource,
.dev = { .dev = {
.platform_data = &s3c_i2s_pdata, .platform_data = &i2sv3_pdata,
}, },
}; };
...@@ -283,7 +311,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata = { ...@@ -283,7 +311,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata = {
static u64 s5pv210_ac97_dmamask = DMA_BIT_MASK(32); static u64 s5pv210_ac97_dmamask = DMA_BIT_MASK(32);
struct platform_device s5pv210_device_ac97 = { struct platform_device s5pv210_device_ac97 = {
.name = "s3c-ac97", .name = "samsung-ac97",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(s5pv210_ac97_resource), .num_resources = ARRAY_SIZE(s5pv210_ac97_resource),
.resource = s5pv210_ac97_resource, .resource = s5pv210_ac97_resource,
......
...@@ -11,6 +11,7 @@ if ARCH_S5PV310 ...@@ -11,6 +11,7 @@ if ARCH_S5PV310
config CPU_S5PV310 config CPU_S5PV310
bool bool
select S3C_PL330_DMA
help help
Enable S5PV310 CPU support Enable S5PV310 CPU support
......
...@@ -13,7 +13,7 @@ obj- := ...@@ -13,7 +13,7 @@ obj- :=
# Core support for S5PV310 system # Core support for S5PV310 system
obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o
obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o dma.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
...@@ -27,6 +27,7 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o ...@@ -27,6 +27,7 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o
# device support # device support
obj-y += dev-audio.o
obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o
obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
......
/* linux/arch/arm/mach-s5pv310/dev-audio.c
*
* Copyright (c) 2010 Samsung Electronics Co. Ltd
* Jaswinder Singh <jassi.brar@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/gpio.h>
#include <plat/gpio-cfg.h>
#include <plat/audio.h>
#include <mach/map.h>
#include <mach/dma.h>
#include <mach/irqs.h>
static const char *rclksrc[] = {
[0] = "busclk",
[1] = "i2sclk",
};
static int s5pv310_cfg_i2s(struct platform_device *pdev)
{
/* configure GPIO for i2s port */
switch (pdev->id) {
case 0:
s3c_gpio_cfgpin_range(S5PV310_GPZ(0), 7, S3C_GPIO_SFN(2));
break;
case 1:
s3c_gpio_cfgpin_range(S5PV310_GPC0(0), 5, S3C_GPIO_SFN(2));
break;
case 2:
s3c_gpio_cfgpin_range(S5PV310_GPC1(0), 5, S3C_GPIO_SFN(4));
break;
default:
printk(KERN_ERR "Invalid Device %d\n", pdev->id);
return -EINVAL;
}
return 0;
}
static struct s3c_audio_pdata i2sv5_pdata = {
.cfg_gpio = s5pv310_cfg_i2s,
.type = {
.i2s = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
| QUIRK_NEED_RSTCLR,
.src_clk = rclksrc,
},
},
};
static struct resource s5pv310_i2s0_resource[] = {
[0] = {
.start = S5PV310_PA_I2S0,
.end = S5PV310_PA_I2S0 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_I2S0_TX,
.end = DMACH_I2S0_TX,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_I2S0_RX,
.end = DMACH_I2S0_RX,
.flags = IORESOURCE_DMA,
},
[3] = {
.start = DMACH_I2S0S_TX,
.end = DMACH_I2S0S_TX,
.flags = IORESOURCE_DMA,
},
};
struct platform_device s5pv310_device_i2s0 = {
.name = "samsung-i2s",
.id = 0,
.num_resources = ARRAY_SIZE(s5pv310_i2s0_resource),
.resource = s5pv310_i2s0_resource,
.dev = {
.platform_data = &i2sv5_pdata,
},
};
static const char *rclksrc_v3[] = {
[0] = "sclk_i2s",
[1] = "no_such_clock",
};
static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s5pv310_cfg_i2s,
.type = {
.i2s = {
.quirks = QUIRK_NO_MUXPSR,
.src_clk = rclksrc_v3,
},
},
};
static struct resource s5pv310_i2s1_resource[] = {
[0] = {
.start = S5PV310_PA_I2S1,
.end = S5PV310_PA_I2S1 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_I2S1_TX,
.end = DMACH_I2S1_TX,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_I2S1_RX,
.end = DMACH_I2S1_RX,
.flags = IORESOURCE_DMA,
},
};
struct platform_device s5pv310_device_i2s1 = {
.name = "samsung-i2s",
.id = 1,
.num_resources = ARRAY_SIZE(s5pv310_i2s1_resource),
.resource = s5pv310_i2s1_resource,
.dev = {
.platform_data = &i2sv3_pdata,
},
};
static struct resource s5pv310_i2s2_resource[] = {
[0] = {
.start = S5PV310_PA_I2S2,
.end = S5PV310_PA_I2S2 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_I2S2_TX,
.end = DMACH_I2S2_TX,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_I2S2_RX,
.end = DMACH_I2S2_RX,
.flags = IORESOURCE_DMA,
},
};
struct platform_device s5pv310_device_i2s2 = {
.name = "samsung-i2s",
.id = 2,
.num_resources = ARRAY_SIZE(s5pv310_i2s2_resource),
.resource = s5pv310_i2s2_resource,
.dev = {
.platform_data = &i2sv3_pdata,
},
};
/* PCM Controller platform_devices */
static int s5pv310_pcm_cfg_gpio(struct platform_device *pdev)
{
switch (pdev->id) {
case 0:
s3c_gpio_cfgpin_range(S5PV310_GPZ(0), 5, S3C_GPIO_SFN(3));
break;
case 1:
s3c_gpio_cfgpin_range(S5PV310_GPC0(0), 5, S3C_GPIO_SFN(3));
break;
case 2:
s3c_gpio_cfgpin_range(S5PV310_GPC1(0), 5, S3C_GPIO_SFN(3));
break;
default:
printk(KERN_DEBUG "Invalid PCM Controller number!");
return -EINVAL;
}
return 0;
}
static struct s3c_audio_pdata s3c_pcm_pdata = {
.cfg_gpio = s5pv310_pcm_cfg_gpio,
};
static struct resource s5pv310_pcm0_resource[] = {
[0] = {
.start = S5PV310_PA_PCM0,
.end = S5PV310_PA_PCM0 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_PCM0_TX,
.end = DMACH_PCM0_TX,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_PCM0_RX,
.end = DMACH_PCM0_RX,
.flags = IORESOURCE_DMA,
},
};
struct platform_device s5pv310_device_pcm0 = {
.name = "samsung-pcm",
.id = 0,
.num_resources = ARRAY_SIZE(s5pv310_pcm0_resource),
.resource = s5pv310_pcm0_resource,
.dev = {
.platform_data = &s3c_pcm_pdata,
},
};
static struct resource s5pv310_pcm1_resource[] = {
[0] = {
.start = S5PV310_PA_PCM1,
.end = S5PV310_PA_PCM1 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_PCM1_TX,
.end = DMACH_PCM1_TX,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_PCM1_RX,
.end = DMACH_PCM1_RX,
.flags = IORESOURCE_DMA,
},
};
struct platform_device s5pv310_device_pcm1 = {
.name = "samsung-pcm",
.id = 1,
.num_resources = ARRAY_SIZE(s5pv310_pcm1_resource),
.resource = s5pv310_pcm1_resource,
.dev = {
.platform_data = &s3c_pcm_pdata,
},
};
static struct resource s5pv310_pcm2_resource[] = {
[0] = {
.start = S5PV310_PA_PCM2,
.end = S5PV310_PA_PCM2 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_PCM2_TX,
.end = DMACH_PCM2_TX,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_PCM2_RX,
.end = DMACH_PCM2_RX,
.flags = IORESOURCE_DMA,
},
};
struct platform_device s5pv310_device_pcm2 = {
.name = "samsung-pcm",
.id = 2,
.num_resources = ARRAY_SIZE(s5pv310_pcm2_resource),
.resource = s5pv310_pcm2_resource,
.dev = {
.platform_data = &s3c_pcm_pdata,
},
};
/* AC97 Controller platform devices */
static int s5pv310_ac97_cfg_gpio(struct platform_device *pdev)
{
return s3c_gpio_cfgpin_range(S5PV310_GPC0(0), 5, S3C_GPIO_SFN(4));
}
static struct resource s5pv310_ac97_resource[] = {
[0] = {
.start = S5PV310_PA_AC97,
.end = S5PV310_PA_AC97 + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_AC97_PCMOUT,
.end = DMACH_AC97_PCMOUT,
.flags = IORESOURCE_DMA,
},
[2] = {
.start = DMACH_AC97_PCMIN,
.end = DMACH_AC97_PCMIN,
.flags = IORESOURCE_DMA,
},
[3] = {
.start = DMACH_AC97_MICIN,
.end = DMACH_AC97_MICIN,
.flags = IORESOURCE_DMA,
},
[4] = {
.start = IRQ_AC97,
.end = IRQ_AC97,
.flags = IORESOURCE_IRQ,
},
};
static struct s3c_audio_pdata s3c_ac97_pdata = {
.cfg_gpio = s5pv310_ac97_cfg_gpio,
};
static u64 s5pv310_ac97_dmamask = DMA_BIT_MASK(32);
struct platform_device s5pv310_device_ac97 = {
.name = "samsung-ac97",
.id = -1,
.num_resources = ARRAY_SIZE(s5pv310_ac97_resource),
.resource = s5pv310_ac97_resource,
.dev = {
.platform_data = &s3c_ac97_pdata,
.dma_mask = &s5pv310_ac97_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
/* S/PDIF Controller platform_device */
static int s5pv310_spdif_cfg_gpio(struct platform_device *pdev)
{
s3c_gpio_cfgpin_range(S5PV310_GPC1(0), 2, S3C_GPIO_SFN(3));
return 0;
}
static struct resource s5pv310_spdif_resource[] = {
[0] = {
.start = S5PV310_PA_SPDIF,
.end = S5PV310_PA_SPDIF + 0x100 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = DMACH_SPDIF,
.end = DMACH_SPDIF,
.flags = IORESOURCE_DMA,
},
};
static struct s3c_audio_pdata samsung_spdif_pdata = {
.cfg_gpio = s5pv310_spdif_cfg_gpio,
};
static u64 s5pv310_spdif_dmamask = DMA_BIT_MASK(32);
struct platform_device s5pv310_device_spdif = {
.name = "samsung-spdif",
.id = -1,
.num_resources = ARRAY_SIZE(s5pv310_spdif_resource),
.resource = s5pv310_spdif_resource,
.dev = {
.platform_data = &samsung_spdif_pdata,
.dma_mask = &s5pv310_spdif_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
/*
* Copyright (C) 2010 Samsung Electronics Co. Ltd.
* Jaswinder Singh <jassi.brar@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <plat/devs.h>
#include <plat/irqs.h>
#include <mach/map.h>
#include <mach/irqs.h>
#include <plat/s3c-pl330-pdata.h>
static u64 dma_dmamask = DMA_BIT_MASK(32);
static struct resource s5pv310_pdma0_resource[] = {
[0] = {
.start = S5PV310_PA_PDMA0,
.end = S5PV310_PA_PDMA0 + SZ_4K,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_PDMA0,
.end = IRQ_PDMA0,
.flags = IORESOURCE_IRQ,
},
};
static struct s3c_pl330_platdata s5pv310_pdma0_pdata = {
.peri = {
[0] = DMACH_PCM0_RX,
[1] = DMACH_PCM0_TX,
[2] = DMACH_PCM2_RX,
[3] = DMACH_PCM2_TX,
[4] = DMACH_MSM_REQ0,
[5] = DMACH_MSM_REQ2,
[6] = DMACH_SPI0_RX,
[7] = DMACH_SPI0_TX,
[8] = DMACH_SPI2_RX,
[9] = DMACH_SPI2_TX,
[10] = DMACH_I2S0S_TX,
[11] = DMACH_I2S0_RX,
[12] = DMACH_I2S0_TX,
[13] = DMACH_I2S2_RX,
[14] = DMACH_I2S2_TX,
[15] = DMACH_UART0_RX,
[16] = DMACH_UART0_TX,
[17] = DMACH_UART2_RX,
[18] = DMACH_UART2_TX,
[19] = DMACH_UART4_RX,
[20] = DMACH_UART4_TX,
[21] = DMACH_SLIMBUS0_RX,
[22] = DMACH_SLIMBUS0_TX,
[23] = DMACH_SLIMBUS2_RX,
[24] = DMACH_SLIMBUS2_TX,
[25] = DMACH_SLIMBUS4_RX,
[26] = DMACH_SLIMBUS4_TX,
[27] = DMACH_AC97_MICIN,
[28] = DMACH_AC97_PCMIN,
[29] = DMACH_AC97_PCMOUT,
[30] = DMACH_MAX,
[31] = DMACH_MAX,
},
};
static struct platform_device s5pv310_device_pdma0 = {
.name = "s3c-pl330",
.id = 0,
.num_resources = ARRAY_SIZE(s5pv310_pdma0_resource),
.resource = s5pv310_pdma0_resource,
.dev = {
.dma_mask = &dma_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &s5pv310_pdma0_pdata,
},
};
static struct resource s5pv310_pdma1_resource[] = {
[0] = {
.start = S5PV310_PA_PDMA1,
.end = S5PV310_PA_PDMA1 + SZ_4K,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_PDMA1,
.end = IRQ_PDMA1,
.flags = IORESOURCE_IRQ,
},
};
static struct s3c_pl330_platdata s5pv310_pdma1_pdata = {
.peri = {
[0] = DMACH_PCM0_RX,
[1] = DMACH_PCM0_TX,
[2] = DMACH_PCM1_RX,
[3] = DMACH_PCM1_TX,
[4] = DMACH_MSM_REQ1,
[5] = DMACH_MSM_REQ3,
[6] = DMACH_SPI1_RX,
[7] = DMACH_SPI1_TX,
[8] = DMACH_I2S0S_TX,
[9] = DMACH_I2S0_RX,
[10] = DMACH_I2S0_TX,
[11] = DMACH_I2S1_RX,
[12] = DMACH_I2S1_TX,
[13] = DMACH_UART0_RX,
[14] = DMACH_UART0_TX,
[15] = DMACH_UART1_RX,
[16] = DMACH_UART1_TX,
[17] = DMACH_UART3_RX,
[18] = DMACH_UART3_TX,
[19] = DMACH_SLIMBUS1_RX,
[20] = DMACH_SLIMBUS1_TX,
[21] = DMACH_SLIMBUS3_RX,
[22] = DMACH_SLIMBUS3_TX,
[23] = DMACH_SLIMBUS5_RX,
[24] = DMACH_SLIMBUS5_TX,
[25] = DMACH_SLIMBUS0AUX_RX,
[26] = DMACH_SLIMBUS0AUX_TX,
[27] = DMACH_SPDIF,
[28] = DMACH_MAX,
[29] = DMACH_MAX,
[30] = DMACH_MAX,
[31] = DMACH_MAX,
},
};
static struct platform_device s5pv310_device_pdma1 = {
.name = "s3c-pl330",
.id = 1,
.num_resources = ARRAY_SIZE(s5pv310_pdma1_resource),
.resource = s5pv310_pdma1_resource,
.dev = {
.dma_mask = &dma_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &s5pv310_pdma1_pdata,
},
};
static struct platform_device *s5pv310_dmacs[] __initdata = {
&s5pv310_device_pdma0,
&s5pv310_device_pdma1,
};
static int __init s5pv310_dma_init(void)
{
platform_add_devices(s5pv310_dmacs, ARRAY_SIZE(s5pv310_dmacs));
return 0;
}
arch_initcall(s5pv310_dma_init);
/*
* Copyright (C) 2010 Samsung Electronics Co. Ltd.
* Jaswinder Singh <jassi.brar@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __MACH_DMA_H
#define __MACH_DMA_H
/* This platform uses the common S3C DMA API driver for PL330 */
#include <plat/s3c-dma-pl330.h>
#endif /* __MACH_DMA_H */
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
#define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64)) #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64))
#define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y)
#define IRQ_PDMA0 COMBINER_IRQ(21, 0)
#define IRQ_PDMA1 COMBINER_IRQ(21, 1)
#define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0) #define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0)
#define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1) #define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1)
#define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2) #define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2)
......
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
#define S5PV310_PA_GIC_DIST (0x10501000) #define S5PV310_PA_GIC_DIST (0x10501000)
#define S5PV310_PA_L2CC (0x10502000) #define S5PV310_PA_L2CC (0x10502000)
/* DMA */
#define S5PV310_PA_MDMA 0x10810000
#define S5PV310_PA_PDMA0 0x12680000
#define S5PV310_PA_PDMA1 0x12690000
#define S5PV310_PA_GPIO1 (0x11400000) #define S5PV310_PA_GPIO1 (0x11400000)
#define S5PV310_PA_GPIO2 (0x11000000) #define S5PV310_PA_GPIO2 (0x11000000)
#define S5PV310_PA_GPIO3 (0x03860000) #define S5PV310_PA_GPIO3 (0x03860000)
...@@ -60,6 +65,22 @@ ...@@ -60,6 +65,22 @@
#define S5PV310_PA_SROMC (0x12570000) #define S5PV310_PA_SROMC (0x12570000)
/* S/PDIF */
#define S5PV310_PA_SPDIF 0xE1100000
/* I2S */
#define S5PV310_PA_I2S0 0x03830000
#define S5PV310_PA_I2S1 0xE3100000
#define S5PV310_PA_I2S2 0xE2A00000
/* PCM */
#define S5PV310_PA_PCM0 0x03840000
#define S5PV310_PA_PCM1 0x13980000
#define S5PV310_PA_PCM2 0x13990000
/* AC97 */
#define S5PV310_PA_AC97 0x139A0000
#define S5PV310_PA_UART (0x13800000) #define S5PV310_PA_UART (0x13800000)
#define S5P_PA_UART(x) (S5PV310_PA_UART + ((x) * S3C_UART_OFFSET)) #define S5P_PA_UART(x) (S5PV310_PA_UART + ((x) * S3C_UART_OFFSET))
......
...@@ -711,6 +711,10 @@ static struct platform_device fsi_device = { ...@@ -711,6 +711,10 @@ static struct platform_device fsi_device = {
}, },
}; };
static struct platform_device fsi_ak4643_device = {
.name = "sh_fsi2_a_ak4643",
};
static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
.clock_source = LCDC_CLK_EXTERNAL, .clock_source = LCDC_CLK_EXTERNAL,
.ch[0] = { .ch[0] = {
...@@ -933,6 +937,7 @@ static struct platform_device *ap4evb_devices[] __initdata = { ...@@ -933,6 +937,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
&sdhi1_device, &sdhi1_device,
&usb1_host_device, &usb1_host_device,
&fsi_device, &fsi_device,
&fsi_ak4643_device,
&sh_mmcif_device, &sh_mmcif_device,
&lcdc1_device, &lcdc1_device,
&lcdc_device, &lcdc_device,
......
...@@ -259,21 +259,6 @@ struct platform_device s3c_device_iis = { ...@@ -259,21 +259,6 @@ struct platform_device s3c_device_iis = {
EXPORT_SYMBOL(s3c_device_iis); EXPORT_SYMBOL(s3c_device_iis);
/* ASoC PCM DMA */
static u64 s3c_device_audio_dmamask = 0xffffffffUL;
struct platform_device s3c_device_pcm = {
.name = "s3c24xx-pcm-audio",
.id = -1,
.dev = {
.dma_mask = &s3c_device_audio_dmamask,
.coherent_dma_mask = 0xffffffffUL
}
};
EXPORT_SYMBOL(s3c_device_pcm);
/* RTC */ /* RTC */
static struct resource s3c_rtc_resource[] = { static struct resource s3c_rtc_resource[] = {
...@@ -496,8 +481,10 @@ static struct resource s3c_ac97_resource[] = { ...@@ -496,8 +481,10 @@ static struct resource s3c_ac97_resource[] = {
}, },
}; };
static u64 s3c_device_audio_dmamask = 0xffffffffUL;
struct platform_device s3c_device_ac97 = { struct platform_device s3c_device_ac97 = {
.name = "s3c-ac97", .name = "samsung-ac97",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(s3c_ac97_resource), .num_resources = ARRAY_SIZE(s3c_ac97_resource),
.resource = s3c_ac97_resource, .resource = s3c_ac97_resource,
......
...@@ -17,6 +17,7 @@ obj-y += clock.o ...@@ -17,6 +17,7 @@ obj-y += clock.o
obj-y += pwm-clock.o obj-y += pwm-clock.o
obj-y += gpio.o obj-y += gpio.o
obj-y += gpio-config.o obj-y += gpio-config.o
obj-y += dev-asocdma.o
obj-$(CONFIG_SAMSUNG_GPIOLIB_4BIT) += gpiolib.o obj-$(CONFIG_SAMSUNG_GPIOLIB_4BIT) += gpiolib.o
obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o
......
/* linux/arch/arm/plat-samsung/dev-asocdma.c
*
* Copyright (c) 2010 Samsung Electronics Co. Ltd
* Jaswinder Singh <jassi.brar@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <plat/devs.h>
static u64 audio_dmamask = DMA_BIT_MASK(32);
struct platform_device samsung_asoc_dma = {
.name = "samsung-audio",
.id = -1,
.dev = {
.dma_mask = &audio_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}
};
EXPORT_SYMBOL(samsung_asoc_dma);
...@@ -25,10 +25,34 @@ extern void s3c64xx_ac97_setup_gpio(int); ...@@ -25,10 +25,34 @@ extern void s3c64xx_ac97_setup_gpio(int);
#define S5PC100_SPDIF_GPG3 1 #define S5PC100_SPDIF_GPG3 1
extern void s5pc100_spdif_setup_gpio(int); extern void s5pc100_spdif_setup_gpio(int);
struct samsung_i2s {
/* If the Primary DAI has 5.1 Channels */
#define QUIRK_PRI_6CHAN (1 << 0)
/* If the I2S block has a Stereo Overlay Channel */
#define QUIRK_SEC_DAI (1 << 1)
/*
* If the I2S block has no internal prescalar or MUX (I2SMOD[10] bit)
* The Machine driver must provide suitably set clock to the I2S block.
*/
#define QUIRK_NO_MUXPSR (1 << 2)
#define QUIRK_NEED_RSTCLR (1 << 3)
/* Quirks of the I2S controller */
u32 quirks;
/*
* Array of clock names that can be used to generate I2S signals.
* Also corresponds to clocks of I2SMOD[10]
*/
const char **src_clk;
};
/** /**
* struct s3c_audio_pdata - common platform data for audio device drivers * struct s3c_audio_pdata - common platform data for audio device drivers
* @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
*/ */
struct s3c_audio_pdata { struct s3c_audio_pdata {
int (*cfg_gpio)(struct platform_device *); int (*cfg_gpio)(struct platform_device *);
union {
struct samsung_i2s i2s;
} type;
}; };
...@@ -32,7 +32,7 @@ extern struct platform_device s3c64xx_device_iisv4; ...@@ -32,7 +32,7 @@ extern struct platform_device s3c64xx_device_iisv4;
extern struct platform_device s3c64xx_device_spi0; extern struct platform_device s3c64xx_device_spi0;
extern struct platform_device s3c64xx_device_spi1; extern struct platform_device s3c64xx_device_spi1;
extern struct platform_device s3c_device_pcm; extern struct platform_device samsung_asoc_dma;
extern struct platform_device s3c64xx_device_pcm0; extern struct platform_device s3c64xx_device_pcm0;
extern struct platform_device s3c64xx_device_pcm1; extern struct platform_device s3c64xx_device_pcm1;
...@@ -96,6 +96,15 @@ extern struct platform_device s5pv210_device_iis1; ...@@ -96,6 +96,15 @@ extern struct platform_device s5pv210_device_iis1;
extern struct platform_device s5pv210_device_iis2; extern struct platform_device s5pv210_device_iis2;
extern struct platform_device s5pv210_device_spdif; extern struct platform_device s5pv210_device_spdif;
extern struct platform_device s5pv310_device_ac97;
extern struct platform_device s5pv310_device_pcm0;
extern struct platform_device s5pv310_device_pcm1;
extern struct platform_device s5pv310_device_pcm2;
extern struct platform_device s5pv310_device_i2s0;
extern struct platform_device s5pv310_device_i2s1;
extern struct platform_device s5pv310_device_i2s2;
extern struct platform_device s5pv310_device_spdif;
extern struct platform_device s5p6442_device_pcm0; extern struct platform_device s5p6442_device_pcm0;
extern struct platform_device s5p6442_device_pcm1; extern struct platform_device s5p6442_device_pcm1;
extern struct platform_device s5p6442_device_iis0; extern struct platform_device s5p6442_device_iis0;
......
...@@ -318,6 +318,10 @@ static struct platform_device fsi_device = { ...@@ -318,6 +318,10 @@ static struct platform_device fsi_device = {
}, },
}; };
static struct platform_device fsi_ak4642_device = {
.name = "sh_fsi_a_ak4642",
};
/* KEYSC in SoC (Needs SW33-2 set to ON) */ /* KEYSC in SoC (Needs SW33-2 set to ON) */
static struct sh_keysc_info keysc_info = { static struct sh_keysc_info keysc_info = {
.mode = SH_KEYSC_MODE_1, .mode = SH_KEYSC_MODE_1,
...@@ -590,6 +594,7 @@ static struct platform_device *ms7724se_devices[] __initdata = { ...@@ -590,6 +594,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
&sh7724_usb0_host_device, &sh7724_usb0_host_device,
&sh7724_usb1_gadget_device, &sh7724_usb1_gadget_device,
&fsi_device, &fsi_device,
&fsi_ak4642_device,
&sdhi0_cn7_device, &sdhi0_cn7_device,
&sdhi1_cn8_device, &sdhi1_cn8_device,
&irda_device, &irda_device,
......
...@@ -35,6 +35,29 @@ static inline struct wm8994_gpio *to_wm8994_gpio(struct gpio_chip *chip) ...@@ -35,6 +35,29 @@ static inline struct wm8994_gpio *to_wm8994_gpio(struct gpio_chip *chip)
return container_of(chip, struct wm8994_gpio, gpio_chip); return container_of(chip, struct wm8994_gpio, gpio_chip);
} }
static int wm8994_gpio_request(struct gpio_chip *chip, unsigned offset)
{
struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
struct wm8994 *wm8994 = wm8994_gpio->wm8994;
switch (wm8994->type) {
case WM8958:
switch (offset) {
case 1:
case 2:
case 3:
case 4:
case 6:
return -EINVAL;
}
break;
default:
break;
}
return 0;
}
static int wm8994_gpio_direction_in(struct gpio_chip *chip, unsigned offset) static int wm8994_gpio_direction_in(struct gpio_chip *chip, unsigned offset)
{ {
struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
...@@ -136,6 +159,7 @@ static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) ...@@ -136,6 +159,7 @@ static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
static struct gpio_chip template_chip = { static struct gpio_chip template_chip = {
.label = "wm8994", .label = "wm8994",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.request = wm8994_gpio_request,
.direction_input = wm8994_gpio_direction_in, .direction_input = wm8994_gpio_direction_in,
.get = wm8994_gpio_get, .get = wm8994_gpio_get,
.direction_output = wm8994_gpio_direction_out, .direction_output = wm8994_gpio_direction_out,
......
...@@ -218,6 +218,18 @@ static const char *wm8994_main_supplies[] = { ...@@ -218,6 +218,18 @@ static const char *wm8994_main_supplies[] = {
"SPKVDD2", "SPKVDD2",
}; };
static const char *wm8958_main_supplies[] = {
"DBVDD1",
"DBVDD2",
"DBVDD3",
"DCVDD",
"AVDD1",
"AVDD2",
"CPVDD",
"SPKVDD1",
"SPKVDD2",
};
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int wm8994_device_suspend(struct device *dev) static int wm8994_device_suspend(struct device *dev)
{ {
...@@ -239,7 +251,7 @@ static int wm8994_device_suspend(struct device *dev) ...@@ -239,7 +251,7 @@ static int wm8994_device_suspend(struct device *dev)
if (ret < 0) if (ret < 0)
dev_err(dev, "Failed to save LDO registers: %d\n", ret); dev_err(dev, "Failed to save LDO registers: %d\n", ret);
ret = regulator_bulk_disable(ARRAY_SIZE(wm8994_main_supplies), ret = regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(dev, "Failed to disable supplies: %d\n", ret); dev_err(dev, "Failed to disable supplies: %d\n", ret);
...@@ -254,7 +266,7 @@ static int wm8994_device_resume(struct device *dev) ...@@ -254,7 +266,7 @@ static int wm8994_device_resume(struct device *dev)
struct wm8994 *wm8994 = dev_get_drvdata(dev); struct wm8994 *wm8994 = dev_get_drvdata(dev);
int ret; int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(wm8994_main_supplies), ret = regulator_bulk_enable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(dev, "Failed to enable supplies: %d\n", ret); dev_err(dev, "Failed to enable supplies: %d\n", ret);
...@@ -305,9 +317,10 @@ static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo) ...@@ -305,9 +317,10 @@ static int wm8994_ldo_in_use(struct wm8994_pdata *pdata, int ldo)
/* /*
* Instantiate the generic non-control parts of the device. * Instantiate the generic non-control parts of the device.
*/ */
static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) static int wm8994_device_init(struct wm8994 *wm8994, int irq)
{ {
struct wm8994_pdata *pdata = wm8994->dev->platform_data; struct wm8994_pdata *pdata = wm8994->dev->platform_data;
const char *devname;
int ret, i; int ret, i;
mutex_init(&wm8994->io_lock); mutex_init(&wm8994->io_lock);
...@@ -323,25 +336,48 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) ...@@ -323,25 +336,48 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq)
goto err; goto err;
} }
switch (wm8994->type) {
case WM8994:
wm8994->num_supplies = ARRAY_SIZE(wm8994_main_supplies);
break;
case WM8958:
wm8994->num_supplies = ARRAY_SIZE(wm8958_main_supplies);
break;
default:
BUG();
return -EINVAL;
}
wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) * wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) *
ARRAY_SIZE(wm8994_main_supplies), wm8994->num_supplies,
GFP_KERNEL); GFP_KERNEL);
if (!wm8994->supplies) { if (!wm8994->supplies) {
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
} }
for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++) switch (wm8994->type) {
wm8994->supplies[i].supply = wm8994_main_supplies[i]; case WM8994:
for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++)
ret = regulator_bulk_get(wm8994->dev, ARRAY_SIZE(wm8994_main_supplies), wm8994->supplies[i].supply = wm8994_main_supplies[i];
break;
case WM8958:
for (i = 0; i < ARRAY_SIZE(wm8958_main_supplies); i++)
wm8994->supplies[i].supply = wm8958_main_supplies[i];
break;
default:
BUG();
return -EINVAL;
}
ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);
goto err_supplies; goto err_supplies;
} }
ret = regulator_bulk_enable(ARRAY_SIZE(wm8994_main_supplies), ret = regulator_bulk_enable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret);
...@@ -353,7 +389,22 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) ...@@ -353,7 +389,22 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq)
dev_err(wm8994->dev, "Failed to read ID register\n"); dev_err(wm8994->dev, "Failed to read ID register\n");
goto err_enable; goto err_enable;
} }
if (ret != 0x8994) { switch (ret) {
case 0x8994:
devname = "WM8994";
if (wm8994->type != WM8994)
dev_warn(wm8994->dev, "Device registered as type %d\n",
wm8994->type);
wm8994->type = WM8994;
break;
case 0x8958:
devname = "WM8958";
if (wm8994->type != WM8958)
dev_warn(wm8994->dev, "Device registered as type %d\n",
wm8994->type);
wm8994->type = WM8958;
break;
default:
dev_err(wm8994->dev, "Device is not a WM8994, ID is %x\n", dev_err(wm8994->dev, "Device is not a WM8994, ID is %x\n",
ret); ret);
ret = -EINVAL; ret = -EINVAL;
...@@ -370,14 +421,16 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) ...@@ -370,14 +421,16 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq)
switch (ret) { switch (ret) {
case 0: case 0:
case 1: case 1:
dev_warn(wm8994->dev, "revision %c not fully supported\n", if (wm8994->type == WM8994)
'A' + ret); dev_warn(wm8994->dev,
"revision %c not fully supported\n",
'A' + ret);
break; break;
default: default:
dev_info(wm8994->dev, "revision %c\n", 'A' + ret);
break; break;
} }
dev_info(wm8994->dev, "%s revision %c\n", devname, 'A' + ret);
if (pdata) { if (pdata) {
wm8994->irq_base = pdata->irq_base; wm8994->irq_base = pdata->irq_base;
...@@ -423,10 +476,10 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq) ...@@ -423,10 +476,10 @@ static int wm8994_device_init(struct wm8994 *wm8994, unsigned long id, int irq)
err_irq: err_irq:
wm8994_irq_exit(wm8994); wm8994_irq_exit(wm8994);
err_enable: err_enable:
regulator_bulk_disable(ARRAY_SIZE(wm8994_main_supplies), regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
err_get: err_get:
regulator_bulk_free(ARRAY_SIZE(wm8994_main_supplies), wm8994->supplies); regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
err_supplies: err_supplies:
kfree(wm8994->supplies); kfree(wm8994->supplies);
err: err:
...@@ -439,9 +492,9 @@ static void wm8994_device_exit(struct wm8994 *wm8994) ...@@ -439,9 +492,9 @@ static void wm8994_device_exit(struct wm8994 *wm8994)
{ {
mfd_remove_devices(wm8994->dev); mfd_remove_devices(wm8994->dev);
wm8994_irq_exit(wm8994); wm8994_irq_exit(wm8994);
regulator_bulk_disable(ARRAY_SIZE(wm8994_main_supplies), regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
regulator_bulk_free(ARRAY_SIZE(wm8994_main_supplies), wm8994->supplies); regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
kfree(wm8994->supplies); kfree(wm8994->supplies);
kfree(wm8994); kfree(wm8994);
} }
...@@ -506,8 +559,9 @@ static int wm8994_i2c_probe(struct i2c_client *i2c, ...@@ -506,8 +559,9 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
wm8994->read_dev = wm8994_i2c_read_device; wm8994->read_dev = wm8994_i2c_read_device;
wm8994->write_dev = wm8994_i2c_write_device; wm8994->write_dev = wm8994_i2c_write_device;
wm8994->irq = i2c->irq; wm8994->irq = i2c->irq;
wm8994->type = id->driver_data;
return wm8994_device_init(wm8994, id->driver_data, i2c->irq); return wm8994_device_init(wm8994, i2c->irq);
} }
static int wm8994_i2c_remove(struct i2c_client *i2c) static int wm8994_i2c_remove(struct i2c_client *i2c)
...@@ -535,7 +589,8 @@ static int wm8994_i2c_resume(struct i2c_client *i2c) ...@@ -535,7 +589,8 @@ static int wm8994_i2c_resume(struct i2c_client *i2c)
#endif #endif
static const struct i2c_device_id wm8994_i2c_id[] = { static const struct i2c_device_id wm8994_i2c_id[] = {
{ "wm8994", 0 }, { "wm8994", WM8994 },
{ "wm8958", WM8958 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id); MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id);
......
...@@ -130,10 +130,19 @@ static struct regulator_ops wm8994_ldo1_ops = { ...@@ -130,10 +130,19 @@ static struct regulator_ops wm8994_ldo1_ops = {
static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev, static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev,
unsigned int selector) unsigned int selector)
{ {
struct wm8994_ldo *ldo = rdev_get_drvdata(rdev);
if (selector > WM8994_LDO2_MAX_SELECTOR) if (selector > WM8994_LDO2_MAX_SELECTOR)
return -EINVAL; return -EINVAL;
return (selector * 100000) + 900000; switch (ldo->wm8994->type) {
case WM8994:
return (selector * 100000) + 900000;
case WM8958:
return (selector * 100000) + 1000000;
default:
return -EINVAL;
}
} }
static int wm8994_ldo2_get_voltage_sel(struct regulator_dev *rdev) static int wm8994_ldo2_get_voltage_sel(struct regulator_dev *rdev)
...@@ -154,7 +163,17 @@ static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev, ...@@ -154,7 +163,17 @@ static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev,
struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); struct wm8994_ldo *ldo = rdev_get_drvdata(rdev);
int selector, v; int selector, v;
selector = (min_uV - 900000) / 100000; switch (ldo->wm8994->type) {
case WM8994:
selector = (min_uV - 900000) / 100000;
break;
case WM8958:
selector = (min_uV - 1000000) / 100000;
break;
default:
return -EINVAL;
}
v = wm8994_ldo2_list_voltage(rdev, selector); v = wm8994_ldo2_list_voltage(rdev, selector);
if (v < 0 || v > max_uV) if (v < 0 || v > max_uV)
return -EINVAL; return -EINVAL;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
#include <sound/initval.h> #include <sound/initval.h>
......
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
enum wm8994_type {
WM8994 = 0,
WM8958 = 1,
};
struct regulator_dev; struct regulator_dev;
struct regulator_bulk_data; struct regulator_bulk_data;
...@@ -48,6 +53,8 @@ struct wm8994 { ...@@ -48,6 +53,8 @@ struct wm8994 {
struct mutex io_lock; struct mutex io_lock;
struct mutex irq_lock; struct mutex irq_lock;
enum wm8994_type type;
struct device *dev; struct device *dev;
int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, int (*read_dev)(struct wm8994 *wm8994, unsigned short reg,
int bytes, void *dest); int bytes, void *dest);
...@@ -68,6 +75,7 @@ struct wm8994 { ...@@ -68,6 +75,7 @@ struct wm8994 {
u16 gpio_regs[WM8994_NUM_GPIO_REGS]; u16 gpio_regs[WM8994_NUM_GPIO_REGS];
struct regulator_dev *dbvdd; struct regulator_dev *dbvdd;
int num_supplies;
struct regulator_bulk_data *supplies; struct regulator_bulk_data *supplies;
}; };
......
...@@ -30,6 +30,8 @@ struct wm8994_ldo_pdata { ...@@ -30,6 +30,8 @@ struct wm8994_ldo_pdata {
#define WM8994_DRC_REGS 5 #define WM8994_DRC_REGS 5
#define WM8994_EQ_REGS 20 #define WM8994_EQ_REGS 20
#define WM8958_MBC_CUTOFF_REGS 20
#define WM8958_MBC_COEFF_REGS 48
/** /**
* DRC configurations are specified with a label and a set of register * DRC configurations are specified with a label and a set of register
...@@ -59,6 +61,18 @@ struct wm8994_retune_mobile_cfg { ...@@ -59,6 +61,18 @@ struct wm8994_retune_mobile_cfg {
u16 regs[WM8994_EQ_REGS]; u16 regs[WM8994_EQ_REGS];
}; };
/**
* Multiband compressor configurations are specified with a label and
* two sets of values to write. Configurations are expected to be
* generated using the multiband compressor configuration panel in
* WISCE - see http://www.wolfsonmicro.com/wisce/
*/
struct wm8958_mbc_cfg {
const char *name;
u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS];
u16 coeff_regs[WM8958_MBC_COEFF_REGS];
};
struct wm8994_pdata { struct wm8994_pdata {
int gpio_base; int gpio_base;
...@@ -78,6 +92,9 @@ struct wm8994_pdata { ...@@ -78,6 +92,9 @@ struct wm8994_pdata {
int num_retune_mobile_cfgs; int num_retune_mobile_cfgs;
struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; struct wm8994_retune_mobile_cfg *retune_mobile_cfgs;
int num_mbc_cfgs;
struct wm8958_mbc_cfg *mbc_cfgs;
/* LINEOUT can be differential or single ended */ /* LINEOUT can be differential or single ended */
unsigned int lineout1_diff:1; unsigned int lineout1_diff:1;
unsigned int lineout2_diff:1; unsigned int lineout2_diff:1;
......
...@@ -64,12 +64,16 @@ ...@@ -64,12 +64,16 @@
#define WM8994_LDO_1 0x3B #define WM8994_LDO_1 0x3B
#define WM8994_LDO_2 0x3C #define WM8994_LDO_2 0x3C
#define WM8994_CHARGE_PUMP_1 0x4C #define WM8994_CHARGE_PUMP_1 0x4C
#define WM8958_CHARGE_PUMP_2 0x4D
#define WM8994_CLASS_W_1 0x51 #define WM8994_CLASS_W_1 0x51
#define WM8994_DC_SERVO_1 0x54 #define WM8994_DC_SERVO_1 0x54
#define WM8994_DC_SERVO_2 0x55 #define WM8994_DC_SERVO_2 0x55
#define WM8994_DC_SERVO_4 0x57 #define WM8994_DC_SERVO_4 0x57
#define WM8994_DC_SERVO_READBACK 0x58 #define WM8994_DC_SERVO_READBACK 0x58
#define WM8994_ANALOGUE_HP_1 0x60 #define WM8994_ANALOGUE_HP_1 0x60
#define WM8958_MIC_DETECT_1 0xD0
#define WM8958_MIC_DETECT_2 0xD1
#define WM8958_MIC_DETECT_3 0xD2
#define WM8994_CHIP_REVISION 0x100 #define WM8994_CHIP_REVISION 0x100
#define WM8994_CONTROL_INTERFACE 0x101 #define WM8994_CONTROL_INTERFACE 0x101
#define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 #define WM8994_WRITE_SEQUENCER_CTRL_1 0x110
...@@ -109,6 +113,10 @@ ...@@ -109,6 +113,10 @@
#define WM8994_AIF2DAC_LRCLK 0x315 #define WM8994_AIF2DAC_LRCLK 0x315
#define WM8994_AIF2DAC_DATA 0x316 #define WM8994_AIF2DAC_DATA 0x316
#define WM8994_AIF2ADC_DATA 0x317 #define WM8994_AIF2ADC_DATA 0x317
#define WM8958_AIF3_CONTROL_1 0x320
#define WM8958_AIF3_CONTROL_2 0x321
#define WM8958_AIF3DAC_DATA 0x322
#define WM8958_AIF3ADC_DATA 0x323
#define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 #define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400
#define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 #define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401
#define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 #define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402
...@@ -242,6 +250,83 @@ ...@@ -242,6 +250,83 @@
#define WM8994_INTERRUPT_STATUS_2_MASK 0x739 #define WM8994_INTERRUPT_STATUS_2_MASK 0x739
#define WM8994_INTERRUPT_CONTROL 0x740 #define WM8994_INTERRUPT_CONTROL 0x740
#define WM8994_IRQ_DEBOUNCE 0x748 #define WM8994_IRQ_DEBOUNCE 0x748
#define WM8958_DSP2_PROGRAM 0x900
#define WM8958_DSP2_CONFIG 0x901
#define WM8958_DSP2_MAGICNUM 0xA00
#define WM8958_DSP2_RELEASEYEAR 0xA01
#define WM8958_DSP2_RELEASEMONTHDAY 0xA02
#define WM8958_DSP2_RELEASETIME 0xA03
#define WM8958_DSP2_VERMAJMIN 0xA04
#define WM8958_DSP2_VERBUILD 0xA05
#define WM8958_DSP2_EXECCONTROL 0xA0D
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_2 0x2203
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_1 0x2204
#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_2 0x2205
#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_1 0x2206
#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_2 0x2207
#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_1 0x2208
#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_2 0x2209
#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_1 0x220A
#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_2 0x220B
#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_1 0x220C
#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_2 0x220D
#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_1 0x220E
#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_2 0x220F
#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_1 0x2210
#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_2 0x2211
#define WM8958_MBC_BAND_1_LOWER_CUTOFF_1 0x2212
#define WM8958_MBC_BAND_1_LOWER_CUTOFF_2 0x2213
#define WM8958_MBC_BAND_1_K_1 0x2400
#define WM8958_MBC_BAND_1_K_2 0x2401
#define WM8958_MBC_BAND_1_N1_1 0x2402
#define WM8958_MBC_BAND_1_N1_2 0x2403
#define WM8958_MBC_BAND_1_N2_1 0x2404
#define WM8958_MBC_BAND_1_N2_2 0x2405
#define WM8958_MBC_BAND_1_N3_1 0x2406
#define WM8958_MBC_BAND_1_N3_2 0x2407
#define WM8958_MBC_BAND_1_N4_1 0x2408
#define WM8958_MBC_BAND_1_N4_2 0x2409
#define WM8958_MBC_BAND_1_N5_1 0x240A
#define WM8958_MBC_BAND_1_N5_2 0x240B
#define WM8958_MBC_BAND_1_X1_1 0x240C
#define WM8958_MBC_BAND_1_X1_2 0x240D
#define WM8958_MBC_BAND_1_X2_1 0x240E
#define WM8958_MBC_BAND_1_X2_2 0x240F
#define WM8958_MBC_BAND_1_X3_1 0x2410
#define WM8958_MBC_BAND_1_X3_2 0x2411
#define WM8958_MBC_BAND_1_ATTACK_1 0x2412
#define WM8958_MBC_BAND_1_ATTACK_2 0x2413
#define WM8958_MBC_BAND_1_DECAY_1 0x2414
#define WM8958_MBC_BAND_1_DECAY_2 0x2415
#define WM8958_MBC_BAND_2_K_1 0x2416
#define WM8958_MBC_BAND_2_K_2 0x2417
#define WM8958_MBC_BAND_2_N1_1 0x2418
#define WM8958_MBC_BAND_2_N1_2 0x2419
#define WM8958_MBC_BAND_2_N2_1 0x241A
#define WM8958_MBC_BAND_2_N2_2 0x241B
#define WM8958_MBC_BAND_2_N3_1 0x241C
#define WM8958_MBC_BAND_2_N3_2 0x241D
#define WM8958_MBC_BAND_2_N4_1 0x241E
#define WM8958_MBC_BAND_2_N4_2 0x241F
#define WM8958_MBC_BAND_2_N5_1 0x2420
#define WM8958_MBC_BAND_2_N5_2 0x2421
#define WM8958_MBC_BAND_2_X1_1 0x2422
#define WM8958_MBC_BAND_2_X1_2 0x2423
#define WM8958_MBC_BAND_2_X2_1 0x2424
#define WM8958_MBC_BAND_2_X2_2 0x2425
#define WM8958_MBC_BAND_2_X3_1 0x2426
#define WM8958_MBC_BAND_2_X3_2 0x2427
#define WM8958_MBC_BAND_2_ATTACK_1 0x2428
#define WM8958_MBC_BAND_2_ATTACK_2 0x2429
#define WM8958_MBC_BAND_2_DECAY_1 0x242A
#define WM8958_MBC_BAND_2_DECAY_2 0x242B
#define WM8958_MBC_B2_PG2_1 0x242C
#define WM8958_MBC_B2_PG2_2 0x242D
#define WM8958_MBC_B1_PG2_1 0x242E
#define WM8958_MBC_B1_PG2_2 0x242F
#define WM8994_WRITE_SEQUENCER_0 0x3000 #define WM8994_WRITE_SEQUENCER_0 0x3000
#define WM8994_WRITE_SEQUENCER_1 0x3001 #define WM8994_WRITE_SEQUENCER_1 0x3001
#define WM8994_WRITE_SEQUENCER_2 0x3002 #define WM8994_WRITE_SEQUENCER_2 0x3002
...@@ -992,6 +1077,12 @@ ...@@ -992,6 +1077,12 @@
/* /*
* R6 (0x06) - Power Management (6) * R6 (0x06) - Power Management (6)
*/ */
#define WM8958_AIF3ADC_SRC_MASK 0x0600 /* AIF3ADC_SRC - [10:9] */
#define WM8958_AIF3ADC_SRC_SHIFT 9 /* AIF3ADC_SRC - [10:9] */
#define WM8958_AIF3ADC_SRC_WIDTH 2 /* AIF3ADC_SRC - [10:9] */
#define WM8958_AIF2DAC_SRC_MASK 0x0180 /* AIF2DAC_SRC - [8:7] */
#define WM8958_AIF2DAC_SRC_SHIFT 7 /* AIF2DAC_SRC - [8:7] */
#define WM8958_AIF2DAC_SRC_WIDTH 2 /* AIF2DAC_SRC - [8:7] */
#define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ #define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */
#define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ #define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */
#define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ #define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */
...@@ -1835,6 +1926,14 @@ ...@@ -1835,6 +1926,14 @@
#define WM8994_CP_ENA_SHIFT 15 /* CP_ENA */ #define WM8994_CP_ENA_SHIFT 15 /* CP_ENA */
#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ #define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */
/*
* R77 (0x4D) - Charge Pump (2)
*/
#define WM8958_CP_DISCH 0x8000 /* CP_DISCH */
#define WM8958_CP_DISCH_MASK 0x8000 /* CP_DISCH */
#define WM8958_CP_DISCH_SHIFT 15 /* CP_DISCH */
#define WM8958_CP_DISCH_WIDTH 1 /* CP_DISCH */
/* /*
* R81 (0x51) - Class W (1) * R81 (0x51) - Class W (1)
*/ */
...@@ -1951,6 +2050,46 @@ ...@@ -1951,6 +2050,46 @@
#define WM8994_HPOUT1R_DLY_SHIFT 1 /* HPOUT1R_DLY */ #define WM8994_HPOUT1R_DLY_SHIFT 1 /* HPOUT1R_DLY */
#define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ #define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */
/*
* R208 (0xD0) - Mic Detect 1
*/
#define WM8958_MICD_BIAS_STARTTIME_MASK 0xF000 /* MICD_BIAS_STARTTIME - [15:12] */
#define WM8958_MICD_BIAS_STARTTIME_SHIFT 12 /* MICD_BIAS_STARTTIME - [15:12] */
#define WM8958_MICD_BIAS_STARTTIME_WIDTH 4 /* MICD_BIAS_STARTTIME - [15:12] */
#define WM8958_MICD_RATE_MASK 0x0F00 /* MICD_RATE - [11:8] */
#define WM8958_MICD_RATE_SHIFT 8 /* MICD_RATE - [11:8] */
#define WM8958_MICD_RATE_WIDTH 4 /* MICD_RATE - [11:8] */
#define WM8958_MICD_DBTIME 0x0002 /* MICD_DBTIME */
#define WM8958_MICD_DBTIME_MASK 0x0002 /* MICD_DBTIME */
#define WM8958_MICD_DBTIME_SHIFT 1 /* MICD_DBTIME */
#define WM8958_MICD_DBTIME_WIDTH 1 /* MICD_DBTIME */
#define WM8958_MICD_ENA 0x0001 /* MICD_ENA */
#define WM8958_MICD_ENA_MASK 0x0001 /* MICD_ENA */
#define WM8958_MICD_ENA_SHIFT 0 /* MICD_ENA */
#define WM8958_MICD_ENA_WIDTH 1 /* MICD_ENA */
/*
* R209 (0xD1) - Mic Detect 2
*/
#define WM8958_MICD_LVL_SEL_MASK 0x00FF /* MICD_LVL_SEL - [7:0] */
#define WM8958_MICD_LVL_SEL_SHIFT 0 /* MICD_LVL_SEL - [7:0] */
#define WM8958_MICD_LVL_SEL_WIDTH 8 /* MICD_LVL_SEL - [7:0] */
/*
* R210 (0xD2) - Mic Detect 3
*/
#define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
#define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
#define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
#define WM8958_MICD_VALID 0x0002 /* MICD_VALID */
#define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */
#define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */
#define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */
#define WM8958_MICD_STS 0x0001 /* MICD_STS */
#define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */
#define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */
#define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */
/* /*
* R256 (0x100) - Chip Revision * R256 (0x100) - Chip Revision
*/ */
...@@ -2069,6 +2208,14 @@ ...@@ -2069,6 +2208,14 @@
/* /*
* R520 (0x208) - Clocking (1) * R520 (0x208) - Clocking (1)
*/ */
#define WM8958_DSP2CLK_ENA 0x4000 /* DSP2CLK_ENA */
#define WM8958_DSP2CLK_ENA_MASK 0x4000 /* DSP2CLK_ENA */
#define WM8958_DSP2CLK_ENA_SHIFT 14 /* DSP2CLK_ENA */
#define WM8958_DSP2CLK_ENA_WIDTH 1 /* DSP2CLK_ENA */
#define WM8958_DSP2CLK_SRC 0x1000 /* DSP2CLK_SRC */
#define WM8958_DSP2CLK_SRC_MASK 0x1000 /* DSP2CLK_SRC */
#define WM8958_DSP2CLK_SRC_SHIFT 12 /* DSP2CLK_SRC */
#define WM8958_DSP2CLK_SRC_WIDTH 1 /* DSP2CLK_SRC */
#define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ #define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */
#define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ #define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */
#define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ #define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */
...@@ -2552,6 +2699,63 @@ ...@@ -2552,6 +2699,63 @@
#define WM8994_AIF2ADCR_DAT_INV_SHIFT 0 /* AIF2ADCR_DAT_INV */ #define WM8994_AIF2ADCR_DAT_INV_SHIFT 0 /* AIF2ADCR_DAT_INV */
#define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ #define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */
/*
* R800 (0x320) - AIF3 Control (1)
*/
#define WM8958_AIF3_LRCLK_INV 0x0080 /* AIF3_LRCLK_INV */
#define WM8958_AIF3_LRCLK_INV_MASK 0x0080 /* AIF3_LRCLK_INV */
#define WM8958_AIF3_LRCLK_INV_SHIFT 7 /* AIF3_LRCLK_INV */
#define WM8958_AIF3_LRCLK_INV_WIDTH 1 /* AIF3_LRCLK_INV */
#define WM8958_AIF3_WL_MASK 0x0060 /* AIF3_WL - [6:5] */
#define WM8958_AIF3_WL_SHIFT 5 /* AIF3_WL - [6:5] */
#define WM8958_AIF3_WL_WIDTH 2 /* AIF3_WL - [6:5] */
#define WM8958_AIF3_FMT_MASK 0x0018 /* AIF3_FMT - [4:3] */
#define WM8958_AIF3_FMT_SHIFT 3 /* AIF3_FMT - [4:3] */
#define WM8958_AIF3_FMT_WIDTH 2 /* AIF3_FMT - [4:3] */
/*
* R801 (0x321) - AIF3 Control (2)
*/
#define WM8958_AIF3DAC_BOOST_MASK 0x0C00 /* AIF3DAC_BOOST - [11:10] */
#define WM8958_AIF3DAC_BOOST_SHIFT 10 /* AIF3DAC_BOOST - [11:10] */
#define WM8958_AIF3DAC_BOOST_WIDTH 2 /* AIF3DAC_BOOST - [11:10] */
#define WM8958_AIF3DAC_COMP 0x0010 /* AIF3DAC_COMP */
#define WM8958_AIF3DAC_COMP_MASK 0x0010 /* AIF3DAC_COMP */
#define WM8958_AIF3DAC_COMP_SHIFT 4 /* AIF3DAC_COMP */
#define WM8958_AIF3DAC_COMP_WIDTH 1 /* AIF3DAC_COMP */
#define WM8958_AIF3DAC_COMPMODE 0x0008 /* AIF3DAC_COMPMODE */
#define WM8958_AIF3DAC_COMPMODE_MASK 0x0008 /* AIF3DAC_COMPMODE */
#define WM8958_AIF3DAC_COMPMODE_SHIFT 3 /* AIF3DAC_COMPMODE */
#define WM8958_AIF3DAC_COMPMODE_WIDTH 1 /* AIF3DAC_COMPMODE */
#define WM8958_AIF3ADC_COMP 0x0004 /* AIF3ADC_COMP */
#define WM8958_AIF3ADC_COMP_MASK 0x0004 /* AIF3ADC_COMP */
#define WM8958_AIF3ADC_COMP_SHIFT 2 /* AIF3ADC_COMP */
#define WM8958_AIF3ADC_COMP_WIDTH 1 /* AIF3ADC_COMP */
#define WM8958_AIF3ADC_COMPMODE 0x0002 /* AIF3ADC_COMPMODE */
#define WM8958_AIF3ADC_COMPMODE_MASK 0x0002 /* AIF3ADC_COMPMODE */
#define WM8958_AIF3ADC_COMPMODE_SHIFT 1 /* AIF3ADC_COMPMODE */
#define WM8958_AIF3ADC_COMPMODE_WIDTH 1 /* AIF3ADC_COMPMODE */
#define WM8958_AIF3_LOOPBACK 0x0001 /* AIF3_LOOPBACK */
#define WM8958_AIF3_LOOPBACK_MASK 0x0001 /* AIF3_LOOPBACK */
#define WM8958_AIF3_LOOPBACK_SHIFT 0 /* AIF3_LOOPBACK */
#define WM8958_AIF3_LOOPBACK_WIDTH 1 /* AIF3_LOOPBACK */
/*
* R802 (0x322) - AIF3DAC Data
*/
#define WM8958_AIF3DAC_DAT_INV 0x0001 /* AIF3DAC_DAT_INV */
#define WM8958_AIF3DAC_DAT_INV_MASK 0x0001 /* AIF3DAC_DAT_INV */
#define WM8958_AIF3DAC_DAT_INV_SHIFT 0 /* AIF3DAC_DAT_INV */
#define WM8958_AIF3DAC_DAT_INV_WIDTH 1 /* AIF3DAC_DAT_INV */
/*
* R803 (0x323) - AIF3ADC Data
*/
#define WM8958_AIF3ADC_DAT_INV 0x0001 /* AIF3ADC_DAT_INV */
#define WM8958_AIF3ADC_DAT_INV_MASK 0x0001 /* AIF3ADC_DAT_INV */
#define WM8958_AIF3ADC_DAT_INV_SHIFT 0 /* AIF3ADC_DAT_INV */
#define WM8958_AIF3ADC_DAT_INV_WIDTH 1 /* AIF3ADC_DAT_INV */
/* /*
* R1024 (0x400) - AIF1 ADC1 Left Volume * R1024 (0x400) - AIF1 ADC1 Left Volume
*/ */
...@@ -4289,4 +4493,102 @@ ...@@ -4289,4 +4493,102 @@
#define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ #define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */
#define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ #define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */
/*
* R2304 (0x900) - DSP2_Program
*/
#define WM8958_DSP2_ENA 0x0001 /* DSP2_ENA */
#define WM8958_DSP2_ENA_MASK 0x0001 /* DSP2_ENA */
#define WM8958_DSP2_ENA_SHIFT 0 /* DSP2_ENA */
#define WM8958_DSP2_ENA_WIDTH 1 /* DSP2_ENA */
/*
* R2305 (0x901) - DSP2_Config
*/
#define WM8958_MBC_SEL_MASK 0x0030 /* MBC_SEL - [5:4] */
#define WM8958_MBC_SEL_SHIFT 4 /* MBC_SEL - [5:4] */
#define WM8958_MBC_SEL_WIDTH 2 /* MBC_SEL - [5:4] */
#define WM8958_MBC_ENA 0x0001 /* MBC_ENA */
#define WM8958_MBC_ENA_MASK 0x0001 /* MBC_ENA */
#define WM8958_MBC_ENA_SHIFT 0 /* MBC_ENA */
#define WM8958_MBC_ENA_WIDTH 1 /* MBC_ENA */
/*
* R2560 (0xA00) - DSP2_MagicNum
*/
#define WM8958_DSP2_MAGIC_NUM_MASK 0xFFFF /* DSP2_MAGIC_NUM - [15:0] */
#define WM8958_DSP2_MAGIC_NUM_SHIFT 0 /* DSP2_MAGIC_NUM - [15:0] */
#define WM8958_DSP2_MAGIC_NUM_WIDTH 16 /* DSP2_MAGIC_NUM - [15:0] */
/*
* R2561 (0xA01) - DSP2_ReleaseYear
*/
#define WM8958_DSP2_RELEASE_YEAR_MASK 0xFFFF /* DSP2_RELEASE_YEAR - [15:0] */
#define WM8958_DSP2_RELEASE_YEAR_SHIFT 0 /* DSP2_RELEASE_YEAR - [15:0] */
#define WM8958_DSP2_RELEASE_YEAR_WIDTH 16 /* DSP2_RELEASE_YEAR - [15:0] */
/*
* R2562 (0xA02) - DSP2_ReleaseMonthDay
*/
#define WM8958_DSP2_RELEASE_MONTH_MASK 0xFF00 /* DSP2_RELEASE_MONTH - [15:8] */
#define WM8958_DSP2_RELEASE_MONTH_SHIFT 8 /* DSP2_RELEASE_MONTH - [15:8] */
#define WM8958_DSP2_RELEASE_MONTH_WIDTH 8 /* DSP2_RELEASE_MONTH - [15:8] */
#define WM8958_DSP2_RELEASE_DAY_MASK 0x00FF /* DSP2_RELEASE_DAY - [7:0] */
#define WM8958_DSP2_RELEASE_DAY_SHIFT 0 /* DSP2_RELEASE_DAY - [7:0] */
#define WM8958_DSP2_RELEASE_DAY_WIDTH 8 /* DSP2_RELEASE_DAY - [7:0] */
/*
* R2563 (0xA03) - DSP2_ReleaseTime
*/
#define WM8958_DSP2_RELEASE_HOURS_MASK 0xFF00 /* DSP2_RELEASE_HOURS - [15:8] */
#define WM8958_DSP2_RELEASE_HOURS_SHIFT 8 /* DSP2_RELEASE_HOURS - [15:8] */
#define WM8958_DSP2_RELEASE_HOURS_WIDTH 8 /* DSP2_RELEASE_HOURS - [15:8] */
#define WM8958_DSP2_RELEASE_MINS_MASK 0x00FF /* DSP2_RELEASE_MINS - [7:0] */
#define WM8958_DSP2_RELEASE_MINS_SHIFT 0 /* DSP2_RELEASE_MINS - [7:0] */
#define WM8958_DSP2_RELEASE_MINS_WIDTH 8 /* DSP2_RELEASE_MINS - [7:0] */
/*
* R2564 (0xA04) - DSP2_VerMajMin
*/
#define WM8958_DSP2_MAJOR_VER_MASK 0xFF00 /* DSP2_MAJOR_VER - [15:8] */
#define WM8958_DSP2_MAJOR_VER_SHIFT 8 /* DSP2_MAJOR_VER - [15:8] */
#define WM8958_DSP2_MAJOR_VER_WIDTH 8 /* DSP2_MAJOR_VER - [15:8] */
#define WM8958_DSP2_MINOR_VER_MASK 0x00FF /* DSP2_MINOR_VER - [7:0] */
#define WM8958_DSP2_MINOR_VER_SHIFT 0 /* DSP2_MINOR_VER - [7:0] */
#define WM8958_DSP2_MINOR_VER_WIDTH 8 /* DSP2_MINOR_VER - [7:0] */
/*
* R2565 (0xA05) - DSP2_VerBuild
*/
#define WM8958_DSP2_BUILD_VER_MASK 0xFFFF /* DSP2_BUILD_VER - [15:0] */
#define WM8958_DSP2_BUILD_VER_SHIFT 0 /* DSP2_BUILD_VER - [15:0] */
#define WM8958_DSP2_BUILD_VER_WIDTH 16 /* DSP2_BUILD_VER - [15:0] */
/*
* R2573 (0xA0D) - DSP2_ExecControl
*/
#define WM8958_DSP2_STOPC 0x0020 /* DSP2_STOPC */
#define WM8958_DSP2_STOPC_MASK 0x0020 /* DSP2_STOPC */
#define WM8958_DSP2_STOPC_SHIFT 5 /* DSP2_STOPC */
#define WM8958_DSP2_STOPC_WIDTH 1 /* DSP2_STOPC */
#define WM8958_DSP2_STOPS 0x0010 /* DSP2_STOPS */
#define WM8958_DSP2_STOPS_MASK 0x0010 /* DSP2_STOPS */
#define WM8958_DSP2_STOPS_SHIFT 4 /* DSP2_STOPS */
#define WM8958_DSP2_STOPS_WIDTH 1 /* DSP2_STOPS */
#define WM8958_DSP2_STOPI 0x0008 /* DSP2_STOPI */
#define WM8958_DSP2_STOPI_MASK 0x0008 /* DSP2_STOPI */
#define WM8958_DSP2_STOPI_SHIFT 3 /* DSP2_STOPI */
#define WM8958_DSP2_STOPI_WIDTH 1 /* DSP2_STOPI */
#define WM8958_DSP2_STOP 0x0004 /* DSP2_STOP */
#define WM8958_DSP2_STOP_MASK 0x0004 /* DSP2_STOP */
#define WM8958_DSP2_STOP_SHIFT 2 /* DSP2_STOP */
#define WM8958_DSP2_STOP_WIDTH 1 /* DSP2_STOP */
#define WM8958_DSP2_RUNR 0x0002 /* DSP2_RUNR */
#define WM8958_DSP2_RUNR_MASK 0x0002 /* DSP2_RUNR */
#define WM8958_DSP2_RUNR_SHIFT 1 /* DSP2_RUNR */
#define WM8958_DSP2_RUNR_WIDTH 1 /* DSP2_RUNR */
#define WM8958_DSP2_RUN 0x0001 /* DSP2_RUN */
#define WM8958_DSP2_RUN_MASK 0x0001 /* DSP2_RUN */
#define WM8958_DSP2_RUN_SHIFT 0 /* DSP2_RUN */
#define WM8958_DSP2_RUN_WIDTH 1 /* DSP2_RUN */
#endif #endif
#ifndef _INCLUDE_SOUND_ALC5623_H
#define _INCLUDE_SOUND_ALC5623_H
struct alc5623_platform_data {
/* configure : */
/* Lineout/Speaker Amps Vmid ratio control */
/* enable/disable adc/dac high pass filters */
unsigned int add_ctrl;
/* configure : */
/* output to enable when jack is low */
/* output to enable when jack is high */
/* jack detect (gpio/nc/jack detect [12] */
unsigned int jack_det_ctrl;
};
#endif
...@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t; ...@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t;
#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
typedef int __bitwise snd_pcm_state_t; typedef int __bitwise snd_pcm_state_t;
...@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t; ...@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t;
#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
struct snd_interval { struct snd_interval {
unsigned int min, max; unsigned int min, max;
......
...@@ -160,12 +160,14 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id ...@@ -160,12 +160,14 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id
} }
/* /*
* Frequently used control callbacks * Frequently used control callbacks/helpers
*/ */
int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo); struct snd_ctl_elem_info *uinfo);
int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo); struct snd_ctl_elem_info *uinfo);
int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels,
unsigned int items, const char *const names[]);
/* /*
* virtual master control * virtual master control
......
...@@ -28,6 +28,7 @@ enum HDSP_IO_Type { ...@@ -28,6 +28,7 @@ enum HDSP_IO_Type {
Multiface, Multiface,
H9652, H9652,
H9632, H9632,
RPM,
Undefined, Undefined,
}; };
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
/* these minors can still be used for autoloading devices (/dev/aload*) */ /* these minors can still be used for autoloading devices (/dev/aload*) */
#define SNDRV_MINOR_CONTROL 0 /* 0 */ #define SNDRV_MINOR_CONTROL 0 /* 0 */
#define SNDRV_MINOR_GLOBAL 1 /* 1 */ #define SNDRV_MINOR_GLOBAL 1 /* 1 */
#define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) #define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */
#define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */
#ifndef CONFIG_SND_DYNAMIC_MINORS #ifndef CONFIG_SND_DYNAMIC_MINORS
/* 2 - 3 (reserved) */ /* 2 - 3 (reserved) */
......
...@@ -297,6 +297,7 @@ struct snd_pcm_runtime { ...@@ -297,6 +297,7 @@ struct snd_pcm_runtime {
unsigned int info; unsigned int info;
unsigned int rate_num; unsigned int rate_num;
unsigned int rate_den; unsigned int rate_den;
unsigned int no_period_wakeup: 1;
/* -- SW params -- */ /* -- SW params -- */
int tstamp_mode; /* mmap timestamp is updated */ int tstamp_mode; /* mmap timestamp is updated */
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <linux/list.h> #include <linux/list.h>
#include <sound/soc.h>
struct snd_pcm_substream; struct snd_pcm_substream;
/* /*
...@@ -205,7 +203,7 @@ struct snd_soc_dai_driver { ...@@ -205,7 +203,7 @@ struct snd_soc_dai_driver {
int (*resume)(struct snd_soc_dai *dai); int (*resume)(struct snd_soc_dai *dai);
/* ops */ /* ops */
struct snd_soc_dai_ops *ops; const struct snd_soc_dai_ops *ops;
/* DAI capabilities */ /* DAI capabilities */
struct snd_soc_pcm_stream capture; struct snd_soc_pcm_stream capture;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/types.h> #include <linux/types.h>
#include <sound/control.h> #include <sound/control.h>
#include <sound/soc.h>
/* widget has no PM register bit */ /* widget has no PM register bit */
#define SND_SOC_NOPM -1 #define SND_SOC_NOPM -1
...@@ -72,6 +71,10 @@ ...@@ -72,6 +71,10 @@
wcontrols, wncontrols) \ wcontrols, wncontrols) \
{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
wcontrols, wncontrols) \
{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
wcontrols, wncontrols)\ wcontrols, wncontrols)\
{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
...@@ -90,6 +93,9 @@ ...@@ -90,6 +93,9 @@
#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \
.shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
...@@ -116,6 +122,11 @@ ...@@ -116,6 +122,11 @@
{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
.event = wevent, .event_flags = wflags} .event = wevent, .event_flags = wflags}
#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
wncontrols, wevent, wflags) \
{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
.event = wevent, .event_flags = wflags}
#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
wncontrols, wevent, wflags) \ wncontrols, wevent, wflags) \
{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
...@@ -140,6 +151,11 @@ ...@@ -140,6 +151,11 @@
{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
.event = wevent, .event_flags = wflags} .event = wevent, .event_flags = wflags}
#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
wevent, wflags) \
{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
.event = wevent, .event_flags = wflags}
/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
...@@ -219,13 +235,6 @@ ...@@ -219,13 +235,6 @@
.info = snd_soc_info_volsw, \ .info = snd_soc_info_volsw, \
.get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \
power) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
.info = snd_soc_info_volsw, \
.get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
.private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
((max) << 16) | ((invert) << 24) }
#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_volsw, \ .info = snd_soc_info_volsw, \
...@@ -233,15 +242,6 @@ ...@@ -233,15 +242,6 @@
.tlv.p = (tlv_array), \ .tlv.p = (tlv_array), \
.get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
#define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \
power, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
.tlv.p = (tlv_array), \
.info = snd_soc_info_volsw, \
.get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
.private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
((max) << 16) | ((invert) << 24) }
#define SOC_DAPM_ENUM(xname, xenum) \ #define SOC_DAPM_ENUM(xname, xenum) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_enum_double, \ .info = snd_soc_info_enum_double, \
...@@ -297,6 +297,7 @@ enum snd_soc_dapm_type; ...@@ -297,6 +297,7 @@ enum snd_soc_dapm_type;
struct snd_soc_dapm_path; struct snd_soc_dapm_path;
struct snd_soc_dapm_pin; struct snd_soc_dapm_pin;
struct snd_soc_dapm_route; struct snd_soc_dapm_route;
struct snd_soc_dapm_context;
int dapm_reg_event(struct snd_soc_dapm_widget *w, int dapm_reg_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event); struct snd_kcontrol *kcontrol, int event);
...@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, ...@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uncontrol); struct snd_ctl_elem_value *uncontrol);
int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uncontrol); struct snd_ctl_elem_value *uncontrol);
int snd_soc_dapm_new_control(struct snd_soc_codec *codec, int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget); const struct snd_soc_dapm_widget *widget);
int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget, const struct snd_soc_dapm_widget *widget,
int num); int num);
/* dapm path setup */ /* dapm path setup */
int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
void snd_soc_dapm_free(struct snd_soc_codec *codec); void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num); const struct snd_soc_dapm_route *route, int num);
/* dapm events */ /* dapm events */
...@@ -343,27 +344,33 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card); ...@@ -343,27 +344,33 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card);
/* dapm sys fs - used by the core */ /* dapm sys fs - used by the core */
int snd_soc_dapm_sys_add(struct device *dev); int snd_soc_dapm_sys_add(struct device *dev);
void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm);
/* dapm audio pin control and status */ /* dapm audio pin control and status */
int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm,
int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); const char *pin);
int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,
int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); const char *pin);
int snd_soc_dapm_sync(struct snd_soc_codec *codec); int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin);
int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
const char *pin);
int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm);
int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
const char *pin); const char *pin);
int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
const char *pin);
/* dapm widget types */ /* dapm widget types */
enum snd_soc_dapm_type { enum snd_soc_dapm_type {
snd_soc_dapm_input = 0, /* input pin */ snd_soc_dapm_input = 0, /* input pin */
snd_soc_dapm_output, /* output pin */ snd_soc_dapm_output, /* output pin */
snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */
snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */
snd_soc_dapm_mixer, /* mixes several analog signals together */ snd_soc_dapm_mixer, /* mixes several analog signals together */
snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
snd_soc_dapm_out_drv, /* output driver */
snd_soc_dapm_adc, /* analog to digital converter */ snd_soc_dapm_adc, /* analog to digital converter */
snd_soc_dapm_dac, /* digital to analog converter */ snd_soc_dapm_dac, /* digital to analog converter */
snd_soc_dapm_micbias, /* microphone bias (power) */ snd_soc_dapm_micbias, /* microphone bias (power) */
...@@ -425,6 +432,7 @@ struct snd_soc_dapm_widget { ...@@ -425,6 +432,7 @@ struct snd_soc_dapm_widget {
char *sname; /* stream name */ char *sname; /* stream name */
struct snd_soc_codec *codec; struct snd_soc_codec *codec;
struct list_head list; struct list_head list;
struct snd_soc_dapm_context *dapm;
/* dapm control */ /* dapm control */
short reg; /* negative reg = no direct dapm */ short reg; /* negative reg = no direct dapm */
...@@ -461,4 +469,35 @@ struct snd_soc_dapm_widget { ...@@ -461,4 +469,35 @@ struct snd_soc_dapm_widget {
struct list_head power_list; struct list_head power_list;
}; };
struct snd_soc_dapm_update {
struct snd_soc_dapm_widget *widget;
struct snd_kcontrol *kcontrol;
int reg;
int mask;
int val;
};
/* DAPM context */
struct snd_soc_dapm_context {
int n_widgets; /* number of widgets in this context */
enum snd_soc_bias_level bias_level;
enum snd_soc_bias_level suspend_bias_level;
struct delayed_work delayed_work;
unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
struct snd_soc_dapm_update *update;
struct device *dev; /* from parent - for debug */
struct snd_soc_codec *codec; /* parent codec */
struct snd_soc_card *card; /* parent card */
/* used during DAPM updates */
int dev_power;
struct list_head list;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_dapm;
#endif
};
#endif #endif
...@@ -222,10 +222,8 @@ enum snd_soc_bias_level { ...@@ -222,10 +222,8 @@ enum snd_soc_bias_level {
struct snd_jack; struct snd_jack;
struct snd_soc_card; struct snd_soc_card;
struct snd_soc_device;
struct snd_soc_pcm_stream; struct snd_soc_pcm_stream;
struct snd_soc_ops; struct snd_soc_ops;
struct snd_soc_dai_mode;
struct snd_soc_pcm_runtime; struct snd_soc_pcm_runtime;
struct snd_soc_dai; struct snd_soc_dai;
struct snd_soc_dai_driver; struct snd_soc_dai_driver;
...@@ -235,9 +233,10 @@ struct snd_soc_platform_driver; ...@@ -235,9 +233,10 @@ struct snd_soc_platform_driver;
struct snd_soc_codec; struct snd_soc_codec;
struct snd_soc_codec_driver; struct snd_soc_codec_driver;
struct soc_enum; struct soc_enum;
struct snd_soc_ac97_ops;
struct snd_soc_jack; struct snd_soc_jack;
struct snd_soc_jack_pin; struct snd_soc_jack_pin;
struct snd_soc_cache_ops;
#include <sound/soc-dapm.h>
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
struct snd_soc_jack_gpio; struct snd_soc_jack_gpio;
...@@ -253,17 +252,30 @@ enum snd_soc_control_type { ...@@ -253,17 +252,30 @@ enum snd_soc_control_type {
SND_SOC_SPI, SND_SOC_SPI,
}; };
enum snd_soc_compress_type {
SND_SOC_FLAT_COMPRESSION = 1,
SND_SOC_LZO_COMPRESSION,
SND_SOC_RBTREE_COMPRESSION
};
int snd_soc_register_platform(struct device *dev, int snd_soc_register_platform(struct device *dev,
struct snd_soc_platform_driver *platform_drv); struct snd_soc_platform_driver *platform_drv);
void snd_soc_unregister_platform(struct device *dev); void snd_soc_unregister_platform(struct device *dev);
int snd_soc_register_codec(struct device *dev, int snd_soc_register_codec(struct device *dev,
struct snd_soc_codec_driver *codec_drv, const struct snd_soc_codec_driver *codec_drv,
struct snd_soc_dai_driver *dai_drv, int num_dai); struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_codec(struct device *dev); void snd_soc_unregister_codec(struct device *dev);
int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg);
int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
int addr_bits, int data_bits, int addr_bits, int data_bits,
enum snd_soc_control_type control); enum snd_soc_control_type control);
int snd_soc_cache_sync(struct snd_soc_codec *codec);
int snd_soc_cache_init(struct snd_soc_codec *codec);
int snd_soc_cache_exit(struct snd_soc_codec *codec);
int snd_soc_cache_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int value);
int snd_soc_cache_read(struct snd_soc_codec *codec,
unsigned int reg, unsigned int *value);
/* Utility functions to get clock rates from various things */ /* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
...@@ -420,23 +432,37 @@ struct snd_soc_ops { ...@@ -420,23 +432,37 @@ struct snd_soc_ops {
int (*trigger)(struct snd_pcm_substream *, int); int (*trigger)(struct snd_pcm_substream *, int);
}; };
/* SoC cache ops */
struct snd_soc_cache_ops {
const char *name;
enum snd_soc_compress_type id;
int (*init)(struct snd_soc_codec *codec);
int (*exit)(struct snd_soc_codec *codec);
int (*read)(struct snd_soc_codec *codec, unsigned int reg,
unsigned int *value);
int (*write)(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value);
int (*sync)(struct snd_soc_codec *codec);
};
/* SoC Audio Codec device */ /* SoC Audio Codec device */
struct snd_soc_codec { struct snd_soc_codec {
const char *name; const char *name;
const char *name_prefix;
int id; int id;
struct device *dev; struct device *dev;
struct snd_soc_codec_driver *driver; const struct snd_soc_codec_driver *driver;
struct mutex mutex; struct mutex mutex;
struct snd_soc_card *card; struct snd_soc_card *card;
struct list_head list; struct list_head list;
struct list_head card_list; struct list_head card_list;
int num_dai; int num_dai;
enum snd_soc_compress_type compress_type;
/* runtime */ /* runtime */
struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
unsigned int active; unsigned int active;
unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
unsigned int cache_only:1; /* Suppress writes to hardware */ unsigned int cache_only:1; /* Suppress writes to hardware */
unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
unsigned int suspended:1; /* Codec is in suspend PM state */ unsigned int suspended:1; /* Codec is in suspend PM state */
...@@ -444,25 +470,25 @@ struct snd_soc_codec { ...@@ -444,25 +470,25 @@ struct snd_soc_codec {
unsigned int ac97_registered:1; /* Codec has been AC97 registered */ unsigned int ac97_registered:1; /* Codec has been AC97 registered */
unsigned int ac97_created:1; /* Codec has been created by SoC */ unsigned int ac97_created:1; /* Codec has been created by SoC */
unsigned int sysfs_registered:1; /* codec has been sysfs registered */ unsigned int sysfs_registered:1; /* codec has been sysfs registered */
unsigned int cache_init:1; /* codec cache has been initialized */
/* codec IO */ /* codec IO */
void *control_data; /* codec control (i2c/3wire) data */ void *control_data; /* codec control (i2c/3wire) data */
hw_write_t hw_write; hw_write_t hw_write;
unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
unsigned int (*read)(struct snd_soc_codec *, unsigned int);
int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
void *reg_cache; void *reg_cache;
const void *reg_def_copy;
const struct snd_soc_cache_ops *cache_ops;
struct mutex cache_rw_mutex;
/* dapm */ /* dapm */
u32 pop_time; struct snd_soc_dapm_context dapm;
struct list_head dapm_widgets;
struct list_head dapm_paths;
enum snd_soc_bias_level bias_level;
enum snd_soc_bias_level suspend_bias_level;
struct delayed_work delayed_work;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_codec_root; struct dentry *debugfs_codec_root;
struct dentry *debugfs_reg; struct dentry *debugfs_reg;
struct dentry *debugfs_pop_time;
struct dentry *debugfs_dapm; struct dentry *debugfs_dapm;
#endif #endif
}; };
...@@ -488,6 +514,7 @@ struct snd_soc_codec_driver { ...@@ -488,6 +514,7 @@ struct snd_soc_codec_driver {
short reg_cache_step; short reg_cache_step;
short reg_word_size; short reg_word_size;
const void *reg_cache_default; const void *reg_cache_default;
enum snd_soc_compress_type compress_type;
/* codec bias level */ /* codec bias level */
int (*set_bias_level)(struct snd_soc_codec *, int (*set_bias_level)(struct snd_soc_codec *,
...@@ -554,6 +581,30 @@ struct snd_soc_dai_link { ...@@ -554,6 +581,30 @@ struct snd_soc_dai_link {
struct snd_soc_ops *ops; struct snd_soc_ops *ops;
}; };
struct snd_soc_codec_conf {
const char *dev_name;
/*
* optional map of kcontrol, widget and path name prefixes that are
* associated per device
*/
const char *name_prefix;
/*
* set this to the desired compression type if you want to
* override the one supplied in codec->driver->compress_type
*/
enum snd_soc_compress_type compress_type;
};
struct snd_soc_aux_dev {
const char *name; /* Codec name */
const char *codec_name; /* for multi-codec */
/* codec/machine specific init - e.g. add machine controls */
int (*init)(struct snd_soc_dapm_context *dapm);
};
/* SoC card */ /* SoC card */
struct snd_soc_card { struct snd_soc_card {
const char *name; const char *name;
...@@ -579,6 +630,8 @@ struct snd_soc_card { ...@@ -579,6 +630,8 @@ struct snd_soc_card {
/* callbacks */ /* callbacks */
int (*set_bias_level)(struct snd_soc_card *, int (*set_bias_level)(struct snd_soc_card *,
enum snd_soc_bias_level level); enum snd_soc_bias_level level);
int (*set_bias_level_post)(struct snd_soc_card *,
enum snd_soc_bias_level level);
long pmdown_time; long pmdown_time;
...@@ -588,12 +641,35 @@ struct snd_soc_card { ...@@ -588,12 +641,35 @@ struct snd_soc_card {
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
int num_rtd; int num_rtd;
/* optional codec specific configuration */
struct snd_soc_codec_conf *codec_conf;
int num_configs;
/*
* optional auxiliary devices such as amplifiers or codecs with DAI
* link unused
*/
struct snd_soc_aux_dev *aux_dev;
int num_aux_devs;
struct snd_soc_pcm_runtime *rtd_aux;
int num_aux_rtd;
struct work_struct deferred_resume_work; struct work_struct deferred_resume_work;
/* lists of probed devices belonging to this card */ /* lists of probed devices belonging to this card */
struct list_head codec_dev_list; struct list_head codec_dev_list;
struct list_head platform_dev_list; struct list_head platform_dev_list;
struct list_head dai_dev_list; struct list_head dai_dev_list;
struct list_head widgets;
struct list_head paths;
struct list_head dapm_list;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_card_root;
struct dentry *debugfs_pop_time;
#endif
u32 pop_time;
}; };
/* SoC machine DAI configuration, glues a codec and cpu DAI together */ /* SoC machine DAI configuration, glues a codec and cpu DAI together */
...@@ -639,17 +715,9 @@ struct soc_enum { ...@@ -639,17 +715,9 @@ struct soc_enum {
}; };
/* codec IO */ /* codec IO */
static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
unsigned int reg) unsigned int snd_soc_write(struct snd_soc_codec *codec,
{ unsigned int reg, unsigned int val);
return codec->driver->read(codec, reg);
}
static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int val)
{
return codec->driver->write(codec, reg, val);
}
/* device driver data */ /* device driver data */
......
#undef TRACE_SYSTEM
#define TRACE_SYSTEM asoc
#if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_ASOC_H
#include <linux/ktime.h>
#include <linux/tracepoint.h>
struct snd_soc_jack;
struct snd_soc_codec;
struct snd_soc_card;
struct snd_soc_dapm_widget;
/*
* Log register events
*/
DECLARE_EVENT_CLASS(snd_soc_reg,
TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
unsigned int val),
TP_ARGS(codec, reg, val),
TP_STRUCT__entry(
__string( name, codec->name )
__field( int, id )
__field( unsigned int, reg )
__field( unsigned int, val )
),
TP_fast_assign(
__assign_str(name, codec->name);
__entry->id = codec->id;
__entry->reg = reg;
__entry->val = val;
),
TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name),
(int)__entry->id, (unsigned int)__entry->reg,
(unsigned int)__entry->val)
);
DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write,
TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
unsigned int val),
TP_ARGS(codec, reg, val)
);
DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read,
TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
unsigned int val),
TP_ARGS(codec, reg, val)
);
DECLARE_EVENT_CLASS(snd_soc_card,
TP_PROTO(struct snd_soc_card *card, int val),
TP_ARGS(card, val),
TP_STRUCT__entry(
__string( name, card->name )
__field( int, val )
),
TP_fast_assign(
__assign_str(name, card->name);
__entry->val = val;
),
TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
);
DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
TP_PROTO(struct snd_soc_card *card, int val),
TP_ARGS(card, val)
);
DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
TP_PROTO(struct snd_soc_card *card, int val),
TP_ARGS(card, val)
);
DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
TP_PROTO(struct snd_soc_card *card),
TP_ARGS(card),
TP_STRUCT__entry(
__string( name, card->name )
),
TP_fast_assign(
__assign_str(name, card->name);
),
TP_printk("card=%s", __get_str(name))
);
DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
TP_PROTO(struct snd_soc_card *card),
TP_ARGS(card)
);
DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
TP_PROTO(struct snd_soc_card *card),
TP_ARGS(card)
);
DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
TP_PROTO(struct snd_soc_dapm_widget *w, int val),
TP_ARGS(w, val),
TP_STRUCT__entry(
__string( name, w->name )
__field( int, val )
),
TP_fast_assign(
__assign_str(name, w->name);
__entry->val = val;
),
TP_printk("widget=%s val=%d", __get_str(name),
(int)__entry->val)
);
DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
TP_PROTO(struct snd_soc_dapm_widget *w, int val),
TP_ARGS(w, val)
);
DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
TP_PROTO(struct snd_soc_dapm_widget *w, int val),
TP_ARGS(w, val)
);
DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
TP_PROTO(struct snd_soc_dapm_widget *w, int val),
TP_ARGS(w, val)
);
TRACE_EVENT(snd_soc_jack_irq,
TP_PROTO(const char *name),
TP_ARGS(name),
TP_STRUCT__entry(
__string( name, name )
),
TP_fast_assign(
__assign_str(name, name);
),
TP_printk("%s", __get_str(name))
);
TRACE_EVENT(snd_soc_jack_report,
TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
TP_ARGS(jack, mask, val),
TP_STRUCT__entry(
__string( name, jack->jack->name )
__field( int, mask )
__field( int, val )
),
TP_fast_assign(
__assign_str(name, jack->jack->name);
__entry->mask = mask;
__entry->val = val;
),
TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
(int)__entry->mask)
);
TRACE_EVENT(snd_soc_jack_notify,
TP_PROTO(struct snd_soc_jack *jack, int val),
TP_ARGS(jack, val),
TP_STRUCT__entry(
__string( name, jack->jack->name )
__field( int, val )
),
TP_fast_assign(
__assign_str(name, jack->jack->name);
__entry->val = val;
),
TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
);
#endif /* _TRACE_ASOC_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
/* /*
* Let drivers decide whether they want to support given codec from their * Let drivers decide whether they want to support given codec from their
* probe method. Drivers have direct access to the struct snd_ac97 structure and may * probe method. Drivers have direct access to the struct snd_ac97
* decide based on the id field amongst other things. * structure and may decide based on the id field amongst other things.
*/ */
static int ac97_bus_match(struct device *dev, struct device_driver *drv) static int ac97_bus_match(struct device *dev, struct device_driver *drv)
{ {
......
...@@ -1114,7 +1114,6 @@ static int onyx_i2c_remove(struct i2c_client *client) ...@@ -1114,7 +1114,6 @@ static int onyx_i2c_remove(struct i2c_client *client)
of_node_put(onyx->codec.node); of_node_put(onyx->codec.node);
if (onyx->codec_info) if (onyx->codec_info)
kfree(onyx->codec_info); kfree(onyx->codec_info);
i2c_set_clientdata(client, onyx);
kfree(onyx); kfree(onyx);
return 0; return 0;
} }
......
...@@ -287,10 +287,9 @@ static void ftr_gpio_exit(struct gpio_runtime *rt) ...@@ -287,10 +287,9 @@ static void ftr_gpio_exit(struct gpio_runtime *rt)
free_irq(linein_detect_irq, &rt->line_in_notify); free_irq(linein_detect_irq, &rt->line_in_notify);
if (rt->line_out_notify.gpio_private) if (rt->line_out_notify.gpio_private)
free_irq(lineout_detect_irq, &rt->line_out_notify); free_irq(lineout_detect_irq, &rt->line_out_notify);
cancel_delayed_work(&rt->headphone_notify.work); cancel_delayed_work_sync(&rt->headphone_notify.work);
cancel_delayed_work(&rt->line_in_notify.work); cancel_delayed_work_sync(&rt->line_in_notify.work);
cancel_delayed_work(&rt->line_out_notify.work); cancel_delayed_work_sync(&rt->line_out_notify.work);
flush_scheduled_work();
mutex_destroy(&rt->headphone_notify.mutex); mutex_destroy(&rt->headphone_notify.mutex);
mutex_destroy(&rt->line_in_notify.mutex); mutex_destroy(&rt->line_in_notify.mutex);
mutex_destroy(&rt->line_out_notify.mutex); mutex_destroy(&rt->line_out_notify.mutex);
......
...@@ -107,10 +107,9 @@ static void pmf_gpio_exit(struct gpio_runtime *rt) ...@@ -107,10 +107,9 @@ static void pmf_gpio_exit(struct gpio_runtime *rt)
/* make sure no work is pending before freeing /* make sure no work is pending before freeing
* all things */ * all things */
cancel_delayed_work(&rt->headphone_notify.work); cancel_delayed_work_sync(&rt->headphone_notify.work);
cancel_delayed_work(&rt->line_in_notify.work); cancel_delayed_work_sync(&rt->line_in_notify.work);
cancel_delayed_work(&rt->line_out_notify.work); cancel_delayed_work_sync(&rt->line_out_notify.work);
flush_scheduled_work();
mutex_destroy(&rt->headphone_notify.mutex); mutex_destroy(&rt->headphone_notify.mutex);
mutex_destroy(&rt->line_in_notify.mutex); mutex_destroy(&rt->line_in_notify.mutex);
......
...@@ -1488,7 +1488,7 @@ int snd_ctl_create(struct snd_card *card) ...@@ -1488,7 +1488,7 @@ int snd_ctl_create(struct snd_card *card)
} }
/* /*
* Frequently used control callbacks * Frequently used control callbacks/helpers
*/ */
int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
...@@ -1513,3 +1513,29 @@ int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, ...@@ -1513,3 +1513,29 @@ int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
} }
EXPORT_SYMBOL(snd_ctl_boolean_stereo_info); EXPORT_SYMBOL(snd_ctl_boolean_stereo_info);
/**
* snd_ctl_enum_info - fills the info structure for an enumerated control
* @info: the structure to be filled
* @channels: the number of the control's channels; often one
* @items: the number of control values; also the size of @names
* @names: an array containing the names of all control values
*
* Sets all required fields in @info to their appropriate values.
* If the control's accessibility is not the default (readable and writable),
* the caller has to fill @info->access.
*/
int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels,
unsigned int items, const char *const names[])
{
info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
info->count = channels;
info->value.enumerated.items = items;
if (info->value.enumerated.item >= items)
info->value.enumerated.item = items - 1;
strlcpy(info->value.enumerated.name,
names[info->value.enumerated.item],
sizeof(info->value.enumerated.name));
return 0;
}
EXPORT_SYMBOL(snd_ctl_enum_info);
...@@ -453,8 +453,10 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm, ...@@ -453,8 +453,10 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm,
} else { } else {
*params = *save; *params = *save;
max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir); max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir);
if (max < 0) if (max < 0) {
kfree(save);
return max; return max;
}
last = 1; last = 1;
} }
_end: _end:
......
...@@ -373,6 +373,27 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, ...@@ -373,6 +373,27 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
(unsigned long)new_hw_ptr, (unsigned long)new_hw_ptr,
(unsigned long)runtime->hw_ptr_base); (unsigned long)runtime->hw_ptr_base);
} }
if (runtime->no_period_wakeup) {
/*
* Without regular period interrupts, we have to check
* the elapsed time to detect xruns.
*/
jdelta = jiffies - runtime->hw_ptr_jiffies;
if (jdelta < runtime->hw_ptr_buffer_jiffies / 2)
goto no_delta_check;
hdelta = jdelta - delta * HZ / runtime->rate;
while (hdelta > runtime->hw_ptr_buffer_jiffies / 2 + 1) {
delta += runtime->buffer_size;
hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary)
hw_base = 0;
new_hw_ptr = hw_base + pos;
hdelta -= runtime->hw_ptr_buffer_jiffies;
}
goto no_delta_check;
}
/* something must be really wrong */ /* something must be really wrong */
if (delta >= runtime->buffer_size + runtime->period_size) { if (delta >= runtime->buffer_size + runtime->period_size) {
hw_ptr_error(substream, hw_ptr_error(substream,
...@@ -442,6 +463,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, ...@@ -442,6 +463,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
(long)old_hw_ptr); (long)old_hw_ptr);
} }
no_delta_check:
if (runtime->status->hw_ptr == new_hw_ptr) if (runtime->status->hw_ptr == new_hw_ptr)
return 0; return 0;
......
...@@ -422,6 +422,9 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -422,6 +422,9 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
runtime->info = params->info; runtime->info = params->info;
runtime->rate_num = params->rate_num; runtime->rate_num = params->rate_num;
runtime->rate_den = params->rate_den; runtime->rate_den = params->rate_den;
runtime->no_period_wakeup =
(params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP) &&
(params->flags & SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP);
bits = snd_pcm_format_physical_width(runtime->format); bits = snd_pcm_format_physical_width(runtime->format);
runtime->sample_bits = bits; runtime->sample_bits = bits;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "seq_timer.h" #include "seq_timer.h"
#include "seq_system.h" #include "seq_system.h"
#include "seq_info.h" #include "seq_info.h"
#include <sound/minors.h>
#include <sound/seq_device.h> #include <sound/seq_device.h>
#if defined(CONFIG_SND_SEQ_DUMMY_MODULE) #if defined(CONFIG_SND_SEQ_DUMMY_MODULE)
...@@ -73,6 +74,9 @@ MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice numbe ...@@ -73,6 +74,9 @@ MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice numbe
module_param(seq_default_timer_resolution, int, 0644); module_param(seq_default_timer_resolution, int, 0644);
MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz."); MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz.");
MODULE_ALIAS_CHARDEV(CONFIG_SND_MAJOR, SNDRV_MINOR_SEQUENCER);
MODULE_ALIAS("devname:snd/seq");
/* /*
* INIT PART * INIT PART
*/ */
......
...@@ -188,14 +188,22 @@ static const struct file_operations snd_fops = ...@@ -188,14 +188,22 @@ static const struct file_operations snd_fops =
}; };
#ifdef CONFIG_SND_DYNAMIC_MINORS #ifdef CONFIG_SND_DYNAMIC_MINORS
static int snd_find_free_minor(void) static int snd_find_free_minor(int type)
{ {
int minor; int minor;
/* static minors for module auto loading */
if (type == SNDRV_DEVICE_TYPE_SEQUENCER)
return SNDRV_MINOR_SEQUENCER;
if (type == SNDRV_DEVICE_TYPE_TIMER)
return SNDRV_MINOR_TIMER;
for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) { for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) {
/* skip minors still used statically for autoloading devices */ /* skip static minors still used for module auto loading */
if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL || if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL)
minor == SNDRV_MINOR_SEQUENCER) continue;
if (minor == SNDRV_MINOR_SEQUENCER ||
minor == SNDRV_MINOR_TIMER)
continue; continue;
if (!snd_minors[minor]) if (!snd_minors[minor])
return minor; return minor;
...@@ -269,7 +277,7 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev, ...@@ -269,7 +277,7 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
preg->private_data = private_data; preg->private_data = private_data;
mutex_lock(&sound_mutex); mutex_lock(&sound_mutex);
#ifdef CONFIG_SND_DYNAMIC_MINORS #ifdef CONFIG_SND_DYNAMIC_MINORS
minor = snd_find_free_minor(); minor = snd_find_free_minor(type);
#else #else
minor = snd_kernel_minor(type, card, dev); minor = snd_kernel_minor(type, card, dev);
if (minor >= 0 && snd_minors[minor]) if (minor >= 0 && snd_minors[minor])
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include <sound/initval.h> #include <sound/initval.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#if defined(CONFIG_SND_HPET) || defined(CONFIG_SND_HPET_MODULE) #if defined(CONFIG_SND_HRTIMER) || defined(CONFIG_SND_HRTIMER_MODULE)
#define DEFAULT_TIMER_LIMIT 3 #define DEFAULT_TIMER_LIMIT 4
#elif defined(CONFIG_SND_RTCTIMER) || defined(CONFIG_SND_RTCTIMER_MODULE) #elif defined(CONFIG_SND_RTCTIMER) || defined(CONFIG_SND_RTCTIMER_MODULE)
#define DEFAULT_TIMER_LIMIT 2 #define DEFAULT_TIMER_LIMIT 2
#else #else
...@@ -52,6 +52,9 @@ MODULE_PARM_DESC(timer_limit, "Maximum global timers in system."); ...@@ -52,6 +52,9 @@ MODULE_PARM_DESC(timer_limit, "Maximum global timers in system.");
module_param(timer_tstamp_monotonic, int, 0444); module_param(timer_tstamp_monotonic, int, 0444);
MODULE_PARM_DESC(timer_tstamp_monotonic, "Use posix monotonic clock source for timestamps (default)."); MODULE_PARM_DESC(timer_tstamp_monotonic, "Use posix monotonic clock source for timestamps (default).");
MODULE_ALIAS_CHARDEV(CONFIG_SND_MAJOR, SNDRV_MINOR_TIMER);
MODULE_ALIAS("devname:snd/timer");
struct snd_timer_user { struct snd_timer_user {
struct snd_timer_instance *timeri; struct snd_timer_instance *timeri;
int tread; /* enhanced read with timestamps and events */ int tread; /* enhanced read with timestamps and events */
......
...@@ -1143,8 +1143,8 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, ...@@ -1143,8 +1143,8 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
(resource->start) + 1); (resource->start) + 1);
if (ml403_ac97cr->port == NULL) { if (ml403_ac97cr->port == NULL) {
snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
"unable to remap memory region (%x to %x)\n", "unable to remap memory region (%pR)\n",
resource->start, resource->end); resource);
snd_ml403_ac97cr_free(ml403_ac97cr); snd_ml403_ac97cr_free(ml403_ac97cr);
return -EBUSY; return -EBUSY;
} }
......
...@@ -57,8 +57,7 @@ static void snd_ak4113_free(struct ak4113 *chip) ...@@ -57,8 +57,7 @@ static void snd_ak4113_free(struct ak4113 *chip)
{ {
chip->init = 1; /* don't schedule new work */ chip->init = 1; /* don't schedule new work */
mb(); mb();
cancel_delayed_work(&chip->work); cancel_delayed_work_sync(&chip->work);
flush_scheduled_work();
kfree(chip); kfree(chip);
} }
...@@ -141,7 +140,7 @@ void snd_ak4113_reinit(struct ak4113 *chip) ...@@ -141,7 +140,7 @@ void snd_ak4113_reinit(struct ak4113 *chip)
{ {
chip->init = 1; chip->init = 1;
mb(); mb();
flush_scheduled_work(); flush_delayed_work_sync(&chip->work);
ak4113_init_regs(chip); ak4113_init_regs(chip);
/* bring up statistics / event queing */ /* bring up statistics / event queing */
chip->init = 0; chip->init = 0;
......
...@@ -67,8 +67,7 @@ static void snd_ak4114_free(struct ak4114 *chip) ...@@ -67,8 +67,7 @@ static void snd_ak4114_free(struct ak4114 *chip)
{ {
chip->init = 1; /* don't schedule new work */ chip->init = 1; /* don't schedule new work */
mb(); mb();
cancel_delayed_work(&chip->work); cancel_delayed_work_sync(&chip->work);
flush_scheduled_work();
kfree(chip); kfree(chip);
} }
...@@ -154,7 +153,7 @@ void snd_ak4114_reinit(struct ak4114 *chip) ...@@ -154,7 +153,7 @@ void snd_ak4114_reinit(struct ak4114 *chip)
{ {
chip->init = 1; chip->init = 1;
mb(); mb();
flush_scheduled_work(); flush_delayed_work_sync(&chip->work);
ak4114_init_regs(chip); ak4114_init_regs(chip);
/* bring up statistics / event queing */ /* bring up statistics / event queing */
chip->init = 0; chip->init = 0;
......
...@@ -209,7 +209,7 @@ config SND_OXYGEN_LIB ...@@ -209,7 +209,7 @@ config SND_OXYGEN_LIB
tristate tristate
config SND_OXYGEN config SND_OXYGEN
tristate "C-Media 8788 (Oxygen)" tristate "C-Media 8786, 8787, 8788 (Oxygen)"
select SND_OXYGEN_LIB select SND_OXYGEN_LIB
select SND_PCM select SND_PCM
select SND_MPU401_UART select SND_MPU401_UART
...@@ -217,13 +217,18 @@ config SND_OXYGEN ...@@ -217,13 +217,18 @@ config SND_OXYGEN
Say Y here to include support for sound cards based on the Say Y here to include support for sound cards based on the
C-Media CMI8788 (Oxygen HD Audio) chip: C-Media CMI8788 (Oxygen HD Audio) chip:
* Asound A-8788 * Asound A-8788
* Asus Xonar DG
* AuzenTech X-Meridian * AuzenTech X-Meridian
* AuzenTech X-Meridian 2G
* Bgears b-Enspirer * Bgears b-Enspirer
* Club3D Theatron DTS * Club3D Theatron DTS
* HT-Omega Claro (plus) * HT-Omega Claro (plus)
* HT-Omega Claro halo (XT) * HT-Omega Claro halo (XT)
* Kuroutoshikou CMI8787-HG2PCI
* Razer Barracuda AC-1 * Razer Barracuda AC-1
* Sondigo Inferno * Sondigo Inferno
* TempoTec/MediaTek HiFier Fantasia
* TempoTec/MediaTek HiFier Serenade
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called snd-oxygen. will be called snd-oxygen.
...@@ -578,18 +583,6 @@ config SND_HDSPM ...@@ -578,18 +583,6 @@ config SND_HDSPM
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called snd-hdspm. will be called snd-hdspm.
config SND_HIFIER
tristate "TempoTec HiFier Fantasia"
select SND_OXYGEN_LIB
select SND_PCM
select SND_MPU401_UART
help
Say Y here to include support for the MediaTek/TempoTec HiFier
Fantasia sound card.
To compile this driver as a module, choose M here: the module
will be called snd-hifier.
config SND_ICE1712 config SND_ICE1712
tristate "ICEnsemble ICE1712 (Envy24)" tristate "ICEnsemble ICE1712 (Envy24)"
select SND_MPU401_UART select SND_MPU401_UART
...@@ -826,8 +819,8 @@ config SND_VIRTUOSO ...@@ -826,8 +819,8 @@ config SND_VIRTUOSO
Say Y here to include support for sound cards based on the Say Y here to include support for sound cards based on the
Asus AV66/AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X, DS, Asus AV66/AV100/AV200 chips, i.e., Xonar D1, DX, D2, D2X, DS,
Essence ST (Deluxe), and Essence STX. Essence ST (Deluxe), and Essence STX.
Support for the HDAV1.3 (Deluxe) is incomplete; for the Support for the HDAV1.3 (Deluxe) and HDAV1.3 Slim is experimental;
HDAV1.3 Slim and Xense, missing. for the Xense, missing.
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called snd-virtuoso. will be called snd-virtuoso.
......
...@@ -1014,8 +1014,7 @@ static int snd_ac97_free(struct snd_ac97 *ac97) ...@@ -1014,8 +1014,7 @@ static int snd_ac97_free(struct snd_ac97 *ac97)
{ {
if (ac97) { if (ac97) {
#ifdef CONFIG_SND_AC97_POWER_SAVE #ifdef CONFIG_SND_AC97_POWER_SAVE
cancel_delayed_work(&ac97->power_work); cancel_delayed_work_sync(&ac97->power_work);
flush_scheduled_work();
#endif #endif
snd_ac97_proc_done(ac97); snd_ac97_proc_done(ac97);
if (ac97->bus) if (ac97->bus)
...@@ -2456,8 +2455,7 @@ void snd_ac97_suspend(struct snd_ac97 *ac97) ...@@ -2456,8 +2455,7 @@ void snd_ac97_suspend(struct snd_ac97 *ac97)
if (ac97->build_ops->suspend) if (ac97->build_ops->suspend)
ac97->build_ops->suspend(ac97); ac97->build_ops->suspend(ac97);
#ifdef CONFIG_SND_AC97_POWER_SAVE #ifdef CONFIG_SND_AC97_POWER_SAVE
cancel_delayed_work(&ac97->power_work); cancel_delayed_work_sync(&ac97->power_work);
flush_scheduled_work();
#endif #endif
snd_ac97_powerdown(ac97); snd_ac97_powerdown(ac97);
} }
......
此差异已折叠。
...@@ -637,15 +637,9 @@ static struct snd_kcontrol_new snd_bt87x_capture_boost = { ...@@ -637,15 +637,9 @@ static struct snd_kcontrol_new snd_bt87x_capture_boost = {
static int snd_bt87x_capture_source_info(struct snd_kcontrol *kcontrol, static int snd_bt87x_capture_source_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info) struct snd_ctl_elem_info *info)
{ {
static char *texts[3] = {"TV Tuner", "FM", "Mic/Line"}; static const char *const texts[3] = {"TV Tuner", "FM", "Mic/Line"};
info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; return snd_ctl_enum_info(info, 1, 3, texts);
info->count = 1;
info->value.enumerated.items = 3;
if (info->value.enumerated.item > 2)
info->value.enumerated.item = 2;
strcpy(info->value.enumerated.name, texts[info->value.enumerated.item]);
return 0;
} }
static int snd_bt87x_capture_source_get(struct snd_kcontrol *kcontrol, static int snd_bt87x_capture_source_get(struct snd_kcontrol *kcontrol,
......
...@@ -2507,14 +2507,12 @@ static int snd_cmipci_line_in_mode_info(struct snd_kcontrol *kcontrol, ...@@ -2507,14 +2507,12 @@ static int snd_cmipci_line_in_mode_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
struct cmipci *cm = snd_kcontrol_chip(kcontrol); struct cmipci *cm = snd_kcontrol_chip(kcontrol);
static char *texts[3] = { "Line-In", "Rear Output", "Bass Output" }; static const char *const texts[3] = {
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; "Line-In", "Rear Output", "Bass Output"
uinfo->count = 1; };
uinfo->value.enumerated.items = cm->chip_version >= 39 ? 3 : 2;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) return snd_ctl_enum_info(uinfo, 1,
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; cm->chip_version >= 39 ? 3 : 2, texts);
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
} }
static inline unsigned int get_line_in_mode(struct cmipci *cm) static inline unsigned int get_line_in_mode(struct cmipci *cm)
...@@ -2564,14 +2562,9 @@ static int snd_cmipci_line_in_mode_put(struct snd_kcontrol *kcontrol, ...@@ -2564,14 +2562,9 @@ static int snd_cmipci_line_in_mode_put(struct snd_kcontrol *kcontrol,
static int snd_cmipci_mic_in_mode_info(struct snd_kcontrol *kcontrol, static int snd_cmipci_mic_in_mode_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[2] = { "Mic-In", "Center/LFE Output" }; static const char *const texts[2] = { "Mic-In", "Center/LFE Output" };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1; return snd_ctl_enum_info(uinfo, 1, 2, texts);
uinfo->value.enumerated.items = 2;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
} }
static int snd_cmipci_mic_in_mode_get(struct snd_kcontrol *kcontrol, static int snd_cmipci_mic_in_mode_get(struct snd_kcontrol *kcontrol,
......
...@@ -4571,6 +4571,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -4571,6 +4571,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
} }
memset(cfg->hp_pins + cfg->hp_outs, 0, memset(cfg->hp_pins + cfg->hp_outs, 0,
sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs)); sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs));
if (!cfg->hp_outs)
cfg->line_out_type = AUTO_PIN_HP_OUT;
} }
/* sort by sequence */ /* sort by sequence */
......
...@@ -1235,7 +1235,8 @@ static int azx_setup_periods(struct azx *chip, ...@@ -1235,7 +1235,8 @@ static int azx_setup_periods(struct azx *chip,
pos_adj = 0; pos_adj = 0;
} else { } else {
ofs = setup_bdle(substream, azx_dev, ofs = setup_bdle(substream, azx_dev,
&bdl, ofs, pos_adj, 1); &bdl, ofs, pos_adj,
!substream->runtime->no_period_wakeup);
if (ofs < 0) if (ofs < 0)
goto error; goto error;
} }
...@@ -1247,7 +1248,8 @@ static int azx_setup_periods(struct azx *chip, ...@@ -1247,7 +1248,8 @@ static int azx_setup_periods(struct azx *chip,
period_bytes - pos_adj, 0); period_bytes - pos_adj, 0);
else else
ofs = setup_bdle(substream, azx_dev, &bdl, ofs, ofs = setup_bdle(substream, azx_dev, &bdl, ofs,
period_bytes, 1); period_bytes,
!substream->runtime->no_period_wakeup);
if (ofs < 0) if (ofs < 0)
goto error; goto error;
} }
...@@ -1515,7 +1517,8 @@ static struct snd_pcm_hardware azx_pcm_hw = { ...@@ -1515,7 +1517,8 @@ static struct snd_pcm_hardware azx_pcm_hw = {
/* No full-resume yet implemented */ /* No full-resume yet implemented */
/* SNDRV_PCM_INFO_RESUME |*/ /* SNDRV_PCM_INFO_RESUME |*/
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START), SNDRV_PCM_INFO_SYNC_START |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP),
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_48000, .rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000, .rate_min = 48000,
......
...@@ -666,7 +666,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = { ...@@ -666,7 +666,7 @@ static struct snd_kcontrol_new ad1986a_mixers[] = {
HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x0f, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Mono Playback Switch", 0x1e, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mono Playback Switch", 0x1e, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
...@@ -729,7 +729,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = { ...@@ -729,7 +729,7 @@ static struct snd_kcontrol_new ad1986a_laptop_mixers[] = {
HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Aux Playback Switch", 0x16, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x0f, 0x0, HDA_OUTPUT),
/* /*
HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mono Playback Volume", 0x1e, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Mono Playback Switch", 0x1e, 0x0, HDA_OUTPUT), */ HDA_CODEC_MUTE("Mono Playback Switch", 0x1e, 0x0, HDA_OUTPUT), */
...@@ -775,7 +775,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { ...@@ -775,7 +775,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x0f, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
{ {
...@@ -1358,7 +1358,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = { ...@@ -1358,7 +1358,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = {
HDA_CODEC_MUTE("Mic Playback Switch", 0x12, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x12, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Line Playback Volume", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Line Playback Volume", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Line Playback Switch", 0x13, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Line Playback Switch", 0x13, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT),
{ {
...@@ -1515,8 +1515,8 @@ static struct snd_kcontrol_new ad1981_mixers[] = { ...@@ -1515,8 +1515,8 @@ static struct snd_kcontrol_new ad1981_mixers[] = {
HDA_CODEC_MUTE("Mic Playback Switch", 0x1c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x1c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x08, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x08, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT),
{ {
...@@ -1726,8 +1726,8 @@ static struct snd_kcontrol_new ad1981_hp_mixers[] = { ...@@ -1726,8 +1726,8 @@ static struct snd_kcontrol_new ad1981_hp_mixers[] = {
HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT),
#endif #endif
HDA_CODEC_VOLUME("Mic Boost", 0x08, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x08, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Internal Mic Boost", 0x18, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x18, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT),
{ {
...@@ -1774,7 +1774,7 @@ static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { ...@@ -1774,7 +1774,7 @@ static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
HDA_CODEC_MUTE("Mic Playback Switch", 0x12, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x12, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x08, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x08, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT),
{ {
...@@ -2160,8 +2160,8 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { ...@@ -2160,8 +2160,8 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT),
{ } /* end */ { } /* end */
}; };
...@@ -2203,8 +2203,8 @@ static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { ...@@ -2203,8 +2203,8 @@ static struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Channel Mode", .name = "Channel Mode",
...@@ -2232,7 +2232,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = { ...@@ -2232,7 +2232,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x39, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -2902,7 +2902,7 @@ static int new_analog_input(struct ad198x_spec *spec, hda_nid_t pin, ...@@ -2902,7 +2902,7 @@ static int new_analog_input(struct ad198x_spec *spec, hda_nid_t pin,
idx = ad1988_pin_idx(pin); idx = ad1988_pin_idx(pin);
bnid = ad1988_boost_nids[idx]; bnid = ad1988_boost_nids[idx];
if (bnid) { if (bnid) {
sprintf(name, "%s Boost", ctlname); sprintf(name, "%s Boost Volume", ctlname);
return add_control(spec, AD_CTL_WIDGET_VOL, name, return add_control(spec, AD_CTL_WIDGET_VOL, name,
HDA_COMPOSE_AMP_VAL(bnid, 3, idx, HDA_OUTPUT)); HDA_COMPOSE_AMP_VAL(bnid, 3, idx, HDA_OUTPUT));
...@@ -3300,8 +3300,8 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = { ...@@ -3300,8 +3300,8 @@ static struct snd_kcontrol_new ad1884_base_mixers[] = {
HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x02, HDA_INPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x15, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x15, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x14, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x14, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT),
...@@ -3499,9 +3499,9 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { ...@@ -3499,9 +3499,9 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = {
HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT), HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT),
HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT), HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT), HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x14, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Internal Mic Boost", 0x15, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x15, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Docking Mic Boost", 0x25, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Dock Mic Boost Volume", 0x25, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT),
...@@ -3560,8 +3560,8 @@ static struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = { ...@@ -3560,8 +3560,8 @@ static struct snd_kcontrol_new ad1984_dell_desktop_mixers[] = {
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
HDA_CODEC_VOLUME("Line-In Playback Volume", 0x20, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Line-In Playback Volume", 0x20, 0x01, HDA_INPUT),
HDA_CODEC_MUTE("Line-In Playback Switch", 0x20, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Line-In Playback Switch", 0x20, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("Line-In Boost", 0x15, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Line-In Boost Volume", 0x15, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x14, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x14, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT),
...@@ -3745,9 +3745,9 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = { ...@@ -3745,9 +3745,9 @@ static struct snd_kcontrol_new ad1884a_base_mixers[] = {
HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x04, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x04, HDA_INPUT),
HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x02, HDA_INPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x14, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x14, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Line Boost", 0x15, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x25, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x25, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT),
...@@ -3888,9 +3888,9 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { ...@@ -3888,9 +3888,9 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x20, 0x04, HDA_INPUT), HDA_CODEC_VOLUME("Dock Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x20, 0x04, HDA_INPUT), HDA_CODEC_MUTE("Dock Mic Playback Switch", 0x20, 0x04, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x14, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Internal Mic Boost", 0x15, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x15, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Dock Mic Boost", 0x25, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Dock Mic Boost Volume", 0x25, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
{ } /* end */ { } /* end */
...@@ -4126,8 +4126,8 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = { ...@@ -4126,8 +4126,8 @@ static struct snd_kcontrol_new ad1984a_thinkpad_mixers[] = {
HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x14, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Internal Mic Boost", 0x17, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x17, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
{ {
...@@ -4255,8 +4255,8 @@ static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { ...@@ -4255,8 +4255,8 @@ static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = {
HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x25, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x25, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Internal Mic Boost", 0x17, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x17, 0x0, HDA_INPUT),
{ } /* end */ { } /* end */
}; };
...@@ -4494,9 +4494,9 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = { ...@@ -4494,9 +4494,9 @@ static struct snd_kcontrol_new ad1882_base_mixers[] = {
HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE_MONO("Mono Playback Switch", 0x13, 1, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x3c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Front Mic Boost", 0x39, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Line-In Boost", 0x3a, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Line-In Boost Volume", 0x3a, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x0d, 0x0, HDA_OUTPUT),
...@@ -4547,7 +4547,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = { ...@@ -4547,7 +4547,7 @@ static struct snd_kcontrol_new ad1882a_loopback_mixers[] = {
HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT), HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x06, HDA_INPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT), HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x06, HDA_INPUT),
HDA_CODEC_VOLUME("Digital Mic Boost", 0x1f, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Digital Mic Boost Volume", 0x1f, 0x0, HDA_INPUT),
{ } /* end */ { } /* end */
}; };
......
...@@ -869,16 +869,16 @@ static void cxt5045_hp_unsol_event(struct hda_codec *codec, ...@@ -869,16 +869,16 @@ static void cxt5045_hp_unsol_event(struct hda_codec *codec,
} }
static struct snd_kcontrol_new cxt5045_mixers[] = { static struct snd_kcontrol_new cxt5045_mixers[] = {
HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x1a, 0x01, HDA_INPUT),
HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Capture Switch", 0x1a, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("Mic Capture Volume", 0x1a, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("Ext Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), HDA_CODEC_MUTE("Mic Capture Switch", 0x1a, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x17, 0x1, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x1, HDA_INPUT),
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x17, 0x1, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x1, HDA_INPUT),
HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x17, 0x2, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x17, 0x2, HDA_INPUT),
HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x17, 0x2, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x17, 0x2, HDA_INPUT),
HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -910,16 +910,16 @@ static struct snd_kcontrol_new cxt5045_benq_mixers[] = { ...@@ -910,16 +910,16 @@ static struct snd_kcontrol_new cxt5045_benq_mixers[] = {
}; };
static struct snd_kcontrol_new cxt5045_mixers_hp530[] = { static struct snd_kcontrol_new cxt5045_mixers_hp530[] = {
HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x1a, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x02, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Capture Switch", 0x1a, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Mic Capture Volume", 0x1a, 0x01, HDA_INPUT),
HDA_CODEC_MUTE("Ext Mic Capture Switch", 0x1a, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Mic Capture Switch", 0x1a, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x17, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x17, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x17, 0x2, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x2, HDA_INPUT),
HDA_CODEC_MUTE("Int Mic Playback Switch", 0x17, 0x2, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x2, HDA_INPUT),
HDA_CODEC_VOLUME("Ext Mic Playback Volume", 0x17, 0x1, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x17, 0x1, HDA_INPUT),
HDA_CODEC_MUTE("Ext Mic Playback Switch", 0x17, 0x1, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x17, 0x1, HDA_INPUT),
HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol), HDA_BIND_VOL("Master Playback Volume", &cxt5045_hp_bind_master_vol),
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -947,7 +947,7 @@ static struct hda_verb cxt5045_init_verbs[] = { ...@@ -947,7 +947,7 @@ static struct hda_verb cxt5045_init_verbs[] = {
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
/* Record selector: Int mic */ /* Record selector: Internal mic */
{0x1a, AC_VERB_SET_CONNECT_SEL,0x1}, {0x1a, AC_VERB_SET_CONNECT_SEL,0x1},
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, {0x1a, AC_VERB_SET_AMP_GAIN_MUTE,
AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
...@@ -960,7 +960,7 @@ static struct hda_verb cxt5045_init_verbs[] = { ...@@ -960,7 +960,7 @@ static struct hda_verb cxt5045_init_verbs[] = {
}; };
static struct hda_verb cxt5045_benq_init_verbs[] = { static struct hda_verb cxt5045_benq_init_verbs[] = {
/* Int Mic, Mic */ /* Internal Mic, Mic */
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 },
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 },
/* Line In,HP, Amp */ /* Line In,HP, Amp */
...@@ -973,7 +973,7 @@ static struct hda_verb cxt5045_benq_init_verbs[] = { ...@@ -973,7 +973,7 @@ static struct hda_verb cxt5045_benq_init_verbs[] = {
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
/* Record selector: Int mic */ /* Record selector: Internal mic */
{0x1a, AC_VERB_SET_CONNECT_SEL, 0x1}, {0x1a, AC_VERB_SET_CONNECT_SEL, 0x1},
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, {0x1a, AC_VERB_SET_AMP_GAIN_MUTE,
AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
...@@ -1376,7 +1376,7 @@ static void cxt5047_hp_unsol_event(struct hda_codec *codec, ...@@ -1376,7 +1376,7 @@ static void cxt5047_hp_unsol_event(struct hda_codec *codec,
static struct snd_kcontrol_new cxt5047_base_mixers[] = { static struct snd_kcontrol_new cxt5047_base_mixers[] = {
HDA_CODEC_VOLUME("Mic Playback Volume", 0x19, 0x02, HDA_INPUT), HDA_CODEC_VOLUME("Mic Playback Volume", 0x19, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x19, 0x02, HDA_INPUT), HDA_CODEC_MUTE("Mic Playback Switch", 0x19, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Boost", 0x1a, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Mic Boost Volume", 0x1a, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT), HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT),
HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT), HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT),
HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT), HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT),
...@@ -1796,8 +1796,8 @@ static struct snd_kcontrol_new cxt5051_playback_mixers[] = { ...@@ -1796,8 +1796,8 @@ static struct snd_kcontrol_new cxt5051_playback_mixers[] = {
static struct snd_kcontrol_new cxt5051_capture_mixers[] = { static struct snd_kcontrol_new cxt5051_capture_mixers[] = {
HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Mic Volume", 0x14, 0x01, HDA_INPUT),
HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Mic Switch", 0x14, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT),
{} {}
...@@ -1806,8 +1806,8 @@ static struct snd_kcontrol_new cxt5051_capture_mixers[] = { ...@@ -1806,8 +1806,8 @@ static struct snd_kcontrol_new cxt5051_capture_mixers[] = {
static struct snd_kcontrol_new cxt5051_hp_mixers[] = { static struct snd_kcontrol_new cxt5051_hp_mixers[] = {
HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Mic Volume", 0x15, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("External Mic Switch", 0x15, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Mic Switch", 0x15, 0x00, HDA_INPUT),
{} {}
}; };
...@@ -1826,8 +1826,8 @@ static struct snd_kcontrol_new cxt5051_f700_mixers[] = { ...@@ -1826,8 +1826,8 @@ static struct snd_kcontrol_new cxt5051_f700_mixers[] = {
static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = { static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = {
HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT),
HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Mic Volume", 0x14, 0x01, HDA_INPUT),
HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), HDA_CODEC_MUTE("Mic Switch", 0x14, 0x01, HDA_INPUT),
{} {}
}; };
...@@ -1847,7 +1847,7 @@ static struct hda_verb cxt5051_init_verbs[] = { ...@@ -1847,7 +1847,7 @@ static struct hda_verb cxt5051_init_verbs[] = {
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
/* DAC1 */ /* DAC1 */
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Record selector: Int mic */ /* Record selector: Internal mic */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44},
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
...@@ -1874,7 +1874,7 @@ static struct hda_verb cxt5051_hp_dv6736_init_verbs[] = { ...@@ -1874,7 +1874,7 @@ static struct hda_verb cxt5051_hp_dv6736_init_verbs[] = {
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
/* DAC1 */ /* DAC1 */
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Record selector: Int mic */ /* Record selector: Internal mic */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44},
{0x14, AC_VERB_SET_CONNECT_SEL, 0x1}, {0x14, AC_VERB_SET_CONNECT_SEL, 0x1},
/* SPDIF route: PCM */ /* SPDIF route: PCM */
...@@ -1904,7 +1904,7 @@ static struct hda_verb cxt5051_lenovo_x200_init_verbs[] = { ...@@ -1904,7 +1904,7 @@ static struct hda_verb cxt5051_lenovo_x200_init_verbs[] = {
{0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x19, AC_VERB_SET_CONNECT_SEL, 0x00},
/* DAC1 */ /* DAC1 */
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Record selector: Int mic */ /* Record selector: Internal mic */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44},
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44}, {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
...@@ -1932,7 +1932,7 @@ static struct hda_verb cxt5051_f700_init_verbs[] = { ...@@ -1932,7 +1932,7 @@ static struct hda_verb cxt5051_f700_init_verbs[] = {
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
/* DAC1 */ /* DAC1 */
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Record selector: Int mic */ /* Record selector: Internal mic */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44}, {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44},
{0x14, AC_VERB_SET_CONNECT_SEL, 0x1}, {0x14, AC_VERB_SET_CONNECT_SEL, 0x1},
/* SPDIF route: PCM */ /* SPDIF route: PCM */
...@@ -2111,6 +2111,11 @@ static struct hda_channel_mode cxt5066_modes[1] = { ...@@ -2111,6 +2111,11 @@ static struct hda_channel_mode cxt5066_modes[1] = {
{ 2, NULL }, { 2, NULL },
}; };
#define HP_PRESENT_PORT_A (1 << 0)
#define HP_PRESENT_PORT_D (1 << 1)
#define hp_port_a_present(spec) ((spec)->hp_present & HP_PRESENT_PORT_A)
#define hp_port_d_present(spec) ((spec)->hp_present & HP_PRESENT_PORT_D)
static void cxt5066_update_speaker(struct hda_codec *codec) static void cxt5066_update_speaker(struct hda_codec *codec)
{ {
struct conexant_spec *spec = codec->spec; struct conexant_spec *spec = codec->spec;
...@@ -2120,24 +2125,20 @@ static void cxt5066_update_speaker(struct hda_codec *codec) ...@@ -2120,24 +2125,20 @@ static void cxt5066_update_speaker(struct hda_codec *codec)
spec->hp_present, spec->cur_eapd); spec->hp_present, spec->cur_eapd);
/* Port A (HP) */ /* Port A (HP) */
pinctl = ((spec->hp_present & 1) && spec->cur_eapd) ? PIN_HP : 0; pinctl = (hp_port_a_present(spec) && spec->cur_eapd) ? PIN_HP : 0;
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
pinctl); pinctl);
/* Port D (HP/LO) */ /* Port D (HP/LO) */
if (spec->dell_automute) { pinctl = spec->cur_eapd ? spec->port_d_mode : 0;
/* DELL AIO Port Rule: PortA> PortD> IntSpk */ if (spec->dell_automute || spec->thinkpad) {
pinctl = (!(spec->hp_present & 1) && spec->cur_eapd) /* Mute if Port A is connected */
? PIN_OUT : 0; if (hp_port_a_present(spec))
} else if (spec->thinkpad) {
if (spec->cur_eapd)
pinctl = spec->port_d_mode;
/* Mute dock line-out if Port A (laptop HP) is present */
if (spec->hp_present& 1)
pinctl = 0; pinctl = 0;
} else { } else {
pinctl = ((spec->hp_present & 2) && spec->cur_eapd) /* Thinkpad/Dell doesn't give pin-D status */
? spec->port_d_mode : 0; if (!hp_port_d_present(spec))
pinctl = 0;
} }
snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
pinctl); pinctl);
...@@ -2379,8 +2380,8 @@ static void cxt5066_hp_automute(struct hda_codec *codec) ...@@ -2379,8 +2380,8 @@ static void cxt5066_hp_automute(struct hda_codec *codec)
/* Port D */ /* Port D */
portD = snd_hda_jack_detect(codec, 0x1c); portD = snd_hda_jack_detect(codec, 0x1c);
spec->hp_present = !!(portA); spec->hp_present = portA ? HP_PRESENT_PORT_A : 0;
spec->hp_present |= portD ? 2 : 0; spec->hp_present |= portD ? HP_PRESENT_PORT_D : 0;
snd_printdd("CXT5066: hp automute portA=%x portD=%x present=%d\n", snd_printdd("CXT5066: hp automute portA=%x portD=%x present=%d\n",
portA, portD, spec->hp_present); portA, portD, spec->hp_present);
cxt5066_update_speaker(codec); cxt5066_update_speaker(codec);
...@@ -2728,7 +2729,7 @@ static struct snd_kcontrol_new cxt5066_mixers[] = { ...@@ -2728,7 +2729,7 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {
static struct snd_kcontrol_new cxt5066_vostro_mixers[] = { static struct snd_kcontrol_new cxt5066_vostro_mixers[] = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Int Mic Boost Capture Enum", .name = "Internal Mic Boost Capture Enum",
.info = cxt5066_mic_boost_mux_enum_info, .info = cxt5066_mic_boost_mux_enum_info,
.get = cxt5066_mic_boost_mux_enum_get, .get = cxt5066_mic_boost_mux_enum_get,
.put = cxt5066_mic_boost_mux_enum_put, .put = cxt5066_mic_boost_mux_enum_put,
...@@ -2954,7 +2955,7 @@ static struct hda_verb cxt5066_init_verbs_ideapad[] = { ...@@ -2954,7 +2955,7 @@ static struct hda_verb cxt5066_init_verbs_ideapad[] = {
{0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
/* internal microphone */ /* internal microphone */
{0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable int mic */ {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable internal mic */
/* EAPD */ /* EAPD */
{0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
...@@ -3009,7 +3010,7 @@ static struct hda_verb cxt5066_init_verbs_thinkpad[] = { ...@@ -3009,7 +3010,7 @@ static struct hda_verb cxt5066_init_verbs_thinkpad[] = {
{0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
/* internal microphone */ /* internal microphone */
{0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable int mic */ {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable internal mic */
/* EAPD */ /* EAPD */
{0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
...@@ -3097,6 +3098,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { ...@@ -3097,6 +3098,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
...@@ -3108,16 +3110,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { ...@@ -3108,16 +3110,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
CXT5066_LAPTOP), CXT5066_LAPTOP),
SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD), SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
SND_PCI_QUIRK(0x17aa, 0x390a, "Lenovo S10-3t", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G series (AMD)", CXT5066_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD),
{} {}
}; };
...@@ -3422,6 +3417,9 @@ static void cx_auto_hp_automute(struct hda_codec *codec) ...@@ -3422,6 +3417,9 @@ static void cx_auto_hp_automute(struct hda_codec *codec)
AC_VERB_SET_PIN_WIDGET_CONTROL, AC_VERB_SET_PIN_WIDGET_CONTROL,
present ? 0 : PIN_OUT); present ? 0 : PIN_OUT);
} }
for (i = 0; !present && i < cfg->line_outs; i++)
if (snd_hda_jack_detect(codec, cfg->line_out_pins[i]))
present = 1;
for (i = 0; i < cfg->speaker_outs; i++) { for (i = 0; i < cfg->speaker_outs; i++) {
snd_hda_codec_write(codec, cfg->speaker_pins[i], 0, snd_hda_codec_write(codec, cfg->speaker_pins[i], 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, AC_VERB_SET_PIN_WIDGET_CONTROL,
......
...@@ -31,10 +31,15 @@ ...@@ -31,10 +31,15 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/moduleparam.h>
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
static bool static_hdmi_pcm;
module_param(static_hdmi_pcm, bool, 0644);
MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
/* /*
* The HDMI/DisplayPort configuration can be highly dynamic. A graphics device * The HDMI/DisplayPort configuration can be highly dynamic. A graphics device
* could support two independent pipes, each of them can be connected to one or * could support two independent pipes, each of them can be connected to one or
...@@ -827,7 +832,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -827,7 +832,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
*codec_pars = *hinfo; *codec_pars = *hinfo;
eld = &spec->sink_eld[idx]; eld = &spec->sink_eld[idx];
if (eld->sad_count > 0) { if (!static_hdmi_pcm && eld->eld_valid && eld->sad_count > 0) {
hdmi_eld_update_pcm_info(eld, hinfo, codec_pars); hdmi_eld_update_pcm_info(eld, hinfo, codec_pars);
if (hinfo->channels_min > hinfo->channels_max || if (hinfo->channels_min > hinfo->channels_max ||
!hinfo->rates || !hinfo->formats) !hinfo->rates || !hinfo->formats)
...@@ -904,23 +909,28 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) ...@@ -904,23 +909,28 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
spec->pin[spec->num_pins] = pin_nid; spec->pin[spec->num_pins] = pin_nid;
spec->num_pins++; spec->num_pins++;
/*
* It is assumed that converter nodes come first in the node list and
* hence have been registered and usable now.
*/
return hdmi_read_pin_conn(codec, pin_nid); return hdmi_read_pin_conn(codec, pin_nid);
} }
static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t nid) static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t nid)
{ {
int i, found_pin = 0;
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
if (spec->num_cvts >= MAX_HDMI_CVTS) { for (i = 0; i < spec->num_pins; i++)
snd_printk(KERN_WARNING if (nid == spec->pin_cvt[i]) {
"HDMI: no space for converter %d\n", nid); found_pin = 1;
return -E2BIG; break;
}
if (!found_pin) {
snd_printdd("HDMI: Skipping node %d (no connection)\n", nid);
return -EINVAL;
} }
if (snd_BUG_ON(spec->num_cvts >= MAX_HDMI_CVTS))
return -E2BIG;
spec->cvt[spec->num_cvts] = nid; spec->cvt[spec->num_cvts] = nid;
spec->num_cvts++; spec->num_cvts++;
...@@ -931,6 +941,8 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -931,6 +941,8 @@ static int hdmi_parse_codec(struct hda_codec *codec)
{ {
hda_nid_t nid; hda_nid_t nid;
int i, nodes; int i, nodes;
int num_tmp_cvts = 0;
hda_nid_t tmp_cvt[MAX_HDMI_CVTS];
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
if (!nid || nodes < 0) { if (!nid || nodes < 0) {
...@@ -941,6 +953,7 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -941,6 +953,7 @@ static int hdmi_parse_codec(struct hda_codec *codec)
for (i = 0; i < nodes; i++, nid++) { for (i = 0; i < nodes; i++, nid++) {
unsigned int caps; unsigned int caps;
unsigned int type; unsigned int type;
unsigned int config;
caps = snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); caps = snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP);
type = get_wcaps_type(caps); type = get_wcaps_type(caps);
...@@ -950,17 +963,32 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -950,17 +963,32 @@ static int hdmi_parse_codec(struct hda_codec *codec)
switch (type) { switch (type) {
case AC_WID_AUD_OUT: case AC_WID_AUD_OUT:
hdmi_add_cvt(codec, nid); if (num_tmp_cvts >= MAX_HDMI_CVTS) {
snd_printk(KERN_WARNING
"HDMI: no space for converter %d\n", nid);
continue;
}
tmp_cvt[num_tmp_cvts] = nid;
num_tmp_cvts++;
break; break;
case AC_WID_PIN: case AC_WID_PIN:
caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP))) if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP)))
continue; continue;
config = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONFIG_DEFAULT, 0);
if (get_defcfg_connect(config) == AC_JACK_PORT_NONE)
continue;
hdmi_add_pin(codec, nid); hdmi_add_pin(codec, nid);
break; break;
} }
} }
for (i = 0; i < num_tmp_cvts; i++)
hdmi_add_cvt(codec, tmp_cvt[i]);
/* /*
* G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event * G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event
* can be lost and presence sense verb will become inaccurate if the * can be lost and presence sense verb will become inaccurate if the
...@@ -1165,11 +1193,53 @@ static int nvhdmi_7x_init(struct hda_codec *codec) ...@@ -1165,11 +1193,53 @@ static int nvhdmi_7x_init(struct hda_codec *codec)
return 0; return 0;
} }
static unsigned int channels_2_6_8[] = {
2, 6, 8
};
static unsigned int channels_2_8[] = {
2, 8
};
static struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = {
.count = ARRAY_SIZE(channels_2_6_8),
.list = channels_2_6_8,
.mask = 0,
};
static struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = {
.count = ARRAY_SIZE(channels_2_8),
.list = channels_2_8,
.mask = 0,
};
static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo, static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
struct hda_codec *codec, struct hda_codec *codec,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL;
switch (codec->preset->id) {
case 0x10de0002:
case 0x10de0003:
case 0x10de0005:
case 0x10de0006:
hw_constraints_channels = &hw_constraints_2_8_channels;
break;
case 0x10de0007:
hw_constraints_channels = &hw_constraints_2_6_8_channels;
break;
default:
break;
}
if (hw_constraints_channels != NULL) {
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_constraints_channels);
}
return snd_hda_multi_out_dig_open(codec, &spec->multiout); return snd_hda_multi_out_dig_open(codec, &spec->multiout);
} }
...@@ -1532,7 +1602,7 @@ static struct hda_codec_preset snd_hda_preset_hdmi[] = { ...@@ -1532,7 +1602,7 @@ static struct hda_codec_preset snd_hda_preset_hdmi[] = {
{ .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi }, { .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002aa01, .name = "R6xx HDMI", .patch = patch_atihdmi }, { .id = 0x1002aa01, .name = "R6xx HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10951390, .name = "SiI1390 HDMI", .patch = patch_generic_hdmi }, { .id = 0x10951390, .name = "SiI1390 HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_generic_hdmi }, { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_generic_hdmi },
{ .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_generic_hdmi }, { .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_generic_hdmi },
......
此差异已折叠。
...@@ -389,6 +389,9 @@ static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = { ...@@ -389,6 +389,9 @@ static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = {
0x11, 0x20, 0 0x11, 0x20, 0
}; };
#define STAC92HD88XXX_NUM_DMICS STAC92HD83XXX_NUM_DMICS
#define stac92hd88xxx_dmic_nids stac92hd83xxx_dmic_nids
#define STAC92HD87B_NUM_DMICS 1 #define STAC92HD87B_NUM_DMICS 1
static hda_nid_t stac92hd87b_dmic_nids[STAC92HD87B_NUM_DMICS + 1] = { static hda_nid_t stac92hd87b_dmic_nids[STAC92HD87B_NUM_DMICS + 1] = {
0x11, 0 0x11, 0
...@@ -3591,7 +3594,7 @@ static int stac_check_auto_mic(struct hda_codec *codec) ...@@ -3591,7 +3594,7 @@ static int stac_check_auto_mic(struct hda_codec *codec)
if (check_mic_pin(codec, spec->dmic_nids[i], if (check_mic_pin(codec, spec->dmic_nids[i],
&fixed, &ext, &dock)) &fixed, &ext, &dock))
return 0; return 0;
if (!fixed && !ext && !dock) if (!fixed || (!ext && !dock))
return 0; /* no input to switch */ return 0; /* no input to switch */
if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
return 0; /* no unsol support */ return 0; /* no unsol support */
...@@ -5422,7 +5425,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5422,7 +5425,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0);
codec->no_trigger_sense = 1; codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->linear_tone_beep = 1; spec->linear_tone_beep = 0;
codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->digbeep_nid = 0x21; spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids; spec->dmic_nids = stac92hd83xxx_dmic_nids;
...@@ -5462,15 +5465,21 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5462,15 +5465,21 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
spec->num_dmics = stac92xx_connected_ports(codec, spec->num_dmics = stac92xx_connected_ports(codec,
stac92hd87b_dmic_nids, stac92hd87b_dmic_nids,
STAC92HD87B_NUM_DMICS); STAC92HD87B_NUM_DMICS);
/* Fall through */ spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids);
spec->pin_nids = stac92hd88xxx_pin_nids;
spec->mono_nid = 0;
spec->num_pwrs = 0;
break;
case 0x111d7666: case 0x111d7666:
case 0x111d7667: case 0x111d7667:
case 0x111d7668: case 0x111d7668:
case 0x111d7669: case 0x111d7669:
spec->num_dmics = stac92xx_connected_ports(codec,
stac92hd88xxx_dmic_nids,
STAC92HD88XXX_NUM_DMICS);
spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids);
spec->pin_nids = stac92hd88xxx_pin_nids; spec->pin_nids = stac92hd88xxx_pin_nids;
spec->mono_nid = 0; spec->mono_nid = 0;
spec->digbeep_nid = 0;
spec->num_pwrs = 0; spec->num_pwrs = 0;
break; break;
case 0x111d7604: case 0x111d7604:
......
...@@ -263,8 +263,7 @@ static void vt1708_stop_hp_work(struct via_spec *spec) ...@@ -263,8 +263,7 @@ static void vt1708_stop_hp_work(struct via_spec *spec)
return; return;
snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81,
!spec->vt1708_jack_detectect); !spec->vt1708_jack_detectect);
cancel_delayed_work(&spec->vt1708_hp_work); cancel_delayed_work_sync(&spec->vt1708_hp_work);
flush_scheduled_work();
} }
......
...@@ -96,6 +96,11 @@ static unsigned char ap_cs8427_codec_select(struct snd_ice1712 *ice) ...@@ -96,6 +96,11 @@ static unsigned char ap_cs8427_codec_select(struct snd_ice1712 *ice)
tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC; tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL; tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
break; break;
case ICE1712_SUBDEVICE_DELTA66E:
tmp |= ICE1712_DELTA_66E_CCLK | ICE1712_DELTA_66E_CS_CHIP_A |
ICE1712_DELTA_66E_CS_CHIP_B;
tmp &= ~ICE1712_DELTA_66E_CS_CS8427;
break;
case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_VX442:
tmp |= ICE1712_VX442_CCLK | ICE1712_VX442_CODEC_CHIP_A | ICE1712_VX442_CODEC_CHIP_B; tmp |= ICE1712_VX442_CCLK | ICE1712_VX442_CODEC_CHIP_A | ICE1712_VX442_CODEC_CHIP_B;
tmp &= ~ICE1712_VX442_CS_DIGITAL; tmp &= ~ICE1712_VX442_CS_DIGITAL;
...@@ -119,6 +124,9 @@ static void ap_cs8427_codec_deassert(struct snd_ice1712 *ice, unsigned char tmp) ...@@ -119,6 +124,9 @@ static void ap_cs8427_codec_deassert(struct snd_ice1712 *ice, unsigned char tmp)
case ICE1712_SUBDEVICE_DELTA410: case ICE1712_SUBDEVICE_DELTA410:
tmp |= ICE1712_DELTA_AP_CS_DIGITAL; tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
break; break;
case ICE1712_SUBDEVICE_DELTA66E:
tmp |= ICE1712_DELTA_66E_CS_CS8427;
break;
case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_VX442:
tmp |= ICE1712_VX442_CS_DIGITAL; tmp |= ICE1712_VX442_CS_DIGITAL;
break; break;
...@@ -275,6 +283,20 @@ static void delta1010lt_ak4524_lock(struct snd_akm4xxx *ak, int chip) ...@@ -275,6 +283,20 @@ static void delta1010lt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
priv->cs_addr = chip << 4; priv->cs_addr = chip << 4;
} }
/*
* AK4524 on Delta66 rev E to choose the chip address
*/
static void delta66e_ak4524_lock(struct snd_akm4xxx *ak, int chip)
{
struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
struct snd_ice1712 *ice = ak->private_data[0];
snd_ice1712_save_gpio_status(ice);
priv->cs_mask =
priv->cs_addr = chip == 0 ? ICE1712_DELTA_66E_CS_CHIP_A :
ICE1712_DELTA_66E_CS_CHIP_B;
}
/* /*
* AK4528 on VX442 to choose the chip mask * AK4528 on VX442 to choose the chip mask
*/ */
...@@ -487,6 +509,29 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = { ...@@ -487,6 +509,29 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = {
.mask_flags = 0, .mask_flags = 0,
}; };
static struct snd_akm4xxx akm_delta66e __devinitdata = {
.type = SND_AK4524,
.num_adcs = 4,
.num_dacs = 4,
.ops = {
.lock = delta66e_ak4524_lock,
.set_rate_val = delta_ak4524_set_rate_val
}
};
static struct snd_ak4xxx_private akm_delta66e_priv __devinitdata = {
.caddr = 2,
.cif = 0, /* the default level of the CIF pin from AK4524 */
.data_mask = ICE1712_DELTA_66E_DOUT,
.clk_mask = ICE1712_DELTA_66E_CCLK,
.cs_mask = 0,
.cs_addr = 0, /* set later */
.cs_none = 0,
.add_flags = 0,
.mask_flags = 0,
};
static struct snd_akm4xxx akm_delta44 __devinitdata = { static struct snd_akm4xxx akm_delta44 __devinitdata = {
.type = SND_AK4524, .type = SND_AK4524,
.num_adcs = 4, .num_adcs = 4,
...@@ -644,9 +689,11 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice) ...@@ -644,9 +689,11 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
err = snd_ice1712_akm4xxx_init(ak, &akm_delta44, &akm_delta44_priv, ice); err = snd_ice1712_akm4xxx_init(ak, &akm_delta44, &akm_delta44_priv, ice);
break; break;
case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_VX442:
case ICE1712_SUBDEVICE_DELTA66E:
err = snd_ice1712_akm4xxx_init(ak, &akm_vx442, &akm_vx442_priv, ice); err = snd_ice1712_akm4xxx_init(ak, &akm_vx442, &akm_vx442_priv, ice);
break; break;
case ICE1712_SUBDEVICE_DELTA66E:
err = snd_ice1712_akm4xxx_init(ak, &akm_delta66e, &akm_delta66e_priv, ice);
break;
default: default:
snd_BUG(); snd_BUG();
return -EINVAL; return -EINVAL;
......
...@@ -144,6 +144,17 @@ extern struct snd_ice1712_card_info snd_ice1712_delta_cards[]; ...@@ -144,6 +144,17 @@ extern struct snd_ice1712_card_info snd_ice1712_delta_cards[];
#define ICE1712_DELTA_1010LT_CS_NONE 0x50 /* nothing */ #define ICE1712_DELTA_1010LT_CS_NONE 0x50 /* nothing */
#define ICE1712_DELTA_1010LT_WORDCLOCK 0x80 /* sample clock source: 0 = Word Clock Input, 1 = S/PDIF Input ??? */ #define ICE1712_DELTA_1010LT_WORDCLOCK 0x80 /* sample clock source: 0 = Word Clock Input, 1 = S/PDIF Input ??? */
/* M-Audio Delta 66 rev. E definitions.
* Newer revisions of Delta 66 have CS8427 over SPI for
* S/PDIF transceiver instead of CS8404/CS8414. */
/* 0x01 = DFS */
#define ICE1712_DELTA_66E_CCLK 0x02 /* SPI clock */
#define ICE1712_DELTA_66E_DIN 0x04 /* data input */
#define ICE1712_DELTA_66E_DOUT 0x08 /* data output */
#define ICE1712_DELTA_66E_CS_CS8427 0x10 /* chip select, low = CS8427 */
#define ICE1712_DELTA_66E_CS_CHIP_A 0x20 /* AK4524 #0 */
#define ICE1712_DELTA_66E_CS_CHIP_B 0x40 /* AK4524 #1 */
/* Digigram VX442 definitions */ /* Digigram VX442 definitions */
#define ICE1712_VX442_CCLK 0x02 /* SPI clock */ #define ICE1712_VX442_CCLK 0x02 /* SPI clock */
#define ICE1712_VX442_DIN 0x04 /* data input */ #define ICE1712_VX442_DIN 0x04 /* data input */
......
snd-oxygen-lib-objs := oxygen_io.o oxygen_lib.o oxygen_mixer.o oxygen_pcm.o snd-oxygen-lib-objs := oxygen_io.o oxygen_lib.o oxygen_mixer.o oxygen_pcm.o
snd-hifier-objs := hifier.o snd-oxygen-objs := oxygen.o xonar_dg.o
snd-oxygen-objs := oxygen.o
snd-virtuoso-objs := virtuoso.o xonar_lib.o \ snd-virtuoso-objs := virtuoso.o xonar_lib.o \
xonar_pcm179x.o xonar_cs43xx.o xonar_wm87x6.o xonar_hdmi.o xonar_pcm179x.o xonar_cs43xx.o xonar_wm87x6.o xonar_hdmi.o
obj-$(CONFIG_SND_OXYGEN_LIB) += snd-oxygen-lib.o obj-$(CONFIG_SND_OXYGEN_LIB) += snd-oxygen-lib.o
obj-$(CONFIG_SND_HIFIER) += snd-hifier.o
obj-$(CONFIG_SND_OXYGEN) += snd-oxygen.o obj-$(CONFIG_SND_OXYGEN) += snd-oxygen.o
obj-$(CONFIG_SND_VIRTUOSO) += snd-virtuoso.o obj-$(CONFIG_SND_VIRTUOSO) += snd-virtuoso.o
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
#define PCM_AC97 5 #define PCM_AC97 5
#define PCM_COUNT 6 #define PCM_COUNT 6
#define OXYGEN_MCLKS(f_single, f_double, f_quad) ((MCLK_##f_single << 0) | \
(MCLK_##f_double << 2) | \
(MCLK_##f_quad << 4))
#define OXYGEN_IO_SIZE 0x100 #define OXYGEN_IO_SIZE 0x100
#define OXYGEN_EEPROM_ID 0x434d /* "CM" */ #define OXYGEN_EEPROM_ID 0x434d /* "CM" */
...@@ -35,6 +39,7 @@ ...@@ -35,6 +39,7 @@
#define MIDI_OUTPUT 0x0800 #define MIDI_OUTPUT 0x0800
#define MIDI_INPUT 0x1000 #define MIDI_INPUT 0x1000
#define AC97_CD_INPUT 0x2000 #define AC97_CD_INPUT 0x2000
#define AC97_FMIC_SWITCH 0x4000
enum { enum {
CONTROL_SPDIF_PCM, CONTROL_SPDIF_PCM,
...@@ -65,6 +70,7 @@ struct snd_pcm_hardware; ...@@ -65,6 +70,7 @@ struct snd_pcm_hardware;
struct snd_pcm_hw_params; struct snd_pcm_hw_params;
struct snd_kcontrol_new; struct snd_kcontrol_new;
struct snd_rawmidi; struct snd_rawmidi;
struct snd_info_buffer;
struct oxygen; struct oxygen;
struct oxygen_model { struct oxygen_model {
...@@ -79,8 +85,6 @@ struct oxygen_model { ...@@ -79,8 +85,6 @@ struct oxygen_model {
void (*resume)(struct oxygen *chip); void (*resume)(struct oxygen *chip);
void (*pcm_hardware_filter)(unsigned int channel, void (*pcm_hardware_filter)(unsigned int channel,
struct snd_pcm_hardware *hardware); struct snd_pcm_hardware *hardware);
unsigned int (*get_i2s_mclk)(struct oxygen *chip, unsigned int channel,
struct snd_pcm_hw_params *hw_params);
void (*set_dac_params)(struct oxygen *chip, void (*set_dac_params)(struct oxygen *chip,
struct snd_pcm_hw_params *params); struct snd_pcm_hw_params *params);
void (*set_adc_params)(struct oxygen *chip, void (*set_adc_params)(struct oxygen *chip,
...@@ -92,15 +96,19 @@ struct oxygen_model { ...@@ -92,15 +96,19 @@ struct oxygen_model {
void (*uart_input)(struct oxygen *chip); void (*uart_input)(struct oxygen *chip);
void (*ac97_switch)(struct oxygen *chip, void (*ac97_switch)(struct oxygen *chip,
unsigned int reg, unsigned int mute); unsigned int reg, unsigned int mute);
void (*dump_registers)(struct oxygen *chip,
struct snd_info_buffer *buffer);
const unsigned int *dac_tlv; const unsigned int *dac_tlv;
unsigned long private_data;
size_t model_data_size; size_t model_data_size;
unsigned int device_config; unsigned int device_config;
u8 dac_channels; u8 dac_channels_pcm;
u8 dac_channels_mixer;
u8 dac_volume_min; u8 dac_volume_min;
u8 dac_volume_max; u8 dac_volume_max;
u8 misc_flags; u8 misc_flags;
u8 function_flags; u8 function_flags;
u8 dac_mclks;
u8 adc_mclks;
u16 dac_i2s_format; u16 dac_i2s_format;
u16 adc_i2s_format; u16 adc_i2s_format;
}; };
...@@ -121,7 +129,6 @@ struct oxygen { ...@@ -121,7 +129,6 @@ struct oxygen {
u8 pcm_running; u8 pcm_running;
u8 dac_routing; u8 dac_routing;
u8 spdif_playback_enable; u8 spdif_playback_enable;
u8 revision;
u8 has_ac97_0; u8 has_ac97_0;
u8 has_ac97_1; u8 has_ac97_1;
u32 spdif_bits; u32 spdif_bits;
...@@ -167,8 +174,6 @@ void oxygen_update_spdif_source(struct oxygen *chip); ...@@ -167,8 +174,6 @@ void oxygen_update_spdif_source(struct oxygen *chip);
/* oxygen_pcm.c */ /* oxygen_pcm.c */
int oxygen_pcm_init(struct oxygen *chip); int oxygen_pcm_init(struct oxygen *chip);
unsigned int oxygen_default_i2s_mclk(struct oxygen *chip, unsigned int channel,
struct snd_pcm_hw_params *hw_params);
/* oxygen_io.c */ /* oxygen_io.c */
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册