Linux Audio

Check our new training course

Loading...
Note: File does not exist in v3.1.
 1// SPDX-License-Identifier: GPL-2.0-only
 2/*
 3 * Intel MIC Platform Software Stack (MPSS)
 4 *
 5 * Copyright(c) 2013 Intel Corporation.
 6 *
 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.
12 *
13 * Intel MIC Card driver.
14 */
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>
20
21#include "../common/mic_dev.h"
22#include "mic_device.h"
23
24/* Debugfs parent dir */
25static struct dentry *mic_dbg;
26
27/**
28 * mic_intr_show - Send interrupts to host.
29 */
30static int mic_intr_show(struct seq_file *s, void *unused)
31{
32	struct mic_driver *mdrv = s->private;
33	struct mic_device *mdev = &mdrv->mdev;
34
35	mic_send_intr(mdev, 0);
36	msleep(1000);
37	mic_send_intr(mdev, 1);
38	msleep(1000);
39	mic_send_intr(mdev, 2);
40	msleep(1000);
41	mic_send_intr(mdev, 3);
42	msleep(1000);
43
44	return 0;
45}
46
47DEFINE_SHOW_ATTRIBUTE(mic_intr);
48
49/**
50 * mic_create_card_debug_dir - Initialize MIC debugfs entries.
51 */
52void __init mic_create_card_debug_dir(struct mic_driver *mdrv)
53{
54	if (!mic_dbg)
55		return;
56
57	mdrv->dbg_dir = debugfs_create_dir(mdrv->name, mic_dbg);
58
59	debugfs_create_file("intr_test", 0444, mdrv->dbg_dir, mdrv,
60			    &mic_intr_fops);
61}
62
63/**
64 * mic_delete_card_debug_dir - Uninitialize MIC debugfs entries.
65 */
66void mic_delete_card_debug_dir(struct mic_driver *mdrv)
67{
68	if (!mdrv->dbg_dir)
69		return;
70
71	debugfs_remove_recursive(mdrv->dbg_dir);
72}
73
74/**
75 * mic_init_card_debugfs - Initialize global debugfs entry.
76 */
77void __init mic_init_card_debugfs(void)
78{
79	mic_dbg = debugfs_create_dir(KBUILD_MODNAME, NULL);
80}
81
82/**
83 * mic_exit_card_debugfs - Uninitialize global debugfs entry
84 */
85void mic_exit_card_debugfs(void)
86{
87	debugfs_remove(mic_dbg);
88}