|
9 | 9 | #include <dt-bindings/input/input.h>
|
10 | 10 | #include <dt-bindings/interrupt-controller/irq.h>
|
11 | 11 | #include <dt-bindings/leds/common.h>
|
| 12 | +#include <dt-bindings/mfd/arizona.h> |
12 | 13 | #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
|
13 | 14 |
|
14 | 15 | / {
|
|
72 | 73 | };
|
73 | 74 | };
|
74 | 75 |
|
| 76 | +/* regulator-spk { |
| 77 | + compatible = "regulator-fixed"; |
| 78 | + regulator-name = "spk_vreg"; |
| 79 | + startup-delay-us = <0>; |
| 80 | + enable-active-high; |
| 81 | + regulator-boot-on; |
| 82 | + regulator-always-on; |
| 83 | + gpio = <&tlmm 101 GPIO_ACTIVE_HIGH>; |
| 84 | + };*/ |
| 85 | + |
| 86 | + regulator-wm8998-ldo { |
| 87 | + compatible = "regulator-fixed"; |
| 88 | + regulator-name = "wm8998_ldo"; |
| 89 | + |
| 90 | + enable-active-high; |
| 91 | + regulator-boot-on; |
| 92 | + regulator-always-on; |
| 93 | + gpio = <&tlmm 114 GPIO_ACTIVE_HIGH>; |
| 94 | + }; |
| 95 | + |
75 | 96 | reg_ts_vdd: regulator-vdd-ts {
|
76 | 97 | compatible = "regulator-fixed";
|
77 | 98 | regulator-name = "regulator-vdd-ts";
|
|
121 | 142 |
|
122 | 143 | };
|
123 | 144 |
|
| 145 | +&blsp_i2c1 { |
| 146 | + status = "okay"; |
| 147 | + |
| 148 | + speaker_codec: audio-codec@1a { |
| 149 | + compatible = "wlf,wm8998"; |
| 150 | + reg = <0x1a>; |
| 151 | + |
| 152 | + reset-gpios = <&tlmm 120 GPIO_ACTIVE_HIGH>; |
| 153 | + wlf,ldoena-gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; |
| 154 | + |
| 155 | + pinctrl-names = "default", "sleep"; |
| 156 | + pinctrl-0 = <&wlf_int_active &speaker_codec_default &speaker_codec_reset_default>; |
| 157 | + pinctrl-1 = <&wlf_int_suspend &speaker_codec_sleep &speaker_codec_reset_sleep>; |
| 158 | + |
| 159 | + // TODO add pinctl for 114? |
| 160 | + // TODO add pinctl for 101? |
| 161 | + |
| 162 | + gpio-controller; |
| 163 | + #gpio-cells = <2>; |
| 164 | + |
| 165 | + sound-name-prefix = "Speaker"; |
| 166 | + #sound-dai-cells = <1>; |
| 167 | + |
| 168 | + AVDD-supply = <&pm8916_l6>; |
| 169 | + DBVDD1-supply = <&pm8916_l6>; |
| 170 | + DBVDD2-supply = <&pm8916_l6>; |
| 171 | + DBVDD3-supply = <&pm8916_l6>; |
| 172 | + CPVDD-supply = <&pm8916_l6>; |
| 173 | + SPKVDDL-supply = <&pm8916_l6>; |
| 174 | + SPKVDDR-supply = <&pm8916_l6>; |
| 175 | + |
| 176 | + interrupt-controller; |
| 177 | + #interrupt-cells = <2>; |
| 178 | + interrupt-parent = <&tlmm>; |
| 179 | + interrupts = <69 IRQ_TYPE_LEVEL_LOW>; |
| 180 | + |
| 181 | + clocks = <&rpmcc RPM_SMD_BB_CLK2>; |
| 182 | + clock-names = "mclk2"; |
| 183 | + |
| 184 | + wlf,gpio-defaults = < |
| 185 | + ARIZONA_GP_DEFAULT |
| 186 | + ARIZONA_GP_DEFAULT |
| 187 | + ARIZONA_GP_DEFAULT |
| 188 | + ARIZONA_GP_DEFAULT |
| 189 | + ARIZONA_GP_DEFAULT |
| 190 | + >; |
| 191 | + |
| 192 | + wlf,inmode = <0 0 0>; |
| 193 | + wlf,micd-detect-debounce = <500>; |
| 194 | + wlf,micd-rate = <ARIZONA_MICD_TIME_8MS>; |
| 195 | + wlf,micd-configs = <0 ARIZONA_DMIC_MICBIAS2 1>; |
| 196 | + wlf,micd-bias-start-time = <ARIZONA_MICD_TIME_16MS>; |
| 197 | + |
| 198 | + // TODO: |
| 199 | +// wlf,infinite_micd = <0x01>; |
| 200 | +// wlf,micbias1 = <0xaf0 0x01 0x00 0x01 0x00>; |
| 201 | +// wlf,micbias2 = <0xaf0 0x01 0x00 0x01 0x00>; |
| 202 | +// wlf,micbias3 = <0xaf0 0x01 0x00 0x01 0x00>; |
| 203 | +// wlf,ldo-enable = <0x77 28 0x00>; |
| 204 | +// wlf,ena-ldo = <0x77 114 0x00>; |
| 205 | +// wlf,clk-gpio = <0x77 116 0x00>; |
| 206 | +// wlf,ldospk = <0x77 0x00 0x00>; // gpio101? downstream spk_vreg |
| 207 | +// wlf,init-mic-delay = <0x1f4>; |
| 208 | + |
| 209 | + micvdd { |
| 210 | + regulator-min-microvolt = <3000000>; |
| 211 | + regulator-max-microvolt = <3000000>; |
| 212 | + }; |
| 213 | + }; |
| 214 | +}; |
| 215 | + |
124 | 216 | &blsp_i2c3 {
|
125 | 217 | status = "okay";
|
126 | 218 |
|
|
328 | 420 | };
|
329 | 421 |
|
330 | 422 | &sound {
|
331 |
| - status = "disabled"; /* TODO */ |
| 423 | + pinctrl-names = "default", "sleep"; |
| 424 | +/* pinctrl-0 = <&ext_mclk_tlmm_lines_act &ext_sec_tlmm_lines_act>;*/ |
| 425 | +/* pinctrl-1 = <&ext_mclk_tlmm_lines_sus &ext_sec_tlmm_lines_sus>;*/ |
| 426 | + pinctrl-0 = <&pri_mi2s_mclk_default &sec_mi2s_default>; |
| 427 | + pinctrl-1 = <&pri_mi2s_mclk_sleep &sec_mi2s_sleep>; |
| 428 | + |
| 429 | + model = "bq-piccolo"; |
| 430 | + widgets = |
| 431 | + "Speaker", "Speaker", |
| 432 | + "Headphone", "Headphones"; |
| 433 | + pin-switches = "Speaker"; |
| 434 | + /*audio-routing = |
| 435 | + "IN1AL", "MICBIAS1", |
| 436 | + "IN1AR", "MICBIAS1", |
| 437 | + "IN2A", "MICBIAS2";*/ |
| 438 | + |
| 439 | + status = "okay"; |
| 440 | + |
| 441 | + /delete-node/ backend1-dai-link; |
| 442 | +}; |
| 443 | + |
| 444 | +&sound_link_backend0 { |
| 445 | + /* Primary MI2S is not used, replace with Quaternary MI2S */ |
| 446 | + link-name = "Quaternary MI2S"; |
| 447 | + |
| 448 | + cpu { |
| 449 | + sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; |
| 450 | + }; |
| 451 | + platform { |
| 452 | + sound-dai = <&q6routing>; |
| 453 | + }; |
| 454 | + codec { |
| 455 | + sound-dai = <&speaker_codec 0>; |
| 456 | + }; |
332 | 457 | };
|
333 | 458 |
|
334 | 459 | &usb {
|
|
353 | 478 | status = "okay";
|
354 | 479 | };
|
355 | 480 |
|
| 481 | +&lpass_codec { |
| 482 | + status = "disabled"; |
| 483 | +}; |
| 484 | + |
| 485 | +&pm8916_codec { |
| 486 | + qcom,micbias-lvl = <2800>; |
| 487 | + qcom,mbhc-vthreshold-low = <25 50 75 112 137>; |
| 488 | + qcom,mbhc-vthreshold-high = <25 50 75 112 137>; |
| 489 | + //qcom,hphl-jack-type-normally-open; |
| 490 | +}; |
| 491 | + |
356 | 492 | &tlmm {
|
357 | 493 | button_backlight_default: button-backlight-default-state {
|
358 | 494 | pins = "gpio17";
|
|
458 | 594 | drive-strength = <2>;
|
459 | 595 | output-high;
|
460 | 596 | };
|
| 597 | + |
| 598 | + speaker_codec_reset_default: speaker-codec-reset-default-state { |
| 599 | + pins = "gpio120"; |
| 600 | + function = "ldo_update"; |
| 601 | + |
| 602 | + drive-strength = <6>; |
| 603 | + bias-pull-up; |
| 604 | + }; |
| 605 | + |
| 606 | + speaker_codec_reset_sleep: speaker-codec-reset-sleep-state { |
| 607 | + pins = "gpio120"; |
| 608 | + function = "ldo_update"; |
| 609 | + |
| 610 | + drive-strength = <2>; |
| 611 | + bias-pull-down; |
| 612 | + }; |
| 613 | + |
| 614 | + speaker_codec_default: speaker-codec-default-state { // ldo_enable |
| 615 | + pins = "gpio28"; |
| 616 | + function = "gpio"; |
| 617 | + drive-strength = <6>; |
| 618 | + bias-pull-up; |
| 619 | + }; |
| 620 | + |
| 621 | + speaker_codec_sleep: speaker-codec-sleep-state { // ldo_enable |
| 622 | + pins = "gpio28"; |
| 623 | + function = "gpio"; |
| 624 | + drive-strength = <2>; |
| 625 | + bias-pull-down; |
| 626 | + }; |
| 627 | +/* |
| 628 | + speaker_enaldo_default: speaker-ena-ldo-default-state { // ena_ldo |
| 629 | + pins = "gpio114"; |
| 630 | + function = "gpio"; |
| 631 | + drive-strength = <6>; |
| 632 | + bias-pull-up; |
| 633 | + }; |
| 634 | + |
| 635 | + speaker_enaldo_sleep: speaker-ena-ldo-sleep-state { // ena_ldo |
| 636 | + pins = "gpio114"; |
| 637 | + function = "gpio"; |
| 638 | + drive-strength = <2>; |
| 639 | + bias-pull-down; |
| 640 | + };*/ |
| 641 | + |
| 642 | +/* wlf_ldospk_pin { |
| 643 | + pins = "gpio101"; |
| 644 | + label = "wlf_speaker_ldo"; |
| 645 | + |
| 646 | + wlf_ldospk_active { |
| 647 | + drive-strength = <6>; |
| 648 | + bias-pull-up; |
| 649 | + }; |
| 650 | + |
| 651 | + wlf_ldospk_suspend { |
| 652 | + drive-strength = <2>; |
| 653 | + bias-pull-down; |
| 654 | + }; |
| 655 | + };*/ |
| 656 | + |
| 657 | + wlf_int_pin { |
| 658 | + /* wolfson codec */ |
| 659 | + wlf_int_active: wlf-int-active { |
| 660 | + pins = "gpio69"; |
| 661 | + drive-strength = <6>; |
| 662 | + bias-pull-up; |
| 663 | + }; |
| 664 | + wlf_int_suspend: wlf-int-suspend { |
| 665 | + pins = "gpio69"; |
| 666 | + drive-strength = <2>; |
| 667 | + bias-pull-down; |
| 668 | + }; |
| 669 | + }; |
461 | 670 | };
|
0 commit comments