Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Digital Beep Input Interface for HD-audio codec
0004  *
0005  * Author: Matt Ranostay <matt.ranostay@konsulko.com>
0006  * Copyright (c) 2008 Embedded Alley Solutions Inc
0007  */
0008 
0009 #ifndef __SOUND_HDA_BEEP_H
0010 #define __SOUND_HDA_BEEP_H
0011 
0012 #include <sound/hda_codec.h>
0013 
0014 #define HDA_BEEP_MODE_OFF   0
0015 #define HDA_BEEP_MODE_ON    1
0016 
0017 /* beep information */
0018 struct hda_beep {
0019     struct input_dev *dev;
0020     struct hda_codec *codec;
0021     char phys[32];
0022     int tone;
0023     hda_nid_t nid;
0024     unsigned int registered:1;
0025     unsigned int enabled:1;
0026     unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */
0027     unsigned int playing:1;
0028     struct work_struct beep_work; /* scheduled task for beep event */
0029     struct mutex mutex;
0030     void (*power_hook)(struct hda_beep *beep, bool on);
0031 };
0032 
0033 #ifdef CONFIG_SND_HDA_INPUT_BEEP
0034 int snd_hda_enable_beep_device(struct hda_codec *codec, int enable);
0035 int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
0036 void snd_hda_detach_beep_device(struct hda_codec *codec);
0037 #else
0038 static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
0039 {
0040     return 0;
0041 }
0042 static inline void snd_hda_detach_beep_device(struct hda_codec *codec)
0043 {
0044 }
0045 #endif
0046 #endif