Skip to content

Commit

Permalink
simple: simple audio overlays for bclk_int_div
Browse files Browse the repository at this point in the history
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
DigitalDreamtime committed Jun 19, 2016
1 parent ef4993f commit 474d804
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo
dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo
dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo
dtbo-$(RPI_DT_OVERLAYS) += sdtweak.dtbo
dtbo-$(RPI_DT_OVERLAYS) += simple-bclk-int-div-40-80.dtbo
dtbo-$(RPI_DT_OVERLAYS) += simple-bclk-int-div-50-100.dtbo
dtbo-$(RPI_DT_OVERLAYS) += simple-es9023-audio.dtbo
dtbo-$(RPI_DT_OVERLAYS) += simple-pcm5102a-audio.dtbo
dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo
Expand Down
18 changes: 18 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,24 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework
debug Enable debug output (default off)


Name: simple-bclk-int-div-40-80
Info: Specify a bclk_integer_divisor preference for multiples of 8k rates
Use bclk_ratio=40 for S16_LE and bclk_ratio=80 for S24_LE and S32_LE
formats when the media sample rate is a multiple of 8000kHz and less
than 192kHz, which allows the use of the OSC with integer divider
rather than PLL with fractional (MASH) divider.
Load: dtoverlay=simple-bclk-int-div-40-80


Name: simple-bclk-int-div-50-100
Info: Specify a bclk_integer_divisor preference for multiples of 8k rates
Use bclk_ratio=50 for S16_LE and bclk_ratio=100 for S24_LE and S32_LE
formats when the media sample rate is a multiple of 8000kHz and less
than 192kHz, which allows the use of the OSC with integer divider
rather than PLL with fractional (MASH) divider.
Load: dtoverlay=simple-bclk-int-div-50-100


Name: simple-es9023-audio
Info: Configures a generic board or HAT using ESS Sabre ES9023 DAC
Load: dtoverlay=simple-es9023-audio,<param>,<param>=<val>
Expand Down
79 changes: 79 additions & 0 deletions arch/arm/boot/dts/overlays/simple-bclk-int-div-40-80-overlay.dts
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 arch/arm/boot/dts/overlays/simple-bclk-int-div-50-100-overlay.dts
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>;
};
};
};
};
};

0 comments on commit 474d804

Please sign in to comment.