-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple: simple audio overlays for bclk_int_div
Specify a bclk_integer_divisor preference for multiples of 8k rates using the msperl simple-card framework via dt overlay. 40/80 bclk_ratio using dtoverlay=simple-bclk-int-div-40-80 50/100 bclk_ratio using dtoverlay=simple-bclk-int-div-50-100 Typically would be used in conjunction with simple-es9023-audio overlay. eg. dtoverlay=simple-es9023-audio,card_name="Akkordion" dtoverlay=simple-bclk-int-div-40-80 Signed-off-by: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
- Loading branch information
1 parent
ef4993f
commit 474d804
Showing
4 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
arch/arm/boot/dts/overlays/simple-bclk-int-div-40-80-overlay.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Definitions of bclk_integer_divisor preference for multiples of 8k rates. | ||
// bclk_ratio=40 for S16_LE. bclk_ratio=80 for S24_LE and S32_LE. | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2708"; | ||
|
||
fragment@0 { | ||
target = <&sound>; | ||
__overlay__ { | ||
// 2ch, 32bit @ 8/16/32/48/64/96kHz rule | ||
// set bclk_ratio=80 | ||
hw-params-rule@0 { | ||
rule-name = "x8kHz_32BIT_2CH_BCLK80"; | ||
priority = <99>; | ||
match@0 { | ||
method = "asoc_generic_hw_params_match_channels"; | ||
values = <2>; | ||
}; | ||
match@1 { | ||
method = "asoc_generic_hw_params_match_rate_lt"; | ||
value = <192000>; | ||
}; | ||
match@2 { | ||
method = "asoc_generic_hw_params_match_rate_div_by"; | ||
value = <8000>; | ||
}; | ||
match@3 { | ||
method = "asoc_generic_hw_params_match_sample_bits"; | ||
values = <32>; | ||
}; | ||
action@0 { | ||
method = "asoc_generic_hw_params_set_fixed_bclk_size"; | ||
value = <80>; | ||
}; | ||
}; | ||
// 2ch, 16bit @ 8/16/32/48/64/96kHz rule | ||
// set bclk_ratio=40 | ||
hw-params-rule@1 { | ||
rule-name = "x8kHz_16BIT_2CH_BCLK40"; | ||
priority = <99>; | ||
match@0 { | ||
method = "asoc_generic_hw_params_match_channels"; | ||
values = <2>; | ||
}; | ||
match@1 { | ||
method = "asoc_generic_hw_params_match_rate_lt"; | ||
value = <192000>; | ||
}; | ||
match@2 { | ||
method = "asoc_generic_hw_params_match_rate_div_by"; | ||
value = <8000>; | ||
}; | ||
match@3 { | ||
method = "asoc_generic_hw_params_match_sample_bits"; | ||
values = <16>; | ||
}; | ||
action@0 { | ||
method = "asoc_generic_hw_params_set_fixed_bclk_size"; | ||
value = <40>; | ||
}; | ||
}; | ||
// default rule | ||
// set blck_ratio=0 (Let cpu driver decide bclk_ratio) | ||
hw-params-rule@2 { | ||
rule-name = "DEFAULT_2CH_BCLK0"; | ||
priority = <0>; | ||
match@0 { | ||
method = "asoc_generic_hw_params_match_noop"; | ||
}; | ||
action@0 { | ||
method = "asoc_generic_hw_params_set_fixed_bclk_size"; | ||
value = <0>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
79 changes: 79 additions & 0 deletions
79
arch/arm/boot/dts/overlays/simple-bclk-int-div-50-100-overlay.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Definitions of bclk_integer_divisor preference for multiples of 8k rates. | ||
// bclk_ratio=50 for S16_LE. bclk_ratio=100 for S24_LE and S32_LE. | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2708"; | ||
|
||
fragment@0 { | ||
target = <&sound>; | ||
__overlay__ { | ||
// 2ch, 32bit @ 8/16/32/48/64/96kHz rule | ||
// set bclk_ratio=100 | ||
hw-params-rule@0 { | ||
rule-name = "x8kHz_32BIT_2CH_BCLK100"; | ||
priority = <99>; | ||
match@0 { | ||
method = "asoc_generic_hw_params_match_channels"; | ||
values = <2>; | ||
}; | ||
match@1 { | ||
method = "asoc_generic_hw_params_match_rate_lt"; | ||
value = <192000>; | ||
}; | ||
match@2 { | ||
method = "asoc_generic_hw_params_match_rate_div_by"; | ||
value = <8000>; | ||
}; | ||
match@3 { | ||
method = "asoc_generic_hw_params_match_sample_bits"; | ||
values = <32>; | ||
}; | ||
action@0 { | ||
method = "asoc_generic_hw_params_set_fixed_bclk_size"; | ||
value = <100>; | ||
}; | ||
}; | ||
// 2ch, 16bit @ 8/16/32/48/64/96kHz rule | ||
// set bclk_ratio=50 | ||
hw-params-rule@1 { | ||
rule-name = "x8kHz_16BIT_2CH_BCLK50"; | ||
priority = <99>; | ||
match@0 { | ||
method = "asoc_generic_hw_params_match_channels"; | ||
values = <2>; | ||
}; | ||
match@1 { | ||
method = "asoc_generic_hw_params_match_rate_lt"; | ||
value = <192000>; | ||
}; | ||
match@2 { | ||
method = "asoc_generic_hw_params_match_rate_div_by"; | ||
value = <8000>; | ||
}; | ||
match@3 { | ||
method = "asoc_generic_hw_params_match_sample_bits"; | ||
values = <16>; | ||
}; | ||
action@0 { | ||
method = "asoc_generic_hw_params_set_fixed_bclk_size"; | ||
value = <50>; | ||
}; | ||
}; | ||
// default rule | ||
// set blck_ratio=0 (Let cpu driver decide bclk_ratio) | ||
hw-params-rule@2 { | ||
rule-name = "DEFAULT_2CH_BCLK0"; | ||
priority = <0>; | ||
match@0 { | ||
method = "asoc_generic_hw_params_match_noop"; | ||
}; | ||
action@0 { | ||
method = "asoc_generic_hw_params_set_fixed_bclk_size"; | ||
value = <0>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |