07 Sep, 2017

1 commit


13 Aug, 2017

1 commit


02 Sep, 2016

1 commit

  • Check for snd_pcm_ops structures that are only stored in the ops field of a
    snd_soc_platform_driver structure or passed as the third argument to
    snd_pcm_set_ops. The corresponding field or parameter is declared const,
    so snd_pcm_ops structures that have this property can be declared as const
    also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct snd_pcm_ops i@p = { ... };

    @ok1@
    identifier r.i;
    struct snd_soc_platform_driver e;
    position p;
    @@
    e.ops = &i@p;

    @ok2@
    identifier r.i;
    expression e1, e2;
    position p;
    @@
    snd_pcm_set_ops(e1, e2, &i@p)

    @bad@
    position p != {r.p,ok1.p,ok2.p};
    identifier r.i;
    struct snd_pcm_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct snd_pcm_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Takashi Iwai

    Julia Lawall
     

02 Nov, 2015

2 commits

  • ESS Allegro (marked ES1989S), [125d:1988] (rev 10) is mute after
    loading snd-maestro3 and running alsactl restore. Touching master
    volume or mute makes it work.

    Looks like a bug in the AC'97 codec integrated into the chip.

    Write AC97_MASTER register twice to work-around the problem.

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     
  • Enable I2S docking for Dell Latitude C810.
    This allows the audio output on C/Port II to work (and probably also
    the audio inputs on C/Dock II).

    The volume can't be adjusted - none of the mixer controls currently
    supported affects the I2S output (they belong to the STAC9721/23 AC'97
    codec responsible for the laptop internal connectors & speakers).

    Signed-off-by: Ondrej Zary
    Signed-off-by: Takashi Iwai

    Ondrej Zary
     

16 Apr, 2015

