Add support for Cirrus Logic CS4213 (HDA Intel Codec)

Bug #910792 reported by David Henningsson
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
David Henningsson
Declined for Oneiric by Chris Van Hoof
Precise
Fix Released
Undecided
David Henningsson

Bug Description

This bug is used for tracking purposes, please do not triage.

Changed in linux (Ubuntu):
assignee: nobody → David Henningsson (diwic)
status: New → In Progress
tags: added: blocks-hwcert-enablement
Revision history for this message
David Henningsson (diwic) wrote :

Upstream accepted patch.

Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.4.0-1.1

---------------
linux (3.4.0-1.1) quantal; urgency=low

  [ Andy Whitcroft ]

  * ubuntu: overlayfs -- overlayfs: apply device cgroup and security
    permissions to overlay files
    - LP: #915941, #918212
    - CVE-2012-0055

  [ Leann Ogasawara ]

  * Open Q
  * Rebase to v3.4-rc5
  * [Config] Temporarily disable CONFIG_TOUCHSCREEN_EETI on arm
  * [Config] Temporarily disable CONFIG_TOUCHSCREEN_EGALAX on arm
  * [Config] Temporarily disable CONFIG_EZX_PCAP on arm
  * [Config] Temporarily disable CONFIG_MFD_OMAP_USB_HOST on arm
  * [Config] Temporarily disable CONFIG_LIS3L02DQ on arm
  * [Config] Temporarily disable CONFIG_USB_EHCI_HCD_PLATFORM on arm
  * [Config] Temporarily disable CONFIG_TI_CPSW on arm
  * [Config] Temporarily disable CONFIG_AX88796 on arm

  [ Upstream Kernel Changes ]

  * vfs: pass struct path to __dentry_open()
  * vfs: add i_op->open()
  * vfs: export do_splice_direct() to modules
  * vfs: introduce clone_private_mount()
  * overlay filesystem
  * overlayfs: add statfs support
  * overlayfs: implement show_options
  * overlay: overlay filesystem documentation
  * fs: limit filesystem stacking depth
  * overlayfs: follow header cleanup
  * overlayfs: switch from d_alloc_root() to d_make_root()
  * overlayfs: update touch_atime() usage
  * rebase to v3.4-rc5
    - LP: #950490
  * rebase to v3.4-rc4
  * rebase to v3.4-rc3
  * rebase to v3.4-rc2
  * rebase to v3.4-rc1
  * rebase to v3.3
  * rebase to v3.3-rc7
  * rebase to v3.3-rc6
  * rebase to v3.3-rc5
  * rebase to v3.3-rc4
    - LP: #900802
    - LP: #930842
  * rebase to v3.3-rc3
    - LP: #924320
    - LP: #923316
    - LP: #923409
    - LP: #918254
  * rebase to v3.3-rc2
  * rebase to v3.3-rc1
    - LP: #795823
    - LP: #909419
    - LP: #910792
    - LP: #878701
    - LP: #724831
 -- Leann Ogasawara <email address hidden> Wed, 25 Jan 2012 06:50:04 -0800

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Anthony Wong (anthonywong) wrote :

@David, can this fix be SRU'd?

tags: added: blocks-hwcert
Revision history for this message
David Henningsson (diwic) wrote : [12.04 SRU PATCH] ALSA: HDA: Add support for Cirrus Logic 4213
Download full text (8.6 KiB)

The CS4213 chip is similar to the CS4210, but it does not have
SPDIF capabilities. Also, it has fewer pins, and the vendor specific
nid is different. With this patch, we have working inputs and outputs
(and automute/autoswitch). However, we don't know anything about
the vendor specific processing coefficients, so we don't read or write
to that node in this patch.

BugLink: https://bugs.launchpad.net/bugs/910792
Tested-by: Hsin-Yi Chen <email address hidden>
Signed-off-by: David Henningsson <email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

(cherry picked from commit 5660ffd06935e564404412997a703279e325fa64)
Signed-off-by: David Henningsson <email address hidden>
---
 sound/pci/hda/patch_cirrus.c | 105 ++++++++++++++++++++++++++++--------------
 1 file changed, 70 insertions(+), 35 deletions(-)

Anthony Wong asked me to try to SRU this patch in order to be able to certify
a machine for 12.04.
The CS4213 shares some code with the CS4210 chip, but the CS4210 chip - which
would be the possible regression risk here, was AFAIK never used in production.
Therefore I believe this should be safe to SRU.

diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index ee2c1ed..297f5e2 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -138,7 +138,7 @@ enum {
 */
 #define CS4210_DAC_NID 0x02
 #define CS4210_ADC_NID 0x03
-#define CS421X_VENDOR_NID 0x0B
+#define CS4210_VENDOR_NID 0x0B
 #define CS421X_DMIC_PIN_NID 0x09 /* Port E */
 #define CS421X_SPDIF_PIN_NID 0x0A /* Port H */

@@ -149,6 +149,10 @@ enum {

 #define SPDIF_EVENT 0x04

+/* Cirrus Logic CS4213 is like CS4210 but does not have SPDIF input/output */
+#define CS4213_VENDOR_NID 0x09
+
+
 static inline int cs_vendor_coef_get(struct hda_codec *codec, unsigned int idx)
 {
  struct cs_spec *spec = codec->spec;
@@ -923,8 +927,8 @@ static void cs_automute(struct hda_codec *codec)
  /* mute speakers if spdif or hp jack is plugged in */
  for (i = 0; i < cfg->speaker_outs; i++) {
   int pin_ctl = hp_present ? 0 : PIN_OUT;
- /* detect on spdif is specific to CS421x */
- if (spdif_present && (spec->vendor_nid == CS421X_VENDOR_NID))
+ /* detect on spdif is specific to CS4210 */
+ if (spdif_present && (spec->vendor_nid == CS4210_VENDOR_NID))
    pin_ctl = 0;

   nid = cfg->speaker_pins[i];
@@ -938,8 +942,8 @@ static void cs_automute(struct hda_codec *codec)
         AC_VERB_SET_GPIO_DATA, gpio);
  }

- /* specific to CS421x */
- if (spec->vendor_nid == CS421X_VENDOR_NID) {
+ /* specific to CS4210 */
+ if (spec->vendor_nid == CS4210_VENDOR_NID) {
   /* mute HPs if spdif jack (SENSE_B) is present */
   for (i = 0; i < cfg->hp_outs; i++) {
    nid = cfg->hp_pins[i];
@@ -976,7 +980,12 @@ static void cs_automic(struct hda_codec *codec)
  present = snd_hda_jack_detect(codec, nid);

  /* specific to CS421x, single ADC */
- if (spec->vendor_nid == CS421X_VENDOR_NID) {
+ if (spec->vendor_nid == CS420X_VENDOR_NID) {
+ if (present)
+ change_cur_input(codec, spec->automic_idx, 0);
+ else
+ change_cur_input(codec, !spec->automic_idx, 0);
+ } else {
   if (present) {
    if (spec->cur_input != spec->automic_idx) {
     ...

Read more...

Revision history for this message
David Henningsson (diwic) wrote :

@a16g, it can! It has now been applied to master-next, i e going out with next kernel SRU or potentially the one after that.
Thanks for asking : -)

Revision history for this message
Luis Henriques (henrix) wrote :

This bug is awaiting verification that the kernel for Precise in -proposed solves the problem (3.2.0-26.41). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-precise' to 'verification-done-precise'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-precise
Revision history for this message
TienFu Chen (ctf) wrote :

Tried with 3.2.0-26.41, this bug fixed on Dell Inspiron 5323(201203-10656).

TienFu Chen (ctf)
tags: added: verification-done-precise
tags: removed: verification-needed-precise
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (13.2 KiB)

This bug was fixed in the package linux - 3.2.0-26.41

---------------
linux (3.2.0-26.41) precise-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1012057

  [ Andy Whitcroft ]

  * [Config] fix up postinst to ensure we know which error is which
    - LP: #1002388
  * [Config] highbank -- commonise filesystems
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise subsystems
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise network protocols
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise input drivers
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise CRYPTO options
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise HID options
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise sensors options
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise EXPORTFS/FHANDLE
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise CONFIG_CRYPTO_LZO
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise ENCRYPTED_KEYS
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise CONFIG_ATALK
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise INET/INET6
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise NLS
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise BLK/CHR
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise PHY settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise CRC settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise BINFMT settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise DM settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise RTC_DRV settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise KEYBOARD/MOUSE settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise USB settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise GPIO settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise I2C settings
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise numerous subsystem selectors
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise A-C modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise D-F modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise G-I modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise J-L modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise M modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise N-P modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise Q-R modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise S modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise T modules missmatches
    - LP: #1000831, #1010463
  * [Config] highbank -- commonise U-Z modules missmatches
    - LP: #1000831, #1010463

  [ Herton Ronaldo Krzesinski ]

  * SAUCE: fix get_gate_vma call in i386 NX emulation code
    - LP: #1009200

  [ Ike Panhc ]

  * [Config] add...

Changed in linux (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.