|  | 
| 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-gpio.h> | 
| 13 | 14 | #include <dt-bindings/pinctrl/qcom,pmic-mpp.h> | 
| 14 | 15 | 
 | 
|  | 
| 73 | 74 | 		}; | 
| 74 | 75 | 	}; | 
| 75 | 76 | 
 | 
|  | 77 | +/*	regulator-spk { | 
|  | 78 | +		compatible = "regulator-fixed"; | 
|  | 79 | +		regulator-name = "spk_vreg"; | 
|  | 80 | +		startup-delay-us = <0>; | 
|  | 81 | +		enable-active-high; | 
|  | 82 | +		regulator-boot-on; | 
|  | 83 | +		regulator-always-on; | 
|  | 84 | +		gpio = <&tlmm 101 GPIO_ACTIVE_HIGH>; | 
|  | 85 | +	};*/ | 
|  | 86 | + | 
|  | 87 | +	regulator-wm8998-ldo { | 
|  | 88 | +		compatible = "regulator-fixed"; | 
|  | 89 | +		regulator-name = "wm8998_ldo"; | 
|  | 90 | + | 
|  | 91 | +		enable-active-high; | 
|  | 92 | +		regulator-boot-on; | 
|  | 93 | +		regulator-always-on; | 
|  | 94 | +		gpio = <&tlmm 114 GPIO_ACTIVE_HIGH>; | 
|  | 95 | +	}; | 
|  | 96 | + | 
| 76 | 97 | 	reg_ts_vdd: regulator-vdd-ts { | 
| 77 | 98 | 		compatible = "regulator-fixed"; | 
| 78 | 99 | 		regulator-name = "regulator-vdd-ts"; | 
|  | 
| 122 | 143 | 
 | 
| 123 | 144 | }; | 
| 124 | 145 | 
 | 
|  | 146 | +&blsp_i2c1 { | 
|  | 147 | +	status = "okay"; | 
|  | 148 | + | 
|  | 149 | +	speaker_codec: audio-codec@1a { | 
|  | 150 | +		compatible = "wlf,wm8998"; | 
|  | 151 | +		reg = <0x1a>; | 
|  | 152 | + | 
|  | 153 | +		reset-gpios = <&tlmm 120 GPIO_ACTIVE_HIGH>; | 
|  | 154 | +		wlf,ldoena-gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; | 
|  | 155 | + | 
|  | 156 | +		pinctrl-names = "default", "sleep"; | 
|  | 157 | +		pinctrl-0 = <&wlf_int_active &speaker_codec_default &speaker_codec_reset_default>; | 
|  | 158 | +		pinctrl-1 = <&wlf_int_suspend &speaker_codec_sleep &speaker_codec_reset_sleep>; | 
|  | 159 | + | 
|  | 160 | +        // TODO add pinctl for 114? | 
|  | 161 | +        // TODO add pinctl for 101? | 
|  | 162 | + | 
|  | 163 | +		gpio-controller; | 
|  | 164 | +		#gpio-cells = <2>; | 
|  | 165 | + | 
|  | 166 | +		sound-name-prefix = "Speaker"; | 
|  | 167 | +		#sound-dai-cells = <1>; | 
|  | 168 | + | 
|  | 169 | +		AVDD-supply = <&pm8916_l6>; | 
|  | 170 | +		DBVDD1-supply = <&pm8916_l6>; | 
|  | 171 | +		DBVDD2-supply = <&pm8916_l6>; | 
|  | 172 | +		DBVDD3-supply = <&pm8916_l6>; | 
|  | 173 | +		CPVDD-supply = <&pm8916_l6>; | 
|  | 174 | +		SPKVDDL-supply = <&pm8916_l6>; | 
|  | 175 | +		SPKVDDR-supply = <&pm8916_l6>; | 
|  | 176 | + | 
|  | 177 | +		interrupt-controller; | 
|  | 178 | +		#interrupt-cells = <2>; | 
|  | 179 | +		interrupt-parent = <&tlmm>; | 
|  | 180 | +		interrupts = <69 IRQ_TYPE_LEVEL_LOW>; | 
|  | 181 | + | 
|  | 182 | +		clocks = <&rpmcc RPM_SMD_BB_CLK2>; | 
|  | 183 | +		clock-names = "mclk2"; | 
|  | 184 | + | 
|  | 185 | +		wlf,gpio-defaults = < | 
|  | 186 | +			ARIZONA_GP_DEFAULT | 
|  | 187 | +			ARIZONA_GP_DEFAULT | 
|  | 188 | +			ARIZONA_GP_DEFAULT | 
|  | 189 | +			ARIZONA_GP_DEFAULT | 
|  | 190 | +			ARIZONA_GP_DEFAULT | 
|  | 191 | +		>; | 
|  | 192 | + | 
|  | 193 | +		wlf,inmode = <0 0 0>; | 
|  | 194 | +		wlf,micd-detect-debounce = <500>; | 
|  | 195 | +		wlf,micd-rate = <ARIZONA_MICD_TIME_8MS>; | 
|  | 196 | +		wlf,micd-configs = <0 ARIZONA_DMIC_MICBIAS2 1>; | 
|  | 197 | +		wlf,micd-bias-start-time = <ARIZONA_MICD_TIME_16MS>; | 
|  | 198 | + | 
|  | 199 | +		// TODO: | 
|  | 200 | +//		wlf,infinite_micd = <0x01>; | 
|  | 201 | +//		wlf,micbias1 = <0xaf0 0x01 0x00 0x01 0x00>; | 
|  | 202 | +//		wlf,micbias2 = <0xaf0 0x01 0x00 0x01 0x00>; | 
|  | 203 | +//		wlf,micbias3 = <0xaf0 0x01 0x00 0x01 0x00>; | 
|  | 204 | +//		wlf,ldo-enable = <0x77 28 0x00>; | 
|  | 205 | +//		wlf,ena-ldo = <0x77 114 0x00>; | 
|  | 206 | +//		wlf,clk-gpio = <0x77 116 0x00>; | 
|  | 207 | +//		wlf,ldospk = <0x77 0x00 0x00>;	// gpio101? downstream spk_vreg | 
|  | 208 | +//		wlf,init-mic-delay = <0x1f4>; | 
|  | 209 | + | 
|  | 210 | +		micvdd { | 
|  | 211 | +			regulator-min-microvolt = <3000000>; | 
|  | 212 | +			regulator-max-microvolt = <3000000>; | 
|  | 213 | +		}; | 
|  | 214 | +	}; | 
|  | 215 | +}; | 
|  | 216 | + | 
| 125 | 217 | &blsp_i2c2 { | 
| 126 | 218 | 	status = "okay"; | 
| 127 | 219 | 
 | 
|  | 
| 400 | 492 | }; | 
| 401 | 493 | 
 | 
