i2c-qup.c (a4721ced760684d1776bf31f7925aa41bb3f4846) i2c-qup.c (e0442d76213981ab48e8ea0874bb6c47e3af5a36)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2009-2013, 2016-2018, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2014, Sony Mobile Communications AB.
5 *
6 */
7
8#include <linux/acpi.h>

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

1655};
1656MODULE_DEVICE_TABLE(acpi, qup_i2c_acpi_match);
1657
1658static int qup_i2c_probe(struct platform_device *pdev)
1659{
1660 static const int blk_sizes[] = {4, 16, 32};
1661 struct qup_i2c_dev *qup;
1662 unsigned long one_bit_t;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2009-2013, 2016-2018, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2014, Sony Mobile Communications AB.
5 *
6 */
7
8#include <linux/acpi.h>

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

1655};
1656MODULE_DEVICE_TABLE(acpi, qup_i2c_acpi_match);
1657
1658static int qup_i2c_probe(struct platform_device *pdev)
1659{
1660 static const int blk_sizes[] = {4, 16, 32};
1661 struct qup_i2c_dev *qup;
1662 unsigned long one_bit_t;
1663 struct resource *res;
1664 u32 io_mode, hw_ver, size;
1665 int ret, fs_div, hs_div;
1666 u32 src_clk_freq = DEFAULT_SRC_CLK;
1667 u32 clk_freq = DEFAULT_CLK_FREQ;
1668 int blocks;
1669 bool is_qup_v1;
1670
1671 qup = devm_kzalloc(&pdev->dev, sizeof(*qup), GFP_KERNEL);

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

1752nodma:
1753 /* We support frequencies up to FAST Mode Plus (1MHz) */
1754 if (!clk_freq || clk_freq > I2C_MAX_FAST_MODE_PLUS_FREQ) {
1755 dev_err(qup->dev, "clock frequency not supported %d\n",
1756 clk_freq);
1757 return -EINVAL;
1758 }
1759
1663 u32 io_mode, hw_ver, size;
1664 int ret, fs_div, hs_div;
1665 u32 src_clk_freq = DEFAULT_SRC_CLK;
1666 u32 clk_freq = DEFAULT_CLK_FREQ;
1667 int blocks;
1668 bool is_qup_v1;
1669
1670 qup = devm_kzalloc(&pdev->dev, sizeof(*qup), GFP_KERNEL);

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

1751nodma:
1752 /* We support frequencies up to FAST Mode Plus (1MHz) */
1753 if (!clk_freq || clk_freq > I2C_MAX_FAST_MODE_PLUS_FREQ) {
1754 dev_err(qup->dev, "clock frequency not supported %d\n",
1755 clk_freq);
1756 return -EINVAL;
1757 }
1758
1760 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1761 qup->base = devm_ioremap_resource(qup->dev, res);
1759 qup->base = devm_platform_ioremap_resource(pdev, 0);
1762 if (IS_ERR(qup->base))
1763 return PTR_ERR(qup->base);
1764
1765 qup->irq = platform_get_irq(pdev, 0);
1766 if (qup->irq < 0) {
1767 dev_err(qup->dev, "No IRQ defined\n");
1768 return qup->irq;
1769 }

--- 229 unchanged lines hidden ---
1760 if (IS_ERR(qup->base))
1761 return PTR_ERR(qup->base);
1762
1763 qup->irq = platform_get_irq(pdev, 0);
1764 if (qup->irq < 0) {
1765 dev_err(qup->dev, "No IRQ defined\n");
1766 return qup->irq;
1767 }

--- 229 unchanged lines hidden ---