.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * I2C bus driver for Conexant Digicolor SoCs |
---|
3 | 4 | * |
---|
4 | 5 | * Author: Baruch Siach <baruch@tkos.co.il> |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (C) 2015 Paradox Innovation Ltd. |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | 8 | */ |
---|
12 | 9 | |
---|
13 | 10 | #include <linux/clk.h> |
---|
.. | .. |
---|
21 | 18 | #include <linux/of.h> |
---|
22 | 19 | #include <linux/platform_device.h> |
---|
23 | 20 | |
---|
24 | | -#define DEFAULT_FREQ 100000 |
---|
25 | 21 | #define TIMEOUT_MS 100 |
---|
26 | 22 | |
---|
27 | 23 | #define II_CONTROL 0x0 |
---|
.. | .. |
---|
191 | 187 | break; |
---|
192 | 188 | } |
---|
193 | 189 | i2c->state = STATE_WRITE; |
---|
194 | | - /* fall through */ |
---|
| 190 | + fallthrough; |
---|
195 | 191 | case STATE_WRITE: |
---|
196 | 192 | if (i2c->msgbuf_ptr < i2c->msg->len) |
---|
197 | 193 | dc_i2c_write_buf(i2c); |
---|
.. | .. |
---|
294 | 290 | { |
---|
295 | 291 | struct device_node *np = pdev->dev.of_node; |
---|
296 | 292 | struct dc_i2c *i2c; |
---|
297 | | - struct resource *r; |
---|
298 | 293 | int ret = 0, irq; |
---|
299 | 294 | |
---|
300 | 295 | i2c = devm_kzalloc(&pdev->dev, sizeof(struct dc_i2c), GFP_KERNEL); |
---|
.. | .. |
---|
303 | 298 | |
---|
304 | 299 | if (of_property_read_u32(pdev->dev.of_node, "clock-frequency", |
---|
305 | 300 | &i2c->frequency)) |
---|
306 | | - i2c->frequency = DEFAULT_FREQ; |
---|
| 301 | + i2c->frequency = I2C_MAX_STANDARD_MODE_FREQ; |
---|
307 | 302 | |
---|
308 | 303 | i2c->dev = &pdev->dev; |
---|
309 | 304 | platform_set_drvdata(pdev, i2c); |
---|
.. | .. |
---|
315 | 310 | if (IS_ERR(i2c->clk)) |
---|
316 | 311 | return PTR_ERR(i2c->clk); |
---|
317 | 312 | |
---|
318 | | - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
319 | | - i2c->regs = devm_ioremap_resource(&pdev->dev, r); |
---|
| 313 | + i2c->regs = devm_platform_ioremap_resource(pdev, 0); |
---|
320 | 314 | if (IS_ERR(i2c->regs)) |
---|
321 | 315 | return PTR_ERR(i2c->regs); |
---|
322 | 316 | |
---|