aboutsummaryrefslogtreecommitdiffstats
path: root/HAL-afb/HDA-intel
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2017-08-03 12:00:41 +0200
committerfulup <fulup.arfoll@iot.bzh>2017-08-03 12:00:41 +0200
commit070ccac33d65c651c972dfab9c6148e43d8d5d8e (patch)
tree07b79faec9bcaacf14dcc7f8ed08cacf35557e7d /HAL-afb/HDA-intel
parent39384e722d9fd7d162012b682aed41b35d16d003 (diff)
Initial Working Version on Alsa Policy-Policy-Hook
Diffstat (limited to 'HAL-afb/HDA-intel')
-rw-r--r--HAL-afb/HDA-intel/IntelHdaHAL.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/HAL-afb/HDA-intel/IntelHdaHAL.c b/HAL-afb/HDA-intel/IntelHdaHAL.c
index f7aec59..f5c260e 100644
--- a/HAL-afb/HDA-intel/IntelHdaHAL.c
+++ b/HAL-afb/HDA-intel/IntelHdaHAL.c
@@ -27,48 +27,52 @@
// Default Values for MasterVolume Ramping
-STATIC halVolRampT volRampMaster= {
- .mode = RAMP_VOL_NORMAL,
- .slave = Master_Playback_Volume,
- .delay = 100*1000, // ramping delay in us
- .stepDown=1,
- .stepUp =1,
+STATIC halVolRampT volRampMaster = {
+ .mode = RAMP_VOL_NORMAL,
+ .slave = Master_Playback_Volume,
+ .delay = 100 * 1000, // ramping delay in us
+ .stepDown = 1,
+ .stepUp = 1,
};
// Map HAL hight sndctl with Alsa numid and optionally with a custom callback for non Alsa supported functionalities.
-STATIC alsaHalMapT alsaHalMap[]= {
- { .tag=Master_Playback_Volume, . ctl={ .name="Master Playback Volume" } },
- { .tag=PCM_Playback_Volume , .ctl={ .name="PCM Playback Volume" } },
- { .tag=PCM_Playback_Switch , .ctl={ .name="Master Playback Switch" } },
- { .tag=Capture_Volume , .ctl={ .name="Capture Volume" } },
+STATIC alsaHalMapT alsaHalMap[] = {
+ { .tag = Master_Playback_Volume, . ctl =
+ { .name = "Master Playback Volume"}},
+ { .tag = PCM_Playback_Volume, .ctl =
+ { .name = "PCM Playback Volume"}},
+ { .tag = PCM_Playback_Switch, .ctl =
+ { .name = "Master Playback Switch"}},
+ { .tag = Capture_Volume, .ctl =
+ { .name = "Capture Volume"}},
- { .tag=Vol_Ramp , .cb={.callback=volumeRamp, .handle=&volRampMaster}, .info="ramp volume linearly according to current ramp setting",
- .ctl={.numid=0, .type=SND_CTL_ELEM_TYPE_INTEGER, .count=1, .minval=0, .maxval=100, .step=1, .name="Hal-VolRamp"}
- },
-
- { .tag=EndHalCrlTag} /* marker for end of the array */
-} ;
+ { .tag = Master_Playback_Volume, .cb =
+ {.callback = volumeRamp, .handle = &volRampMaster}, .info = "ramp volume linearly according to current ramp setting",
+ .ctl =
+ {.numid = 0, .type = SND_CTL_ELEM_TYPE_INTEGER, .count = 1, .minval = 0, .maxval = 100, .step = 1, .name = "Hal-VolRamp"}},
-// HAL sound card mapping info
-STATIC alsaHalSndCardT alsaHalSndCard = {
- .name = "HDA Intel PCH", // WARNING: name MUST match with 'aplay -l'
- .info = "Hardware Abstraction Layer for IntelHDA sound card",
- .ctls = alsaHalMap,
+ { .tag = EndHalCrlTag} /* marker for end of the array */
};
+// HAL sound card mapping info
+STATIC alsaHalSndCardT alsaHalSndCard = {
+ .name = "HDA Intel PCH", // WARNING: name MUST match with 'aplay -l'
+ .info = "Hardware Abstraction Layer for IntelHDA sound card",
+ .ctls = alsaHalMap,
+};
-STATIC int sndServiceInit () {
+STATIC int sndServiceInit() {
int err;
- AFB_DEBUG ("IntelHalBinding Init");
+ AFB_DEBUG("IntelHal Binding Init");
- err = halServiceInit (afbBindingV2.api, &alsaHalSndCard);
+ err = halServiceInit(afbBindingV2.api, &alsaHalSndCard);
return err;
}
// API prefix should be unique for each snd card
PUBLIC const struct afb_binding_v2 afbBindingV2 = {
- .api = "intel-hda",
- .init = sndServiceInit,
- .verbs = halServiceApi,
+ .api = "intel-hda",
+ .init = sndServiceInit,
+ .verbs = halServiceApi,
.onevent = halServiceEvent,
};