From owner-svn-src-all@freebsd.org Sun Jan 12 20:19:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65CE11E9252; Sun, 12 Jan 2020 20:19:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wp2s26lCz4mdM; Sun, 12 Jan 2020 20:19:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440E521145; Sun, 12 Jan 2020 20:19:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00CKJ1WJ065392; Sun, 12 Jan 2020 20:19:01 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00CKJ0Od065387; Sun, 12 Jan 2020 20:19:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <202001122019.00CKJ0Od065387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 12 Jan 2020 20:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356665 - in stable/12: share/man/man4 sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/sound/pci/hda X-SVN-Commit-Revision: 356665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jan 2020 20:19:01 -0000 Author: sbruno Date: Sun Jan 12 20:19:00 2020 New Revision: 356665 URL: https://svnweb.freebsd.org/changeset/base/356665 Log: MFC r350078 Add the ability to accept the default pin widget configuration to help with various laptops using hdaa(4) sound devices. We don't seem to know the "correct" configurations for these devices and the defaults are far superiour, e.g. they work if you don't nuke the default configs. Modified: stable/12/share/man/man4/snd_hda.4 stable/12/sys/dev/sound/pci/hda/hdaa.c stable/12/sys/dev/sound/pci/hda/hdaa.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/snd_hda.4 ============================================================================== --- stable/12/share/man/man4/snd_hda.4 Sun Jan 12 20:12:34 2020 (r356664) +++ stable/12/share/man/man4/snd_hda.4 Sun Jan 12 20:19:00 2020 (r356665) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2018 +.Dd July 16, 2019 .Dt SND_HDA 4 .Os .Sh NAME @@ -153,6 +153,12 @@ The and .Dq Li ovref Ns Ar X options control the voltage used to power external microphones. +.It Va dev.hdaa.%d.init_clear +Zero out the pin widget config setup by the system. +Some systems seem to have unuseable audio devices if the pin widgit +configuration is cleared. +Set this value to 0 to accept the default configuration values setup by the +BIOS. .It Va hint.hdaa.%d.gpio_config Overrides audio function GPIO pins configuration set by BIOS. May be specified as a set of space-separated Modified: stable/12/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdaa.c Sun Jan 12 20:12:34 2020 (r356664) +++ stable/12/sys/dev/sound/pci/hda/hdaa.c Sun Jan 12 20:19:00 2020 (r356665) @@ -5034,11 +5034,13 @@ hdaa_audio_prepare_pin_ctrl(struct hdaa_devinfo *devin pincap = w->wclass.pin.cap; /* Disable everything. */ - w->wclass.pin.ctrl &= ~( - HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + if (devinfo->init_clear) { + w->wclass.pin.ctrl &= ~( + HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + } if (w->enable == 0) { /* Pin is unused so left it disabled. */ @@ -6671,6 +6673,10 @@ hdaa_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "init_clear", CTLFLAG_RW, + &devinfo->init_clear, 1,"Clear initial pin widget configuration"); bus_generic_attach(dev); return (0); } Modified: stable/12/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdaa.h Sun Jan 12 20:12:34 2020 (r356664) +++ stable/12/sys/dev/sound/pci/hda/hdaa.h Sun Jan 12 20:19:00 2020 (r356665) @@ -214,6 +214,7 @@ struct hdaa_devinfo { struct hdaa_chan *chans; struct callout poll_jack; int poll_ival; + uint32_t init_clear; }; #define HDAA_CHN_RUNNING 0x00000001