aboutsummaryrefslogtreecommitdiffstats
path: root/HAL-afb/HDA-intel
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2017-07-09 19:59:24 +0200
committerfulup <fulup.arfoll@iot.bzh>2017-07-09 19:59:24 +0200
commitdb4d63597b22b63eb73b5c0558476652ed4988bb (patch)
tree839d67c2dd32064f1047f788f70860cf3036e691 /HAL-afb/HDA-intel
parent3d5816a07c22dd6c655a60000fb0f175d613e484 (diff)
initial version of HAL (registration + getctls)
Work in progress
Diffstat (limited to 'HAL-afb/HDA-intel')
-rw-r--r--HAL-afb/HDA-intel/IntelHdaHAL.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/HAL-afb/HDA-intel/IntelHdaHAL.c b/HAL-afb/HDA-intel/IntelHdaHAL.c
index f394fd6..66f241f 100644
--- a/HAL-afb/HDA-intel/IntelHdaHAL.c
+++ b/HAL-afb/HDA-intel/IntelHdaHAL.c
@@ -25,28 +25,27 @@
#include "hal-interface.h"
#include "audio-interface.h"
-STATIC struct json_object* MasterOnOff (alsaHalCtlMapT *control, void* handle) {
- static int powerStatus=0;
+STATIC struct json_object* MasterOnOff (alsaHalCtlMapT *control, void* handle, struct json_object *valJ) {
+ struct json_object *reponseJ;
- if (! powerStatus) {
- powerStatus = 1;
- AFB_DEBUG ("Power Set to On");
- } else {
- powerStatus = 0;
- AFB_DEBUG ("Power Set to Off");
- }
+ AFB_INFO ("Power Set value=%s", json_object_get_string(valJ));
- return NULL;
+ reponseJ=json_object_new_object();
+ json_object_object_add (reponseJ, "Callback", json_object_new_string("Hello From HAL"));
+
+ return reponseJ;
}
// Map HAL hight sndctl with Alsa numid and optionally with a custom callback for non Alsa supported functionalities.
STATIC alsaHalMapT alsaHalMap[]= {
- { .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=99, .name="Power-Switch"}, .cb={.callback=MasterOnOff, .handle=NULL}, .info= "OnOff Global Switch"},
- { .alsa={.numid=0}, .cb={.callback=NULL, .handle=NULL}} /* marker for end of the array */
+ { .tag=Master_Playback_Volume, .ctl={.numid=04 } },
+ { .tag=PCM_Playback_Volume , .ctl={.numid=06 } },
+ { .tag=PCM_Playback_Switch , .ctl={.numid=05 } },
+ { .tag=Capture_Volume , .ctl={.numid=12 } },
+ { .tag=Master_OnOff_Switch , .ctl={.numid=0, .type=SND_CTL_ELEM_TYPE_BOOLEAN, .count=1, .name="Power-Switch"}, .cb={.callback=MasterOnOff, .handle=NULL}},
+ { .tag=Master_Playback_Ramp , .ctl={.numid=0, .type=SND_CTL_ELEM_TYPE_INTEGER, .count=2, .name="Volume-Switch"}, .cb={.callback=MasterOnOff, .handle=NULL}},
+
+ { .tag=EndHalCrlTag} /* marker for end of the array */
} ;
// HAL sound card mapping info