ALSA: hda_intel: add card number to irq description
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 22 Dec 2015 18:09:05 +0000 (19:09 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 12 Jan 2016 20:05:16 +0000 (21:05 +0100)
Currently the info in /proc/interrupts doesn't allow to figure out which
interrupt belongs to which card (HDMI, PCH, ..).
Therefore add card details to the interrupt description.
With the patch the info in /proc/interrupts looks like this:

PCI-MSI 442368-edge      snd_hda_intel:card1
PCI-MSI 49152-edge      snd_hda_intel:card0

NOTE: this patch adds the new irq_descr field snd_card struct that is
filled automatically at a card object creation.  This can be used
generically for other drivers as well.  The changes for others will
follow later -- tiwai

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/core.h
sound/core/init.c
sound/pci/hda/hda_intel.c

index cdfecafff0f49092331e422a7ab82ec23f781c99..31079ea5e48466575bfdf0bbc0e2c87fde26deeb 100644 (file)
@@ -99,6 +99,7 @@ struct snd_card {
        char driver[16];                /* driver name */
        char shortname[32];             /* short name of this soundcard */
        char longname[80];              /* name of this soundcard */
+       char irq_descr[32];             /* Interrupt description */
        char mixername[80];             /* mixer name */
        char components[128];           /* card components delimited with
                                                                space */
index 20f37fb3800ecce8222fc67ef48afa91f65ecb4c..6bda8436d7652299a90c29d5608c0b4b34f4f693 100644 (file)
@@ -268,6 +268,9 @@ int snd_card_new(struct device *parent, int idx, const char *xid,
        if (err < 0)
                goto __error;
 
+       snprintf(card->irq_descr, sizeof(card->irq_descr), "%s:%s",
+                dev_driver_string(card->dev), dev_name(&card->card_dev));
+
        /* the control interface cannot be accessed from the user space until */
        /* snd_cards_bitmask and snd_cards are set with snd_card_register */
        err = snd_ctl_create(card);
index 83800ac6ebd782512d004311ee5004dc4fa097de..c0bef11afa7e2cc01138a46708f4d6e9cd4bd529 100644 (file)
@@ -725,7 +725,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
 
        if (request_irq(chip->pci->irq, azx_interrupt,
                        chip->msi ? 0 : IRQF_SHARED,
-                       KBUILD_MODNAME, chip)) {
+                       chip->card->irq_descr, chip)) {
                dev_err(chip->card->dev,
                        "unable to grab IRQ %d, disabling device\n",
                        chip->pci->irq);