Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77dd3559 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Rohit Vaswani
Browse files

qpnp: Add snapshot of some qpnp, regulator and charger drivers



This snapshot is taken as of msm-3.18 commit
9da4ddc (Merge "clk: msm: clock-gcc: Associate gfx rail
voting with gfx3d branch")

Change-Id: Idd2f467f1f1863a156d1757589dfe78158f0e43f
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 6aa370ab
Loading
Loading
Loading
Loading
+224 −0
Original line number Diff line number Diff line
* msm-qpnp-pin

msm-qpnp-pin is a GPIO chip driver for the MSM SPMI implementation.
It creates a spmi_device for every spmi-dev-container block of device_nodes.
These device_nodes contained within specify the PMIC pin number associated
with each gpio chip. The driver will map these to Linux GPIO numbers.

[PMIC GPIO Device Declarations]

-Root Node-

Required properties :
 - spmi-dev-container : Used to specify the following child nodes as part of the
   same SPMI device.
 - gpio-controller : Specify as gpio-contoller. All child nodes will belong to
   this gpio_chip.
 - #gpio-cells: We encode a PMIC pin number and a 32-bit flag field to
   specify the gpio configuration. This must be set to '2'.
 - #address-cells: Specify one address field. This must be set to '1'.
 - #size-cells: Specify one size-cell. This must be set to '1'.
 - compatible = "qcom,qpnp-pin" : Specify driver matching for this driver.
 - label: String giving the name for the gpio_chip device. This name
   should be unique on the system and portray the specifics of the device.

-Child Nodes-

Required properties :
 - reg : Specify the spmi offset and size for this pin device.
 - qcom,pin-num : Specify the PMIC pin number for this device.

Optional configuration properties :
 -  qcom,mode:		indicates whether the pin should be input, output, or
			both for gpios. mpp pins also support bidirectional,
			analog in, analog out and current sink.
			QPNP_PIN_MODE_DIG_IN	 = 0, (GPIO/MPP)
			QPNP_PIN_MODE_DIG_OUT	 = 1, (GPIO/MPP)
			QPNP_PIN_MODE_DIG_IN_OUT = 2, (GPIO/MPP)
			QPNP_PIN_MODE_ANA_PASS_THRU = 3, (GPIO_LV/GPIO_MV)
			QPNP_PIN_MODE_BIDIR	 = 3, (MPP)
			QPNP_PIN_MODE_AIN	 = 4, (MPP)
			QPNP_PIN_MODE_AOUT	 = 5, (MPP)
			QPNP_PIN_MODE_SINK	 = 6  (MPP)

 - qcom,output-type:	indicates gpio should be configured as CMOS or open
			drain.
			QPNP_PIN_OUT_BUF_CMOS		 = 0, (GPIO)
			QPNP_PIN_OUT_BUF_OPEN_DRAIN_NMOS = 1, (GPIO)
			QPNP_PIN_OUT_BUF_OPEN_DRAIN_PMOS = 2  (GPIO)
			QPNP_PIN_OUT_BUF_NO_DRIVE	 = 3, (GPIO_LV/GPIO_MV)

 - qcom,invert:		Invert the signal of the gpio line -
			QPNP_PIN_INVERT_DISABLE = 0 (GPIO/MPP)
			QPNP_PIN_INVERT_ENABLE	= 1 (GPIO/MPP)

 - qcom,pull:		This parameter should be programmed to different values
			depending on whether it's GPIO or MPP.
			For GPIO, it indicates whether a pull up or pull down
			should be applied. If a pullup is required the
			current strength needs to be specified.
			Current values of 30uA, 1.5uA, 31.5uA, 1.5uA with 30uA
			boost are supported. This value should be one of
			the QPNP_PIN_GPIO_PULL_*. Note that the hardware ignores
			this configuration if the GPIO is not set to input or
			output open-drain mode.
			QPNP_PIN_PULL_UP_30	 = 0, (GPIO)
			QPNP_PIN_PULL_UP_1P5	 = 1, (GPIO)
			QPNP_PIN_PULL_UP_31P5	 = 2, (GPIO)
			QPNP_PIN_PULL_UP_1P5_30  = 3, (GPIO)
			QPNP_PIN_PULL_DN	 = 4, (GPIO)
			QPNP_PIN_PULL_NO	 = 5  (GPIO)

			For MPP, it indicates whether a pullup should be
			applied for bidirectitional mode only. The hardware
			ignores the configuration when operating in other modes.
			This value should be one of the QPNP_PIN_MPP_PULL_*.

			QPNP_PIN_MPP_PULL_UP_0P6KOHM = 0, (MPP)
			QPNP_PIN_MPP_PULL_UP_OPEN    = 1  (MPP)
			QPNP_PIN_MPP_PULL_UP_10KOHM  = 2, (MPP)
			QPNP_PIN_MPP_PULL_UP_30KOHM  = 3, (MPP)

  - qcom,vin-sel:	specifies the voltage level when the output is set to 1.
			For an input gpio specifies the voltage level at which
			the input is interpreted as a logical 1.
			QPNP_PIN_VIN0 = 0, (GPIO/MPP/GPIO_LV/GPIO_MV)
			QPNP_PIN_VIN1 = 1, (GPIO/MPP/GPIO_MV)
			QPNP_PIN_VIN2 = 2, (GPIO/MPP)
			QPNP_PIN_VIN3 = 3, (GPIO/MPP)
			QPNP_PIN_VIN4 = 4, (GPIO/MPP)
			QPNP_PIN_VIN5 = 5, (GPIO/MPP)
			QPNP_PIN_VIN6 = 6, (GPIO/MPP)
			QPNP_PIN_VIN7 = 7  (GPIO/MPP)

  - qcom,out-strength:	the amount of current supplied for an output gpio.
			QPNP_PIN_OUT_STRENGTH_LOW  = 1  (GPIO)
			QPNP_PIN_OUT_STRENGTH_MED  = 2, (GPIO)
			QPNP_PIN_OUT_STRENGTH_HIGH = 3, (GPIO)

  - qcom,dtest-sel	Route the pin internally to a DTEST line.
			QPNP_PIN_DIG_IN_CTL_DTEST1 = 1	(GPIO/MPP)
			QPNP_PIN_DIG_IN_CTL_DTEST2 = 2,	(GPIO/MPP)
			QPNP_PIN_DIG_IN_CTL_DTEST3 = 3,	(GPIO/MPP)
			QPNP_PIN_DIG_IN_CTL_DTEST4 = 4,	(GPIO/MPP)

  - qcom,src-sel:	select a function for the pin. Certain pins
			can be paired (shorted) with each other. Some gpio pins
			can act as alternate functions.
			In the context of gpio, this acts as a source select.
			For mpps, this is an enable select.
			QPNP_PIN_SEL_FUNC_CONSTANT = 0, (GPIO/MPP)
			QPNP_PIN_SEL_FUNC_PAIRED   = 1, (GPIO/MPP)
			QPNP_PIN_SEL_FUNC_1	   = 2, (GPIO/MPP)
			QPNP_PIN_SEL_FUNC_2	   = 3, (GPIO/MPP)
			QPNP_PIN_SEL_DTEST1	   = 4, (GPIO/MPP)
			QPNP_PIN_SEL_DTEST2	   = 5, (GPIO/MPP)
			QPNP_PIN_SEL_DTEST3	   = 6, (GPIO/MPP)
			QPNP_PIN_SEL_DTEST4	   = 7  (GPIO/MPP)

			Below are the source-select values for GPIO_LV/MV.
			QPNP_PIN_LV_MV_SEL_FUNC_CONSTANT   = 0, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_FUNC_PAIRED	   = 1, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_FUNC_1	   = 2, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_FUNC_2	   = 3, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_FUNC_3	   = 4, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_FUNC_4	   = 5, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_DTEST1	   = 6  (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_DTEST2	   = 7, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_DTEST3	   = 8, (GPIO_LV/GPIO_MV)
			QPNP_PIN_LV_MV_SEL_DTEST4	   = 9, (GPIO_LV/GPIO_MV)

 - qcom,master-en:	1 = Enable features within the
			pin block based on configurations. (GPIO/MPP)
			0 = Completely disable the block and
			let the pin float with high impedance
			regardless of other settings. (GPIO/MPP)
 - qcom,aout-ref:	set the analog output reference.

			QPNP_PIN_AOUT_1V25    = 0, (MPP)
			QPNP_PIN_AOUT_0V625   = 1, (MPP)
			QPNP_PIN_AOUT_0V3125  = 2, (MPP)
			QPNP_PIN_AOUT_MPP     = 3, (MPP)
			QPNP_PIN_AOUT_ABUS1   = 4, (MPP)
			QPNP_PIN_AOUT_ABUS2   = 5, (MPP)
			QPNP_PIN_AOUT_ABUS3   = 6, (MPP)
			QPNP_PIN_AOUT_ABUS4   = 7  (MPP)

 - qcom,ain-route:	Set the destination for analog input.
			QPNP_PIN_AIN_AMUX_CH5   = 0, (MPP)
			QPNP_PIN_AIN_AMUX_CH6   = 1, (MPP)
			QPNP_PIN_AIN_AMUX_CH7   = 2, (MPP)
			QPNP_PIN_AIN_AMUX_CH8   = 3, (MPP)
			QPNP_PIN_AIN_AMUX_ABUS1 = 4, (MPP)
			QPNP_PIN_AIN_AMUX_ABUS2 = 5, (MPP)
			QPNP_PIN_AIN_AMUX_ABUS3 = 6, (MPP)
			QPNP_PIN_AIN_AMUX_ABUS4 = 7  (MPP)

 - qcom,cs-out:		Set the the amount of output to sync in mA.
			QPNP_PIN_CS_OUT_5MA  = 0, (MPP)
			QPNP_PIN_CS_OUT_10MA = 1, (MPP)
			QPNP_PIN_CS_OUT_15MA = 2, (MPP)
			QPNP_PIN_CS_OUT_20MA = 3, (MPP)
			QPNP_PIN_CS_OUT_25MA = 4, (MPP)
			QPNP_PIN_CS_OUT_30MA = 5, (MPP)
			QPNP_PIN_CS_OUT_35MA = 6, (MPP)
			QPNP_PIN_CS_OUT_40MA = 7  (MPP)

 - qcom,apass-sel:	Set the ATEST channel to route the signal
			QPNP_PIN_APASS_SEL_ATEST1 = 0, (GPIO_LV/GPIO_MV)
			QPNP_PIN_APASS_SEL_ATEST2 = 1, (GPIO_LV/GPIO_MV)
			QPNP_PIN_APASS_SEL_ATEST3 = 2, (GPIO_LV/GPIO_MV)
			QPNP_PIN_APASS_SEL_ATEST4 = 3, (GPIO_LV/GPIO_MV)

*Note: If any of the configuration properties are not specified, then the
       qpnp-pin driver will not modify that respective configuration in
       hardware.

[PMIC GPIO clients]

Required properties :
 - gpios : Contains 3 fields of the form <&gpio_controller pmic_pin_num flags>

[Example]

qpnp: qcom,spmi@fc4c0000 {
		#address-cells = <1>;
		#size-cells = <0>;
		interrupt-controller;
		#interrupt-cells = <3>;

		qcom,pm8941@0 {
			spmi-slave-container;
			reg = <0x0>;
			#address-cells = <1>;
			#size-cells = <1>;

			pm8941_gpios: gpios {
				spmi-dev-container;
				compatible = "qcom,qpnp-pin";
				gpio-controller;
				#gpio-cells = <2>;
				#address-cells = <1>;
				#size-cells = <1>;

				gpio@c000 {
					reg = <0xc000 0x100>;
					qcom,pin-num = <62>;
				};

				gpio@c100 {
					reg = <0xc100 0x100>;
					qcom,pin-num = <20>;
					qcom,source_sel = <2>;
					qcom,pull = <5>;
				};
			};

			qcom,testgpio@1000 {
				compatible = "qcom,qpnp-testgpio";
				reg = <0x1000 0x1000>;
				gpios = <&pm8941_gpios 62 0x0 &pm8941_gpios 20 0x1>;
			};
		};
	};
};
+104 −0
Original line number Diff line number Diff line
Qualcomm's QPNP PMIC current ADC driver

QPNP PMIC current ADC (IADC) provides interface to clients to read
current. A 16 bit ADC is used for current measurements. There are multiple
peripherals to the IADC and the scope of the driver is to provide interface
for the USR peripheral of the IADC.

IADC node

Required properties:
- compatible : should be "qcom,qpnp-iadc" for Current ADC driver.
- reg : offset and length of the PMIC Arbiter register map.
- reg-names : resource names used for the physical base address of the PMIC IADC
	      peripheral, the SMBB_BAT_IF_TRIM_CNST_RDS register.
	      Should be "iadc-base" for the PMIC IADC peripheral base register.
	      Should be "batt-id-trim-cnst-rds" for reading the
	      SMBB_BAT_IF_TRIM_CNST_RDS register.
- address-cells : Must be one.
- size-cells : Must be zero.
- interrupts : The USR bank peripheral IADC interrupt.
- interrupt-names : Should contain "eoc-int-en-set".
- qcom,adc-bit-resolution : Bit resolution of the ADC.
- qcom,adc-vdd-reference : Voltage reference used by the ADC.

Optional properties:
- qcom,rsense : Use this property when external rsense should be used
		for current calculation and specify the units in nano-ohms.
- qcom,iadc-poll-eoc: Use polling instead of interrupts for End of Conversion completion.
- qcom,pmic-revid : Phandle pointing to the revision peripheral node. Use it to query the
		    PMIC type and revision for applying the appropriate temperature
		    compensation parameters.
- qcom,use-default-rds-trim : Add this property to check if certain conditions are to be checked
			      reading the SMBB_BAT_IF_CNST_RDS, IADC_RDS trim register and
			      manufacturer type. Check the driver for conditions that each of the type.
			      0 : Select the TypeA to read the IADC and SMBB trim register and
				  apply the default RSENSE if conditions are met.
			      1 : Select the TypeB to read the IADC, SMBB trim register and
				  manufacturer type and apply the default RSENSE if conditions are met.
			      2 : Select the TypeC to read the IADC, SMBB trim register and
				  apply the default RSENSE if conditions are met.

Channel node
NOTE: Atleast one Channel node is required.

Client required property:
- qcom,<consumer name>-iadc : The phandle to the corresponding iadc device.
			The consumer name passed to the driver when calling
			qpnp_get_iadc() is used to associate the client
			with the corresponding device.

Required properties:
- label : Channel name used for sysfs entry.
- reg : AMUX channel number.
- qcom,channel-num : Channel number associated to the AMUX input.
- qcom,decimation : Sampling rate to use for the individual channel measurement.
		    Select from the following unsigned int.
		    0 : 512
		    1 : 1K
		    2 : 2K
		    3 : 4K
- qcom,fast-avg-setup : Average number of samples to be used for measurement. Fast averaging
			provides the option to obtain a single measurement from the ADC that
			is an average of multiple samples. The value selected is 2^(value)
			Select from the following unsigned int.
			0 : 1
			1 : 2
			2 : 4
			3 : 8
			4 : 16
			5 : 32
			6 : 64
			7 : 128
			8 : 256
- qcom,iadc-vadc : Corresponding phandle of the VADC device to read the die_temperature and set
		simultaneous voltage and current conversion requests.

Example:
	/* Main Node */
	qcom,iadc@3200 {
                        compatible = "qcom,qpnp-iadc";
                        reg = <0x3200 0x100>;
			#address-cells = <1>;
			#size-cells = <0>;
                        interrupts = <0 0x36 0>;
			interrupt-names = "eoc-int-en-set";
                        qcom,adc-bit-resolution = <16>;
                        qcom,adc-vdd-reference = <1800>;
			qcom,rsense = <1500>;
			qcom,iadc-vadc = <&pm8941_vadc>;

			/* Channel Node */
                        chan@0 = {
                                label = "rsense";
                                reg = <0>;
                                qcom,decimation = <0>;
                                qcom,fast-avg-setup = <0>;
                        };
	};

Client device example:
/* Add to the clients node that needs the IADC */
client_node {
	qcom,client-iadc = <&pm8941_iadc>;
};
+181 −0
Original line number Diff line number Diff line
Qualcomm's QPNP PMIC Voltage ADC Arbiter

QPNP PMIC Voltage ADC (VADC) provides interface to clients to read
Voltage. A 15 bit ADC is used for Voltage measurements. There are multiple
peripherals to the VADC and the scope of the driver is to provide interface
for the USR peripheral of the VADC.

VADC node

Required properties:
- compatible : should be "qcom,qpnp-vadc" for Voltage ADC driver and
		"qcom,qpnp-vadc-hc" for VADC_HC voltage ADC driver.
- reg : offset and length of the PMIC Aribter register map.
- address-cells : Must be one.
- size-cells : Must be zero.
- interrupts : The USR bank peripheral VADC interrupt.
- interrupt-names : Should contain "eoc-int-en-set" for EOC,
		"high-thr-en-set" for high threshold interrupts and
		"low-thr-en-set" for low threshold interrupts. High and low threshold
		interrupts are to be enabled if VADC_USR needs to support recurring measurement.
- qcom,adc-bit-resolution : Bit resolution of the ADC.
- qcom,adc-vdd-reference : Voltage reference used by the ADC.

Channel nodes
NOTE: Atleast one Channel node is required.

Optional properties:
- qcom,vadc-poll-eoc: Use polling instead of interrupts for End of Conversion completion.
- qcom,pmic-revid : Phandle pointing to the revision peripheral node. Use it to query the
		    PMIC type and revision for applying the appropriate temperature
		    compensation parameters.
-qcom,vadc-meas-int-mode : Enable VADC_USR to handle requests to perform recurring measurements
			   for any one supported channel along with supporting single conversion
			   requests.
- qcom,vadc-recalib-check: Add this property to check if recalibration required due to inaccuracy.
- qcom,vadc-thermal-node : If present a thermal node is created and the channel is registered as
			   part of the thermal sysfs which allows clients to use the thermal framework
			   to set temperature thresholds and receive notification when the temperature
			   crosses a set threshold, read temperature and enable/set trip types supported
			   by the thermal framework.
- hkadc_ldo-supply : Add this property if VADC needs to perform a Software Vote for the HKADC.
- hkadc_ok-supply : Add this property if the VADC needs to perform a Software vote for the HKADC VREG_OK.

Client required property:
- qcom,<consumer name>-vadc : The phandle to the corresponding vadc device.
			The consumer name passed to the driver when calling
			qpnp_get_vadc() is used to associate the client
			with the corresponding device.

Required properties:
- label : Channel name used for sysfs entry.
- reg : AMUX channel number.
- qcom,decimation : Sampling rate to use for the individual channel measurement.
		    Select from following unsigned int.
		    0 : 512
		    1 : 1K
		    2 : 2K
		    3 : 4K
- qcom,pre-div-channel-scaling : Pre-div used for the channel before the signal
				 is being measured. Some of the AMUX channels
				 support dividing the signal from a predetermined
				 ratio. The configuration for this node is to know
				 the pre-determined ratio and use it for post scaling.
				 Select from the following unsinged int.
				 0 : {1, 1}
				 1 : {1, 3}
				 2 : {1, 4}
				 3 : {1, 6}
				 4 : {1, 20}
				 5 : {1, 8}
				 6 : {10, 81}
				 7 : {1, 10}
- qcom,calibration-type : Reference voltage to use for channel calibration.
			  Channel calibration is dependendent on the channel.
			  Certain channels like XO_THERM, BATT_THERM use ratiometric
			  calibration. Most other channels fall under absolute calibration.
			  Select from the following strings.
			  "absolute" : Uses the 625mv and 1.25V reference channels.
			  "ratiometric" : Uses the reference Voltage/GND for calibration.
- qcom,scale-function : Scaling function used to convert raw ADC code to units specific to
			a given channel.
			Select from the following unsigned int.
			0 : Default scaling to convert raw adc code to voltage.
			1 : Conversion to temperature based on btm parameters.
			2 : Returns result in degC for 100k pull-up.
			3 : Returns current across 0.1 ohm resistor.
			4 : Returns XO thermistor voltage in degree's Centigrade.
			5 : Returns result in degC for 150k pull-up.
			9 : Conversion to temperature based on -15~55 allowable
			    battery charging tempeature setting for btm parameters.
- qcom,hw-settle-time : Settling period for the channel before ADC read.
			Select from the following unsigned int.
			0 : 0us
			1 : 100us
			2 : 200us
			3 : 300us
			4 : 400us
			5 : 500us
			6 : 600us
			7 : 700us
			8 : 800us
			9 : 900us
			0xa : 1ms
			0xb : 2ms
			0xc : 4ms
			0xd : 6ms
			0xe : 8ms
			0xf : 10ms
- qcom,fast-avg-setup : Average number of samples to be used for measurement. Fast averaging
			provides the option to obtain a single measurement from the ADC that
			is an average of multiple samples. The value selected is 2^(value)
			Select from the following unsigned int.
			0 : 1
			1 : 2
			2 : 4
			3 : 8
			4 : 16
			5 : 32
			6 : 64
			7 : 128
			8 : 256

Example:
	/* Main Node */
	qcom,vadc@3100 {
                        compatible = "qcom,qpnp-vadc";
                        reg = <0x3100 0x100>;
			#address-cells = <1>;
			#size-cells = <0>;
                        interrupts = <0x0 0x31 0x0>;
			interrupt-names = "eoc-int-en-set";
                        qcom,adc-bit-resolution = <15>;
                        qcom,adc-vdd-reference = <1800>;

			/* Channel Node */
                        chan@0 {
                                label = "usb_in";
                                reg = <0>;
                                qcom,decimation = <0>;
                                qcom,pre-div-channel-scaling = <4>;
                                qcom,calibration-type = "absolute";
                                qcom,scale-function = <0>;
                                qcom,hw-settle-time = <0>;
                                qcom,fast-avg-setup = <0>;
                        };
	};

Client device example:
/* Add to the clients node that needs the VADC channel A/D */
client_node {
	qcom,client-vadc = <&pm8941_vadc>;
};

/* Clients have an option of measuring an analog signal through an MPP.
   MPP block is not part of the VADC block but is an individual PMIC
   block that has an option to support clients to configure an MPP as
   an analog input which can be routed through one of the VADC pre-mux
   inputs. Here is an example of how to configure an MPP as an analog
   input */

/* Configure MPP4 as an Analog input to AMUX8 and read from channel 0x23 */
/* MPP DT configuration in the platform DT file*/
	mpp@a300 { /* MPP 4 */
		qcom,mode = <4>; /* AIN input */
		qcom,invert = <1>; /* Enable MPP */
		qcom,ain-route = <3>; /* AMUX 8 */
		qcom,master-en = <1>;
		qcom,src-sel = <0>; /* Function constant */
	};

/* VADC Channel configuration */
	chan@23 {
		label = "mpp4_div3";
		reg = <0x23>;
		qcom,decimation = <0>;
		qcom,pre-div-channel-scaling = <1>;
		qcom,calibration-type = "absolute";
		qcom,scale-function = <0>;
		qcom,hw-settle-time = <0>;
		qcom,fast-avg-setup = <0>;
	};
+180 −0

File added.

Preview size limit exceeded, changes collapsed.

+90 −0
Original line number Diff line number Diff line
Qualcomm Technologies QPNP WLED

QPNP (Qualcomm Technologies Plug N Play) WLED (White Light
Emitting Diode) driver is used for controlling display
backlight that is part of PMIC on Qualcomm Technologies
reference platforms. The PMIC is connected to the host
processor via SPMI bus.

Required properties:
- compatible		: should be "qcom,qpnp-wled"
- reg			: base address and size for wled modules
- reg-names		: names associated with base addresses. It
			should be "qpnp-wled-ctrl-base", "qpnp-wled-sink-base",
			"qpnp-wled-ibb-base", "qpnp-wled-lab-base".

Optional properties for WLED:
 - interrupts		: Specifies the interrupts associated with WLED. The available
			  interrupts are over voltage protection(ovp) and short circuit(sc).
			  The values for ovp and sc are <0x3 0xd8 0x1> and <0x3 0xd8 0x2>.
 - interrupt-names	: Specify the interrupt names associated with interrupts. Must be
			  one of "ovp-irq" or "sc-irq"
- linux,name		: name of the wled. default is "wled".
- linux,default-trigger	: trigger for the backlight. default is NONE.
- qcom,fdbk-output	: string feedback current output for wled module. The accepted values
			  are "wled1", "wled2", "wled3", "wled4" and "auto". default is "auto".
- qcom,vref-mv		: maximum reference voltage in mv. default is 350.
- qcom,switch-freq-khz	: switch frequency in khz. default is 800.
- qcom,ovp-mv		: over voltage protection value in mv. default is 17800.
- qcom,ilim-ma		: maximum current limiter in ma. default is 980.
- qcom,boost-duty-ns	: maximum boost duty cycle in ns. default is 104.
- qcom,mod-freq-khz	: modulation frequency in khz. default is 9600.
- qcom,dim-mode		: dimming mode. supporting dimming modes are "analog",
			  "digital", and "hybrid". default is "hybrid".
- qcom,hyb-thres	: threshold value when used in hybrid mode. It represents the
			  percentage of brightntess at which dimming mode is switched
			  from "digital" to "analog". the default value is 6.25%. as the
			  floating point cannot be represented directly, the value is
			  multiplied by 100. so the default is 625.
- qcom,sync-dly-us	: delay for current sync in us. default is 400.
- qcom,fs-curr-ua	: maximum full scale current in ua. default is 25000.
- qcom,en-9b-dim-res	: boolean, specify if 9-bit dim resultion is needed. otherwise 12-bit is used.
- qcom,en-phase-stag	: boolean, specify if phase staggering is needed.
- qcom,en-cabc		: boolean, specify if cabc (content adaptive backlight control) is needed.
- qcom,disp-type-amoled	: specify if the display is amoled
- qcom,led-strings-list	: Wled module has four strings of leds numbered from 0 to 3. each string of leds
			  are operated individually. specify the list of strings used by the device.
			  any combination of led strings can be used. default value is [00 01 02 03]
- qcom,en-ext-pfet-sc-pro : Specify if external pfet short circuit protection is needed
- qcom,cons-sync-write-delay-us : Specify in 'us' the duration of delay between two consecutive writes to
				  SYNC register.

Optional properties if 'qcom,disp-type-amoled' is mentioned in DT:
- qcom,loop-ea-gm	: control the gm for gm stage in control loop. default is 3.
- qcom,loop-comp-res-kohm	: control to select the compensation resistor in kohm. default is 320.
- qcom,vref-psm-mv	: reference psm voltage in mv. default for amoled is 450.
- qcom,sc-deb-cycles	: debounce time for short circuit detection
- qcom,avdd-trim-steps-from-center : The number of steps to trim the OVP threshold voltage. The possible values can be between -7 to 8.

Example:
	qcom,leds@d800 {
		compatible = "qcom,qpnp-wled";
		reg = <0xd800 0x100>,
			<0xd900 0x100>,
			<0xdc00 0x100>,
			<0xde00 0x100>;
		reg-names = "qpnp-wled-ctrl-base",
				"qpnp-wled-sink-base",
				"qpnp-wled-ibb-base",
				"qpnp-wled-lab-base";
		interrupts = <0x3 0xd8 0x2>;
		interrupt-names = "sc-irq";
		status = "okay";
		linux,name = "wled";
		linux,default-trigger = "bkl-trigger";
		qcom,fdbk-output = "auto";
		qcom,vref-mv = <350>;
		qcom,switch-freq-khz = <800>;
		qcom,ovp-mv = <29500>;
		qcom,ilim-ma = <980>;
		qcom,boost-duty-ns = <26>;
		qcom,mod-freq-khz = <9600>;
		qcom,dim-mode = "hybrid";
		qcom,dim-method = "linear";
		qcom,hyb-thres = <625>;
		qcom,sync-dly-us = <800>;
		qcom,fs-curr-ua = <16000>;
		qcom,en-phase-stag;
		qcom,led-strings-list = [00 01 02 03];
		qcom,en-ext-pfet-sc-pro;
	};
Loading