| 402 | 494 | &sound { | 
| 403 |  | -	status = "disabled"; /* TODO */ | 
|  | 495 | +	pinctrl-names = "default", "sleep"; | 
|  | 496 | +/*	pinctrl-0 = <&ext_mclk_tlmm_lines_act &ext_sec_tlmm_lines_act>;*/ | 
|  | 497 | +/*	pinctrl-1 = <&ext_mclk_tlmm_lines_sus &ext_sec_tlmm_lines_sus>;*/ | 
|  | 498 | +	pinctrl-0 = <&pri_mi2s_mclk_default &sec_mi2s_default>; | 
|  | 499 | +	pinctrl-1 = <&pri_mi2s_mclk_sleep &sec_mi2s_sleep>; | 
|  | 500 | + | 
|  | 501 | +	model = "bq-piccolo"; | 
|  | 502 | +	widgets = | 
|  | 503 | +		"Speaker", "Speaker", | 
|  | 504 | +		"Headphone", "Headphones"; | 
|  | 505 | +	pin-switches = "Speaker"; | 
|  | 506 | +	audio-routing = | 
|  | 507 | +		"Speaker IN1AL", "Speaker MICBIAS1", | 
|  | 508 | +		"Speaker IN1AR", "Speaker MICBIAS1", | 
|  | 509 | +		"Speaker IN2A", "Speaker MICBIAS2"; | 
|  | 510 | + | 
|  | 511 | +	status = "okay"; | 
|  | 512 | + | 
|  | 513 | +	/delete-node/ backend1-dai-link; | 
|  | 514 | +}; | 
|  | 515 | + | 
|  | 516 | +&sound_link_backend0 { | 
|  | 517 | +	/* Primary MI2S is not used, replace with Quaternary MI2S */ | 
|  | 518 | +	link-name = "Quaternary MI2S"; | 
|  | 519 | + | 
|  | 520 | +	cpu { | 
|  | 521 | +		sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; | 
|  | 522 | +	}; | 
|  | 523 | +	platform { | 
|  | 524 | +		sound-dai = <&q6routing>; | 
|  | 525 | +	}; | 
|  | 526 | +	codec { | 
|  | 527 | +		sound-dai = <&speaker_codec 0>; | 
|  | 528 | +	}; | 
| 404 | 529 | }; | 
| 405 | 530 | 
 | 
| 406 | 531 | &usb { | 
|  | 
| 425 | 550 | 	status = "okay"; | 
| 426 | 551 | }; | 
| 427 | 552 | 
 | 
