@@ -425,6 +425,10 @@ static const struct attribute_group platform_profile_group = {
425
425
.is_visible = profile_class_is_visible ,
426
426
};
427
427
428
+ /**
429
+ * platform_profile_notify - Notify class device and legacy sysfs interface
430
+ * @dev: The class device
431
+ */
428
432
void platform_profile_notify (struct device * dev )
429
433
{
430
434
scoped_cond_guard (mutex_intr , return , & profile_lock ) {
@@ -434,6 +438,11 @@ void platform_profile_notify(struct device *dev)
434
438
}
435
439
EXPORT_SYMBOL_GPL (platform_profile_notify );
436
440
441
+ /**
442
+ * platform_profile_cycle - Cycles profiles available on all registered class devices
443
+ *
444
+ * Return: 0 on success, -errno on failure
445
+ */
437
446
int platform_profile_cycle (void )
438
447
{
439
448
enum platform_profile_option next = PLATFORM_PROFILE_LAST ;
@@ -477,6 +486,15 @@ int platform_profile_cycle(void)
477
486
}
478
487
EXPORT_SYMBOL_GPL (platform_profile_cycle );
479
488
489
+ /**
490
+ * platform_profile_register - Creates and registers a platform profile class device
491
+ * @dev: Parent device
492
+ * @name: Name of the class device
493
+ * @drvdata: Driver data that will be attached to the class device
494
+ * @ops: Platform profile's mandatory operations
495
+ *
496
+ * Return: pointer to the new class device on success, ERR_PTR on failure
497
+ */
480
498
struct device * platform_profile_register (struct device * dev , const char * name ,
481
499
void * drvdata ,
482
500
const struct platform_profile_ops * ops )
@@ -546,6 +564,12 @@ struct device *platform_profile_register(struct device *dev, const char *name,
546
564
}
547
565
EXPORT_SYMBOL_GPL (platform_profile_register );
548
566
567
+ /**
568
+ * platform_profile_remove - Unregisters a platform profile class device
569
+ * @dev: Class device
570
+ *
571
+ * Return: 0
572
+ */
549
573
int platform_profile_remove (struct device * dev )
550
574
{
551
575
struct platform_profile_handler * pprof = to_pprof_handler (dev );
@@ -571,6 +595,15 @@ static void devm_platform_profile_release(struct device *dev, void *res)
571
595
platform_profile_remove (* ppdev );
572
596
}
573
597
598
+ /**
599
+ * devm_platform_profile_register - Device managed version of platform_profile_register
600
+ * @dev: Parent device
601
+ * @name: Name of the class device
602
+ * @drvdata: Driver data that will be attached to the class device
603
+ * @ops: Platform profile's mandatory operations
604
+ *
605
+ * Return: pointer to the new class device on success, ERR_PTR on failure
606
+ */
574
607
struct device * devm_platform_profile_register (struct device * dev , const char * name ,
575
608
void * drvdata ,
576
609
const struct platform_profile_ops * ops )
0 commit comments