Commit Graph

680 Commits

Author SHA1 Message Date
Adrian Chadd
3fdeac5b5a Update from mav@ - don't break the input switching. 2014-07-27 20:14:22 +00:00
Adrian Chadd
dcd850637a Add support for my Lenovo T400.
Tested:

* Lenovo T400, model w/ P8700 Intel CPU on-board
2014-07-27 08:44:15 +00:00
Mark Johnston
05929f8bd0 Add a headphone redirection quirk for the Lenovo G580.
MFC after:	1 week
2014-07-13 10:31:29 +00:00
John Baldwin
86843ea8de Fix various bugs with freeing static DMA allocations in sound drivers:
- Don't compare the DMA map to NULL to determine if bus_dmamap_unload()
  should be called when releasing a static allocation.  Instead, compare
  the bus address against 0.
- Don't assume that the DMA map for static allocations is NULL.  Instead,
  save the value set by bus_dmamem_alloc() so it can later be passed to
  bus_dmamem_free().  Also, add missing calls to bus_dmamap_unload() in
  these cases before freeing the buffer.
- Use the bus address from the bus_dma callback instead of calling
  vtophys() on the address allocated by bus_dmamem_alloc().

Reviewed by:	kan
2014-06-17 16:07:57 +00:00
Marius Strobl
bdec45e2bc Actually, just merge r233362 and do away with the unnecessary uint8_t
pointer casting altogether.
2014-05-28 14:26:46 +00:00
Marius Strobl
50253ed99d Commit the right version of r266793. 2014-05-28 12:32:07 +00:00
Marius Strobl
3ac1248373 - Fix compilation with PAE support enabled by improving the casting of
physical addresses.
- Nuke the unused softc of emujoy(4).
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	3 days
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-05-28 09:01:35 +00:00
Marius Strobl
abe917ad4c - Sprinkle const and static as appropriate.
- Convert the remainder of snd_hda(4) to take advantage of nitems().
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	3 days
2014-04-23 19:32:50 +00:00
Marius Strobl
d98052c4a2 Add quirk to configure headphones redirection on Intel DH87RL boards.
MFC after:	3 days
2014-04-23 19:25:59 +00:00
Hans Petter Selasky
42cb359e6e Use system macro instead of own hand-rolled one. 2014-02-05 08:29:24 +00:00
Hans Petter Selasky
6b97b1b3fe Add more quirks for making builtin audio speakers work with more
MacBookPro's. Only tested with MacBookPro 9,2.

Obtained from:	Linux
MFC after:	1 week
2014-02-05 08:27:02 +00:00
Dimitry Andric
bff60cf827 In sys/dev/sound/pci/maestro.c, #if 0 two unused static functions.
MFC after:	3 days
2013-12-30 22:17:33 +00:00
Eitan Adler
7a22215c53 Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
Alexander Motin
c9b3a5a00b Add some more Intel HDA controller IDs and rename HDMI CODEC to Haswell. 2013-11-15 13:55:55 +00:00
Alexander Motin
667b72800a Add ID for Intel Lynx Point HDMI CODEC.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-11-15 13:12:53 +00:00
Scott Long
c68534f1d5 Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register.  The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR.  Thus, the bit is no longer
a reliable indication of capability, and should not be checked.  This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Submitted by:	jhb
Reviewed by:	jfv, marius, achadd, achim
MFC after:	1 day
2013-08-12 23:30:01 +00:00
Ulrich Spörlein
9c8a649226 snd_ds1(4): Fix order of arguments for stereo/16bit mode
This function is called 4 times in this file, with swapped parameter
ordering. Fix the function definition instead of all the call sites.
16bit/stereo or 8bit/mono playback is unaffected and was probably
working fine before, this should fix 16bit/mono and 8bit/stereo
playback.

Found by:	Coverity Scan, CID 1006688
2013-07-25 09:29:48 +00:00
Alexander Motin
fff11ae8af Add quirk to configure headphones redirection on ASUS UX31A laptop.
MFC after:	3 days
2013-07-08 15:28:09 +00:00
Sean Bruno
156860b2b3 Update snd quirks for T520, T420, X220.
Group onboard mic and headphone mic jack together.  Creates association that
will switch between microphone inputs depending on the state of the headphone
jack being connected to a live mic.

