~ubuntu-branches/ubuntu/lucid/linux-ec2/lucid-proposed

« back to all changes in this revision

Viewing changes to sound/pci/hda/patch_realtek.c

  • Committer: Package Import Robot
  • Author(s): Stefan Bader, Stefan Bader, Ubuntu: 2.6.32-49.111
  • Date: 2013-06-19 09:57:14 UTC
  • Revision ID: package-import@ubuntu.com-20130619095714-5zz4z0yt038px5am
Tags: 2.6.32-354.67
[ Stefan Bader ]

* Rebased to Ubuntu-2.6.32-49.111
* SAUCE: ec2: Backport x86/mm: Check if PUD is large when validating a
  kernel address
  - LP: #1193044
* SAUCE: ec2: Backport x86, ioapic: initialize nr_ioapic_registers early
  in mp_register_ioapic()
  - LP: #1193044
* Release Tracking Bug
  - LP: #1193202

[ Ubuntu: 2.6.32-49.111 ]

* Revert "pcdp: use early_ioremap/early_iounmap to access pcdp table"
  - LP: #1193044
* Revert "block: improve queue_should_plug() by looking at IO depths"
  - LP: #1193044
* kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
  - LP: #1187732
  - CVE-2013-2141
* b43: stop format string leaking into error msgs
  - LP: #1189833
  - CVE-2013-2852
* 2.6.32.y: timekeeping: Fix nohz issue with commit
  61b76840ddee647c0c223365378c3f394355b7d7
  - LP: #1193044
* clockevents: Don't allow dummy broadcast timers
  - LP: #1193044
* posix-cpu-timers: Fix nanosleep task_struct leak
  - LP: #1193044
* timer: Don't reinitialize the cpu base lock during CPU_UP_PREPARE
  - LP: #1193044
* tick: Cleanup NOHZ per cpu data on cpu down
  - LP: #1193044
* kbuild: Fix gcc -x syntax
  - LP: #1193044
* gen_init_cpio: avoid stack overflow when expanding
  - LP: #1193044
* coredump: prevent double-free on an error path in core dumper
  - LP: #1193044
* kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()
  - LP: #1193044
* ring-buffer: Fix race between integrity check and readers
  - LP: #1193044
* genalloc: stop crashing the system when destroying a pool
  - LP: #1193044
* kernel/resource.c: fix stack overflow in __reserve_region_with_split()
  - LP: #1193044
* Driver core: treat unregistered bus_types as having no devices
  - LP: #1193044
* cgroup: remove incorrect dget/dput() pair in cgroup_create_dir()
  - LP: #1193044
* Fix a dead loop in async_synchronize_full()
  - LP: #1193044
* tracing: Don't call page_to_pfn() if page is NULL
  - LP: #1193044
* tracing: Fix double free when function profile init failed
  - LP: #1193044
* mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED
  - LP: #1193044
* mm: bugfix: set current->reclaim_state to NULL while returning from
  kswapd()
  - LP: #1193044
* mm: fix invalidate_complete_page2() lock ordering
  - LP: #1193044
* mempolicy: fix a race in shared_policy_replace()
  - LP: #1193044
* ALSA: hda - More ALC663 fixes and support of compatible chips
  - LP: #1193044
* ALSA: hda - Add a pin-fix for FSC Amilo Pi1505
  - LP: #1193044
* ALSA: seq: Fix missing error handling in snd_seq_timer_open()
  - LP: #1193044
* ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
  - LP: #1193044
* x86, ioapic: initialize nr_ioapic_registers early in
  mp_register_ioapic()
  - LP: #1193044
* x86: Don't use the EFI reboot method by default
  - LP: #1193044
* x86, random: make ARCH_RANDOM prompt if EMBEDDED, not EXPERT
  - LP: #1193044
* x86/mm: Check if PUD is large when validating a kernel address
  - LP: #1193044
* x86, mm, paravirt: Fix vmalloc_fault oops during lazy MMU updates
  - LP: #1193044
* xen/bootup: allow read_tscp call for Xen PV guests.
  - LP: #1193044
* xen/bootup: allow {read|write}_cr8 pvops call.
  - LP: #1193044
* KVM: x86: relax MSR_KVM_SYSTEM_TIME alignment check
  - LP: #1193044
* KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set
  (CVE-2012-4461)
  - LP: #1193044
* MCE: Fix vm86 handling for 32bit mce handler
  - LP: #1193044
* ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled
  - LP: #1193044
* alpha: Add irongate_io to PCI bus resources
  - LP: #1193044
* PARISC: fix user-triggerable panic on parisc
  - LP: #1193044
* serial: 8250, increase PASS_LIMIT
  - LP: #1193044
* drivers/char/ipmi: memcpy, need additional 2 bytes to avoid memory
  overflow
  - LP: #1193044
* w1: fix oops when w1_search is called from netlink connector
  - LP: #1193044
* staging: comedi: ni_labpc: correct differential channel sequence for AI
  commands
  - LP: #1193044
* staging: comedi: ni_labpc: set up command4 register *after* command3
  - LP: #1193044
* staging: comedi: comedi_test: fix race when cancelling command
  - LP: #1193044
* staging: comedi: fix memory leak for saved channel list
  - LP: #1193044
* staging: comedi: s626: don't dereference insn->data
  - LP: #1193044
* staging: comedi: jr3_pci: fix iomem dereference
  - LP: #1193044
* staging: comedi: don't dereference user memory for INSN_INTTRIG
  - LP: #1193044
* staging: comedi: check s->async for poll(), read() and write()
  - LP: #1193044
* staging: comedi: das08: Correct AO output for das08jr-16-ao
  - LP: #1193044
* staging: vt6656: [BUG] out of bound array reference in RFbSetPower.
  - LP: #1193044
* libata: fix Null pointer dereference on disk error
  - LP: #1193044
* scsi: Silence unnecessary warnings about ioctl to partition
  - LP: #1193044
* scsi: use __uX types for headers exported to user space
  - LP: #1193044
* fix crash in scsi_dispatch_cmd()
  - LP: #1193044
* SCSI: bnx2i: Fixed NULL ptr deference for 1G bnx2 Linux iSCSI offload
  - LP: #1193044
* crypto: cryptd - disable softirqs in cryptd_queue_worker to prevent
  data corruption
  - LP: #1193044
* xfrm_user: return error pointer instead of NULL #2
  - LP: #1193044
* r8169: correct settings of rtl8102e.
  - LP: #1193044
* r8169: remove the obsolete and incorrect AMD workaround
  - LP: #1193044
* r8169: Add support for D-Link 530T rev C1 (Kernel Bug 38862)
  - LP: #1193044
* r8169: incorrect identifier for a 8168dp
  - LP: #1193044
* b43legacy: Fix crash on unload when firmware not available
  - LP: #1193044
* tg3: Avoid null pointer dereference in tg3_interrupt in netconsole mode
  - LP: #1193044
* IPoIB: Fix use-after-free of multicast object
  - LP: #1193044
* telephony: ijx: buffer overflow in ixj_write_cid()
  - LP: #1193044
* Bluetooth: HCI - Fix info leak in getsockopt(HCI_FILTER)
  - LP: #1193044
* xhci: Make handover code more robust
  - LP: #1193044
* USB: whiteheat: fix memory leak in error path
  - LP: #1193044
* USB: serial: Fix memory leak in sierra_release()
  - LP: #1193044
* USB: mos7840: fix urb leak at release
  - LP: #1193044
* USB: mos7840: fix port-device leak in error path
  - LP: #1193044
* USB: garmin_gps: fix memory leak on disconnect
  - LP: #1193044
* USB: serial: ftdi_sio: Handle the old_termios == 0 case e.g.
  uart_resume_port()
  - LP: #1193044
* USB: ftdi_sio: Quiet sparse noise about using plain integer was NULL
  pointer
  - LP: #1193044
* epoll: prevent missed events on EPOLL_CTL_MOD
  - LP: #1193044
* fs/fscache/stats.c: fix memory leak
  - LP: #1193044
* sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
  - LP: #1193044
* jbd: Delay discarding buffers in journal_unmap_buffer
  - LP: #1193044
* jbd: Fix assertion failure in commit code due to lacking transaction
  credits
  - LP: #1193044
* jbd: Fix lock ordering bug in journal_unmap_buffer()
  - LP: #1193044
* ext4: Fix fs corruption when make_indexed_dir() fails
  - LP: #1193044