|  | 553 | +&lpass { | 
|  | 554 | +	status = "okay"; | 
|  | 555 | +}; | 
|  | 556 | + | 
|  | 557 | +&pm8916_codec { | 
|  | 558 | +	qcom,micbias-lvl = <2800>; | 
|  | 559 | +	qcom,mbhc-vthreshold-low = <25 50 75 112 137>; | 
|  | 560 | +	qcom,mbhc-vthreshold-high = <25 50 75 112 137>; | 
|  | 561 | +	//qcom,hphl-jack-type-normally-open; | 
|  | 562 | +}; | 
|  | 563 | + | 
| 428 | 564 | &tlmm { | 
| 429 | 565 | 	button_backlight_default: button-backlight-default-state { | 
| 430 | 566 | 		pins = "gpio17"; | 
|  | 
| 537 | 673 | 		drive-strength = <2>; | 
| 538 | 674 | 		output-high; | 
| 539 | 675 | 	}; | 
|  | 676 | + | 
|  | 677 | +	speaker_codec_reset_default: speaker-codec-reset-default-state { | 
|  | 678 | +		pins = "gpio120"; | 
|  | 679 | +		function = "ldo_update"; | 
|  | 680 | + | 
|  | 681 | +		drive-strength = <6>; | 
|  | 682 | +		bias-pull-up; | 
|  | 683 | +	}; | 
|  | 684 | + | 
|  | 685 | +	speaker_codec_reset_sleep: speaker-codec-reset-sleep-state { | 
|  | 686 | +		pins = "gpio120"; | 
|  | 687 | +		function = "ldo_update"; | 
|  | 688 | + | 
|  | 689 | +		drive-strength = <2>; | 
|  | 690 | +		bias-pull-down; | 
|  | 691 | +	}; | 
|  | 692 | + | 
|  | 693 | +	speaker_codec_default: speaker-codec-default-state {    // ldo_enable | 
|  | 694 | +		pins = "gpio28"; | 
|  | 695 | +		function = "gpio"; | 
|  | 696 | +		drive-strength = <6>; | 
|  | 697 | +		bias-pull-up; | 
|  | 698 | +	}; | 
|  | 699 | + | 
|  | 700 | +	speaker_codec_sleep: speaker-codec-sleep-state {    // ldo_enable | 
|  | 701 | +		pins = "gpio28"; | 
|  | 702 | +		function = "gpio"; | 
|  | 703 | +		drive-strength = <2>; | 
|  | 704 | +		bias-pull-down; | 
|  | 705 | +	}; | 
|  | 706 | +/* | 
|  | 707 | +	speaker_enaldo_default: speaker-ena-ldo-default-state {    // ena_ldo | 
|  | 708 | +		pins = "gpio114"; | 
|  | 709 | +		function = "gpio"; | 
|  | 710 | +		drive-strength = <6>; | 
|  | 711 | +		bias-pull-up; | 
|  | 712 | +	}; | 
|  | 713 | + | 
|  | 714 | +	speaker_enaldo_sleep: speaker-ena-ldo-sleep-state {    // ena_ldo | 
|  | 715 | +		pins = "gpio114"; | 
|  | 716 | +		function = "gpio"; | 
|  | 717 | +		drive-strength = <2>; | 
|  | 718 | +		bias-pull-down; | 
|  | 719 | +	};*/ | 
|  | 720 | + | 
|  | 721 | +/*	wlf_ldospk_pin { | 
|  | 722 | +		pins = "gpio101"; | 
|  | 723 | +		label = "wlf_speaker_ldo"; | 
|  | 724 | + | 
|  | 725 | +		wlf_ldospk_active { | 
|  | 726 | +			drive-strength = <6>; | 
|  | 727 | +			bias-pull-up; | 
|  | 728 | +		}; | 
|  | 729 | + | 
|  | 730 | +		wlf_ldospk_suspend { | 
|  | 731 | +			drive-strength = <2>; | 
|  | 732 | +			bias-pull-down; | 
|  | 733 | +		}; | 
|  | 734 | +	};*/ | 
|  | 735 | + | 
|  | 736 | +	wlf_int_pin { | 
|  | 737 | +		/* wolfson codec */ | 
|  | 738 | +		wlf_int_active: wlf-int-active { | 
|  | 739 | +			pins = "gpio69"; | 
|  | 740 | +			drive-strength = <6>; | 
|  | 741 | +			bias-pull-up; | 
|  | 742 | +		}; | 
|  | 743 | +		wlf_int_suspend: wlf-int-suspend { | 
|  | 744 | +			pins = "gpio69"; | 
|  | 745 | +			drive-strength = <2>; | 
|  | 746 | +			bias-pull-down; | 
|  | 747 | +		}; | 
|  | 748 | +	}; | 
| 540 | 749 | }; | 
0 commit comments