Lines Matching refs:dev

330 		dev_warn(i2c->adap.dev.parent,  in ocores_poll_wait()
420 static int ocores_init(struct device *dev, struct ocores_i2c *i2c) in ocores_init() argument
435 dev_err(dev, in ocores_init()
531 struct device_node *np = pdev->dev.of_node; in ocores_i2c_of_probe()
541 dev_err(&pdev->dev, "invalid regstep %d\n", in ocores_i2c_of_probe()
546 dev_warn(&pdev->dev, in ocores_i2c_of_probe()
555 i2c->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL); in ocores_i2c_of_probe()
557 return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), in ocores_i2c_of_probe()
567 dev_err(&pdev->dev, in ocores_i2c_of_probe()
572 dev_warn(&pdev->dev, in ocores_i2c_of_probe()
581 of_property_read_u32(pdev->dev.of_node, "reg-io-width", in ocores_i2c_of_probe()
584 match = of_match_node(ocores_i2c_match, pdev->dev.of_node); in ocores_i2c_of_probe()
586 dev_dbg(&pdev->dev, "GRLIB variant of i2c-ocores\n"); in ocores_i2c_of_probe()
606 i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); in ocores_i2c_probe()
614 i2c->base = devm_ioremap_resource(&pdev->dev, res); in ocores_i2c_probe()
622 if (!devm_request_region(&pdev->dev, res->start, in ocores_i2c_probe()
625 dev_err(&pdev->dev, "Can't get I/O resource.\n"); in ocores_i2c_probe()
632 pdata = dev_get_platdata(&pdev->dev); in ocores_i2c_probe()
652 of_device_is_big_endian(pdev->dev.of_node); in ocores_i2c_probe()
671 dev_err(&pdev->dev, "Unsupported I/O width (%d)\n", in ocores_i2c_probe()
685 if (of_device_is_compatible(pdev->dev.of_node, in ocores_i2c_probe()
699 ret = devm_request_any_context_irq(&pdev->dev, irq, in ocores_i2c_probe()
703 dev_err(&pdev->dev, "Cannot claim IRQ\n"); in ocores_i2c_probe()
708 ret = ocores_init(&pdev->dev, i2c); in ocores_i2c_probe()
716 i2c->adap.dev.parent = &pdev->dev; in ocores_i2c_probe()
717 i2c->adap.dev.of_node = pdev->dev.of_node; in ocores_i2c_probe()
746 static int ocores_i2c_suspend(struct device *dev) in ocores_i2c_suspend() argument
748 struct ocores_i2c *i2c = dev_get_drvdata(dev); in ocores_i2c_suspend()
759 static int ocores_i2c_resume(struct device *dev) in ocores_i2c_resume() argument
761 struct ocores_i2c *i2c = dev_get_drvdata(dev); in ocores_i2c_resume()
767 return dev_err_probe(dev, ret, "clk_prepare_enable failed\n"); in ocores_i2c_resume()
771 return ocores_init(dev, i2c); in ocores_i2c_resume()