Skip to content

Commit 9d71b54

Browse files
Vadim Fedorenkodavem330
authored andcommitted
dpll: netlink: Add DPLL framework base functions
DPLL framework is used to represent and configure DPLL devices in systems. Each device that has DPLL and can configure inputs and outputs can use this framework. Implement dpll netlink framework functions for enablement of dpll subsystem netlink family. Co-developed-by: Milena Olech <[email protected]> Signed-off-by: Milena Olech <[email protected]> Co-developed-by: Michal Michalik <[email protected]> Signed-off-by: Michal Michalik <[email protected]> Signed-off-by: Vadim Fedorenko <[email protected]> Co-developed-by: Arkadiusz Kubalewski <[email protected]> Signed-off-by: Arkadiusz Kubalewski <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9431063 commit 9d71b54

File tree

4 files changed

+1268
-1
lines changed

4 files changed

+1268
-1
lines changed

drivers/dpll/dpll_core.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/string.h>
1515

1616
#include "dpll_core.h"
17+
#include "dpll_netlink.h"
1718

1819
/* Mutex lock to protect DPLL subsystem devices and pins */
1920
DEFINE_MUTEX(dpll_lock);
@@ -381,6 +382,7 @@ int dpll_device_register(struct dpll_device *dpll, enum dpll_type type,
381382
}
382383

383384
xa_set_mark(&dpll_device_xa, dpll->id, DPLL_REGISTERED);
385+
dpll_device_create_ntf(dpll);
384386
mutex_unlock(&dpll_lock);
385387

386388
return 0;
@@ -404,6 +406,7 @@ void dpll_device_unregister(struct dpll_device *dpll,
404406

405407
mutex_lock(&dpll_lock);
406408
ASSERT_DPLL_REGISTERED(dpll);
409+
dpll_device_delete_ntf(dpll);
407410
reg = dpll_device_registration_find(dpll, ops, priv);
408411
if (WARN_ON(!reg)) {
409412
mutex_unlock(&dpll_lock);
@@ -528,6 +531,7 @@ __dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin,
528531
if (ret)
529532
goto ref_pin_del;
530533
xa_set_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED);
534+
dpll_pin_create_ntf(pin);
531535

532536
return ret;
533537

@@ -602,6 +606,7 @@ void dpll_pin_unregister(struct dpll_device *dpll, struct dpll_pin *pin,
602606
return;
603607

604608
mutex_lock(&dpll_lock);
609+
dpll_pin_delete_ntf(pin);
605610
__dpll_pin_unregister(dpll, pin, ops, priv);
606611
mutex_unlock(&dpll_lock);
607612
}
@@ -650,15 +655,18 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin,
650655
stop = i;
651656
goto dpll_unregister;
652657
}
658+
dpll_pin_create_ntf(pin);
653659
}
654660
mutex_unlock(&dpll_lock);
655661

656662
return ret;
657663

658664
dpll_unregister:
659665
xa_for_each(&parent->dpll_refs, i, ref)
660-
if (i < stop)
666+
if (i < stop) {
661667
__dpll_pin_unregister(ref->dpll, pin, ops, priv);
668+
dpll_pin_delete_ntf(pin);
669+
}
662670
refcount_dec(&pin->refcount);
663671
dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv);
664672
unlock:
@@ -684,6 +692,7 @@ void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *pin,
684692
unsigned long i;
685693

686694
mutex_lock(&dpll_lock);
695+
dpll_pin_delete_ntf(pin);
687696
dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv);
688697
refcount_dec(&pin->refcount);
689698
xa_for_each(&pin->dpll_refs, i, ref)

0 commit comments

Comments
 (0)