Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178116482
D50046.1796013444.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D50046.1796013444.diff
View Options
diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c
--- a/sys/dev/sound/pci/hda/hdaa_patches.c
+++ b/sys/dev/sound/pci/hda/hdaa_patches.c
@@ -732,10 +732,27 @@
return (hda_command(dev, HDA_CMD_SET_PROCESSING_COEFF(0, nid, val)));
}
+static void
+hdaa_cs4208_fix_amp_caps(struct hdaa_devinfo *devinfo, nid_t nid)
+{
+ struct hdaa_widget *w;
+ int val;
+
+ w = hdaa_widget_get(devinfo, nid);
+ if (w == NULL)
+ return;
+ val = hda_command(devinfo->dev, HDA_CMD_GET_PARAMETER(0, nid,
+ HDA_PARAM_INPUT_AMP_CAP));
+ val &= ~HDA_PARAM_INPUT_AMP_CAP_OFFSET_MASK;
+ val |= 0x02;
+ w->param.inamp_cap = val;
+}
+
void
hdaa_patch_direct(struct hdaa_devinfo *devinfo)
{
device_t dev = devinfo->dev;
+ struct hdaa_widget *w;
uint32_t id, subid, val;
id = hdaa_codec_id(devinfo);
@@ -765,6 +782,36 @@
hdaa_write_coef(dev, 0x20, 0x07, 0x7cb);
}
break;
+ case HDA_CODEC_CS4208:
+ if (subid == APPLE_MACBOOKAIR61 || subid == APPLE_MACBOOKAIR62) {
+ /* Enable headphone jack detection. */
+ /* AFG: D0 */
+ hda_command(dev, HDA_CMD_SET_POWER_STATE(0, 0x01,
+ HDA_CMD_POWER_STATE_D0));
+ /* VPW: Processing on */
+ hda_command(dev, HDA_CMD_SET_PROCESSING_STATE(0, 0x24,
+ HDA_CMD_GET_PROCESSING_STATE_STATE_ON));
+ /* A1 ICS */
+ hdaa_write_coef(dev, 0x24, 0x0033, 0x0001);
+ /* A1 Enable, A Thresh = 300mV */
+ hdaa_write_coef(dev, 0x24, 0x0034, 0x1c01);
+
+ /* Fix widget caps. */
+ w = hdaa_widget_get(devinfo, 0x18);
+ if (w != NULL) {
+ w->param.widget_cap = hda_command(dev,
+ HDA_CMD_GET_PARAMETER(0, w->nid,
+ HDA_PARAM_AUDIO_WIDGET_CAP)) |
+ HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_MASK <<
+ HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT;
+ }
+
+ /* Fix amplifier caps. */
+ hdaa_cs4208_fix_amp_caps(devinfo, 0x18);
+ hdaa_cs4208_fix_amp_caps(devinfo, 0x1b);
+ hdaa_cs4208_fix_amp_caps(devinfo, 0x1c);
+ }
+ break;
}
if (id == HDA_CODEC_ALC255 || id == HDA_CODEC_ALC256) {
val = hdaa_read_coef(dev, 0x20, 0x46);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 30, 4:37 AM (13 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42100627
Default Alt Text
D50046.1796013444.diff (2 KB)
Attached To
Mode
D50046: snd_hda: Apply fixes for Macbook Air 6,1 and 6,2
Attached
Detach File
Event Timeline