Commit Graph

31 Commits

Author SHA1 Message Date
manu
fd1575217d Fix hdaudio device configuration
When disabling unassociated devices, we have a special handling
for pins of type COP_AWCAP_TYPE_PIN_COMPLEX, but it came after code
that may disable any pins, including the ones that should be handled
as COP_AWCAP_TYPE_PIN_COMPLEX.

The result was that hdaudio could fail to detect some devices.  We
fix the situation by making sure that COP_AWCAP_TYPE_PIN_COMPLEX
pins always get their specific handling.

The change makes the built-in speaker work on Dell OptiPlex 5060
2018-09-27 01:18:11 +00:00
christos
87fd18f8e5 s/static inline/static __inline/g for consistency. 2018-04-19 21:50:06 +00:00
maya
1b2f7af0ae Remove dead code.
From David Binderman in PR kern/53029
2018-02-14 18:28:43 +00:00
khorben
db8ce746e1 Fix off-by-one when calling snprintf(9) in hdafg_getdev()
This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@
2018-01-04 00:09:12 +00:00
jmcneill
ccc79c82ab Always go through RIRB startup process, initialize RIRB interrupt count
register, and ack RIRBs as we process them in polling mode.

XXX pullup
2017-11-24 17:51:10 +00:00
jmcneill
52e61030ba Always access CORBCTL using hda_read1/hda_write1 (it is an 8-bit wide reg).
Reported by Michal Necasek.
2017-11-24 14:00:04 +00:00
jmcneill
2729224216 Enter link reset even if GCTL says we are already in reset state. Fixes
hdaudio codec detection under VirtualBox on a "cold" boot.

XXX pullup
2017-11-24 00:30:29 +00:00
riastradh
2803f25f6a Add #includes to make this compile.
<sys/cdefs.h> for __packed
<sys/types.h> for uint32_t
2017-10-28 06:24:24 +00:00
kre
659488a459 In rev 1.0a of the Intel High Definition Audio Spec:
https://www.intel.com/content/www/us/en/standards/
		high-definition-audio-specification.html

page 186 shows the layout of the baseline block of the ELD (EDID Like Data)
struct - and allows a reserved (effectively padding) area at the end of the
struct.  This is required to keep the struct an even number of words long
(size measured in units of 32 bits) while allowing for a variable length
monitor name, followed by a variable number of 3 byte structs - the
combination of which is not likely to be a multiple of 4.

Code here assumed that there was no padding, and objected to the ELD
format if any padding bytes existed (hdafg_dd_parse_info() would return
EINVAL) causing a "failed to parse ELD data" message (if HDAFG_HDMI_DEBUG
is defined) from hdafg_assoc_dump_dd() making it difficult (or at least
confusing) to debug HDMI related audio issues (hdafg_assoc_dump_dd would
not print most of the data it is expected to print) although this would
most likely have no effect on actual operations.

Change a test from a != to < (there must be enough data, not exactly the
amount needed) for the EINVAL.   As a consequence, the length after the
SAD data is parsed (the 3 byte structs) is no longer required to be 0,
so remove the KASSERT() (previously it was just useless, the code guaranteed
a 0 value, now it is incorrect.)   While here also change a related
diagnostic message to be slightly more informative as to what is being shown.

OK jmcneill@
2017-09-26 09:24:22 +00:00
mrg
634cdb733a put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.
this silences a frequent and largely useless series of messages
in my dmesg.  ok jmcneill.
2017-08-04 00:25:23 +00:00
pgoyette
52b02286ed Move the hdaudio_cd out of the hdaudio_pci module and into the main
hdaudio module.  Rearrange the inter-module dependencies accordingly.

Should resolve (my) PR kern/49836

XXX Pull-ups needed for netbsd-8 branch
2017-06-04 23:34:55 +00:00
chs
fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
maya
8ac9ff4e15 remove redundant assignments
nchan is overwritten before it is used in all cases. so is i.

from clang static analyzer
ok riastradh
2017-04-18 16:30:21 +00:00
pgoyette
c9690682a0 Update the devlist2h.awk script to track the maximum lengths of vendor
and product strings, and report the max values at end of the run.

Update the Makefiles.{pci,usb,hdaudio}devs to point users at the places
which might need to be updated if the maximum lengths get larger.

Since this commit makes no changes to the generated files, we don't
need to regenerate them now.
2016-10-26 01:03:23 +00:00
pgoyette
a36b37e027 Replace numeric magic-number constant with something a bit more meaningful. 2016-10-25 09:15:55 +00:00
jmcneill
8c6ade7fd1 get rid of HDAUDIO_FLAG_NO_STREAM_RESET hack 2015-12-23 12:45:06 +00:00
jmcneill
a85a846423 disable data island packet transmission on Tegra124 HDMI codec 2015-11-15 23:03:50 +00:00
christos
a6e6c18e8f mute the mixer with that has input children 2015-11-04 21:04:11 +00:00
christos
408bc6e228 Remove trailing and stray whitespace. 2015-11-04 18:10:49 +00:00
christos
43e009024b more complex version to determine what is an input. 2015-11-04 18:04:28 +00:00
christos
af1e0ffcca be more selective and mute only mic's. Suggested by jmcneill 2015-11-04 15:01:56 +00:00
christos
c7d2d3ea39 Startup with the mic muted to avoid feedback and spying. 2015-11-04 14:11:09 +00:00
jmcneill
8e8646698a - Support multi-channel (> 2) output to HDMI sinks.
- Fix a bug in hdafg_set_params that could program converters using the
  wrong audio_params_t if auconv is in use
- Force Tegra124 HDMI codec to a fixed rate 44.1kHz
2015-07-26 19:06:26 +00:00
jmcneill
fd314950d4 Skip stream reset if HDAUDIO_FLAG_NO_STREAM_RESET flag is set. 2015-07-26 17:54:33 +00:00
jmcneill
bde2e953b3 regen 2015-05-30 14:12:57 +00:00
jmcneill
605211179f add Tegra124 HDMI 2015-05-30 14:12:42 +00:00
jmcneill
319b131679 fix path to devlist2h 2015-05-30 14:10:01 +00:00
jmcneill
1b8b4c6772 add HDAUDIO_32BIT_ACCESS option, which wraps mmio read/writes to only use 32-bit accesses 2015-05-30 13:47:03 +00:00
riastradh
16adabdccc Initialize dma.dma_sizereg to avoid copying uninitialized data later.
This field is not actually used here -- not clear it should be in
the hdaudio_dma structure at all.

Noted by Coverity, CID 979553.
2015-05-20 18:28:32 +00:00
jmcneill
343fcd6e6c replace hdaudio_config.h with defflags 2015-03-28 14:50:20 +00:00
jmcneill
8a9ff04ba8 Split hdaudio and PCI attach glue. Even though the driver was written with
this separation in mind, all of the code lived in sys/dev/pci/hdaudio. Move
common parts to sys/dev/hdaudio and PCI attach glue to sys/dev/pci.
2015-03-28 14:09:58 +00:00