1 // SPDX-License-Identifier: GPL-2.0-only
3 * Intel MIC Platform Software Stack (MPSS)
5 * Copyright(c) 2013 Intel Corporation.
7 * Disclaimer: The codes contained in these modules may be specific to
8 * the Intel Software Development Platform codenamed: Knights Ferry, and
9 * the Intel product codenamed: Knights Corner, and are not backward
10 * compatible with other Intel products. Additionally, Intel will NOT
11 * support the codes or instruction set in future products.
13 * Intel MIC Card driver.
15 #include <linux/debugfs.h>
16 #include <linux/delay.h>
17 #include <linux/seq_file.h>
18 #include <linux/interrupt.h>
19 #include <linux/device.h>
21 #include "../common/mic_dev.h"
22 #include "mic_device.h"
24 /* Debugfs parent dir */
25 static struct dentry
*mic_dbg
;
28 * mic_intr_show - Send interrupts to host.
30 static int mic_intr_show(struct seq_file
*s
, void *unused
)
32 struct mic_driver
*mdrv
= s
->private;
33 struct mic_device
*mdev
= &mdrv
->mdev
;
35 mic_send_intr(mdev
, 0);
37 mic_send_intr(mdev
, 1);
39 mic_send_intr(mdev
, 2);
41 mic_send_intr(mdev
, 3);
47 DEFINE_SHOW_ATTRIBUTE(mic_intr
);
50 * mic_create_card_debug_dir - Initialize MIC debugfs entries.
52 void __init
mic_create_card_debug_dir(struct mic_driver
*mdrv
)
57 mdrv
->dbg_dir
= debugfs_create_dir(mdrv
->name
, mic_dbg
);
59 debugfs_create_file("intr_test", 0444, mdrv
->dbg_dir
, mdrv
,
64 * mic_delete_card_debug_dir - Uninitialize MIC debugfs entries.
66 void mic_delete_card_debug_dir(struct mic_driver
*mdrv
)
68 debugfs_remove_recursive(mdrv
->dbg_dir
);
72 * mic_init_card_debugfs - Initialize global debugfs entry.
74 void __init
mic_init_card_debugfs(void)
76 mic_dbg
= debugfs_create_dir(KBUILD_MODNAME
, NULL
);
80 * mic_exit_card_debugfs - Uninitialize global debugfs entry
82 void mic_exit_card_debugfs(void)
84 debugfs_remove(mic_dbg
);