Lines Matching refs:dev

68 	struct device			*dev;
163 dev_dbg(sm->dev, "MISCT=%08lx, PM0=%08lx, PM1=%08lx\n",
166 dev_dbg(sm->dev, "PLL2 = %ld.%ld MHz (%ld), SDCLK0=%08lx, SDCLK1=%08lx\n",
169 dev_dbg(sm->dev, "SDRAM: PM0=%ld, PM1=%ld\n", sdclk0, sdclk1);
171 dev_dbg(sm->dev, "PM0[%c]: "
180 dev_dbg(sm->dev, "PM1[%c]: "
194 dev_info(sm->dev, "System Control %08x\n",
196 dev_info(sm->dev, "Misc Control %08x\n",
198 dev_info(sm->dev, "GPIO Control Low %08x\n",
200 dev_info(sm->dev, "GPIO Control Hi %08x\n",
202 dev_info(sm->dev, "DRAM Control %08x\n",
204 dev_info(sm->dev, "Arbitration Ctrl %08x\n",
206 dev_info(sm->dev, "Misc Timing %08x\n",
212 dev_info(sm->dev, "CurrentGate %08x\n",
214 dev_info(sm->dev, "CurrentClock %08x\n",
216 dev_info(sm->dev, "PowerModeControl %08x\n",
253 int sm501_misc_control(struct device *dev,
256 struct sm501_devdata *sm = dev_get_drvdata(dev);
270 dev_dbg(sm->dev, "MISC_CONTROL %08lx\n", misc);
285 unsigned long sm501_modify_reg(struct device *dev,
290 struct sm501_devdata *sm = dev_get_drvdata(dev);
315 int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)
317 struct sm501_devdata *sm = dev_get_drvdata(dev);
331 dev_err(dev, "%s: bad unit %d\n", __func__, unit);
335 dev_dbg(sm->dev, "%s: unit %d, cur %d, to %d\n", __func__, unit,
339 dev_err(sm->dev, "unit %d is already shutdown\n", unit);
377 dev_dbg(sm->dev, "gate %08lx, clock %08lx, mode %08lx\n",
508 unsigned long sm501_set_clock(struct device *dev,
512 struct sm501_devdata *sm = dev_get_drvdata(dev);
621 dev_dbg(sm->dev, "gate %08lx, clock %08lx, mode %08lx\n",
639 unsigned long sm501_find_clock(struct device *dev,
643 struct sm501_devdata *sm = dev_get_drvdata(dev);
688 static void sm501_device_release(struct device *dev)
690 kfree(to_sm_device(to_platform_device(dev)));
711 smdev->pdev.dev.release = sm501_device_release;
715 smdev->pdev.dev.parent = sm->dev;
716 smdev->pdev.dev.coherent_dma_mask = 0xffffffff;
723 smdev->pdev.dev.platform_data = (void *)(smdev+1);
748 dev_dbg(sm->dev, "registered %s\n", pdev->name);
751 dev_err(sm->dev, "error registering %s (%d)\n",
843 uart_data = dev_get_platdata(&pdev->dev);
847 sm501_unit_power(sm->dev, SM501_GATE_UART0, 1);
848 sm501_modify_reg(sm->dev, SM501_IRQ_MASK, 1 << 12, 0);
849 sm501_modify_reg(sm->dev, SM501_GPIO63_32_CONTROL, 0x01e0, 0);
853 sm501_unit_power(sm->dev, SM501_GATE_UART1, 1);
854 sm501_modify_reg(sm->dev, SM501_IRQ_MASK, 1 << 13, 0);
855 sm501_modify_reg(sm->dev, SM501_GPIO63_32_CONTROL, 0x1e00, 0);
907 dev_info(sm501_gpio_to_dev(smchip->ourgpio)->dev,
928 dev_dbg(sm501_gpio_to_dev(smgpio)->dev, "%s(%p,%d)\n",
953 dev_dbg(sm501_gpio_to_dev(smgpio)->dev, "%s(%p,%d)\n",
980 dev_dbg(sm501_gpio_to_dev(smgpio)->dev, "%s(%p,%d,%d)\n",
1046 dev_dbg(sm->dev, "registering gpio block %08llx\n",
1053 dev_err(sm->dev, "gpio: failed to request region\n");
1059 dev_err(sm->dev, "gpio: failed to remap registers\n");
1068 dev_err(sm->dev, "failed to add low chip\n");
1074 dev_err(sm->dev, "failed to add high chip\n");
1142 lookup = devm_kzalloc(&pdev->dev, struct_size(lookup, table, 3),
1158 icd = dev_get_platdata(&pdev->dev);
1170 dev_info(sm->dev, "registering i2c-%d: sda=%d, scl=%d\n",
1198 static ssize_t dbg_regs_show(struct device *dev,
1201 struct sm501_devdata *sm = dev_get_drvdata(dev) ;
1246 sm501_misc_control(sm->dev,
1255 dev_info(sm->dev, "setting M1XCLK to %ld\n", init->m1xclk);
1256 sm501_set_clock(sm->dev, SM501_CLOCK_M1XCLK, init->m1xclk);
1260 dev_info(sm->dev, "setting MCLK to %ld\n", init->mclk);
1261 sm501_set_clock(sm->dev, SM501_CLOCK_MCLK, init->mclk);
1314 dev_err(sm->dev, "incorrect device id %08lx\n", devid);
1324 dev_info(sm->dev, "SM501 At %p: Version %08lx, %ld Mb, IRQ %d\n",
1331 ret = device_create_file(sm->dev, &dev_attr_dbg_regs);
1333 dev_err(sm->dev, "failed to create debug regs file\n");
1355 dev_err(sm->dev, "no gpio available for i2c gpio.\n");
1362 dev_err(sm->dev, "M1X and M clocks sourced from different "
1373 static int sm501_plat_probe(struct platform_device *dev)
1384 sm->dev = &dev->dev;
1385 sm->pdev_id = dev->id;
1386 sm->platdata = dev_get_platdata(&dev->dev);
1388 ret = platform_get_irq(dev, 0);
1393 sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);
1394 sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
1396 dev_err(&dev->dev, "failed to get IO resource\n");
1404 dev_err(&dev->dev, "cannot claim registers\n");
1409 platform_set_drvdata(dev, sm);
1413 dev_err(&dev->dev, "cannot remap registers\n");
1445 if (pd->get_power(sm->dev) == on) {
1446 dev_dbg(sm->dev, "is already %d\n", on);
1452 dev_dbg(sm->dev, "setting power to %d\n", on);
1454 pd->set_power(sm->dev, on);
1489 dev_info(sm->dev, "SM501_MISC_CONTROL changed over sleep\n");
1555 static int sm501_pci_probe(struct pci_dev *dev,
1568 dev->dev.platform_data = sm->platdata = &sm501_pci_platdata;
1571 sm->pdev_id = 32 + dev->devfn;
1573 pci_set_drvdata(dev, sm);
1575 err = pci_enable_device(dev);
1577 dev_err(&dev->dev, "cannot enable device\n");
1581 sm->dev = &dev->dev;
1582 sm->irq = dev->irq;
1594 if (!(pci_resource_flags(dev, 0) & IORESOURCE_MEM)) {
1595 dev_err(&dev->dev, "region #0 is not memory?\n");
1600 if (!(pci_resource_flags(dev, 1) & IORESOURCE_MEM)) {
1601 dev_err(&dev->dev, "region #1 is not memory?\n");
1608 sm->io_res = &dev->resource[1];
1609 sm->mem_res = &dev->resource[0];
1614 dev_err(&dev->dev, "cannot claim registers\n");
1619 sm->regs = pci_ioremap_bar(dev, 1);
1621 dev_err(&dev->dev, "cannot remap registers\n");
1632 pci_disable_device(dev);
1653 device_remove_file(sm->dev, &dev_attr_dbg_regs);
1658 static void sm501_pci_remove(struct pci_dev *dev)
1660 struct sm501_devdata *sm = pci_get_drvdata(dev);
1667 pci_disable_device(dev);
1670 static int sm501_plat_remove(struct platform_device *dev)
1672 struct sm501_devdata *sm = platform_get_drvdata(dev);