Lines Matching refs:mapping
340 struct clk_mapping *mapping = clk->mapping; in clk_establish_mapping() local
345 if (!mapping) { in clk_establish_mapping()
352 clk->mapping = &dummy_mapping; in clk_establish_mapping()
361 mapping = clkp->mapping; in clk_establish_mapping()
362 BUG_ON(!mapping); in clk_establish_mapping()
368 if (!mapping->base && mapping->phys) { in clk_establish_mapping()
369 kref_init(&mapping->ref); in clk_establish_mapping()
371 mapping->base = ioremap(mapping->phys, mapping->len); in clk_establish_mapping()
372 if (unlikely(!mapping->base)) in clk_establish_mapping()
374 } else if (mapping->base) { in clk_establish_mapping()
378 kref_get(&mapping->ref); in clk_establish_mapping()
381 clk->mapping = mapping; in clk_establish_mapping()
383 clk->mapped_reg = clk->mapping->base; in clk_establish_mapping()
384 clk->mapped_reg += (phys_addr_t)clk->enable_reg - clk->mapping->phys; in clk_establish_mapping()
390 struct clk_mapping *mapping; in clk_destroy_mapping() local
392 mapping = container_of(kref, struct clk_mapping, ref); in clk_destroy_mapping()
394 iounmap(mapping->base); in clk_destroy_mapping()
399 struct clk_mapping *mapping = clk->mapping; in clk_teardown_mapping() local
402 if (mapping == &dummy_mapping) in clk_teardown_mapping()
405 kref_put(&mapping->ref, clk_destroy_mapping); in clk_teardown_mapping()
406 clk->mapping = NULL; in clk_teardown_mapping()