hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/arch/arm/mach-omap1/board-nokia770.c
....@@ -1,15 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-omap1/board-nokia770.c
34 *
45 * Modified from board-generic.c
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107 #include <linux/clkdev.h>
118 #include <linux/irq.h>
129 #include <linux/gpio.h>
10
+#include <linux/gpio/machine.h>
1311 #include <linux/kernel.h>
1412 #include <linux/init.h>
1513 #include <linux/mutex.h>
....@@ -25,7 +23,6 @@
2523 #include <linux/platform_data/keypad-omap.h>
2624 #include <linux/platform_data/lcd-mipid.h>
2725 #include <linux/platform_data/gpio-omap.h>
28
-#include <linux/platform_data/i2c-cbus-gpio.h>
2926
3027 #include <asm/mach-types.h>
3128 #include <asm/mach/arch.h>
....@@ -217,18 +214,19 @@
217214 #endif
218215
219216 #if IS_ENABLED(CONFIG_I2C_CBUS_GPIO)
220
-static struct i2c_cbus_platform_data nokia770_cbus_data = {
221
- .clk_gpio = OMAP_MPUIO(9),
222
- .dat_gpio = OMAP_MPUIO(10),
223
- .sel_gpio = OMAP_MPUIO(11),
217
+static struct gpiod_lookup_table nokia770_cbus_gpio_table = {
218
+ .dev_id = "i2c-cbus-gpio.2",
219
+ .table = {
220
+ GPIO_LOOKUP_IDX("mpuio", 9, NULL, 0, 0), /* clk */
221
+ GPIO_LOOKUP_IDX("mpuio", 10, NULL, 1, 0), /* dat */
222
+ GPIO_LOOKUP_IDX("mpuio", 11, NULL, 2, 0), /* sel */
223
+ { },
224
+ },
224225 };
225226
226227 static struct platform_device nokia770_cbus_device = {
227228 .name = "i2c-cbus-gpio",
228229 .id = 2,
229
- .dev = {
230
- .platform_data = &nokia770_cbus_data,
231
- },
232230 };
233231
234232 static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = {
....@@ -257,6 +255,7 @@
257255 nokia770_i2c_board_info_2[1].irq = gpio_to_irq(tahvo_irq_gpio);
258256 i2c_register_board_info(2, nokia770_i2c_board_info_2,
259257 ARRAY_SIZE(nokia770_i2c_board_info_2));
258
+ gpiod_add_lookup_table(&nokia770_cbus_gpio_table);
260259 platform_device_register(&nokia770_cbus_device);
261260 }
262261 #else /* CONFIG_I2C_CBUS_GPIO */