i2c-exynos5.c (a4721ced760684d1776bf31f7925aa41bb3f4846) i2c-exynos5.c (e0442d76213981ab48e8ea0874bb6c47e3af5a36)
1// SPDX-License-Identifier: GPL-2.0-only
2/**
3 * i2c-exynos5.c - Samsung Exynos5 I2C Controller Driver
4 *
5 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
6*/
7
8#include <linux/kernel.h>

--- 722 unchanged lines hidden (view full) ---

731 .master_xfer = exynos5_i2c_xfer,
732 .functionality = exynos5_i2c_func,
733};
734
735static int exynos5_i2c_probe(struct platform_device *pdev)
736{
737 struct device_node *np = pdev->dev.of_node;
738 struct exynos5_i2c *i2c;
1// SPDX-License-Identifier: GPL-2.0-only
2/**
3 * i2c-exynos5.c - Samsung Exynos5 I2C Controller Driver
4 *
5 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
6*/
7
8#include <linux/kernel.h>

--- 722 unchanged lines hidden (view full) ---

731 .master_xfer = exynos5_i2c_xfer,
732 .functionality = exynos5_i2c_func,
733};
734
735static int exynos5_i2c_probe(struct platform_device *pdev)
736{
737 struct device_node *np = pdev->dev.of_node;
738 struct exynos5_i2c *i2c;
739 struct resource *mem;
740 int ret;
741
742 i2c = devm_kzalloc(&pdev->dev, sizeof(struct exynos5_i2c), GFP_KERNEL);
743 if (!i2c)
744 return -ENOMEM;
745
746 if (of_property_read_u32(np, "clock-frequency", &i2c->op_clock))
747 i2c->op_clock = I2C_MAX_STANDARD_MODE_FREQ;

--- 9 unchanged lines hidden (view full) ---

757 dev_err(&pdev->dev, "cannot get clock\n");
758 return -ENOENT;
759 }
760
761 ret = clk_prepare_enable(i2c->clk);
762 if (ret)
763 return ret;
764
739 int ret;
740
741 i2c = devm_kzalloc(&pdev->dev, sizeof(struct exynos5_i2c), GFP_KERNEL);
742 if (!i2c)
743 return -ENOMEM;
744
745 if (of_property_read_u32(np, "clock-frequency", &i2c->op_clock))
746 i2c->op_clock = I2C_MAX_STANDARD_MODE_FREQ;

--- 9 unchanged lines hidden (view full) ---

756 dev_err(&pdev->dev, "cannot get clock\n");
757 return -ENOENT;
758 }
759
760 ret = clk_prepare_enable(i2c->clk);
761 if (ret)
762 return ret;
763
765 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
766 i2c->regs = devm_ioremap_resource(&pdev->dev, mem);
764 i2c->regs = devm_platform_ioremap_resource(pdev, 0);
767 if (IS_ERR(i2c->regs)) {
768 ret = PTR_ERR(i2c->regs);
769 goto err_clk;
770 }
771
772 i2c->adap.dev.of_node = np;
773 i2c->adap.algo_data = i2c;
774 i2c->adap.dev.parent = &pdev->dev;

--- 110 unchanged lines hidden ---
765 if (IS_ERR(i2c->regs)) {
766 ret = PTR_ERR(i2c->regs);
767 goto err_clk;
768 }
769
770 i2c->adap.dev.of_node = np;
771 i2c->adap.algo_data = i2c;
772 i2c->adap.dev.parent = &pdev->dev;

--- 110 unchanged lines hidden ---