Lines Matching refs:cell
32 const struct mfd_cell *cell = mfd_get_cell(pdev); in mfd_cell_enable() local
36 if (atomic_inc_return(cell->usage_count) == 1) in mfd_cell_enable()
37 err = cell->enable(pdev); in mfd_cell_enable()
41 atomic_dec(cell->usage_count); in mfd_cell_enable()
49 const struct mfd_cell *cell = mfd_get_cell(pdev); in mfd_cell_disable() local
53 if (atomic_dec_return(cell->usage_count) == 0) in mfd_cell_disable()
54 err = cell->disable(pdev); in mfd_cell_disable()
58 atomic_inc(cell->usage_count); in mfd_cell_disable()
61 WARN_ON(atomic_read(cell->usage_count) < 0); in mfd_cell_disable()
68 const struct mfd_cell *cell, in mfd_platform_add_cell() argument
71 if (!cell) in mfd_platform_add_cell()
74 pdev->mfd_cell = kmemdup(cell, sizeof(*cell), GFP_KERNEL); in mfd_platform_add_cell()
83 static void mfd_acpi_add_device(const struct mfd_cell *cell, in mfd_acpi_add_device() argument
86 const struct mfd_cell_acpi_match *match = cell->acpi_match; in mfd_acpi_add_device()
134 static inline void mfd_acpi_add_device(const struct mfd_cell *cell, in mfd_acpi_add_device() argument
141 const struct mfd_cell *cell, atomic_t *usage_count, in mfd_add_device() argument
155 platform_id = id + cell->id; in mfd_add_device()
157 pdev = platform_device_alloc(cell->name, platform_id); in mfd_add_device()
161 res = kzalloc(sizeof(*res) * cell->num_resources, GFP_KERNEL); in mfd_add_device()
172 &pdev->dev, cell->parent_supplies, in mfd_add_device()
173 parent, cell->parent_supplies, in mfd_add_device()
174 cell->num_parent_supplies); in mfd_add_device()
178 if (parent->of_node && cell->of_compatible) { in mfd_add_device()
180 if (of_device_is_compatible(np, cell->of_compatible)) { in mfd_add_device()
187 mfd_acpi_add_device(cell, pdev); in mfd_add_device()
189 if (cell->pdata_size) { in mfd_add_device()
191 cell->platform_data, cell->pdata_size); in mfd_add_device()
196 if (cell->properties) { in mfd_add_device()
197 ret = platform_device_add_properties(pdev, cell->properties); in mfd_add_device()
202 ret = mfd_platform_add_cell(pdev, cell, usage_count); in mfd_add_device()
206 for (r = 0; r < cell->num_resources; r++) { in mfd_add_device()
207 res[r].name = cell->resources[r].name; in mfd_add_device()
208 res[r].flags = cell->resources[r].flags; in mfd_add_device()
211 if ((cell->resources[r].flags & IORESOURCE_MEM) && mem_base) { in mfd_add_device()
214 cell->resources[r].start; in mfd_add_device()
216 cell->resources[r].end; in mfd_add_device()
217 } else if (cell->resources[r].flags & IORESOURCE_IRQ) { in mfd_add_device()
220 WARN_ON(cell->resources[r].start != in mfd_add_device()
221 cell->resources[r].end); in mfd_add_device()
223 domain, cell->resources[r].start); in mfd_add_device()
226 cell->resources[r].start; in mfd_add_device()
228 cell->resources[r].end; in mfd_add_device()
231 res[r].parent = cell->resources[r].parent; in mfd_add_device()
232 res[r].start = cell->resources[r].start; in mfd_add_device()
233 res[r].end = cell->resources[r].end; in mfd_add_device()
236 if (!cell->ignore_resource_conflicts) { in mfd_add_device()
245 ret = platform_device_add_resources(pdev, res, cell->num_resources); in mfd_add_device()
253 if (cell->pm_runtime_no_callbacks) in mfd_add_device()
262 cell->parent_supplies, in mfd_add_device()
263 cell->num_parent_supplies); in mfd_add_device()
308 const struct mfd_cell *cell; in mfd_remove_devices_fn() local
315 cell = mfd_get_cell(pdev); in mfd_remove_devices_fn()
317 regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, in mfd_remove_devices_fn()
318 cell->num_parent_supplies); in mfd_remove_devices_fn()
321 if (!*usage_count || (cell->usage_count < *usage_count)) in mfd_remove_devices_fn()
322 *usage_count = cell->usage_count; in mfd_remove_devices_fn()
375 int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones) in mfd_clone_cell() argument
383 dev = bus_find_device_by_name(&platform_bus_type, NULL, cell); in mfd_clone_cell()
385 printk(KERN_ERR "failed to find device for cell %s\n", cell); in mfd_clone_cell()