@@ -2002,8 +2002,7 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
20022002 * _opp_add_v1() - Allocate a OPP based on v1 bindings.
20032003 * @opp_table: OPP table
20042004 * @dev: device for which we do this operation
2005- * @freq: Frequency in Hz for this OPP
2006- * @u_volt: Voltage in uVolts for this OPP
2005+ * @data: The OPP data for the OPP to add
20072006 * @dynamic: Dynamically added OPPs.
20082007 *
20092008 * This function adds an opp definition to the opp table and returns status.
@@ -2021,10 +2020,10 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
20212020 * -ENOMEM Memory allocation failure
20222021 */
20232022int _opp_add_v1 (struct opp_table * opp_table , struct device * dev ,
2024- unsigned long freq , long u_volt , bool dynamic )
2023+ struct dev_pm_opp_data * data , bool dynamic )
20252024{
20262025 struct dev_pm_opp * new_opp ;
2027- unsigned long tol ;
2026+ unsigned long tol , u_volt = data -> u_volt ;
20282027 int ret ;
20292028
20302029 if (!assert_single_clk (opp_table ))
@@ -2035,7 +2034,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
20352034 return - ENOMEM ;
20362035
20372036 /* populate the opp table */
2038- new_opp -> rates [0 ] = freq ;
2037+ new_opp -> rates [0 ] = data -> freq ;
20392038 tol = u_volt * opp_table -> voltage_tolerance_v1 / 100 ;
20402039 new_opp -> supplies [0 ].u_volt = u_volt ;
20412040 new_opp -> supplies [0 ].u_volt_min = u_volt - tol ;
@@ -2825,10 +2824,9 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table,
28252824}
28262825
28272826/**
2828- * dev_pm_opp_add() - Add an OPP table from a table definitions
2829- * @dev: device for which we do this operation
2830- * @freq: Frequency in Hz for this OPP
2831- * @u_volt: Voltage in uVolts for this OPP
2827+ * dev_pm_opp_add_dynamic() - Add an OPP table from a table definitions
2828+ * @dev: The device for which we do this operation
2829+ * @data: The OPP data for the OPP to add
28322830 *
28332831 * This function adds an opp definition to the opp table and returns status.
28342832 * The opp is made available by default and it can be controlled using
@@ -2841,7 +2839,7 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table,
28412839 * Duplicate OPPs (both freq and volt are same) and !opp->available
28422840 * -ENOMEM Memory allocation failure
28432841 */
2844- int dev_pm_opp_add (struct device * dev , unsigned long freq , unsigned long u_volt )
2842+ int dev_pm_opp_add_dynamic (struct device * dev , struct dev_pm_opp_data * data )
28452843{
28462844 struct opp_table * opp_table ;
28472845 int ret ;
@@ -2853,13 +2851,13 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
28532851 /* Fix regulator count for dynamic OPPs */
28542852 opp_table -> regulator_count = 1 ;
28552853
2856- ret = _opp_add_v1 (opp_table , dev , freq , u_volt , true);
2854+ ret = _opp_add_v1 (opp_table , dev , data , true);
28572855 if (ret )
28582856 dev_pm_opp_put_opp_table (opp_table );
28592857
28602858 return ret ;
28612859}
2862- EXPORT_SYMBOL_GPL (dev_pm_opp_add );
2860+ EXPORT_SYMBOL_GPL (dev_pm_opp_add_dynamic );
28632861
28642862/**
28652863 * _opp_set_availability() - helper to set the availability of an opp
0 commit comments