18c2ecf20Sopenharmony_ciCS35L33 Speaker Amplifier
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciRequired properties:
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci  - compatible : "cirrus,cs35l33"
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci  - reg : the I2C address of the device for I2C
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci  - VA-supply, VP-supply : power supplies for the device,
108c2ecf20Sopenharmony_ci    as covered in
118c2ecf20Sopenharmony_ci    Documentation/devicetree/bindings/regulator/regulator.txt.
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciOptional properties:
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci  - reset-gpios : gpio used to reset the amplifier
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci -  interrupts : IRQ line info CS35L33.
188c2ecf20Sopenharmony_ci    (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
198c2ecf20Sopenharmony_ci    for further information relating to interrupt properties)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci  - cirrus,boost-ctl : Booster voltage use to supply the amp. If the value is
228c2ecf20Sopenharmony_ci    0, then VBST = VP. If greater than 0, the boost voltage will be 3300mV with
238c2ecf20Sopenharmony_ci    a value of 1 and will increase at a step size of 100mV until a maximum of
248c2ecf20Sopenharmony_ci    8000mV.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci  - cirrus,ramp-rate : On power up, it affects the time from when the power
278c2ecf20Sopenharmony_ci    up sequence begins to the time the audio reaches a full-scale output.
288c2ecf20Sopenharmony_ci    On power down, it affects the time from when the power-down sequence
298c2ecf20Sopenharmony_ci    begins to when the amplifier disables the PWM outputs. If this property
308c2ecf20Sopenharmony_ci    is not set then soft ramping will be disabled and ramp time would be
318c2ecf20Sopenharmony_ci    20ms. If this property is set to 0,1,2,3 then ramp times would be 40ms,
328c2ecf20Sopenharmony_ci    60ms,100ms,175ms respectively for 48KHz sample rate.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci  - cirrus,boost-ipk : The maximum current allowed for the boost converter.
358c2ecf20Sopenharmony_ci    The range starts at 1850000uA and goes to a maximum of 3600000uA
368c2ecf20Sopenharmony_ci    with a step size of 15625uA. The default is 2500000uA.
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci  - cirrus,imon-adc-scale : Configures the scaling of data bits from the IMON
398c2ecf20Sopenharmony_ci    ADC data word. This property can be set as a value of 0 for bits 15 down
408c2ecf20Sopenharmony_ci    to 0, 6 for 21 down to 6, 7, for 22 down to 7, 8 for 23 down to 8.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciOptional H/G Algorithm sub-node:
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciThe cs35l33 node can have a single "cirrus,hg-algo" sub-node that will enable
468c2ecf20Sopenharmony_cithe internal H/G Algorithm.
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci  - cirrus,hg-algo : Sub-node for internal Class H/G algorithm that
498c2ecf20Sopenharmony_ci    controls the amplifier supplies.
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciOptional properties for the "cirrus,hg-algo" sub-node:
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci  - cirrus,mem-depth : Memory depth for the Class H/G algorithm measured in
548c2ecf20Sopenharmony_ci    LRCLK cycles. If this property is set to 0, 1, 2, or 3 then the memory
558c2ecf20Sopenharmony_ci    depths will be 1, 4, 8, 16 LRCLK cycles.  The default is 16 LRCLK cycles.
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci    cirrus,release-rate : The number of consecutive LRCLK periods before
588c2ecf20Sopenharmony_ci    allowing release condition tracking updates. The number of LRCLK periods
598c2ecf20Sopenharmony_ci    start at 3 to a maximum of 255.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci  - cirrus,ldo-thld : Configures the signal threshold at which the PWM output
628c2ecf20Sopenharmony_ci    stage enters LDO operation. Starts as a default value of 50mV for a value
638c2ecf20Sopenharmony_ci    of 1 and increases with a step size of 50mV to a maximum of 750mV (value of
648c2ecf20Sopenharmony_ci    0xF).
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci  - cirrus,ldo-path-disable : This is a boolean property. If present, the H/G
678c2ecf20Sopenharmony_ci    algorithm uses the max detection path.  If not present, the LDO
688c2ecf20Sopenharmony_ci    detection path is used.
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci  - cirrus,ldo-entry-delay : The LDO entry delay in milliseconds before the H/G
718c2ecf20Sopenharmony_ci    algorithm switches to the LDO voltage.  This property can be set to values
728c2ecf20Sopenharmony_ci    from 0 to 7 for delays of 5ms, 10ms, 50ms, 100ms, 200ms, 500ms, 1000ms.
738c2ecf20Sopenharmony_ci    The default is 100ms.
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci  - cirrus,vp-hg-auto : This is a boolean property.  When set, class H/G VPhg
768c2ecf20Sopenharmony_ci    automatic updating is enabled.
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci  - cirrus,vp-hg :  Class H/G algorithm VPhg.  Controls the H/G algorithm's
798c2ecf20Sopenharmony_ci    reference to the VP voltage for when to start generating a boosted VBST.
808c2ecf20Sopenharmony_ci    The reference voltage starts at 3000mV with a value of 0x3 and is increased
818c2ecf20Sopenharmony_ci    by 100mV per step to a maximum of 5500mV.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci  - cirrus,vp-hg-rate : The rate (number of LRCLK periods) at which the VPhg is
848c2ecf20Sopenharmony_ci    allowed to increase to a higher voltage when using VPhg automatic
858c2ecf20Sopenharmony_ci    tracking. This property can be set to values from 0 to 3 with rates of 128
868c2ecf20Sopenharmony_ci    periods, 2048 periods, 32768 periods, and 524288 periods.
878c2ecf20Sopenharmony_ci    The default is 32768 periods.
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci  - cirrus,vp-hg-va : VA calculation reference for automatic VPhg tracking
908c2ecf20Sopenharmony_ci    using VPMON. This property can be set to values from 0 to 6 starting at
918c2ecf20Sopenharmony_ci    1800mV with a step size of 50mV up to a maximum value of 1750mV.
928c2ecf20Sopenharmony_ci    Default is 1800mV.
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ciExample:
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cics35l33: cs35l33@40 {
978c2ecf20Sopenharmony_ci	compatible = "cirrus,cs35l33";
988c2ecf20Sopenharmony_ci	reg = <0x40>;
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci	VA-supply = <&ldo5_reg>;
1018c2ecf20Sopenharmony_ci	VP-supply = <&ldo5_reg>;
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci	interrupt-parent = <&gpio8>;
1048c2ecf20Sopenharmony_ci	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci	reset-gpios = <&cs47l91 34 0>;
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci	cirrus,ramp-rate = <0x0>;
1098c2ecf20Sopenharmony_ci	cirrus,boost-ctl = <0x30>;  /* VBST = 8000mV */
1108c2ecf20Sopenharmony_ci	cirrus,boost-ipk = <0xE0>; /* 3600mA */
1118c2ecf20Sopenharmony_ci	cirrus,imon-adc-scale = <0> /* Bits 15 down to 0 */
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	cirrus,hg-algo {
1148c2ecf20Sopenharmony_ci		cirrus,mem-depth = <0x3>;
1158c2ecf20Sopenharmony_ci		cirrus,release-rate = <0x3>;
1168c2ecf20Sopenharmony_ci		cirrus,ldo-thld = <0x1>;
1178c2ecf20Sopenharmony_ci		cirrus,ldo-path-disable = <0x0>;
1188c2ecf20Sopenharmony_ci		cirrus,ldo-entry-delay=<0x4>;
1198c2ecf20Sopenharmony_ci		cirrus,vp-hg-auto;
1208c2ecf20Sopenharmony_ci		cirrus,vp-hg=<0xF>;
1218c2ecf20Sopenharmony_ci		cirrus,vp-hg-rate=<0x2>;
1228c2ecf20Sopenharmony_ci		cirrus,vp-hg-va=<0x0>;
1238c2ecf20Sopenharmony_ci	};
1248c2ecf20Sopenharmony_ci};
125