* ext4: don't dereference null pointer when make_indexed_dir() fails
  - LP: #1193044
* ext4: fix memory leak in ext4_xattr_set_acl()'s error path
  - LP: #1193044
* ext4: online defrag is not supported for journaled files
  - LP: #1193044
* ext4: always set i_op in ext4_mknod()
  - LP: #1193044
* ext4: fix fdatasync() for files with only i_size changes
  - LP: #1193044
* ext4: lock i_mutex when truncating orphan inodes
  - LP: #1193044
* ext4: fix race in ext4_mb_add_n_trim()
  - LP: #1193044
* ext4: limit group search loop for non-extent files
  - LP: #1193044
* CVE-2012-4508 kernel: ext4: AIO vs fallocate stale data exposure
  - LP: #1193044
  - CVE-2012-4508 kernel: ext4: AIO vs fallocate stale data exposure
* ext4: make orphan functions be no-op in no-journal mode
  - LP: #1193044
* ext4: avoid hang when mounting non-journal filesystems with orphan list
  - LP: #1193044
* udf: fix memory leak while allocating blocks during write
  - LP: #1193044
* udf: Fix bitmap overflow on large filesystems with small block size
  - LP: #1193044
* fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
  - LP: #1193044
* fat: Fix stat->f_namelen
  - LP: #1193044
* hfsplus: fix potential overflow in hfsplus_file_truncate()
  - LP: #1193044
* btrfs: use rcu_barrier() to wait for bdev puts at unmount
  - LP: #1193044
* kernel panic when mount NFSv4
  - LP: #1193044
* nfsd4: fix oops on unusual readlike compound
  - LP: #1193044
* net/core: Fix potential memory leak in dev_set_alias()
  - LP: #1193044
* net: reduce net_rx_action() latency to 2 HZ
  - LP: #1193044
* softirq: reduce latencies
  - LP: #1193044
* af_packet: remove BUG statement in tpacket_destruct_skb
  - LP: #1193044
* bridge: set priority of STP packets
  - LP: #1193044
* bonding: Fix slave selection bug.
  - LP: #1193044
* ipv4: check rt_genid in dst_check
  - LP: #1193044
* net_sched: gact: Fix potential panic in tcf_gact().
  - LP: #1193044
* net: sched: integer overflow fix
  - LP: #1193044
* net: prevent setting ttl=0 via IP_TTL
  - LP: #1193044
* net: guard tcp_set_keepalive() to tcp sockets
  - LP: #1193044
* inet: add RCU protection to inet->opt
  - LP: #1193044
* tcp: allow splice() to build full TSO packets
  - LP: #1193044
* tcp: fix MSG_SENDPAGE_NOTLAST logic
  - LP: #1193044
* tcp: preserve ACK clocking in TSO
  - LP: #1193044
* unix: fix a race condition in unix_release()
  - LP: #1193044
* sctp: fix memory leak in sctp_datamsg_from_user() when copy from user
  space fails
  - LP: #1193044
* net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
  - LP: #1193044
* net: sctp: sctp_endpoint_free: zero out secret key data
  - LP: #1193044
* net: sctp: sctp_auth_key_put: use kzfree instead of kfree
  - LP: #1193044
* netfilter: nf_ct_ipv4: packets with wrong ihl are invalid
  - LP: #1193044
* ipvs: allow transmit of GRO aggregated skbs
  - LP: #1193044
* ipvs: IPv6 MTU checking cleanup and bugfix
  - LP: #1193044
* isdnloop: fix and simplify isdnloop_init()
  - LP: #1193044
* mpt2sas: Send default descriptor for RAID pass through in mpt2ctl
  - LP: #1193044
* x86, ptrace: fix build breakage with gcc 4.7
  - LP: #1193044
* Linux 2.6.32.61
  - LP: #1193044

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
enum {
132
132
        ALC269_BASIC,
133
133
        ALC269_QUANTA_FL1,
134
 
        ALC269_ASUS_EEEPC_P703,
135
 
