• Home
  • Raw
  • Download

Lines Matching refs:info

67 	struct physmap_flash_info *info;  in physmap_flash_remove()  local
71 info = platform_get_drvdata(dev); in physmap_flash_remove()
73 if (info->cmtd) { in physmap_flash_remove()
74 WARN_ON(mtd_device_unregister(info->cmtd)); in physmap_flash_remove()
76 if (info->cmtd != info->mtds[0]) in physmap_flash_remove()
77 mtd_concat_destroy(info->cmtd); in physmap_flash_remove()
80 for (i = 0; i < info->nmaps; i++) { in physmap_flash_remove()
81 if (info->mtds[i]) in physmap_flash_remove()
82 map_destroy(info->mtds[i]); in physmap_flash_remove()
98 struct physmap_flash_info *info; in physmap_set_vpp() local
107 info = platform_get_drvdata(pdev); in physmap_set_vpp()
109 spin_lock_irqsave(&info->vpp_lock, flags); in physmap_set_vpp()
111 if (++info->vpp_refcnt == 1) /* first nested 'on' */ in physmap_set_vpp()
114 if (--info->vpp_refcnt == 0) /* last nested 'off' */ in physmap_set_vpp()
117 spin_unlock_irqrestore(&info->vpp_lock, flags); in physmap_set_vpp()
121 static void physmap_set_addr_gpios(struct physmap_flash_info *info, in physmap_set_addr_gpios() argument
126 ofs >>= info->win_order; in physmap_set_addr_gpios()
127 if (info->gpio_values == ofs) in physmap_set_addr_gpios()
130 for (i = 0; i < info->gpios->ndescs; i++) { in physmap_set_addr_gpios()
131 if ((BIT(i) & ofs) == (BIT(i) & info->gpio_values)) in physmap_set_addr_gpios()
134 gpiod_set_value(info->gpios->desc[i], !!(BIT(i) & ofs)); in physmap_set_addr_gpios()
137 info->gpio_values = ofs; in physmap_set_addr_gpios()
146 struct physmap_flash_info *info; in physmap_addr_gpios_read() local
151 info = platform_get_drvdata(pdev); in physmap_addr_gpios_read()
152 physmap_set_addr_gpios(info, ofs); in physmap_addr_gpios_read()
154 word = readw(map->virt + (ofs & win_mask(info->win_order))); in physmap_addr_gpios_read()
163 struct physmap_flash_info *info; in physmap_addr_gpios_copy_from() local
166 info = platform_get_drvdata(pdev); in physmap_addr_gpios_copy_from()
169 unsigned int winofs = ofs & win_mask(info->win_order); in physmap_addr_gpios_copy_from()
171 BIT(info->win_order) - winofs); in physmap_addr_gpios_copy_from()
173 physmap_set_addr_gpios(info, ofs); in physmap_addr_gpios_copy_from()
185 struct physmap_flash_info *info; in physmap_addr_gpios_write() local
189 info = platform_get_drvdata(pdev); in physmap_addr_gpios_write()
190 physmap_set_addr_gpios(info, ofs); in physmap_addr_gpios_write()
193 writew(word, map->virt + (ofs & win_mask(info->win_order))); in physmap_addr_gpios_write()
200 struct physmap_flash_info *info; in physmap_addr_gpios_copy_to() local
203 info = platform_get_drvdata(pdev); in physmap_addr_gpios_copy_to()
206 unsigned int winofs = ofs & win_mask(info->win_order); in physmap_addr_gpios_copy_to()
208 BIT(info->win_order) - winofs); in physmap_addr_gpios_copy_to()
210 physmap_set_addr_gpios(info, ofs); in physmap_addr_gpios_copy_to()
335 struct physmap_flash_info *info = platform_get_drvdata(dev); in physmap_flash_of_init() local
346 info->probe_type = of_select_probe_type(dev); in physmap_flash_of_init()
348 info->part_types = of_get_part_probes(dev); in physmap_flash_of_init()
349 if (!info->part_types) in physmap_flash_of_init()
367 for (i = 0; i < info->nmaps; i++) { in physmap_flash_of_init()
368 info->maps[i].name = mtd_name; in physmap_flash_of_init()
369 info->maps[i].swap = swap; in physmap_flash_of_init()
370 info->maps[i].bankwidth = bankwidth; in physmap_flash_of_init()
371 info->maps[i].device_node = dp; in physmap_flash_of_init()
373 err = of_flash_probe_bt1_rom(dev, dp, &info->maps[i]); in physmap_flash_of_init()
377 err = of_flash_probe_gemini(dev, dp, &info->maps[i]); in physmap_flash_of_init()
381 err = of_flash_probe_ixp4xx(dev, dp, &info->maps[i]); in physmap_flash_of_init()
385 err = of_flash_probe_versatile(dev, dp, &info->maps[i]); in physmap_flash_of_init()
398 info->maps[i].phys = NO_XIP; in physmap_flash_of_init()
422 struct physmap_flash_info *info = platform_get_drvdata(dev); in physmap_flash_pdata_init() local
431 info->probe_type = physmap_data->probe_type; in physmap_flash_pdata_init()
432 info->part_types = physmap_data->part_probe_types ? : part_probe_types; in physmap_flash_pdata_init()
433 info->parts = physmap_data->parts; in physmap_flash_pdata_init()
434 info->nparts = physmap_data->nr_parts; in physmap_flash_pdata_init()
442 for (i = 0; i < info->nmaps; i++) { in physmap_flash_pdata_init()
443 info->maps[i].bankwidth = physmap_data->width; in physmap_flash_pdata_init()
444 info->maps[i].pfow_base = physmap_data->pfow_base; in physmap_flash_pdata_init()
445 info->maps[i].set_vpp = physmap_set_vpp; in physmap_flash_pdata_init()
453 struct physmap_flash_info *info; in physmap_flash_probe() local
460 info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL); in physmap_flash_probe()
461 if (!info) in physmap_flash_probe()
464 while (platform_get_resource(dev, IORESOURCE_MEM, info->nmaps)) in physmap_flash_probe()
465 info->nmaps++; in physmap_flash_probe()
467 if (!info->nmaps) in physmap_flash_probe()
470 info->maps = devm_kzalloc(&dev->dev, in physmap_flash_probe()
471 sizeof(*info->maps) * info->nmaps, in physmap_flash_probe()
473 if (!info->maps) in physmap_flash_probe()
476 info->mtds = devm_kzalloc(&dev->dev, in physmap_flash_probe()
477 sizeof(*info->mtds) * info->nmaps, in physmap_flash_probe()
479 if (!info->mtds) in physmap_flash_probe()
482 platform_set_drvdata(dev, info); in physmap_flash_probe()
484 info->gpios = devm_gpiod_get_array_optional(&dev->dev, "addr", in physmap_flash_probe()
486 if (IS_ERR(info->gpios)) in physmap_flash_probe()
487 return PTR_ERR(info->gpios); in physmap_flash_probe()
489 if (info->gpios && info->nmaps > 1) { in physmap_flash_probe()
508 for (i = 0; i < info->nmaps; i++) { in physmap_flash_probe()
512 info->maps[i].virt = devm_ioremap_resource(&dev->dev, res); in physmap_flash_probe()
513 if (IS_ERR(info->maps[i].virt)) { in physmap_flash_probe()
514 err = PTR_ERR(info->maps[i].virt); in physmap_flash_probe()
521 if (!info->maps[i].name) in physmap_flash_probe()
522 info->maps[i].name = dev_name(&dev->dev); in physmap_flash_probe()
524 if (!info->maps[i].phys) in physmap_flash_probe()
525 info->maps[i].phys = res->start; in physmap_flash_probe()
527 info->win_order = get_bitmask_order(resource_size(res)) - 1; in physmap_flash_probe()
528 info->maps[i].size = BIT(info->win_order + in physmap_flash_probe()
529 (info->gpios ? in physmap_flash_probe()
530 info->gpios->ndescs : 0)); in physmap_flash_probe()
532 info->maps[i].map_priv_1 = (unsigned long)dev; in physmap_flash_probe()
534 if (info->gpios) { in physmap_flash_probe()
535 err = physmap_addr_gpios_map_init(&info->maps[i]); in physmap_flash_probe()
546 if (!info->maps[i].read) in physmap_flash_probe()
547 simple_map_init(&info->maps[i]); in physmap_flash_probe()
549 simple_map_init(&info->maps[i]); in physmap_flash_probe()
552 if (info->probe_type) { in physmap_flash_probe()
553 info->mtds[i] = do_map_probe(info->probe_type, in physmap_flash_probe()
554 &info->maps[i]); in physmap_flash_probe()
557 if (!info->mtds[i] && IS_ENABLED(CONFIG_MTD_ROM) && in physmap_flash_probe()
558 strcmp(info->probe_type, "map_rom")) { in physmap_flash_probe()
561 info->probe_type); in physmap_flash_probe()
563 info->mtds[i] = do_map_probe("map_rom", in physmap_flash_probe()
564 &info->maps[i]); in physmap_flash_probe()
570 info->mtds[i] = do_map_probe(rom_probe_types[j], in physmap_flash_probe()
571 &info->maps[i]); in physmap_flash_probe()
572 if (info->mtds[i]) in physmap_flash_probe()
577 if (!info->mtds[i]) { in physmap_flash_probe()
582 info->mtds[i]->dev.parent = &dev->dev; in physmap_flash_probe()
585 if (info->nmaps == 1) { in physmap_flash_probe()
586 info->cmtd = info->mtds[0]; in physmap_flash_probe()
591 info->cmtd = mtd_concat_create(info->mtds, info->nmaps, in physmap_flash_probe()
593 if (!info->cmtd) in physmap_flash_probe()
599 spin_lock_init(&info->vpp_lock); in physmap_flash_probe()
601 mtd_set_of_node(info->cmtd, dev->dev.of_node); in physmap_flash_probe()
602 err = mtd_device_parse_register(info->cmtd, info->part_types, NULL, in physmap_flash_probe()
603 info->parts, info->nparts); in physmap_flash_probe()
617 struct physmap_flash_info *info = platform_get_drvdata(dev); in physmap_flash_shutdown() local
620 for (i = 0; i < info->nmaps && info->mtds[i]; i++) in physmap_flash_shutdown()
621 if (mtd_suspend(info->mtds[i]) == 0) in physmap_flash_shutdown()
622 mtd_resume(info->mtds[i]); in physmap_flash_shutdown()