Source
429
429
430
430
ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL);
431
431
if (!ondemand_data) {
432
432
ret = -ENOMEM;
433
433
goto err;
434
434
}
435
435
ondemand_data->upthreshold = 40;
436
436
ondemand_data->downdifferential = 5;
437
437
438
438
/* Add devfreq device to monitor and handle the exynos bus */
439
-
bus->devfreq = devm_devfreq_add_device(dev, profile, "simple_ondemand",
439
+
bus->devfreq = devm_devfreq_add_device(dev, profile,
440
+
DEVFREQ_GOV_SIMPLE_ONDEMAND,
440
441
ondemand_data);
441
442
if (IS_ERR(bus->devfreq)) {
442
443
dev_err(dev, "failed to add devfreq device\n");
443
444
ret = PTR_ERR(bus->devfreq);
444
445
goto err;
445
446
}
446
447
447
448
/* Register opp_notifier to catch the change of OPP */
448
449
ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq);
449
450
if (ret < 0) {
481
482
}
482
483
483
484
passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL);
484
485
if (!passive_data) {
485
486
ret = -ENOMEM;
486
487
goto err;
487
488
}
488
489
passive_data->parent = parent_devfreq;
489
490
490
491
/* Add devfreq device for exynos bus with passive governor */
491
-
bus->devfreq = devm_devfreq_add_device(dev, profile, "passive",
492
+
bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE,
492
493
passive_data);
493
494
if (IS_ERR(bus->devfreq)) {
494
495
dev_err(dev,
495
496
"failed to add devfreq dev with passive governor\n");
496
497
ret = PTR_ERR(bus->devfreq);
497
498
goto err;
498
499
}
499
500
500
501
out:
501
502
max_state = bus->devfreq->profile->max_state;