summaryrefslogtreecommitdiffstats
path: root/HAL-afb/HDA-intel/IntelHdaHAL.c
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2017-06-27 14:24:38 +0200
committerfulup <fulup.arfoll@iot.bzh>2017-06-27 14:25:53 +0200
commit6c0d556e956eaf1f4eea734d7313d258dd75b878 (patch)
tree3308e313b6520ea4469ecce5fdc1dbd6850e1882 /HAL-afb/HDA-intel/IntelHdaHAL.c
parent0fe1ff36dcc75149481d8071a1806c5408f70acc (diff)
Work in Progress
Diffstat (limited to 'HAL-afb/HDA-intel/IntelHdaHAL.c')
-rw-r--r--HAL-afb/HDA-intel/IntelHdaHAL.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/HAL-afb/HDA-intel/IntelHdaHAL.c b/HAL-afb/HDA-intel/IntelHdaHAL.c
index bc8fc43..6967c1f 100644
--- a/HAL-afb/HDA-intel/IntelHdaHAL.c
+++ b/HAL-afb/HDA-intel/IntelHdaHAL.c
@@ -28,6 +28,18 @@ STATIC int IntelHalInit (const struct afb_binding_interface *itf, struct afb_ser
return 0; // 0=OK
}
+STATIC void MasterOnOff (void * handle) {
+ static powerStatus=0;
+
+ if (! powerStatus) {
+ powerStatus = 1;
+ DEBUG (itf, "Power Set to On");
+ } else {
+ powerStatus = 0;
+ DEBUG (itf, "Power Set to Off");
+ }
+}
+
/******************************************************************************************
* alsaCtlsMap link hight level sound control with low level Alsa numid ctls.
*
@@ -41,10 +53,11 @@ STATIC int IntelHalInit (const struct afb_binding_interface *itf, struct afb_ser
* .cb={.handle=xxxx, .callback=(json_object)MyCtlFunction(struct afb_service service, int controle, int value, const struct alsaHalCtlMapS *map)};
********************************************************************************************/
STATIC alsaHalMapT alsaHalMap[]= {
- { .alsa={.control=Master_Playback_Volume,.numid=16,.group=OUTVOL,.values=1,.minval=0,.maxval= 87 ,.step=0,.acl=RW}, .info= "Master Playback Volume" },
- { .alsa={.control=PCM_Playback_Volume ,.numid=27,.group=PCMVOL,.values=2,.minval=0,.maxval= 255,.step=0,.acl=RW}, .info= "PCM Playback Volume" },
- { .alsa={.control=PCM_Playback_Switch ,.numid=17,.group=SWITCH,.values=1,.minval=0,.maxval= 1 ,.step=0,.acl=RW}, .info= "Master Playback Switch" },
- { .alsa={.control=Capture_Volume ,.numid=12,.group=INVOL ,.values=2,.minval=0,.maxval= 31 ,.step=0,.acl=RW}, .info= "Capture Volume" },
+ { .alsa={.control=Master_Playback_Volume,.numid=16, .name="Master-Vol" , .values=1,.minval=0,.maxval= 87 ,.step=0}, .info= "Master Playback Volume" },
+ { .alsa={.control=PCM_Playback_Volume ,.numid=27, .name="Play-Vol" , .values=2,.minval=0,.maxval= 255,.step=0}, .info= "PCM Playback Volume" },
+ { .alsa={.control=PCM_Playback_Switch ,.numid=17, .name="Play-Switch" , .values=1,.minval=0,.maxval= 1 ,.step=0}, .info= "Master Playback Switch" },
+ { .alsa={.control=Capture_Volume ,.numid=12, .name="Capt-vol" , .values=2,.minval=0,.maxval= 31 ,.step=0}, .info= "Capture Volume" },
+ { .alsa={.control=Master_OnOff_Switch ,.numid=1000, .name="Power-Switch"}, .cb={.callback=MasterOnOff, .handle=NULL}} /* marker for end of the array */
{ .alsa={.numid=0}, .cb={.callback=NULL, .handle=NULL}} /* marker for end of the array */
} ;