hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/busses/i2c-digicolor.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * I2C bus driver for Conexant Digicolor SoCs
34 *
45 * Author: Baruch Siach <baruch@tkos.co.il>
56 *
67 * 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.
118 */
129
1310 #include <linux/clk.h>
....@@ -21,7 +18,6 @@
2118 #include <linux/of.h>
2219 #include <linux/platform_device.h>
2320
24
-#define DEFAULT_FREQ 100000
2521 #define TIMEOUT_MS 100
2622
2723 #define II_CONTROL 0x0
....@@ -191,7 +187,7 @@
191187 break;
192188 }
193189 i2c->state = STATE_WRITE;
194
- /* fall through */
190
+ fallthrough;
195191 case STATE_WRITE:
196192 if (i2c->msgbuf_ptr < i2c->msg->len)
197193 dc_i2c_write_buf(i2c);
....@@ -294,7 +290,6 @@
294290 {
295291 struct device_node *np = pdev->dev.of_node;
296292 struct dc_i2c *i2c;
297
- struct resource *r;
298293 int ret = 0, irq;
299294
300295 i2c = devm_kzalloc(&pdev->dev, sizeof(struct dc_i2c), GFP_KERNEL);
....@@ -303,7 +298,7 @@
303298
304299 if (of_property_read_u32(pdev->dev.of_node, "clock-frequency",
305300 &i2c->frequency))
306
- i2c->frequency = DEFAULT_FREQ;
301
+ i2c->frequency = I2C_MAX_STANDARD_MODE_FREQ;
307302
308303 i2c->dev = &pdev->dev;
309304 platform_set_drvdata(pdev, i2c);
....@@ -315,8 +310,7 @@
315310 if (IS_ERR(i2c->clk))
316311 return PTR_ERR(i2c->clk);
317312
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);
320314 if (IS_ERR(i2c->regs))
321315 return PTR_ERR(i2c->regs);
322316