Mercurial > illumos > s390-betelgeuse
changeset 4814:57cc010c0779 onnv_71
6508863 no audio support for Ferrari 5000 using Realtek ALC883
6588838 audiohd AUDIO_GETDEV output doesn't match man page / not consistant with other drivers
author | cg149915 |
---|---|
date | Mon, 06 Aug 2007 21:38:43 -0700 |
parents | 8eaf4b355227 |
children | 4e93bfb65812 |
files | usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c usr/src/uts/common/sys/audio/audiohd.h usr/src/uts/common/sys/audio/impl/audiohd_impl.h |
diffstat | 3 files changed, 44 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c Mon Aug 06 20:08:38 2007 -0700 +++ b/usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c Mon Aug 06 21:38:43 2007 -0700 @@ -833,7 +833,7 @@ /* set playback stream tag */ AUDIOHD_REG_SET8(regbase + AUDIOHD_SDREG_OFFSET_CTL + 2, - (statep->hda_play_stag) << 4 | 4); + (statep->hda_play_stag) << 4); /* Enable interrupt and start DMA */ AUDIOHD_REG_SET8(regbase + AUDIOHD_SDREG_OFFSET_CTL, @@ -1092,7 +1092,7 @@ /* set stream tag to 1 */ AUDIOHD_REG_SET8(regbase + AUDIOHD_SDREG_OFFSET_CTL + 2, - statep->hda_record_stag << 4 | 4); + statep->hda_record_stag << 4); statep->hda_flags |= AUDIOHD_RECORD_STARTED; /* start DMA */ @@ -1327,27 +1327,44 @@ pci_config_put16(statep->hda_pci_handle, PCI_CONF_COMM, cmdreg | PCI_COMM_MAE | PCI_COMM_ME); - /* - * Currently, Intel (G)MCH and ICHx chipsets support PCI Express - * QoS. It implemenets two VCs(virtual channels) and allows OS - * software to map 8 traffic classes to the two VCs. Some BIOSes - * initialize HD audio hardware to use TC7 (traffic class 7) and - * map TC7 to VC1 as Intel recommended. However, solaris doesn't - * PCI express QoS yet. As a result, this driver can not work for - * those hardware without touching PCI express control registers. - * So, here, we set TCSEL to 0 so as to use TC0/VC0 (VC0 is always - * enabled and TC0 is always mapped to VC0) for All Intel Hd audio - * controllers. - */ vid = pci_config_get16(statep->hda_pci_handle, PCI_CONF_VENID); - if (vid == AUDIOHD_VID_INTEL) { + switch (vid) { + + case AUDIOHD_VID_INTEL: + /* + * Currently, Intel (G)MCH and ICHx chipsets support PCI + * Express QoS. It implemenets two VCs(virtual channels) + * and allows OS software to map 8 traffic classes to the + * two VCs. Some BIOSes initialize HD audio hardware to + * use TC7 (traffic class 7) and to map TC7 to VC1 as Intel + * recommended. However, solaris doesn't support PCI express + * QoS yet. As a result, this driver can not work for those + * hardware without touching PCI express control registers. + * Here, we set TCSEL to 0 so as to use TC0/VC0 (VC0 is + * always enabled and TC0 is always mapped to VC0) for all + * Intel HD audio controllers. + */ cTmp = pci_config_get8(statep->hda_pci_handle, AUDIOHD_INTEL_PCI_TCSEL); pci_config_put8(statep->hda_pci_handle, AUDIOHD_INTEL_PCI_TCSEL, (cTmp & 0xf8)); + break; + + case AUDIOHD_VID_ATI: + /* + * Refer to ATI SB450 datesheet. We set snoop for SB450 + * like hardware. + */ + cTmp = pci_config_get8(statep->hda_pci_handle, + AUDIOHD_ATI_PCI_MISC2); + pci_config_put8(statep->hda_pci_handle, AUDIOHD_ATI_PCI_MISC2, + (cTmp & 0xf8) | AUDIOHD_ATI_MISC2_SNOOP); + break; + + default: + break; } - return (AUDIO_SUCCESS); err_init_pci_exit2:
--- a/usr/src/uts/common/sys/audio/audiohd.h Mon Aug 06 20:08:38 2007 -0700 +++ b/usr/src/uts/common/sys/audio/audiohd.h Mon Aug 06 21:38:43 2007 -0700 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -78,8 +78,8 @@ #define AUDIOHD_DEFAULT_BAL AUDIO_MID_BALANCE #define AUDIOHD_DEFAULT_MONITOR_GAIN 0 -#define AUDIOHD_DEV_NAME "audiohd" -#define AUDIOHD_DEV_CONFIG "hda audio config" +#define AUDIOHD_DEV_NAME "SUNW,audiohd" +#define AUDIOHD_DEV_CONFIG "onboard1" #define AUDIOHD_DEV_VERSION "a" #ifdef __cplusplus
--- a/usr/src/uts/common/sys/audio/impl/audiohd_impl.h Mon Aug 06 20:08:38 2007 -0700 +++ b/usr/src/uts/common/sys/audio/impl/audiohd_impl.h Mon Aug 06 21:38:43 2007 -0700 @@ -60,6 +60,8 @@ #define AUDIOHD_VID_AD1988B 0x11d4198b #define AUDIOHD_VID_INTEL 0x8086 +#define AUDIOHD_VID_ATI 0x1002 + /* * Only for Intel hardware: @@ -67,8 +69,12 @@ */ #define AUDIOHD_INTEL_PCI_TCSEL 0x44 -/* vendor-id and device-id for ATI SB450 */ -#define AUDIOHD_ATI_SB450 0x437d1002 +/* + * Only for ATI SB450: + * MISC control register 2 + */ +#define AUDIOHD_ATI_PCI_MISC2 0x42 +#define AUDIOHD_ATI_MISC2_SNOOP 0x02 #define AUDIOHDC_NID(x) x #define AUDIOHDC_NULL_NODE -1