1*4882a593SmuzhiyunVoltage/Current regulator 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunBinding: 4*4882a593SmuzhiyunThe regulator devices don't use the "compatible" property. The binding is done 5*4882a593Smuzhiyunby the prefix of regulator node's name, or, if this fails, by the prefix of the 6*4882a593Smuzhiyunregulator's "regulator-name" property. Usually the pmic I/O driver will provide 7*4882a593Smuzhiyunthe array of 'struct pmic_child_info' with the prefixes and compatible drivers. 8*4882a593SmuzhiyunThe bind is done by calling function: pmic_bind_childs(). 9*4882a593SmuzhiyunExample drivers: 10*4882a593Smuzhiyunpmic: drivers/power/pmic/max77686.c 11*4882a593Smuzhiyunregulator: drivers/power/regulator/max77686.c 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunFor the node name e.g.: "prefix[:alpha:]num { ... }": 14*4882a593Smuzhiyun- the driver prefix should be: "prefix" - case sensitive 15*4882a593Smuzhiyun- the node name's "num" is set as "dev->driver_data" on bind 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunExample the prefix "ldo" will pass for: "ldo1", "ldo@1", "ldoreg@1, ... 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunBinding by means of the node's name is preferred. However if the node names 20*4882a593Smuzhiyunwould produce ambiguous prefixes (like "regulator@1" and "regualtor@11") and you 21*4882a593Smuzhiyuncan't or do not want to change them then binding against the "regulator-name" 22*4882a593Smuzhiyunproperty is possible. The syntax for the prefix of the "regulator-name" property 23*4882a593Smuzhiyunis the same as the one for the regulator's node name. 24*4882a593SmuzhiyunUse case: a regulator named "regulator@1" to be bound to a driver named 25*4882a593Smuzhiyun"LDO_DRV" and a regulator named "regualator@11" to be bound to an other driver 26*4882a593Smuzhiyunnamed "BOOST_DRV". Using prefix "regualtor@1" for driver matching would load 27*4882a593Smuzhiyunthe same driver for both regulators, hence the prefix is ambiguous. 28*4882a593Smuzhiyun 29*4882a593SmuzhiyunOptional properties: 30*4882a593Smuzhiyun- regulator-name: a string, required by the regulator uclass, used for driver 31*4882a593Smuzhiyun binding if binding by node's name prefix fails 32*4882a593Smuzhiyun- regulator-min-microvolt: a minimum allowed Voltage value 33*4882a593Smuzhiyun- regulator-max-microvolt: a maximum allowed Voltage value 34*4882a593Smuzhiyun- regulator-min-microamp: a minimum allowed Current value 35*4882a593Smuzhiyun- regulator-max-microamp: a maximum allowed Current value 36*4882a593Smuzhiyun- regulator-always-on: regulator should never be disabled 37*4882a593Smuzhiyun- regulator-boot-on: enabled by bootloader/firmware 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunNote 40*4882a593SmuzhiyunThe "regulator-name" constraint is used for setting the device's uclass 41*4882a593Smuzhiyunplatform data '.name' field. And the regulator device name is set from 42*4882a593Smuzhiyunit's node name. If "regulator-name" is not provided in dts, node name 43*4882a593Smuzhiyunis chosen for setting the device's uclass platform data '.name' field. 44*4882a593Smuzhiyun 45*4882a593SmuzhiyunOther kernel-style properties, are currently not used. 46*4882a593Smuzhiyun 47*4882a593SmuzhiyunNote: 48*4882a593SmuzhiyunFor the regulator autoset from constraints, the framework expects that: 49*4882a593Smuzhiyun- regulator-min-microvolt is equal to regulator-max-microvolt 50*4882a593Smuzhiyun- regulator-min-microamp is equal to regulator-max-microamp 51*4882a593Smuzhiyun- regulator-always-on or regulator-boot-on is set 52*4882a593Smuzhiyun 53*4882a593SmuzhiyunExample: 54*4882a593Smuzhiyunldo0 { 55*4882a593Smuzhiyun /* Optional */ 56*4882a593Smuzhiyun regulator-name = "VDDQ_EMMC_1.8V"; 57*4882a593Smuzhiyun regulator-min-microvolt = <1800000>; 58*4882a593Smuzhiyun regulator-max-microvolt = <1800000>; 59*4882a593Smuzhiyun regulator-min-microamp = <100000>; 60*4882a593Smuzhiyun regulator-max-microamp = <100000>; 61*4882a593Smuzhiyun regulator-always-on; 62*4882a593Smuzhiyun regulator-boot-on; 63*4882a593Smuzhiyun}; 64