NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/48495
The following reply was made to PR kern/48495; it has been noted by GNATS.
From: Nat Sloss <nathanialsloss%yahoo.com.au@localhost>
To: "gnats-bugs" <gnats-bugs%netbsd.org@localhost>
Cc:
Subject: Re: kern/48495
Date: Fri, 19 Sep 2014 23:45:47 +1000
Hi,
Here is a new revised patch for sysbeep on Toughbook cf19 mk 1 and mk 5
computers and other computers using sigmatel and realtek hdaudio
controllers:
Index: src/sys/dev/pci/hdaudio/hdafg.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/hdaudio/hdafg.c,v
retrieving revision 1.21
diff -u -r1.21 hdafg.c
--- src/sys/dev/pci/hdaudio/hdafg.c 23 May 2014 13:57:04 -0000 1.21
+++ src/sys/dev/pci/hdaudio/hdafg.c 19 Sep 2014 13:40:05 -0000
@@ -338,6 +338,7 @@
prop_dictionary_t);
static int hdafg_codec_info(void *, prop_dictionary_t,
prop_dictionary_t);
+static void hdafg_enable_analog_beep(struct hdafg_softc *);
CFATTACH_DECL2_NEW(
hdafg,
@@ -3688,6 +3689,9 @@
if (1) hdafg_widget_pin_dump(sc);
hdafg_assoc_dump(sc);
+ hda_debug(sc, "enabling analog beep\n");
+ hdafg_enable_analog_beep(sc);
+
hda_debug(sc, "configuring encodings\n");
sc->sc_audiodev.ad_sc = sc;
hdafg_configure_encodings(sc);
@@ -4361,3 +4365,61 @@
return ENOTTY;
}
}
+
+#define HDAFG_GET_ANACTRL 0xFe0
+#define HDAFG_SET_ANACTRL 0x7e0
+#define HDAFG_ANALOG_BEEP_EN __BIT(5)
+
+static void
+hdafg_enable_analog_beep(struct hdafg_softc *sc)
+{
+ int nid;
+ uint32_t response;
+
+ switch (sc->sc_vendor) {
+ case HDA_VENDOR_SIGMATEL:
+ switch (sc->sc_product) {
+ case HDA_PRODUCT_STAC9200:
+ case HDA_PRODUCT_STAC9200D:
+ case HDA_PRODUCT_STAC9202:
+ case HDA_PRODUCT_STAC9202D:
+ case HDA_PRODUCT_STAC9204:
+ case HDA_PRODUCT_STAC9204D:
+ case HDA_PRODUCT_STAC9205:
+ case HDA_PRODUCT_STAC9205_2:
+ case HDA_PRODUCT_STAC9205D:
+ nid = 0x01;
+
+ response = hdaudio_command(sc->sc_codec, nid,
+ HDAFG_GET_ANACTRL, 0x00);
+ hda_delay(100);
+
+ response |= HDAFG_ANALOG_BEEP_EN;
+
+ hdaudio_command(sc->sc_codec, nid, HDAFG_SET_ANACTRL,
+ response);
+ hda_delay(100);
+ break;
+ default:
+ break;
+ }
+ break;
+ case HDA_VENDOR_REALTEK:
+ switch (sc->sc_product) {
+ case HDA_PRODUCT_ALC269:
+ /* The Panasonic Toughbook CF19 - Mk 5 uses a Realtek
+ * ALC231 that identifies as an ALC269.
+ * This unmutes the PCBEEP on the speaker.
+ */
+ nid = 0xf;
+ response = hdaudio_command(sc->sc_codec, nid,
+ CORB_SET_AMPLIFIER_GAIN_MUTE, 0x7100);
+ hda_delay(100);
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+}
Index: src/sys/dev/pci/hdaudio/hdaudio_ids.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/hdaudio/hdaudio_ids.h,v
retrieving revision 1.3
diff -u -r1.3 hdaudio_ids.h
--- src/sys/dev/pci/hdaudio/hdaudio_ids.h 24 Oct 2011 22:20:59 -0000
1.3
+++ src/sys/dev/pci/hdaudio/hdaudio_ids.h 19 Sep 2014 13:40:12 -0000
@@ -43,6 +43,20 @@
#define HDA_VENDOR_INTEL 0x8086
#define HDA_VENDOR_SIGMATEL 0x8384
+/* SigmaTel products */
+#define HDA_PRODUCT_STAC9200 0x7690
+#define HDA_PRODUCT_STAC9200D 0x7691
+#define HDA_PRODUCT_STAC9202 0x7632
+#define HDA_PRODUCT_STAC9202D 0x7633
+#define HDA_PRODUCT_STAC9204 0x76a2
+#define HDA_PRODUCT_STAC9204D 0x76a3
+#define HDA_PRODUCT_STAC9205 0x7698
+#define HDA_PRODUCT_STAC9205_2 0x76a0
+#define HDA_PRODUCT_STAC9205D 0x76a1
+
+/* Realtek Semiconductor products */
+#define HDA_PRODUCT_ALC269 0x0269
+
#define HDA_PRODUCT_ANY 0xffff
void hdaudio_id2name(uint16_t, uint16_t, char *, size_t);
Regards,
Nat
Home |
Main Index |
Thread Index |
Old Index