        ALC269_ASUS_EEEPC_P901,
 
134
        ALC269_ASUS_AMIC,
 
135
        ALC269_ASUS_DMIC,
136
136
        ALC269_FUJITSU,
137
137
        ALC269_LIFEBOOK,
138
138
        ALC269_AUTO,
188
188
        ALC663_ASUS_MODE4,
189
189
        ALC663_ASUS_MODE5,
190
190
        ALC663_ASUS_MODE6,
 
191
        ALC663_ASUS_MODE7,
 
192
        ALC663_ASUS_MODE8,
191
193
        ALC272_DELL,
192
194
        ALC272_DELL_ZM1,
193
195
        ALC272_SAMSUNG_NC10,
13234
13236
/* toggle speaker-output according to the hp-jack state */
13235
13237
static void alc269_speaker_automute(struct hda_codec *codec)
13236
13238
{
 
13239
        struct alc_spec *spec = codec->spec;
 
13240
        unsigned int nid = spec->autocfg.hp_pins[0];
13237
13241
        unsigned int present;
13238
13242
        unsigned char bits;
13239
13243
 
13240
 
        present = snd_hda_codec_read(codec, 0x15, 0,
 
13244
        present = snd_hda_codec_read(codec, nid, 0,
13241
13245
                                AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
13242
13246
        bits = present ? AMP_IN_MUTE(0) : 0;
13243
13247
        snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13463
13467
static const char *alc269_models[ALC269_MODEL_LAST] = {
13464
13468
        [ALC269_BASIC]                  = "basic",
13465
13469
        [ALC269_QUANTA_FL1]             = "quanta",
13466
 
        [ALC269_ASUS_EEEPC_P703]        = "eeepc-p703",
13467
 
        [ALC269_ASUS_EEEPC_P901]        = "eeepc-p901",
 
13470
        [ALC269_ASUS_AMIC]              = "asus-amic",
 
13471
        [ALC269_ASUS_DMIC]              = "asus-dmic",
13468
13472
        [ALC269_FUJITSU]                = "fujitsu",
13469
13473
        [ALC269_LIFEBOOK]               = "lifebook",
13470
13474
        [ALC269_AUTO]                   = "auto",
13473
13477
static struct snd_pci_quirk alc269_cfg_tbl[] = {
13474
13478
        SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1),
13475
13479
        SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
13476
 
                      ALC269_ASUS_EEEPC_P703),
13477
 
        SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_EEEPC_P703),
13478
 
        SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_EEEPC_P703),
13479
 
        SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_EEEPC_P703),
13480
 
        SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_EEEPC_P703),
13481
 
        SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_EEEPC_P703),
13482
 
        SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_EEEPC_P703),
 
13480
                      ALC269_ASUS_AMIC),
 
13481
        SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_ASUS_AMIC),
 
13482
        SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80JT", ALC269_ASUS_AMIC),
 
13483
        SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_ASUS_AMIC),
 
13484
        SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_ASUS_AMIC),
 
13485
        SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_ASUS_AMIC),
 
13486
        SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_ASUS_AMIC),
 
13487
        SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_ASUS_AMIC),
 
13488
        SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_ASUS_AMIC),
 
13489
        SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_ASUS_AMIC),
 
13490
        SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_ASUS_AMIC),
 
13491
        SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_ASUS_AMIC),
 
13492
        SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_ASUS_AMIC),
 
13493
        SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_ASUS_AMIC),
 
13494
        SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_ASUS_AMIC),
 
13495
        SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_ASUS_AMIC),
 
13496
        SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_ASUS_AMIC),
 
13497
        SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_ASUS_AMIC),
 
13498
        SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_ASUS_AMIC),
 
13499
        SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_ASUS_AMIC),
 
13500
        SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_ASUS_AMIC),
 
13501
        SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_AMIC),
 
13502
        SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_ASUS_AMIC),
 
13503
        SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_AMIC),
 
13504
        SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_DMIC),
 
13505
        SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_AMIC),
 
13506
        SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_AMIC),
 
13507
        SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_AMIC),
 
13508
        SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_AMIC),
13483
13509
        SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
13484
 
                      ALC269_ASUS_EEEPC_P901),
 
13510
                      ALC269_ASUS_DMIC),
13485
13511
        SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
13486
 
                      ALC269_ASUS_EEEPC_P901),
13487
 
        SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_EEEPC_P901),
 
13512
                      ALC269_ASUS_DMIC),
 
13513
        SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_ASUS_DMIC),
 
13514
        SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_ASUS_DMIC),
13488
13515
        SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
13489
13516
        SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK),
13490
13517
        {}
