Lines Matching +full:externally +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-only
3 * i2sbus driver -- bus control routines
25 return -ENOMEM; in i2sbus_control_init()
27 INIT_LIST_HEAD(&(*c)->list); in i2sbus_control_init()
29 (*c)->macio = dev->bus->chip; in i2sbus_control_init()
38 /* this is serialised externally */
44 np = i2sdev->sound.ofdev.dev.of_node; in i2sbus_control_add_dev()
45 i2sdev->enable = pmf_find_function(np, "enable"); in i2sbus_control_add_dev()
46 i2sdev->cell_enable = pmf_find_function(np, "cell-enable"); in i2sbus_control_add_dev()
47 i2sdev->clock_enable = pmf_find_function(np, "clock-enable"); in i2sbus_control_add_dev()
48 i2sdev->cell_disable = pmf_find_function(np, "cell-disable"); in i2sbus_control_add_dev()
49 i2sdev->clock_disable = pmf_find_function(np, "clock-disable"); in i2sbus_control_add_dev()
52 * the platform functions -- there's nothing in Darwin that in i2sbus_control_add_dev()
56 if (i2sdev->bus_number != 0 && i2sdev->bus_number != 1 && in i2sbus_control_add_dev()
57 (!i2sdev->enable || in i2sbus_control_add_dev()
58 !i2sdev->cell_enable || !i2sdev->clock_enable || in i2sbus_control_add_dev()
59 !i2sdev->cell_disable || !i2sdev->clock_disable)) { in i2sbus_control_add_dev()
60 pmf_put_function(i2sdev->enable); in i2sbus_control_add_dev()
61 pmf_put_function(i2sdev->cell_enable); in i2sbus_control_add_dev()
62 pmf_put_function(i2sdev->clock_enable); in i2sbus_control_add_dev()
63 pmf_put_function(i2sdev->cell_disable); in i2sbus_control_add_dev()
64 pmf_put_function(i2sdev->clock_disable); in i2sbus_control_add_dev()
65 return -ENODEV; in i2sbus_control_add_dev()
68 list_add(&i2sdev->item, &c->list); in i2sbus_control_add_dev()
76 /* this is serialised externally */ in i2sbus_control_remove_dev()
77 list_del(&i2sdev->item); in i2sbus_control_remove_dev()
78 if (list_empty(&c->list)) in i2sbus_control_remove_dev()
86 struct macio_chip *macio = c->macio; in i2sbus_control_enable()
88 if (i2sdev->enable) in i2sbus_control_enable()
89 return pmf_call_one(i2sdev->enable, &args); in i2sbus_control_enable()
91 if (macio == NULL || macio->base == NULL) in i2sbus_control_enable()
92 return -ENODEV; in i2sbus_control_enable()
94 switch (i2sdev->bus_number) { in i2sbus_control_enable()
104 return -ENODEV; in i2sbus_control_enable()
111 int enable) in i2sbus_control_cell() argument
114 struct macio_chip *macio = c->macio; in i2sbus_control_cell()
116 switch (enable) { in i2sbus_control_cell()
118 if (i2sdev->cell_disable) in i2sbus_control_cell()
119 return pmf_call_one(i2sdev->cell_disable, &args); in i2sbus_control_cell()
122 if (i2sdev->cell_enable) in i2sbus_control_cell()
123 return pmf_call_one(i2sdev->cell_enable, &args); in i2sbus_control_cell()
126 printk(KERN_ERR "i2sbus: INVALID CELL ENABLE VALUE\n"); in i2sbus_control_cell()
127 return -ENODEV; in i2sbus_control_cell()
130 if (macio == NULL || macio->base == NULL) in i2sbus_control_cell()
131 return -ENODEV; in i2sbus_control_cell()
133 switch (i2sdev->bus_number) { in i2sbus_control_cell()
135 if (enable) in i2sbus_control_cell()
141 if (enable) in i2sbus_control_cell()
147 return -ENODEV; in i2sbus_control_cell()
154 int enable) in i2sbus_control_clock() argument
157 struct macio_chip *macio = c->macio; in i2sbus_control_clock()
159 switch (enable) { in i2sbus_control_clock()
161 if (i2sdev->clock_disable) in i2sbus_control_clock()
162 return pmf_call_one(i2sdev->clock_disable, &args); in i2sbus_control_clock()
165 if (i2sdev->clock_enable) in i2sbus_control_clock()
166 return pmf_call_one(i2sdev->clock_enable, &args); in i2sbus_control_clock()
169 printk(KERN_ERR "i2sbus: INVALID CLOCK ENABLE VALUE\n"); in i2sbus_control_clock()
170 return -ENODEV; in i2sbus_control_clock()
173 if (macio == NULL || macio->base == NULL) in i2sbus_control_clock()
174 return -ENODEV; in i2sbus_control_clock()
176 switch (i2sdev->bus_number) { in i2sbus_control_clock()
178 if (enable) in i2sbus_control_clock()
184 if (enable) in i2sbus_control_clock()
190 return -ENODEV; in i2sbus_control_clock()