mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-30 18:05:48 +01:00 
			
		
		
		
	mmc: omap_hsmmc: Use regulator_set_enable_if_allowed for enabling regulator
Use regulator_set_enable_if_allowed() api instead of regulator_set_enable() while enabling io regulators. This way the driver doesn't see an error when disabling an always-on regulator and when enabling is not supported. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
		
				
					committed by
					
						 Simon Glass
						Simon Glass
					
				
			
			
				
	
			
			
			
						parent
						
							cc4a224af2
						
					
				
				
					commit
					d3de38554a
				
			| @@ -470,21 +470,21 @@ static int omap_hsmmc_set_io_regulator(struct mmc *mmc, int mV) | |||||||
| 		return 0; | 		return 0; | ||||||
|  |  | ||||||
| 	/* Disable PBIAS */ | 	/* Disable PBIAS */ | ||||||
| 	ret = regulator_set_enable(priv->pbias_supply, false); | 	ret = regulator_set_enable_if_allowed(priv->pbias_supply, false); | ||||||
| 	if (ret && ret != -ENOSYS) | 	if (ret) | ||||||
| 		return ret; | 		return ret; | ||||||
|  |  | ||||||
| 	/* Turn off IO voltage */ | 	/* Turn off IO voltage */ | ||||||
| 	ret = regulator_set_enable(mmc->vqmmc_supply, false); | 	ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, false); | ||||||
| 	if (ret && ret != -ENOSYS) | 	if (ret) | ||||||
| 		return ret; | 		return ret; | ||||||
| 	/* Program a new IO voltage value */ | 	/* Program a new IO voltage value */ | ||||||
| 	ret = regulator_set_value(mmc->vqmmc_supply, uV); | 	ret = regulator_set_value(mmc->vqmmc_supply, uV); | ||||||
| 	if (ret) | 	if (ret) | ||||||
| 		return ret; | 		return ret; | ||||||
| 	/* Turn on IO voltage */ | 	/* Turn on IO voltage */ | ||||||
| 	ret = regulator_set_enable(mmc->vqmmc_supply, true); | 	ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, true); | ||||||
| 	if (ret && ret != -ENOSYS) | 	if (ret) | ||||||
| 		return ret; | 		return ret; | ||||||
|  |  | ||||||
| 	/* Program PBIAS voltage*/ | 	/* Program PBIAS voltage*/ | ||||||
| @@ -492,8 +492,8 @@ static int omap_hsmmc_set_io_regulator(struct mmc *mmc, int mV) | |||||||
| 	if (ret && ret != -ENOSYS) | 	if (ret && ret != -ENOSYS) | ||||||
| 		return ret; | 		return ret; | ||||||
| 	/* Enable PBIAS */ | 	/* Enable PBIAS */ | ||||||
| 	ret = regulator_set_enable(priv->pbias_supply, true); | 	ret = regulator_set_enable_if_allowed(priv->pbias_supply, true); | ||||||
| 	if (ret && ret != -ENOSYS) | 	if (ret) | ||||||
| 		return ret; | 		return ret; | ||||||
|  |  | ||||||
| 	return 0; | 	return 0; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user