.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/arm/mach-omap1/board-nokia770.c |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
9 | 6 | */ |
---|
10 | 7 | #include <linux/clkdev.h> |
---|
11 | 8 | #include <linux/irq.h> |
---|
12 | 9 | #include <linux/gpio.h> |
---|
| 10 | +#include <linux/gpio/machine.h> |
---|
13 | 11 | #include <linux/kernel.h> |
---|
14 | 12 | #include <linux/init.h> |
---|
15 | 13 | #include <linux/mutex.h> |
---|
.. | .. |
---|
25 | 23 | #include <linux/platform_data/keypad-omap.h> |
---|
26 | 24 | #include <linux/platform_data/lcd-mipid.h> |
---|
27 | 25 | #include <linux/platform_data/gpio-omap.h> |
---|
28 | | -#include <linux/platform_data/i2c-cbus-gpio.h> |
---|
29 | 26 | |
---|
30 | 27 | #include <asm/mach-types.h> |
---|
31 | 28 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
217 | 214 | #endif |
---|
218 | 215 | |
---|
219 | 216 | #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 | + }, |
---|
224 | 225 | }; |
---|
225 | 226 | |
---|
226 | 227 | static struct platform_device nokia770_cbus_device = { |
---|
227 | 228 | .name = "i2c-cbus-gpio", |
---|
228 | 229 | .id = 2, |
---|
229 | | - .dev = { |
---|
230 | | - .platform_data = &nokia770_cbus_data, |
---|
231 | | - }, |
---|
232 | 230 | }; |
---|
233 | 231 | |
---|
234 | 232 | static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = { |
---|
.. | .. |
---|
257 | 255 | nokia770_i2c_board_info_2[1].irq = gpio_to_irq(tahvo_irq_gpio); |
---|
258 | 256 | i2c_register_board_info(2, nokia770_i2c_board_info_2, |
---|
259 | 257 | ARRAY_SIZE(nokia770_i2c_board_info_2)); |
---|
| 258 | + gpiod_add_lookup_table(&nokia770_cbus_gpio_table); |
---|
260 | 259 | platform_device_register(&nokia770_cbus_device); |
---|
261 | 260 | } |
---|
262 | 261 | #else /* CONFIG_I2C_CBUS_GPIO */ |
---|