09 May, 2017

1 commit

  • set_memory_* functions have moved to set_memory.h. Switch to this
    explicitly.

    Link: http://lkml.kernel.org/r/1488920133-27229-14-git-send-email-labbott@redhat.com
    Signed-off-by: Laura Abbott
    Acked-by: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Laura Abbott
     

21 Mar, 2017

1 commit

  • CONFIG_SND_X86 is a menu config to filter only for x86-specific
    drivers in its sub-menu, and this doesn't have to be tristate but
    rather it should be a bool. Also, like other sub-menu configs, it's
    more user-friendly to be default=y; it's merely a menu config and the
    actual drivers are configured in the sub-menu, after all.

    Fixes: 287599cf2d77 ("ALSA: add Intel HDMI LPE audio driver for BYT/CHT-T")
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

22 Feb, 2017

3 commits

  • The newly added driver uses the PCM helpers and fails to link if they are disabled:

    sound/built-in.o: In function `hdmi_lpe_audio_runtime_suspend':
    intel_hdmi_audio.c:(.text+0x15906): undefined reference to `snd_pcm_suspend'
    sound/built-in.o: In function `had_pcm_hw_params':
    intel_hdmi_audio.c:(.text+0x15ac7): undefined reference to `snd_pcm_lib_malloc_pages'
    sound/built-in.o: In function `had_pcm_open':
    intel_hdmi_audio.c:(.text+0x15d49): undefined reference to `snd_pcm_hw_constraint_integer'

    This uses a Kconfig 'select' statement to make sure they are enabled.

    Fixes: 5dab11d89777 ("ALSA: x86: hdmi: Add audio support for BYT and CHT")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • Unlike HSW and newer, BYT/CHT devices have no fine control of audio
    power domain in i915 side. Since there is little gain by runtime PM
    on BYT/CHT, so far, this commit removes the pm_runtime_enable() call
    as default.

    User who still wants the runtime PM may adjust the corresponding
    sysfs files (power/control and power/autosuspend_delay_ms)
    appropriately, of course.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • 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

    Takashi Iwai
     

16 Feb, 2017

8 commits


13 Feb, 2017

2 commits

  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     

10 Feb, 2017

5 commits

  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     

07 Feb, 2017

6 commits

  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     
  • 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
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • 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
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • 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

    Takashi Iwai
     
  • 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

    Takashi Iwai
     

06 Feb, 2017

1 commit

  • 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

    Takashi Iwai
     

05 Feb, 2017

4 commits


04 Feb, 2017

9 commits