Skip to content

Commit

Permalink
topology2: dmic-generic: add switch for LED control
Browse files Browse the repository at this point in the history
Add a switch to gain widget for LED control purpose.

Signed-off-by: Brent Lu <[email protected]>
  • Loading branch information
brentlu committed Jan 12, 2024
1 parent 8d2fb32 commit b889977
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tools/topology/topology2/include/components/gain.conf
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,31 @@ Class.Widget."gain" {
}
}
}

# mute switch control
mixer."2" {
## Channel register and shift for Front Left/Right
Object.Base.channel.1 {
name "fl"
reg 2
shift 0
}
Object.Base.channel.2 {
name "fr"
reg 2
}

Object.Base.ops.1 {
name "ctl"
info "volsw"
## get = 259 binds the mixer control to switch get/put handlers
get 259
put 259
}

#max 1 indicates switch type control
max 1
}
}

# Default attribute values for gain widget
Expand Down
6 changes: 6 additions & 0 deletions tools/topology/topology2/platform/intel/dmic-generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ IncludeByKey.PASSTHROUGH {
Object.Control.mixer.1 {
name '$DMIC0_PCM_NAME Capture Volume'
}
Object.Control.mixer.2 {
name '$DMIC0_PCM_NAME Capture Switch'

mute_led_use 1
mute_led_direction 1
}
}

Object.Widget.module-copier."2" {
Expand Down

0 comments on commit b889977

Please sign in to comment.