at v6.14 707 lines 19 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Generic OPP Interface 4 * 5 * Copyright (C) 2009-2010 Texas Instruments Incorporated. 6 * Nishanth Menon 7 * Romit Dasgupta 8 * Kevin Hilman 9 */ 10 11#ifndef __LINUX_OPP_H__ 12#define __LINUX_OPP_H__ 13 14#include <linux/energy_model.h> 15#include <linux/err.h> 16#include <linux/notifier.h> 17 18struct clk; 19struct cpufreq_frequency_table; 20struct regulator; 21struct dev_pm_opp; 22struct device; 23struct opp_table; 24 25enum dev_pm_opp_event { 26 OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, 27 OPP_EVENT_ADJUST_VOLTAGE, 28}; 29 30/** 31 * struct dev_pm_opp_supply - Power supply voltage/current values 32 * @u_volt: Target voltage in microvolts corresponding to this OPP 33 * @u_volt_min: Minimum voltage in microvolts corresponding to this OPP 34 * @u_volt_max: Maximum voltage in microvolts corresponding to this OPP 35 * @u_amp: Maximum current drawn by the device in microamperes 36 * @u_watt: Power used by the device in microwatts 37 * 38 * This structure stores the voltage/current/power values for a single power 39 * supply. 40 */ 41struct dev_pm_opp_supply { 42 unsigned long u_volt; 43 unsigned long u_volt_min; 44 unsigned long u_volt_max; 45 unsigned long u_amp; 46 unsigned long u_watt; 47}; 48 49typedef int (*config_regulators_t)(struct device *dev, 50 struct dev_pm_opp *old_opp, struct dev_pm_opp *new_opp, 51 struct regulator **regulators, unsigned int count); 52 53typedef int (*config_clks_t)(struct device *dev, struct opp_table *opp_table, 54 struct dev_pm_opp *opp, void *data, bool scaling_down); 55 56/** 57 * struct dev_pm_opp_config - Device OPP configuration values 58 * @clk_names: Clk names, NULL terminated array. 59 * @config_clks: Custom set clk helper. 60 * @prop_name: Name to postfix to properties. 61 * @config_regulators: Custom set regulator helper. 62 * @supported_hw: Array of hierarchy of versions to match. 63 * @supported_hw_count: Number of elements in the array. 64 * @regulator_names: Array of pointers to the names of the regulator, NULL terminated. 65 * @required_dev: The required OPP device. 66 * @required_dev_index: The index of the required OPP for the @required_dev. 67 * 68 * This structure contains platform specific OPP configurations for the device. 69 */ 70struct dev_pm_opp_config { 71 /* NULL terminated */ 72 const char * const *clk_names; 73 config_clks_t config_clks; 74 const char *prop_name; 75 config_regulators_t config_regulators; 76 const unsigned int *supported_hw; 77 unsigned int supported_hw_count; 78 const char * const *regulator_names; 79 struct device *required_dev; 80 unsigned int required_dev_index; 81}; 82 83#define OPP_LEVEL_UNSET U32_MAX 84 85/** 86 * struct dev_pm_opp_data - The data to use to initialize an OPP. 87 * @turbo: Flag to indicate whether the OPP is to be marked turbo or not. 88 * @level: The performance level for the OPP. Set level to OPP_LEVEL_UNSET if 89 * level field isn't used. 90 * @freq: The clock rate in Hz for the OPP. 91 * @u_volt: The voltage in uV for the OPP. 92 */ 93struct dev_pm_opp_data { 94 bool turbo; 95 unsigned int level; 96 unsigned long freq; 97 unsigned long u_volt; 98}; 99 100#if defined(CONFIG_PM_OPP) 101 102struct opp_table *dev_pm_opp_get_opp_table(struct device *dev); 103void dev_pm_opp_get_opp_table_ref(struct opp_table *opp_table); 104void dev_pm_opp_put_opp_table(struct opp_table *opp_table); 105 106unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, bool peak, int index); 107 108unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp); 109 110int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *supplies); 111 112unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp); 113 114unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index); 115 116unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp); 117 118unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp, 119 unsigned int index); 120 121bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp); 122 123int dev_pm_opp_get_opp_count(struct device *dev); 124unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev); 125unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev); 126unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev); 127unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev); 128 129struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, 130 unsigned long freq, 131 bool available); 132 133struct dev_pm_opp * 134dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq, 135 u32 index, bool available); 136 137struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, 138 unsigned long *freq); 139 140struct dev_pm_opp *dev_pm_opp_find_freq_floor_indexed(struct device *dev, 141 unsigned long *freq, u32 index); 142 143struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, 144 unsigned long *freq); 145 146struct dev_pm_opp *dev_pm_opp_find_freq_ceil_indexed(struct device *dev, 147 unsigned long *freq, u32 index); 148 149struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev, 150 unsigned int level); 151 152struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev, 153 unsigned int *level); 154 155struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev, 156 unsigned int *level); 157 158struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev, 159 unsigned int *bw, int index); 160 161struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev, 162 unsigned int *bw, int index); 163 164void dev_pm_opp_get(struct dev_pm_opp *opp); 165void dev_pm_opp_put(struct dev_pm_opp *opp); 166 167int dev_pm_opp_add_dynamic(struct device *dev, struct dev_pm_opp_data *opp); 168 169void dev_pm_opp_remove(struct device *dev, unsigned long freq); 170void dev_pm_opp_remove_all_dynamic(struct device *dev); 171 172int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq, 173 unsigned long u_volt, unsigned long u_volt_min, 174 unsigned long u_volt_max); 175 176int dev_pm_opp_enable(struct device *dev, unsigned long freq); 177 178int dev_pm_opp_disable(struct device *dev, unsigned long freq); 179 180int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb); 181int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb); 182 183int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config); 184int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config); 185void dev_pm_opp_clear_config(int token); 186int dev_pm_opp_config_clks_simple(struct device *dev, 187 struct opp_table *opp_table, struct dev_pm_opp *opp, void *data, 188 bool scaling_down); 189 190struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, struct opp_table *dst_table, struct dev_pm_opp *src_opp); 191int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate); 192int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); 193int dev_pm_opp_set_opp(struct device *dev, struct dev_pm_opp *opp); 194int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask); 195int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); 196void dev_pm_opp_remove_table(struct device *dev); 197void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask); 198int dev_pm_opp_sync_regulators(struct device *dev); 199#else 200static inline struct opp_table *dev_pm_opp_get_opp_table(struct device *dev) 201{ 202 return ERR_PTR(-EOPNOTSUPP); 203} 204 205static inline struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index) 206{ 207 return ERR_PTR(-EOPNOTSUPP); 208} 209 210static inline void dev_pm_opp_get_opp_table_ref(struct opp_table *opp_table) {} 211 212static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {} 213 214static inline unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, bool peak, int index) 215{ 216 return 0; 217} 218 219static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) 220{ 221 return 0; 222} 223 224static inline int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *supplies) 225{ 226 return -EOPNOTSUPP; 227} 228 229static inline unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp) 230{ 231 return 0; 232} 233 234static inline unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index) 235{ 236 return 0; 237} 238 239static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp) 240{ 241 return 0; 242} 243 244static inline 245unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp, 246 unsigned int index) 247{ 248 return 0; 249} 250 251static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp) 252{ 253 return false; 254} 255 256static inline int dev_pm_opp_get_opp_count(struct device *dev) 257{ 258 return 0; 259} 260 261static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev) 262{ 263 return 0; 264} 265 266static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev) 267{ 268 return 0; 269} 270 271static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev) 272{ 273 return 0; 274} 275 276static inline unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev) 277{ 278 return 0; 279} 280 281static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, 282 unsigned long freq, bool available) 283{ 284 return ERR_PTR(-EOPNOTSUPP); 285} 286 287static inline struct dev_pm_opp * 288dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq, 289 u32 index, bool available) 290{ 291 return ERR_PTR(-EOPNOTSUPP); 292} 293 294static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, 295 unsigned long *freq) 296{ 297 return ERR_PTR(-EOPNOTSUPP); 298} 299 300static inline struct dev_pm_opp * 301dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq, u32 index) 302{ 303 return ERR_PTR(-EOPNOTSUPP); 304} 305 306static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, 307 unsigned long *freq) 308{ 309 return ERR_PTR(-EOPNOTSUPP); 310} 311 312static inline struct dev_pm_opp * 313dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq, u32 index) 314{ 315 return ERR_PTR(-EOPNOTSUPP); 316} 317 318static inline struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev, 319 unsigned int level) 320{ 321 return ERR_PTR(-EOPNOTSUPP); 322} 323 324static inline struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev, 325 unsigned int *level) 326{ 327 return ERR_PTR(-EOPNOTSUPP); 328} 329 330static inline struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev, 331 unsigned int *level) 332{ 333 return ERR_PTR(-EOPNOTSUPP); 334} 335 336static inline struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev, 337 unsigned int *bw, int index) 338{ 339 return ERR_PTR(-EOPNOTSUPP); 340} 341 342static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev, 343 unsigned int *bw, int index) 344{ 345 return ERR_PTR(-EOPNOTSUPP); 346} 347 348static inline void dev_pm_opp_get(struct dev_pm_opp *opp) {} 349 350static inline void dev_pm_opp_put(struct dev_pm_opp *opp) {} 351 352static inline int 353dev_pm_opp_add_dynamic(struct device *dev, struct dev_pm_opp_data *opp) 354{ 355 return -EOPNOTSUPP; 356} 357 358static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq) 359{ 360} 361 362static inline void dev_pm_opp_remove_all_dynamic(struct device *dev) 363{ 364} 365 366static inline int 367dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq, 368 unsigned long u_volt, unsigned long u_volt_min, 369 unsigned long u_volt_max) 370{ 371 return 0; 372} 373 374static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq) 375{ 376 return 0; 377} 378 379static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq) 380{ 381 return 0; 382} 383 384static inline int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb) 385{ 386 return -EOPNOTSUPP; 387} 388 389static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb) 390{ 391 return -EOPNOTSUPP; 392} 393 394static inline int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) 395{ 396 return -EOPNOTSUPP; 397} 398 399static inline int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) 400{ 401 return -EOPNOTSUPP; 402} 403 404static inline void dev_pm_opp_clear_config(int token) {} 405 406static inline int dev_pm_opp_config_clks_simple(struct device *dev, 407 struct opp_table *opp_table, struct dev_pm_opp *opp, void *data, 408 bool scaling_down) 409{ 410 return -EOPNOTSUPP; 411} 412 413static inline struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, 414 struct opp_table *dst_table, struct dev_pm_opp *src_opp) 415{ 416 return ERR_PTR(-EOPNOTSUPP); 417} 418 419static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate) 420{ 421 return -EOPNOTSUPP; 422} 423 424static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) 425{ 426 return -EOPNOTSUPP; 427} 428 429static inline int dev_pm_opp_set_opp(struct device *dev, struct dev_pm_opp *opp) 430{ 431 return -EOPNOTSUPP; 432} 433 434static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask) 435{ 436 return -EOPNOTSUPP; 437} 438 439static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) 440{ 441 return -EINVAL; 442} 443 444static inline void dev_pm_opp_remove_table(struct device *dev) 445{ 446} 447 448static inline void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask) 449{ 450} 451 452static inline int dev_pm_opp_sync_regulators(struct device *dev) 453{ 454 return -EOPNOTSUPP; 455} 456 457#endif /* CONFIG_PM_OPP */ 458 459#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 460int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table); 461void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table); 462#else 463static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table) 464{ 465 return -EINVAL; 466} 467 468static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table) 469{ 470} 471#endif 472 473 474#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) 475int dev_pm_opp_of_add_table(struct device *dev); 476int dev_pm_opp_of_add_table_indexed(struct device *dev, int index); 477int devm_pm_opp_of_add_table_indexed(struct device *dev, int index); 478void dev_pm_opp_of_remove_table(struct device *dev); 479int devm_pm_opp_of_add_table(struct device *dev); 480int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask); 481void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask); 482int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); 483struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); 484struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); 485int of_get_required_opp_performance_state(struct device_node *np, int index); 486bool dev_pm_opp_of_has_required_opp(struct device *dev); 487int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table); 488int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus); 489int dev_pm_opp_calc_power(struct device *dev, unsigned long *uW, 490 unsigned long *kHz); 491static inline void dev_pm_opp_of_unregister_em(struct device *dev) 492{ 493 em_dev_unregister_perf_domain(dev); 494} 495#else 496static inline int dev_pm_opp_of_add_table(struct device *dev) 497{ 498 return -EOPNOTSUPP; 499} 500 501static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index) 502{ 503 return -EOPNOTSUPP; 504} 505 506static inline int devm_pm_opp_of_add_table_indexed(struct device *dev, int index) 507{ 508 return -EOPNOTSUPP; 509} 510 511static inline void dev_pm_opp_of_remove_table(struct device *dev) 512{ 513} 514 515static inline int devm_pm_opp_of_add_table(struct device *dev) 516{ 517 return -EOPNOTSUPP; 518} 519 520static inline int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask) 521{ 522 return -EOPNOTSUPP; 523} 524 525static inline void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask) 526{ 527} 528 529static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) 530{ 531 return -EOPNOTSUPP; 532} 533 534static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev) 535{ 536 return NULL; 537} 538 539static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) 540{ 541 return NULL; 542} 543 544static inline int dev_pm_opp_of_register_em(struct device *dev, 545 struct cpumask *cpus) 546{ 547 return -EOPNOTSUPP; 548} 549 550static inline void dev_pm_opp_of_unregister_em(struct device *dev) 551{ 552} 553 554static inline int dev_pm_opp_calc_power(struct device *dev, unsigned long *uW, 555 unsigned long *kHz) 556{ 557 return -EOPNOTSUPP; 558} 559 560static inline int of_get_required_opp_performance_state(struct device_node *np, int index) 561{ 562 return -EOPNOTSUPP; 563} 564 565static inline bool dev_pm_opp_of_has_required_opp(struct device *dev) 566{ 567 return false; 568} 569 570static inline int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table) 571{ 572 return -EOPNOTSUPP; 573} 574#endif 575 576/* OPP Configuration helpers */ 577 578static inline int dev_pm_opp_add(struct device *dev, unsigned long freq, 579 unsigned long u_volt) 580{ 581 struct dev_pm_opp_data data = { 582 .freq = freq, 583 .u_volt = u_volt, 584 }; 585 586 return dev_pm_opp_add_dynamic(dev, &data); 587} 588 589/* Regulators helpers */ 590static inline int dev_pm_opp_set_regulators(struct device *dev, 591 const char * const names[]) 592{ 593 struct dev_pm_opp_config config = { 594 .regulator_names = names, 595 }; 596 597 return dev_pm_opp_set_config(dev, &config); 598} 599 600static inline void dev_pm_opp_put_regulators(int token) 601{ 602 dev_pm_opp_clear_config(token); 603} 604 605static inline int devm_pm_opp_set_regulators(struct device *dev, 606 const char * const names[]) 607{ 608 struct dev_pm_opp_config config = { 609 .regulator_names = names, 610 }; 611 612 return devm_pm_opp_set_config(dev, &config); 613} 614 615/* Supported-hw helpers */ 616static inline int dev_pm_opp_set_supported_hw(struct device *dev, 617 const u32 *versions, 618 unsigned int count) 619{ 620 struct dev_pm_opp_config config = { 621 .supported_hw = versions, 622 .supported_hw_count = count, 623 }; 624 625 return dev_pm_opp_set_config(dev, &config); 626} 627 628static inline void dev_pm_opp_put_supported_hw(int token) 629{ 630 dev_pm_opp_clear_config(token); 631} 632 633static inline int devm_pm_opp_set_supported_hw(struct device *dev, 634 const u32 *versions, 635 unsigned int count) 636{ 637 struct dev_pm_opp_config config = { 638 .supported_hw = versions, 639 .supported_hw_count = count, 640 }; 641 642 return devm_pm_opp_set_config(dev, &config); 643} 644 645/* clkname helpers */ 646static inline int dev_pm_opp_set_clkname(struct device *dev, const char *name) 647{ 648 const char *names[] = { name, NULL }; 649 struct dev_pm_opp_config config = { 650 .clk_names = names, 651 }; 652 653 return dev_pm_opp_set_config(dev, &config); 654} 655 656static inline void dev_pm_opp_put_clkname(int token) 657{ 658 dev_pm_opp_clear_config(token); 659} 660 661static inline int devm_pm_opp_set_clkname(struct device *dev, const char *name) 662{ 663 const char *names[] = { name, NULL }; 664 struct dev_pm_opp_config config = { 665 .clk_names = names, 666 }; 667 668 return devm_pm_opp_set_config(dev, &config); 669} 670 671/* config-regulators helpers */ 672static inline int dev_pm_opp_set_config_regulators(struct device *dev, 673 config_regulators_t helper) 674{ 675 struct dev_pm_opp_config config = { 676 .config_regulators = helper, 677 }; 678 679 return dev_pm_opp_set_config(dev, &config); 680} 681 682static inline void dev_pm_opp_put_config_regulators(int token) 683{ 684 dev_pm_opp_clear_config(token); 685} 686 687/* prop-name helpers */ 688static inline int dev_pm_opp_set_prop_name(struct device *dev, const char *name) 689{ 690 struct dev_pm_opp_config config = { 691 .prop_name = name, 692 }; 693 694 return dev_pm_opp_set_config(dev, &config); 695} 696 697static inline void dev_pm_opp_put_prop_name(int token) 698{ 699 dev_pm_opp_clear_config(token); 700} 701 702static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) 703{ 704 return dev_pm_opp_get_freq_indexed(opp, 0); 705} 706 707#endif /* __LINUX_OPP_H__ */