mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	drm/lima: Migrate to dev_pm_opp_set_config()
The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
		
							parent
							
								
									f88d152dc7
								
							
						
					
					
						commit
						d8c32d3971
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
					@ -112,6 +112,11 @@ int lima_devfreq_init(struct lima_device *ldev)
 | 
				
			||||||
	unsigned long cur_freq;
 | 
						unsigned long cur_freq;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	const char *regulator_names[] = { "mali", NULL };
 | 
						const char *regulator_names[] = { "mali", NULL };
 | 
				
			||||||
 | 
						const char *clk_names[] = { "core", NULL };
 | 
				
			||||||
 | 
						struct dev_pm_opp_config config = {
 | 
				
			||||||
 | 
							.regulator_names = regulator_names,
 | 
				
			||||||
 | 
							.clk_names = clk_names,
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!device_property_present(dev, "operating-points-v2"))
 | 
						if (!device_property_present(dev, "operating-points-v2"))
 | 
				
			||||||
		/* Optional, continue without devfreq */
 | 
							/* Optional, continue without devfreq */
 | 
				
			||||||
| 
						 | 
					@ -119,11 +124,7 @@ int lima_devfreq_init(struct lima_device *ldev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock_init(&ldevfreq->lock);
 | 
						spin_lock_init(&ldevfreq->lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = devm_pm_opp_set_clkname(dev, "core");
 | 
						ret = devm_pm_opp_set_config(dev, &config);
 | 
				
			||||||
	if (ret)
 | 
					 | 
				
			||||||
		return ret;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ret = devm_pm_opp_set_regulators(dev, regulator_names);
 | 
					 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		/* Continue if the optional regulator is missing */
 | 
							/* Continue if the optional regulator is missing */
 | 
				
			||||||
		if (ret != -ENODEV)
 | 
							if (ret != -ENODEV)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue