Lines Matching refs:cell
28 const struct mfd_cell *cell = mfd_get_cell(pdev); in mfd_cell_enable() local
32 if (atomic_inc_return(cell->usage_count) == 1) in mfd_cell_enable()
33 err = cell->enable(pdev); in mfd_cell_enable()
37 atomic_dec(cell->usage_count); in mfd_cell_enable()
45 const struct mfd_cell *cell = mfd_get_cell(pdev); in mfd_cell_disable() local
49 if (atomic_dec_return(cell->usage_count) == 0) in mfd_cell_disable()
50 err = cell->disable(pdev); in mfd_cell_disable()
54 atomic_inc(cell->usage_count); in mfd_cell_disable()
57 WARN_ON(atomic_read(cell->usage_count) < 0); in mfd_cell_disable()
64 const struct mfd_cell *cell, in mfd_platform_add_cell() argument
67 if (!cell) in mfd_platform_add_cell()
70 pdev->mfd_cell = kmemdup(cell, sizeof(*cell), GFP_KERNEL); in mfd_platform_add_cell()
79 static void mfd_acpi_add_device(const struct mfd_cell *cell, in mfd_acpi_add_device() argument
82 const struct mfd_cell_acpi_match *match = cell->acpi_match; in mfd_acpi_add_device()
130 static inline void mfd_acpi_add_device(const struct mfd_cell *cell, in mfd_acpi_add_device() argument
137 const struct mfd_cell *cell, atomic_t *usage_count, in mfd_add_device() argument
151 platform_id = id + cell->id; in mfd_add_device()
153 pdev = platform_device_alloc(cell->name, platform_id); in mfd_add_device()
157 res = kcalloc(cell->num_resources, sizeof(*res), GFP_KERNEL); in mfd_add_device()
168 &pdev->dev, cell->parent_supplies, in mfd_add_device()
169 parent, cell->parent_supplies, in mfd_add_device()
170 cell->num_parent_supplies); in mfd_add_device()
174 if (parent->of_node && cell->of_compatible) { in mfd_add_device()
176 if (of_device_is_compatible(np, cell->of_compatible)) { in mfd_add_device()
184 mfd_acpi_add_device(cell, pdev); in mfd_add_device()
186 if (cell->pdata_size) { in mfd_add_device()
188 cell->platform_data, cell->pdata_size); in mfd_add_device()
193 if (cell->properties) { in mfd_add_device()
194 ret = platform_device_add_properties(pdev, cell->properties); in mfd_add_device()
199 ret = mfd_platform_add_cell(pdev, cell, usage_count); in mfd_add_device()
203 for (r = 0; r < cell->num_resources; r++) { in mfd_add_device()
204 res[r].name = cell->resources[r].name; in mfd_add_device()
205 res[r].flags = cell->resources[r].flags; in mfd_add_device()
208 if ((cell->resources[r].flags & IORESOURCE_MEM) && mem_base) { in mfd_add_device()
211 cell->resources[r].start; in mfd_add_device()
213 cell->resources[r].end; in mfd_add_device()
214 } else if (cell->resources[r].flags & IORESOURCE_IRQ) { in mfd_add_device()
217 WARN_ON(cell->resources[r].start != in mfd_add_device()
218 cell->resources[r].end); in mfd_add_device()
220 domain, cell->resources[r].start); in mfd_add_device()
223 cell->resources[r].start; in mfd_add_device()
225 cell->resources[r].end; in mfd_add_device()
228 res[r].parent = cell->resources[r].parent; in mfd_add_device()
229 res[r].start = cell->resources[r].start; in mfd_add_device()
230 res[r].end = cell->resources[r].end; in mfd_add_device()
233 if (!cell->ignore_resource_conflicts) { in mfd_add_device()
242 ret = platform_device_add_resources(pdev, res, cell->num_resources); in mfd_add_device()
250 if (cell->pm_runtime_no_callbacks) in mfd_add_device()
259 cell->parent_supplies, in mfd_add_device()
260 cell->num_parent_supplies); in mfd_add_device()
318 const struct mfd_cell *cell; in mfd_remove_devices_fn() local
325 cell = mfd_get_cell(pdev); in mfd_remove_devices_fn()
327 regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, in mfd_remove_devices_fn()
328 cell->num_parent_supplies); in mfd_remove_devices_fn()
331 if (!*usage_count || (cell->usage_count < *usage_count)) in mfd_remove_devices_fn()
332 *usage_count = cell->usage_count; in mfd_remove_devices_fn()
385 int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones) in mfd_clone_cell() argument
393 dev = bus_find_device_by_name(&platform_bus_type, NULL, cell); in mfd_clone_cell()
395 printk(KERN_ERR "failed to find device for cell %s\n", cell); in mfd_clone_cell()