Lines Matching refs:dev

50 static int bcma_wait_bits(struct bcma_device *dev, u16 reg, u32 bitmask,  in bcma_wait_bits()  argument
57 val = bcma_read32(dev, reg); in bcma_wait_bits()
66 static void bcma_hcd_4716wa(struct bcma_device *dev) in bcma_hcd_4716wa() argument
70 if (dev->bus->chipinfo.id == 0x4716) { in bcma_hcd_4716wa()
73 tmp = bcma_cpu_clock(&dev->bus->drv_mips); in bcma_hcd_4716wa()
85 bcma_write32(dev, 0x524, 0x1); /* write sel to enable */ in bcma_hcd_4716wa()
88 bcma_write32(dev, 0x524, tmp); in bcma_hcd_4716wa()
90 bcma_write32(dev, 0x524, 0x4ab); in bcma_hcd_4716wa()
92 bcma_read32(dev, 0x528); in bcma_hcd_4716wa()
93 bcma_write32(dev, 0x528, 0x80000000); in bcma_hcd_4716wa()
100 static void bcma_hcd_init_chip_mips(struct bcma_device *dev) in bcma_hcd_init_chip_mips() argument
114 if (!bcma_core_is_enabled(dev)) { in bcma_hcd_init_chip_mips()
115 bcma_core_enable(dev, 0); in bcma_hcd_init_chip_mips()
117 if (dev->id.rev >= 5) { in bcma_hcd_init_chip_mips()
119 tmp = bcma_read32(dev, 0x1e0); in bcma_hcd_init_chip_mips()
121 bcma_write32(dev, 0x1e0, tmp); in bcma_hcd_init_chip_mips()
122 if (bcma_wait_bits(dev, 0x1e0, 1 << 24, 100)) in bcma_hcd_init_chip_mips()
126 bcma_write32(dev, 0x200, 0x4ff); in bcma_hcd_init_chip_mips()
128 bcma_write32(dev, 0x200, 0x6ff); in bcma_hcd_init_chip_mips()
132 bcma_write32(dev, 0x524, 0x6b); in bcma_hcd_init_chip_mips()
134 tmp = bcma_read32(dev, 0x524); in bcma_hcd_init_chip_mips()
136 bcma_write32(dev, 0x524, 0xab); in bcma_hcd_init_chip_mips()
138 tmp = bcma_read32(dev, 0x524); in bcma_hcd_init_chip_mips()
140 bcma_write32(dev, 0x524, 0x2b); in bcma_hcd_init_chip_mips()
142 tmp = bcma_read32(dev, 0x524); in bcma_hcd_init_chip_mips()
144 bcma_write32(dev, 0x524, 0x10ab); in bcma_hcd_init_chip_mips()
146 tmp = bcma_read32(dev, 0x524); in bcma_hcd_init_chip_mips()
148 if (bcma_wait_bits(dev, 0x528, 0xc000, 10000)) { in bcma_hcd_init_chip_mips()
149 tmp = bcma_read32(dev, 0x528); in bcma_hcd_init_chip_mips()
153 bcma_write32(dev, 0x528, 0x80000000); in bcma_hcd_init_chip_mips()
154 tmp = bcma_read32(dev, 0x314); in bcma_hcd_init_chip_mips()
156 bcma_write32(dev, 0x200, 0x7ff); in bcma_hcd_init_chip_mips()
160 bcma_write32(dev, 0x510, 0); in bcma_hcd_init_chip_mips()
162 bcma_write32(dev, 0x200, 0x7ff); in bcma_hcd_init_chip_mips()
167 bcma_hcd_4716wa(dev); in bcma_hcd_init_chip_mips()
182 struct device *dev = &core->dev; in bcma_hcd_usb20_old_arm_init() local
191 dev_err(dev, "Could not find PMU core\n"); in bcma_hcd_usb20_old_arm_init()
236 of_platform_default_populate(dev->of_node, NULL, dev); in bcma_hcd_usb20_old_arm_init()
241 static void bcma_hcd_usb20_ns_init_hc(struct bcma_device *dev) in bcma_hcd_usb20_ns_init_hc() argument
246 val = bcma_read32(dev, 0x94); in bcma_hcd_usb20_ns_init_hc()
249 bcma_write32(dev, 0x94, val); in bcma_hcd_usb20_ns_init_hc()
252 val = bcma_read32(dev, 0x9c); in bcma_hcd_usb20_ns_init_hc()
254 bcma_write32(dev, 0x9c, val); in bcma_hcd_usb20_ns_init_hc()
271 struct device *dev = &core->dev; in bcma_hcd_usb20_ns_init() local
279 of_platform_default_populate(dev->of_node, NULL, dev); in bcma_hcd_usb20_ns_init()
284 static void bcma_hci_platform_power_gpio(struct bcma_device *dev, bool val) in bcma_hci_platform_power_gpio() argument
286 struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev); in bcma_hci_platform_power_gpio()
300 static struct platform_device *bcma_hcd_create_pdev(struct bcma_device *dev, in bcma_hcd_create_pdev() argument
315 hci_res[1].start = dev->irq; in bcma_hcd_create_pdev()
322 hci_dev->dev.parent = &dev->dev; in bcma_hcd_create_pdev()
323 hci_dev->dev.dma_mask = &hci_dev->dev.coherent_dma_mask; in bcma_hcd_create_pdev()
346 struct bcma_device *dev = usb_dev->core; in bcma_hcd_usb20_init() local
347 struct bcma_chipinfo *chipinfo = &dev->bus->chipinfo; in bcma_hcd_usb20_init()
351 if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32))) in bcma_hcd_usb20_init()
354 bcma_hcd_init_chip_mips(dev); in bcma_hcd_usb20_init()
357 ohci_addr = dev->addr_s[0]; in bcma_hcd_usb20_init()
363 usb_dev->ohci_dev = bcma_hcd_create_pdev(dev, "ohci-platform", in bcma_hcd_usb20_init()
369 usb_dev->ehci_dev = bcma_hcd_create_pdev(dev, "ehci-platform", in bcma_hcd_usb20_init()
370 dev->addr, &ehci_pdata, in bcma_hcd_usb20_init()
387 struct device *dev = &core->dev; in bcma_hcd_usb30_init() local
391 of_platform_default_populate(dev->of_node, NULL, dev); in bcma_hcd_usb30_init()
403 usb_dev = devm_kzalloc(&core->dev, sizeof(struct bcma_hcd_device), in bcma_hcd_probe()
409 usb_dev->gpio_desc = devm_gpiod_get_optional(&core->dev, "vcc", in bcma_hcd_probe()
412 return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc), in bcma_hcd_probe()
440 static void bcma_hcd_remove(struct bcma_device *dev) in bcma_hcd_remove() argument
442 struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev); in bcma_hcd_remove()
451 bcma_core_disable(dev, 0); in bcma_hcd_remove()
454 static void bcma_hcd_shutdown(struct bcma_device *dev) in bcma_hcd_shutdown() argument
456 bcma_hci_platform_power_gpio(dev, false); in bcma_hcd_shutdown()
457 bcma_core_disable(dev, 0); in bcma_hcd_shutdown()
462 static int bcma_hcd_suspend(struct bcma_device *dev) in bcma_hcd_suspend() argument
464 bcma_hci_platform_power_gpio(dev, false); in bcma_hcd_suspend()
465 bcma_core_disable(dev, 0); in bcma_hcd_suspend()
470 static int bcma_hcd_resume(struct bcma_device *dev) in bcma_hcd_resume() argument
472 bcma_hci_platform_power_gpio(dev, true); in bcma_hcd_resume()
473 bcma_core_enable(dev, 0); in bcma_hcd_resume()