Fixes onboard mic not working at all on T520.

Tested on T520, T420.
Suspect X220 needs this too, untested on.

MFC after:	1 month
2013-05-19 01:45:29 +00:00
Alexander Motin
6691312c46 Some fixes to snd_envy24ht(4) driver:
- Allow DMA addresses anywhere in the lower 4GB; Envy24HT has a 32-bit DMA
engine, not 28-bit like Envy24.
 - Mark interrupt handler as MPSAFE, seems to be correctly synchronized.

PR:		kern/152378
Submitted by:	Jason Harmening <jason.harmening@gmail.com>
MFC after:	1 month
2013-05-05 19:09:34 +00:00
Gabor Kovesdan
84a17a97ce - Correct mispellings of word and
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:48:46 +00:00
Alexander Motin
7019329c1a Add Subsystem ID field to the quirk table. Use it to identify Mac Pro 1,1,
which requires OVREF to be set to get proper playback volume, but which has
all zeroes in HDA controller subdevice IDs on PCI.

MFC after:	1 month
Sponsored by:
2013-03-27 07:30:08 +00:00
Xin LI
b4cd804a96 Add quirk for Lenovo T530 headphone redirection.
MFC after:	2 weeks
2013-03-13 20:35:51 +00:00
Gleb Smirnoff
aa4dd0f23f More Lenovo headphones redirection quirks: Lenovo T430, Lenovo T430S.
Submitted by:	Sergey Nasonov <snasonov bcc.ru>, T430
Submitted by:	Johannes Dieterich <dieterich.joh gmail.com>, T430S
2013-03-12 08:45:42 +00:00
Gleb Smirnoff
2112695c03 Add quirks to enable headphones redirection on number of Lenovo
laptops, namely X1, X1 Carbon, T420, T520.

PR:		misc/176656
Submitted by:	Hiren Panchasar <hiren.panchasara gmail.com>
Tested by:	glebius, X1 Carbon
Tested by:	osa, X1
Tested by:	Hiren Panchasar, T420
Tested by:	sbruno, T520
Reviewed by:	mav
Sponsored by:	Nginx, Inc.
2013-03-07 08:00:04 +00:00
Gleb Smirnoff
a95940fd46 Plug a memory leak.
Reviewed by:	mav
Sponsored by:	Nginx, Inc.
2013-03-07 07:54:50 +00:00
Alexander Motin
32ea29e2eb Add quirk to enable headphones redirection on Lenovo X220.
PR:		kern/174876
MFC after:	1 week
2013-03-04 21:20:13 +00:00
Ulrich Spörlein
6dcf64df00 Fix typo
Submitted by:	Matt Burke <mattblists@icritical.com>
2013-02-19 10:25:51 +00:00
Sofian Brabez
61bfd86762 Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
Reviewed by:	cognet
Approved by:	cognet
2013-01-30 18:01:20 +00:00
Jack F Vogel
9e81697fdf Add Intel Lynx Point PCH HD Audio Device IDs 2013-01-02 21:56:58 +00:00
Alexander Motin
ae84f236a9 Add quirks for AD1984A codec and Lenovo X300 laptop.
PR:		kern/148741
MFC after:	2 weeks
2012-12-12 11:44:20 +00:00
Eitan Adler
dec3a11b26 Add a few more translations from IDs to model name.
Submitted by:	"4721@hushmail.com" <4721@hushmail.com>
Approved by:	cperciva (implicit)
MFC after:	2 weeks
2012-12-02 18:41:22 +00:00
Eitan Adler
bff5138029 Add support for hdmi hda codec onboard nvidia gt 440 graphics card
PR:		kern/174059
Submitted by:	"4721@hushmail.com" <4721@hushmail.com>
Approved by:	cperciva (implicit)
MFC after:	2 weeks
2012-12-02 17:54:52 +00:00
Alexander Motin
1ba706292c Fix uninitialized variable reported by gcc, but not clang. 2012-11-26 02:04:11 +00:00
Alexander Motin
8903f19ef0 Remove extra sbuf_trim() copy/pasted into r243530. 2012-11-26 01:54:00 +00:00
Alexander Motin
7ec13509e9 On multiple requests, compact HDA driver verbose output by hiding CODEC's
detailed information under the sound debug.  To make it easier accessible,
export that information through the set of sysctls like dev.hdaa.X.nidY.
Also tune some output to make it both more compact and informative.
2012-11-25 20:06:01 +00:00
Alexander Motin
6d36c821ad Summarize information about connected analog pins and EDID-like data received
from HDMI/DisplayPort devices in form of general connection status and
sound(4)-style channel matrix.  Now that information is only reported in
readable form to verbose logs, but potentially could be used by sound(4)
to correctly choose default devices and configure vchans.

Fix rear and side channels swap on analog 7.1 outputs.  As soon as there is
a huge mess in industry about naming and using of these channels, duplicate
rear channels of 4 and 5.1 streams to both read and side speakers.
2012-11-17 06:33:13 +00:00
Kevin Lo
0f5e7edc14 Fix typo; s/ouput/output 2012-11-07 07:00:59 +00:00
Alexander Motin
3049555773 ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker
if unused in that configuration mixer at NID 15 is muted.  Probably CODEC
incorrectly reports its internal connections.  Hide that muter from the
driver to avoid muting and make built-in speaker work.

There are several different CODECs sharing this ID and I have not enough
information about them and the bug to implement more universal solution.

Tested by:	Big Yuuta <init.py@gmail.com>
MFC after:	2 weeks
2012-10-31 22:11:51 +00:00
Alexander Motin
401f7c11ff Set all pins initial connection status to unknown (2) and then update it
with the real value in regular way if sensing is supported.  This fixes
minor inconsistency when playback redirection appeared in undefined state
on boot if headphones were not connected.
2012-10-30 12:44:30 +00:00
Alexander Motin
ed228e403f Print card and subsystem IDs in verbose logs to help to identify system.
Hide some less iseful messages under debug.
2012-10-30 10:59:42 +00:00
Eitan Adler
2da1951583 Now that device disabling is generic, remove extraneous code from the
device drivers that used to provide this feature.

This is a subset of 241856 (which was reverted)

Reviewed by:	des
Approved by:	cperciva (implicit)
MFC after:	1 week
2012-10-22 22:29:48 +00:00
Eitan Adler
a8de37b024 This isn't functionally identical. In some cases a hint to disable
unit 0 would in fact disable all units.

This reverts r241856

Approved by: cperciva (implicit)
2012-10-22 13:06:09 +00:00
Eitan Adler
76b7512247 Now that device disabling is generic, remove extraneous code from the
device drivers that used to provide this feature.

Reviewed by:	des
Approved by:	cperciva
MFC after:	1 week
2012-10-22 03:41:14 +00:00
Eitan Adler
db702c59cf remove duplicate semicolons where possible.
Approved by:	cperciva
MFC after:	1 week
2012-10-22 03:00:37 +00:00
Alexander Motin
675dce071a Cast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
make analog input loopback and dual-stream playback work by enabling
signal mixing by nid 22, as it should be according to info returned by
the CODEC.  Otherwise pin nid 28 receives only signal from DAC nid 16.

PR:		kern/169124
MFC after:	1 week
2012-10-09 17:06:31 +00:00
Kevin Lo
b5db12bfb5 Free result of device_get_children(9). 2012-09-30 09:21:10 +00:00
Alexander Motin
076b76e871 Fix panic caused by wrong pointer dereference, left after pin sense rewrite
at r230551.

Also while there, make sense polling use reported for each node separately
instead of reporting accumulated total status.

Submitted by:	Barbara <barbara.freebsd@gmail.com> (1)
MFC after:	3 days
2012-09-24 08:23:05 +00:00
Alexander Motin
7d0ec9dd3f Add bunch of ATI HDMI HDA controller IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2012-08-30 15:47:20 +00:00
Alexander Motin
52e9cf7de5 Fix "speaker" volume control, broken at r230451.
Reported and tested by:	Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after:	1 month
2012-08-16 07:43:15 +00:00