13514
13541
                .setup = alc269_quanta_fl1_setup,
13515
13542
                .init_hook = alc269_quanta_fl1_init_hook,
13516
13543
        },
13517
 
        [ALC269_ASUS_EEEPC_P703] = {
 
13544
        [ALC269_ASUS_AMIC] = {
13518
13545
                .mixers = { alc269_eeepc_mixer },
13519
13546
                .cap_mixer = alc269_epc_capture_mixer,
13520
13547
                .init_verbs = { alc269_init_verbs,
13528
13555
                .setup = alc269_eeepc_amic_setup,
13529
13556
                .init_hook = alc269_eeepc_inithook,
13530
13557
        },
13531
 
        [ALC269_ASUS_EEEPC_P901] = {
 
13558
        [ALC269_ASUS_DMIC] = {
13532
13559
                .mixers = { alc269_eeepc_mixer },
13533
13560
                .cap_mixer = alc269_epc_capture_mixer,
13534
13561
                .init_verbs = { alc269_init_verbs,
14686
14713
        },
14687
14714
};
14688
14715
 
 
14716
/* Pin config fixes */
 
14717
enum {
 
14718
        PINFIX_FSC_AMILO_PI1505,
 
14719
};
 
14720
 
 
14721
static struct alc_pincfg alc861_fsc_amilo_pi1505_pinfix[] = {
 
14722
        { 0x0b, 0x0221101f }, /* HP */
 
14723
        { 0x0f, 0x90170310 }, /* speaker */
 
14724
        { }
 
14725
};
 
14726
 
 
14727
static const struct alc_fixup alc861_fixups[] = {
 
14728
        [PINFIX_FSC_AMILO_PI1505] = {
 
14729
                .pins = alc861_fsc_amilo_pi1505_pinfix
 
14730
        },
 
14731
};
 
14732
 
 
14733
static struct snd_pci_quirk alc861_fixup_tbl[] = {
 
14734
        SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1505),
 
14735
        {}
 
14736
};
14689
14737
 
14690
14738
static int patch_alc861(struct hda_codec *codec)
14691
14739
{
14709
14757
                board_config = ALC861_AUTO;
14710
14758
        }
14711
14759
 
 
14760
        alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups);
 
14761
 
14712
14762
        if (board_config == ALC861_AUTO) {
14713
14763
                /* automatic parse from the BIOS config */
14714
14764
                err = alc861_parse_auto_config(codec);
16144
16194
        { } /* end */
16145
16195
};
16146
16196
 
 
16197
static struct hda_bind_ctls alc663_asus_mode7_8_all_bind_switch = {
 
16198
        .ops = &snd_hda_bind_sw,
 
16199
        .values = {
 
16200
                HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
 
16201
                HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
 
16202
                HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
 
16203
                HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT),
 
16204
                HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
 
16205
                0
 
16206
        },
 
16207
};
 
16208
 
 
16209
static struct hda_bind_ctls alc663_asus_mode7_8_sp_bind_switch = {
 
16210
        .ops = &snd_hda_bind_sw,
 
16211
        .values = {
 
16212
                HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
 
16213
                HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
 
16214
                0
 
16215
        },
 
16216
};
 
16217
 
 
16218
static struct snd_kcontrol_new alc663_mode7_mixer[] = {
 
16219
        HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
 
16220
        HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
 
16221
        HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
 
16222
        HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
 
16223
        HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
 
16224
        HDA_CODEC_VOLUME("IntMic Playback Volume", 0x0b, 0x0, HDA_INPUT),
 
16225
        HDA_CODEC_MUTE("IntMic Playback Switch", 0x0b, 0x0, HDA_INPUT),
 
16226
        HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
 
16227
        HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
 
16228
        { } /* end */
 
16229
};
 
16230
 
 
16231
static struct snd_kcontrol_new alc663_mode8_mixer[] = {
 
16232
        HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
 
16233
        HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
 
16234
        HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
 
16235
        HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x15, 0x0, HDA_OUTPUT),
 
16236
        HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
 
16237
        HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
 
16238
        HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
 
16239
        { } /* end */
 
16240
};
 
16241
 
 
16242
 
