3002b9fb | 13-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Use runtime PM autosuspend
This patch adds a few lines to the driver to use autosuspend for the runtime PM. It'll become useful with the combination of the keep-link feature.
Signed-off
ALSA: x86: Use runtime PM autosuspend
This patch adds a few lines to the driver to use autosuspend for the runtime PM. It'll become useful with the combination of the keep-link feature.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
b1ef30e5 | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Don't bail out from PCM ops when disconnected
Currently the driver returns -ENODEV when the monitor is disconnected. But PA alsa module doesn't like this and it starts playing Juliet, kil
ALSA: x86: Don't bail out from PCM ops when disconnected
Currently the driver returns -ENODEV when the monitor is disconnected. But PA alsa module doesn't like this and it starts playing Juliet, kills itself as if it were a fatal tragedy.
Since we protect the whole read/write at disconnection, just allow the PCM accesses even during disconnection.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
2d42c033 | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Minor code rearrangement
Put the stuff in the right order; notification should be at the end of the action.
Also dropped a superfluous debug print and incorrect comments.
Signed-off-by:
ALSA: x86: Minor code rearrangement
Put the stuff in the right order; notification should be at the end of the action.
Also dropped a superfluous debug print and incorrect comments.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
be9a2e93 | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Stop the stream when buffer is processed after disconnection
This shouldn't happen, but just to be sure...
Signed-off-by: Takashi Iwai <tiwai@suse.de> |
28ed125b | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Avoid register accesses during disconnection
It seems that accessing registers during disconnection often leads to the GPU pipe error. The original driver had a similar check in the past
ALSA: x86: Avoid register accesses during disconnection
It seems that accessing registers during disconnection often leads to the GPU pipe error. The original driver had a similar check in the past, but it was lost through refactoring. Now put a connection check in the register access functions.
One exception is the irq handler: it still needs to access the raw register even while disconnected, because it has to read and write to ACK the irq mask. Although the irq shouldn't be raised while disconnected (the stream should have been disabled), let's make it safer for now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
a72ccfba | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Don't return an error from chmap ctl at disconnected
It's not wise to return an error at info/get callback when disconnected, which happens at any time. The chmap ctl is supposed to fill
ALSA: x86: Don't return an error from chmap ctl at disconnected
It's not wise to return an error at info/get callback when disconnected, which happens at any time. The chmap ctl is supposed to fill zero for such a case, instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
18353192 | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Fix memory leak in had_build_channel_allocation_map()
The previously allocated chmap has to be released before setting the new one.
Signed-off-by: Takashi Iwai <tiwai@suse.de> |
5def9019 | 15-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Use snd_pcm_stop_xrun() for connection / disconnection paths
This seems more friendly to user-space, as it's notified at least as an error, instead of forcibly moving the PCM state to SET
ALSA: x86: Use snd_pcm_stop_xrun() for connection / disconnection paths
This seems more friendly to user-space, as it's notified at least as an error, instead of forcibly moving the PCM state to SETUP out of sudden.
Moreover, snd_pcm_stop() needs an extra PCM spinlock I forgot, while snd_pcm_stop_xrun() takes the spinlock by itself.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
b9bacf27 | 14-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Implement jack control
This patch implements a jack interface for notifying HDMI/DP connection. PA listens to this, so it can handle the monitor connection more gracefully.
Signed-off-b
ALSA: x86: Implement jack control
This patch implements a jack interface for notifying HDMI/DP connection. PA listens to this, so it can handle the monitor connection more gracefully.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
df42cb49 | 12-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Drop unused stream.running field
The pcm_stream_info.running field is only set in the PCM trigger callback but never referred, thus it can be safely removed.
Also, properly cover the spi
ALSA: x86: Drop unused stream.running field
The pcm_stream_info.running field is only set in the PCM trigger callback but never referred, thus it can be safely removed.
Also, properly cover the spinlock in both the trigger START and STOP to protect had_enable_audio() calls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
e2acecf2 | 11-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Handle reset at prepare callback
Currently the driver handles some reset procedure at the trigger STOP and the underrun functions, where both are executed in the interrupt context. Espec
ALSA: x86: Handle reset at prepare callback
Currently the driver handles some reset procedure at the trigger STOP and the underrun functions, where both are executed in the interrupt context. Especially the underrun function has a sync-loop to clear the UNDERRUN status bit, and this is supposed to be one of plausible causes of GPU hangup.
Since the job to be done in the interrupt handler should be minimum, we move the reset function out of trigger and underrun, and push it into the prepare (and hw_free) callbacks instead. Here a new flag, need_reset, is introduced to indicate the requirement of the reset procedure. This is for avoiding the multiple resets when PCM prepare is called sequentially.
Also in the UNDERRUN bit-clear sync loop, take a longer pause to be in the safer side. Taking a longer delay is no longer a problem now because we're running in the normal context.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
3fe2cf7e | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Support S16 format
Now we support S16 PCM format in addition. For this, we need to set packet_mode=1 in AUD_CONFIG register.
Signed-off-by: Takashi Iwai <tiwai@suse.de> |
85bd8748 | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Support S32 format
The hardware has the support for the left-aligned 24bit format in 32bit packet. This corresponds to S32 format in ALSA. We need to set the msbits restriction as well
ALSA: x86: Support S32 format
The hardware has the support for the left-aligned 24bit format in 32bit packet. This corresponds to S32 format in ALSA. We need to set the msbits restriction as well to inform user-space that only MSB 24bit are available.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
e8de9859 | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Allow no-period-wakeup setup
In the current implementation, the driver may update the BDs even at PCM pointer callback. This allows us to skip the period interrupt effectively.
Signed-o
ALSA: x86: Allow no-period-wakeup setup
In the current implementation, the driver may update the BDs even at PCM pointer callback. This allows us to skip the period interrupt effectively.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
8d48c016 | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Allow single period PCM operation
This is an implementation of PCM streaming with only 1 period. Since the hardware requires the refresh of BDs after each BD processing finishes, we'd nee
ALSA: x86: Allow single period PCM operation
This is an implementation of PCM streaming with only 1 period. Since the hardware requires the refresh of BDs after each BD processing finishes, we'd need at least two BDs. The trick is that both BDs point to the same content: the address of the PCM buffer head, and the whole buffer size. Then it loops over to the whole buffer again after it finished once.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
a9ebdd0e | 02-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Don't pass SNDRV_PCM_INFO_BATCH flag
The PCM engine on LPE audio isn't like a batch-style process any longer, but rather it deals with the standard ring buffer. Remove the BATCH info fla
ALSA: x86: Don't pass SNDRV_PCM_INFO_BATCH flag
The PCM engine on LPE audio isn't like a batch-style process any longer, but rather it deals with the standard ring buffer. Remove the BATCH info flag so that PA can handle the buffer in timer-sched mode.
Similarly, the DOUBLE flag is also superfluous. Drop both bits.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
40ce4b5d | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Cache AUD_CONFIG register value
At enabling the audio, we modify AUD_CONFIG register bit 0. So far, it does read-modify-write procedure with a special hack for the channel bits due to th
ALSA: x86: Cache AUD_CONFIG register value
At enabling the audio, we modify AUD_CONFIG register bit 0. So far, it does read-modify-write procedure with a special hack for the channel bits due to the silicon bug. But we can optimize it by remembering the AUD_CONFIG register value privately. This simplifies the things a lot.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
77531bee | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Rearrange defines
We have two header files and everything is mixed up chaotically. Move the chip-specific definitions like the hardware registers to intel_hdmi_lpe_audio.h, and the rest,
ALSA: x86: Rearrange defines
We have two header files and everything is mixed up chaotically. Move the chip-specific definitions like the hardware registers to intel_hdmi_lpe_audio.h, and the rest, the implementation specific stuff into intel_hdmi_audio.h.
In addition, put some more comments to the register fields, and fix the incorrect name prefix for AUD_HDMI_STATUS bits, too.
The whole changes are merely a code shuffling, and there is no functional change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
1df98924 | 07-Feb-2017 |
Arnd Bergmann <arnd@arndb.de> |
ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused
The two functions are unused when CONFIG_PM_SLEEP is disabled:
sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' d
ALSA: x86: mark hdmi suspend/resume functions as __maybe_unused
The two functions are unused when CONFIG_PM_SLEEP is disabled:
sound/x86/intel_hdmi_audio.c:1633:12: error: 'hdmi_lpe_audio_resume' defined but not used [-Werror=unused-function] sound/x86/intel_hdmi_audio.c:1622:12: error: 'hdmi_lpe_audio_suspend' defined but not used [-Werror=unused-function]
Marking them as __maybe_unused avoids the warning without introducing an ugly #ifdef.
Fixes: 182cdf23dbf6 ("ALSA: x86: Implement runtime PM") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
873ab035 | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Fix driver name string overflow
The driver sets card->driver name string over its size (16 bytes). Shorten the name string to fit with it.
Also, set more verbose string to card->shortnam
ALSA: x86: Fix driver name string overflow
The driver sets card->driver name string over its size (16 bytes). Shorten the name string to fit with it.
Also, set more verbose string to card->shortname and ->longname. This doesn't have to be identical with card->driver at all.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
075a1d46 | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Rename had_enable_audio_int() to had_ack_irqs()
had_enable_audio_int() came from the LPE audio shell set_caps callback with ENABLE_INT and DISABLE_INT caps. I interpreted as these corres
ALSA: x86: Rename had_enable_audio_int() to had_ack_irqs()
had_enable_audio_int() came from the LPE audio shell set_caps callback with ENABLE_INT and DISABLE_INT caps. I interpreted as these correspond to enabling / disabling the audio interface, but the actual implementation is only to clear (send ACK) to both BUFFER_DONE and BUFFER_UNDERRUN interrupts unconditionally. And, there is no counterpart, DISABLE_INT, code at all.
For avoiding the further misunderstanding, rename the function to the more fitting one, had_ack_irqs(), and drop the calls with enable=false in allover places. There is no functional changes at all.
After this patch, there is only one caller at the PCM trigger start. Then it's doubtful whether this call is still really needed or not; I bet it not, but let's stay in the safer side for now and keep it as was.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
3e21a76c | 07-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Drop suspicious U24 format support
U24 format is declared to be supported by the driver, but this looks really doubtful, as there is no corresponding code. Better to drop it. This forma
ALSA: x86: Drop suspicious U24 format support
U24 format is declared to be supported by the driver, but this looks really doubtful, as there is no corresponding code. Better to drop it. This format is very uncommon, so there should be practically no impact by this change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
e1b239f3 | 02-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Refactor PCM process engine
This is again a big rewrite of the driver; now it touches the code to process PCM stream transfers.
The most fundamental change is that the driver may support
ALSA: x86: Refactor PCM process engine
This is again a big rewrite of the driver; now it touches the code to process PCM stream transfers.
The most fundamental change is that the driver may support more than four periods. Instead of keeping the same index between both the ring buffer (with the fixed four buffer descriptors) and the PCM buffer periods, we keep difference indices for both (bd_head and pcm_head fields). In addition, when the periods are more than four, we need to track both head and next indices. That is, we now have three indices: bd_head, pcm_head and pcm_filled.
Also, the driver works better for periods < 4, too: the remaining BDs out of four are marked as invalid, so that the hardware skips those BDs in its loop.
By this flexibility, we can use even ALSA-lib dmix plugin, which requires 16 periods as default.
The buffer size could be up to 20bit, so the max buffer size was increased accordingly. However, the buffer pre-allocation is kept as the old value (600kB) as default. The reason is the limited number of BDs: since it doesn't suffice for the useful SG page management that can fit with the usual page allocator like some other drivers, we have to still allocate continuous pages, hence we shouldn't take too big memories there.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
b556290f | 04-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Unify local function prefix
Use had_ prefix consistently to all local helper functions, as well as had_pcm_ for PCM ops.
Signed-off-by: Takashi Iwai <tiwai@suse.de> |
f4566aa1 | 04-Feb-2017 |
Takashi Iwai <tiwai@suse.de> |
ALSA: x86: Minor cleanup of reset buffer procedure
The procedure to reset buffer pointers is performed in two places and still open-coded. Simplify the helper function and use it consistently.
Sig
ALSA: x86: Minor cleanup of reset buffer procedure
The procedure to reset buffer pointers is performed in two places and still open-coded. Simplify the helper function and use it consistently.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|