1 commit

  • Replace occurences of the pci api by appropriate call to the dma api.

    A simplified version of the semantic patch that finds this problem is as
    follows: (http://coccinelle.lip6.fr)

    @deprecated@
    idexpression id;
    position p;
    @@

    (
    pci_dma_supported@p ( id, ...)
    |
    pci_alloc_consistent@p ( id, ...)
    )

    @bad1@
    idexpression id;
    position deprecated.p;
    @@
    ...when != &id->dev
    when != pci_get_drvdata ( id )
    when != pci_enable_device ( id )
    (
    pci_dma_supported@p ( id, ...)
    |
    pci_alloc_consistent@p ( id, ...)
    )

    @depends on !bad1@
    idexpression id;
    expression direction;
    position deprecated.p;
    @@

    (
    - pci_dma_supported@p ( id,
    + dma_supported ( &id->dev,
    ...
    + , GFP_ATOMIC
    )
    |
    - pci_alloc_consistent@p ( id,
    + dma_alloc_coherent ( &id->dev,
    ...
    + , GFP_ATOMIC
    )
    )

    Signed-off-by: Quentin Lambert
    Signed-off-by: Takashi Iwai

    Quentin Lambert
     

28 Jan, 2015

1 commit


09 Jan, 2015

1 commit

  • This is a similar cleanup like the commit [3db084fd0af5: ALSA: fm801:
    PCI core handles power state for us].

    Since pci_set_power_state(), pci_save_state() and pci_restore_state()
    are already done in the PCI core side, so we don't need to it doubly.

    Also, pci_enable_device(), pci_disable_device() and pci_set_master()
    calls in PM callbacks are superfluous nowadays, too, so get rid of
    them as well.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

13 Aug, 2014

1 commit

  • We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
    meet kernel coding style guidelines. This issue was reported by checkpatch.

    A simplified version of the semantic patch that makes this change is as
    follows (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i;
    declarer name DEFINE_PCI_DEVICE_TABLE;
    initializer z;
    @@

    - DEFINE_PCI_DEVICE_TABLE(i)
    + const struct pci_device_id i[]
    = z;

    //

    [bhelgaas: add semantic patch]
    Signed-off-by: Benoit Taine
    Signed-off-by: Bjorn Helgaas

    Benoit Taine
     

26 Feb, 2014

1 commit


12 Feb, 2014

1 commit


29 May, 2013

1 commit

  • As drvdata is cleared to NULL at probe failure or at removal by the
    driver core, we don't have to call pci_set_drvdata(pci, NULL) any
    longer in each driver.

    The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
    hda_intel.c. Since this function itself releases the card instance,
    we need to clear drvdata here as well, so that it won't be released
    doubly in the remove callback.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

26 Jan, 2013

1 commit

  • Because currently snd_printd() and snd_printdd() macros are expanded
    to empty when CONFIG_SND_DEBUG=n, a compile warning like below
    appears sometimes, and we had to covert it by ugly ifdefs:
    sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’:
    sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable]

    For "fixing" these issues better, this patch replaces snd_printd() and
    snd_printdd() definitions with empty inline functions instead of
    macros. This should have the same effect but shut up warnings like
    above.

    But since we had already put ifdefs, changing to inline functions
    would trigger compile errors. So, such ifdefs is removed in this
    patch.

    In addition, snd_pci_quirk name field is defined only when
    CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in
    snd_printdd() argument triggers the build errors, too. For avoiding
    these errors, introduce a new macro snd_pci_quirk_name() that is
    defined no matter how the debug option is set.

    Reported-by: Stratos Karafotis
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

07 Dec, 2012

1 commit

  • CONFIG_HOTPLUG is going away as an option. As result the __dev*
    markings will be going away.

    Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
    and __devexit.

    Signed-off-by: Bill Pemberton
    Signed-off-by: Takashi Iwai

    Bill Pemberton
     

15 Aug, 2012

1 commit


19 Jul, 2012

1 commit


03 Jul, 2012

1 commit


18 Jun, 2012

1 commit


24 Apr, 2012

1 commit


19 Dec, 2011

1 commit

  • module_param(bool) used to counter-intuitively take an int. In
    fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
    trick.

    It's time to remove the int/unsigned int option. For this version
    it'll simply give a warning, but it'll break next kernel version.

    Signed-off-by: Rusty Russell
    Signed-off-by: Takashi Iwai

    Rusty Russell
     

01 Nov, 2011

1 commit


14 Sep, 2011

1 commit

  • The semantics of snd_mpu401_uart_new()'s interrupt parameters are
    somewhat counterintuitive: To prevent the function from allocating its
    own interrupt, either the irq number must be invalid, or the irq_flags
    parameter must be zero. At the same time, the irq parameter being
    invalid specifies that the mpu401 code has to work without an interrupt
    allocated by the caller. This implies that, if there is an interrupt
    and it is allocated by the caller, the irq parameter must be set to
    a valid-looking number which then isn't actually used.

    With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
    which forces us to handle the parameters differently.

    This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
    device interrupt is handled by the caller, and makes the allocation of
    the interrupt to depend only on the irq parameter. As suggested by
    Takashi, the irq_flags parameter was dropped because, when used, it had
    the constant value IRQF_DISABLED.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

14 Jun, 2011

1 commit


10 Jun, 2011

2 commits

  • The name argument of request_irq() appears in /proc/interrupts, and
    it's quite ugly when the name entry contains a space or special letters.
    In general, it's simpler and more readable when the module name appears
    there, so let's replace all entries with KBUILD_MODNAME.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The convention for pci_driver.name entry in kernel drivers seem to be
    the module name or equivalent ones. But, so far, almost all PCI sound
    drivers use more verbose name like "ABC Xyz (12)", and these are fairly
    confusing when appearing as a file name.

    This patch converts the all pci_driver.name entries in sound/pci/* to
    use KBUILD_MODNAME for more unified appearance.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

08 May, 2010

1 commit


23 Apr, 2010

1 commit

  • While working on the sound suspend / resume problems with my laptop
    I noticed that the hardware volume handling code in essence just detects
    key presses, and then does some hardcoded modification of the master volume
    based on which key is pressed.

    This made me think that clearly the right thing to do here is just report
    these keypresses to userspace and let userspace decide what to with them.

    This patch adds a Kconfig option which when enabled reports the volume
    buttons as keypresses using an input device. When enabled this option
    also gets rid of the ugly direct ac97 writes from the tasklet, the ac97lock
    and the need for using a tasklet in general.

    As an added bonus the keys now work identical to volume keys on a (usb)
    keyboard with multimedia keys, providing visual feedback of the volume
    level change, and a better range of the volume control (with a properly
    configured desktop environment).

    Signed-off-by: Hans de Goede
    Signed-off-by: Takashi Iwai

    Hans de Goede
     

22 Apr, 2010

3 commits

  • While working on a fix for the volume being muted on the allegro in my
    Compaq EVO N600C after suspend, I've learned a few things about the hardware
    volume control worth documenting. The actual fix for the suspend / resume
    issue is in the next patch in this set.

    Signed-off-by: Hans de Goede
    Signed-off-by: Takashi Iwai

    Hans de Goede
     
  • Ignore spurious HV interrupts during suspend / resume, this avoids
    mistaking them for a mute button press. This is not very pretty but
    it seems the only way to fix the master volume control gets muted
    after suspend issue I'm seeing. Note that the es1968 driver is doing
    exactly the same.

    Signed-off-by: Hans de Goede
    Cc:
    Signed-off-by: Takashi Iwai

    Hans de Goede
     
  • Without this quirk sound stops working after suspend resume. With this quirk,
    one still needs to manually unmute the master volume control after a suspend /
    / resume cycle. That is fixed in another patch in this set.

    Note that this patch was submitted to the alsa bug tracker a long time ago:
    https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4319

    Signed-off-by: Hans de Goede
    CC:
    Signed-off-by: Takashi Iwai

    Hans de Goede
     

09 Feb, 2010

1 commit


07 Apr, 2009

1 commit


12 Jan, 2009

1 commit


18 Dec, 2008

1 commit


13 Aug, 2008

1 commit


15 Jul, 2008

1 commit


10 Jul, 2008

2 commits

  • Signed-off-by: David Woodhouse

    David Woodhouse
     
  • The maestro3 driver is byte-swapping its firmware to be host-endian in
    advance, when it doesn't seem to be necessary -- we could just use
    le16_to_cpu() as we load it.

    Doing that means that we need to switch the in-tree firmware to be
    little-endian too.

    Take the least intrusive way of doing this, which is to switch the
    existing snd_m3_convert_from_le() function to convert _to_ little-endian
    instead, and use it on the in-tree firmware instead of the loaded
    firmware. It's a bit suboptimal but doesn't matter much right now
    because we're about to remove the special cases for the in-tree version
    anyway.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

06 Jun, 2008

1 commit

  • Make the hw volume buttons work correctly on some HP OmniBook laptops.
    The original quirk was apparently applied a bit too early and it was
    also lacking some critial register writes. This improved sequence was
    discovered by trial and error (like the original sequence). Tested and
    found working on OB500 and OB6000 laptops.

    Signed-off-by: Ville Syrjala
    Signed-off-by: Takashi Iwai

    Ville Syrjälä
     

24 Apr, 2008

1 commit

  • free_irq() calls synchronize_irq() for you, so there is no need for
    drivers to manually do the same thing (again). Thus, calls where
    sync-irq immediately precedes free-irq can be simplified.

    However, during this audit several bugs were noticed, where free-irq is
    preceded by a "irq >= 0" check... but the sync-irq call is not covered
    by the same check.

    So, where sync-irq could not be eliminated completely, the missing check
    was added.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Takashi Iwai

    Jeff Garzik