1248a380aSMatt Ranostay /* SPDX-License-Identifier: GPL-2.0+ */ 21cd2224cSMatthew Ranostay /* 31cd2224cSMatthew Ranostay * Digital Beep Input Interface for HD-audio codec 41cd2224cSMatthew Ranostay * 5248a380aSMatt Ranostay * Author: Matt Ranostay <matt.ranostay@konsulko.com> 61cd2224cSMatthew Ranostay * Copyright (c) 2008 Embedded Alley Solutions Inc 71cd2224cSMatthew Ranostay */ 81cd2224cSMatthew Ranostay 91cd2224cSMatthew Ranostay #ifndef __SOUND_HDA_BEEP_H 101cd2224cSMatthew Ranostay #define __SOUND_HDA_BEEP_H 111cd2224cSMatthew Ranostay 12be57bfffSPierre-Louis Bossart #include <sound/hda_codec.h> 131cd2224cSMatthew Ranostay 149bb1fe39STakashi Iwai #define HDA_BEEP_MODE_OFF 0 159bb1fe39STakashi Iwai #define HDA_BEEP_MODE_ON 1 162dca0bbaSJaroslav Kysela 171cd2224cSMatthew Ranostay /* beep information */ 181cd2224cSMatthew Ranostay struct hda_beep { 191cd2224cSMatthew Ranostay struct input_dev *dev; 201cd2224cSMatthew Ranostay struct hda_codec *codec; 211cd2224cSMatthew Ranostay char phys[32]; 221cd2224cSMatthew Ranostay int tone; 23fa797966STakashi Iwai hda_nid_t nid; 24d604b399STakashi Iwai unsigned int registered:1; 25fa797966STakashi Iwai unsigned int enabled:1; 26fa797966STakashi Iwai unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */ 27e914b25eSTakashi Iwai unsigned int playing:1; 28*4c8d695cSTakashi Iwai unsigned int keep_power_at_enable:1; /* set by driver */ 291cd2224cSMatthew Ranostay struct work_struct beep_work; /* scheduled task for beep event */ 305ccf835cSTakashi Iwai void (*power_hook)(struct hda_beep *beep, bool on); 311cd2224cSMatthew Ranostay }; 321cd2224cSMatthew Ranostay 331cd2224cSMatthew Ranostay #ifdef CONFIG_SND_HDA_INPUT_BEEP 34123c07aeSJaroslav Kysela int snd_hda_enable_beep_device(struct hda_codec *codec, int enable); 351cd2224cSMatthew Ranostay int snd_hda_attach_beep_device(struct hda_codec *codec, int nid); 361cd2224cSMatthew Ranostay void snd_hda_detach_beep_device(struct hda_codec *codec); 371cd2224cSMatthew Ranostay #else snd_hda_attach_beep_device(struct hda_codec * codec,int nid)382308f4adSJoe Perchesstatic inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) 392308f4adSJoe Perches { 402308f4adSJoe Perches return 0; 412308f4adSJoe Perches } snd_hda_detach_beep_device(struct hda_codec * codec)42ca2585afSTakashi Iwaistatic inline void snd_hda_detach_beep_device(struct hda_codec *codec) 432308f4adSJoe Perches { 442308f4adSJoe Perches } 451cd2224cSMatthew Ranostay #endif 461cd2224cSMatthew Ranostay #endif 47