16147
16243
static struct snd_kcontrol_new alc662_chmode_mixer[] = {
16148
16244
        {
16149
16245
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
16431
16527
        {}
16432
16528
};
16433
16529
 
 
16530
static struct hda_verb alc663_mode7_init_verbs[] = {
 
16531
        {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
 
16532
        {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
 
16533
        {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
 
16534
        {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
16535
        {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
 
16536
        {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
16537
        {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
 
16538
        {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
 
16539
        {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
16540
        {0x21, AC_VERB_SET_CONNECT_SEL, 0x01},  /* Headphone */
 
16541
        {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
 
16542
        {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
 
16543
        {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
 
16544
        {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
 
16545
        {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
 
16546
        {}
 
16547
};
 
16548
 
 
16549
static struct hda_verb alc663_mode8_init_verbs[] = {
 
16550
        {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
 
16551
        {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
 
16552
        {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
16553
        {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
 
16554
        {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
 
16555
        {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
 
16556
        {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
16557
        {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
 
16558
        {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
 
16559
        {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
 
16560
        {0x21, AC_VERB_SET_CONNECT_SEL, 0x01},  /* Headphone */
 
16561
        {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
 
16562
        {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
 
16563
        {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
 
16564
        {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
 
16565
        {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
 
16566
        {}
 
16567
};
 
16568
 
16434
16569
static struct snd_kcontrol_new alc662_auto_capture_mixer[] = {
16435
16570
        HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
16436
16571
        HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
16626
16761
        }
16627
16762
}
16628
16763
 
 
16764
static void alc663_two_hp_m7_speaker_automute(struct hda_codec *codec)
 
16765
{
 
16766
        unsigned int present1, present2;
 
16767
 
 
16768
        present1 = snd_hda_codec_read(codec, 0x1b, 0,
 
16769
                        AC_VERB_GET_PIN_SENSE, 0)
 
16770
                        & AC_PINSENSE_PRESENCE;
 
16771
        present2 = snd_hda_codec_read(codec, 0x21, 0,
 
16772
                        AC_VERB_GET_PIN_SENSE, 0)
 
16773
                        & AC_PINSENSE_PRESENCE;
 
16774
 
 
16775
        if (present1 || present2) {
 
16776
                snd_hda_codec_write_cache(codec, 0x14, 0,
 
16777
                        AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
 
16778
                snd_hda_codec_write_cache(codec, 0x17, 0,
 
16779
                        AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
 
16780
        } else {
 
16781
                snd_hda_codec_write_cache(codec, 0x14, 0,
 
16782
                        AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
 
16783
                snd_hda_codec_write_cache(codec, 0x17, 0,
 
16784
                        AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
 
16785
        }
 
16786
}
 
16787
 
 
16788
static void alc663_two_hp_m8_speaker_automute(struct hda_codec *codec)
 
16789
{
 
16790
        unsigned int present1, present2;
 
16791
 
 
16792
        present1 = snd_hda_codec_read(codec, 0x21, 0,
 
16793
                        AC_VERB_GET_PIN_SENSE, 0)
 
16794
                        & AC_PINSENSE_PRESENCE;
 
16795
        present2 = snd_hda_codec_read(codec, 0x15, 0,
 
16796
                        AC_VERB_GET_PIN_SENSE, 0)
 
16797
                        & AC_PINSENSE_PRESENCE;
 
16798
 
 
16799
        if (present1 || present2) {
 
16800
                snd_hda_codec_write_cache(codec, 0x14, 0,
 
16801
                        AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
 
16802
                snd_hda_codec_write_cache(codec, 0x17, 0,
 
16803
                        AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
 
16804
        } else {
 
16805
                snd_hda_codec_write_cache(codec, 0x14, 0,
 
16806
                        AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
 
16807
                snd_hda_codec_write_cache(codec, 0x17, 0,
 
16808
                        AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
 
16809
        }
 
16810
}
 
16811
 
16629
16812
static void alc663_m51va_unsol_event(struct hda_codec *codec,
16630
16813
                                           unsigned int res)
16631
16814
{
16645
16828
        spec->ext_mic.pin = 0x18;
16646
16829
        spec->ext_mic.mux_idx = 0;
16647
16830
        spec->int_mic.pin = 0x12;
16648
 
        spec->int_mic.mux_idx = 1;
 
16831
        spec->int_mic.mux_idx = 9;
16649
16832
        spec->auto_mic = 1;
16650
16833
}
16651
16834
 
16657
16840
 
16658
16841
/* ***************** Mode1 ******************************/
16659
16842
#define alc663_mode1_unsol_event        alc663_m51va_unsol_event
16660
 
#define alc663_mode1_setup              alc663_m51va_setup
 
16843
 
 
16844
static void alc663_mode1_setup(struct hda_codec *codec)
 
16845
{
 
16846
        struct alc_spec *spec = codec->spec;
 
16847
        spec->ext_mic.pin = 0x18;
 
16848
        spec->ext_mic.mux_idx = 0;
 
16849
        spec->int_mic.pin = 0x19;
 
16850
        spec->int_mic.mux_idx = 1;
 
16851
        spec->auto_mic = 1;
 
16852
}
 
16853
 
16661
16854
#define alc663_mode1_inithook           alc663_m51va_inithook
16662
16855
 
16663
16856
/* ***************** Mode2 ******************************/
16674
16867
        }
16675
16868
}
16676
16869
 
16677
 
#define alc662_mode2_setup      alc663_m51va_setup
 
16870
#define alc662_mode2_setup      alc663_mode1_setup
16678
16871
 
16679
16872
static void alc662_mode2_inithook(struct hda_codec *codec)
16680
16873
{
16695
16888
        }
16696
16889
}
16697
16890
 
16698
 
#define alc663_mode3_setup      alc663_m51va_setup
 
16891
#define alc663_mode3_setup      alc663_mode1_setup
16699
16892
 
16700
16893
static void alc663_mode3_inithook(struct hda_codec *codec)
16701
16894
{
16716
16909
        }
16717
16910
}
16718
16911
 
16719
 
#define alc663_mode4_setup      alc663_m51va_setup
 
16912
#define alc663_mode4_setup      alc663_mode1_setup
16720
16913
 
16721
16914
static void alc663_mode4_inithook(struct hda_codec *codec)
16722
16915
{
16737
16930
        }
16738
16931
}
16739
16932
 
16740
 
#define alc663_mode5_setup      alc663_m51va_setup
 
16933
#define alc663_mode5_setup      alc663_mode1_setup
16741
16934
 
16742
16935
static void alc663_mode5_inithook(struct hda_codec *codec)
16743
16936
{
16758
16951
        }
16759
16952
}
16760
16953
 
16761
 
#define alc663_mode6_setup      alc663_m51va_setup
 
16954
#define alc663_mode6_setup      alc663_mode1_setup
16762
16955
 
16763
16956
static void alc663_mode6_inithook(struct hda_codec *codec)
16764
16957
{
16766
16959
        alc_mic_automute(codec);
16767
16960
}
16768
16961
 
 
16962
/* ***************** Mode7 ******************************/
 
16963
static void alc663_mode7_unsol_event(struct hda_codec *codec,
 
16964
                                           unsigned int res)
 
16965
{
 
16966
        switch (res >> 26) {
 
16967
        case ALC880_HP_EVENT:
 
16968
                alc663_two_hp_m7_speaker_automute(codec);
 
16969
                break;
 
16970
        case ALC880_MIC_EVENT:
 
16971
                alc_mic_automute(codec);
 
16972
                break;
 
16973
        }
 
16974
}
 
16975
 
 
16976
#define alc663_mode7_setup      alc663_mode1_setup
 
16977
 
 
16978
static void alc663_mode7_inithook(struct hda_codec *codec)
 
16979
{
 
16980
        alc663_two_hp_m7_speaker_automute(codec);
 
16981
        alc_mic_automute(codec);
 
16982
}
 
16983
 
 
16984
/* ***************** Mode8 ******************************/
 
16985
static void alc663_mode8_unsol_event(struct hda_codec *codec,
 
16986
                                           unsigned int res)
 
16987
{
 
16988
        switch (res >> 26) {
 
16989
        case ALC880_HP_EVENT:
 
16990
                alc663_two_hp_m8_speaker_automute(codec);
 
16991
                break;
 
16992
        case ALC880_MIC_EVENT:
 
16993
                alc_mic_automute(codec);
 
16994
                break;
 
16995
        }
 
16996
}
 
16997
 
 
16998
#define alc663_mode8_setup      alc663_m51va_setup
 
16999
 
 
17000
static void alc663_mode8_inithook(struct hda_codec *codec)
 
17001
{
 
17002
        alc663_two_hp_m8_speaker_automute(codec);
 
17003
        alc_mic_automute(codec);
 
17004
}
 
17005
 
16769
17006
static void alc663_g71v_hp_automute(struct hda_codec *codec)
16770
17007
{
16771
17008
        unsigned int present;
16904
17141
        [ALC663_ASUS_MODE4] = "asus-mode4",
16905
17142
        [ALC663_ASUS_MODE5] = "asus-mode5",
16906
17143
        [ALC663_ASUS_MODE6] = "asus-mode6",
 
17144
        [ALC663_ASUS_MODE7] = "asus-mode7",
 
17145
        [ALC663_ASUS_MODE8] = "asus-mode8",
16907
17146
        [ALC272_DELL]           = "dell",
16908
17147
        [ALC272_DELL_ZM1]       = "dell-zm1",
16909
17148
        [ALC272_SAMSUNG_NC10]   = "samsung-nc10",
16920
17159
        SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1),
16921
17160
        SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2),
16922
17161
        SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1),
 
17162
        SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC663_ASUS_MODE1),
 
17163
        SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC663_ASUS_MODE1),
16923
17164
        SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2),
 
17165
        SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC663_ASUS_MODE7),
 
17166
        SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC663_ASUS_MODE7),
 
17167
        SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC663_ASUS_MODE8),
 
17168
        SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC663_ASUS_MODE3),
 
17169
        SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC663_ASUS_MODE1),
16924
17170
        SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2),
 
17171
        SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_ASUS_MODE2),
 
17172
        SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC663_ASUS_MODE1),
16925
17173
        SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2),
16926
17174
        SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6),
16927
17175
        SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6),
16928
17176
        SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2),
 
17177
        SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC663_ASUS_MODE1),
16929
17178
        SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3),
16930
17179
        SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA),
16931
17180
        SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2),
17208
17457
                .setup = alc663_mode6_setup,
17209
17458
                .init_hook = alc663_mode6_inithook,
17210
17459
        },
 
17460
        [ALC663_ASUS_MODE7] = {
 
17461
                .mixers = { alc663_mode7_mixer },
 
17462
                .cap_mixer = alc662_auto_capture_mixer,
 
17463
                .init_verbs = { alc662_init_verbs,
 
17464
                                alc663_mode7_init_verbs },
 
17465
                .num_dacs = ARRAY_SIZE(alc662_dac_nids),
 
17466
                .hp_nid = 0x03,
 
17467
                .dac_nids = alc662_dac_nids,
 
17468
                .dig_out_nid = ALC662_DIGOUT_NID,
 
17469
                .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
 
17470
                .channel_mode = alc662_3ST_2ch_modes,
 
17471
                .unsol_event = alc663_mode7_unsol_event,
 
17472
                .setup = alc663_mode7_setup,
 
17473
                .init_hook = alc663_mode7_inithook,
 
17474
        },
 
17475
        [ALC663_ASUS_MODE8] = {
 
17476
                .mixers = { alc663_mode8_mixer },
 
17477
                .cap_mixer = alc662_auto_capture_mixer,
 
17478
                .init_verbs = { alc662_init_verbs,
 
17479
                                alc663_mode8_init_verbs },
 
17480
                .num_dacs = ARRAY_SIZE(alc662_dac_nids),
 
17481
                .hp_nid = 0x03,
 
17482
                .dac_nids = alc662_dac_nids,
 
17483
                .dig_out_nid = ALC662_DIGOUT_NID,
 
17484
                .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
 
17485
                .channel_mode = alc662_3ST_2ch_modes,
 
17486
                .unsol_event = alc663_mode8_unsol_event,
 
17487
                .setup = alc663_mode8_setup,
 
17488
                .init_hook = alc663_mode8_inithook,
 
17489
        },
17211
17490
        [ALC272_DELL] = {
17212
17491
                .mixers = { alc663_m51va_mixer },
17213
17492
                .cap_mixer = alc272_auto_capture_mixer,
17676
17955
        { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
17677
17956
        { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 },
17678
17957
        { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 },
 
17958
        { .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 },
17679
17959
        { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
 
17960
        { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
17680
17961
        { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
17681
17962
          .patch = patch_alc861 },
17682
17963
        { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },