mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	regulator: gpio: Honor regulator-boot-on property
When requesting the enable GPIO, the driver should do so with the
correct output level matching some expected state. This is especially
important if the regulator is a critical one, such as a supply for
the boot CPU. This is currently done by checking for the enable-at-boot
property, but this is not documented in the device tree binding, nor
does it match the common regulator properties.
Honor the common regulator-boot-on property by checking the boot_on
constraint setting within the DT probe path. This is the same as what
is done in the fixed regulator driver.
Also add a comment stating that the enable-at-boot property should not
be used.
Fixes: 006694d099 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200720132809.26908-1-wens@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									a98bcaa92d
								
							
						
					
					
						commit
						3acff11cef
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -148,6 +148,13 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np, | ||||||
| 
 | 
 | ||||||
| 	config->supply_name = config->init_data->constraints.name; | 	config->supply_name = config->init_data->constraints.name; | ||||||
| 
 | 
 | ||||||
|  | 	if (config->init_data->constraints.boot_on) | ||||||
|  | 		config->enabled_at_boot = true; | ||||||
|  | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * Do not use: undocumented device tree property. | ||||||
|  | 	 * This is kept around solely for device tree ABI stability. | ||||||
|  | 	 */ | ||||||
| 	if (of_property_read_bool(np, "enable-at-boot")) | 	if (of_property_read_bool(np, "enable-at-boot")) | ||||||
| 		config->enabled_at_boot = true; | 		config->enabled_at_boot = true; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Chen-Yu Tsai
						Chen-Yu Tsai