diff options
Diffstat (limited to 'arch/blackfin/mach-bf561/boards')
-rw-r--r-- | arch/blackfin/mach-bf561/boards/Kconfig | 1 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 18 |
2 files changed, 15 insertions, 4 deletions
diff --git a/arch/blackfin/mach-bf561/boards/Kconfig b/arch/blackfin/mach-bf561/boards/Kconfig index 1aa529b9f8bb..10e977b56710 100644 --- a/arch/blackfin/mach-bf561/boards/Kconfig +++ b/arch/blackfin/mach-bf561/boards/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 choice prompt "System type" default BFIN561_EZKIT diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 57d1c43726d9..acc5363f60c6 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c @@ -16,6 +16,7 @@ #include <linux/interrupt.h> #include <linux/gpio.h> #include <linux/delay.h> +#include <linux/gpio/machine.h> #include <asm/dma.h> #include <asm/bfin5xx_spi.h> #include <asm/portmux.h> @@ -379,11 +380,17 @@ static struct platform_device bfin_device_gpiokeys = { #if IS_ENABLED(CONFIG_I2C_GPIO) #include <linux/i2c-gpio.h> +static struct gpiod_lookup_table bfin_i2c_gpiod_table = { + .dev_id = "i2c-gpio", + .table = { + GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF1, NULL, 0, + GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), + GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF0, NULL, 1, + GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), + }, +}; + static struct i2c_gpio_platform_data i2c_gpio_data = { - .sda_pin = GPIO_PF1, - .scl_pin = GPIO_PF0, - .sda_is_open_drain = 0, - .scl_is_open_drain = 0, .udelay = 10, }; @@ -633,6 +640,9 @@ static int __init ezkit_init(void) printk(KERN_INFO "%s(): registering device resources\n", __func__); +#if IS_ENABLED(CONFIG_I2C_GPIO) + gpiod_add_lookup_table(&bfin_i2c_gpiod_table); +#endif ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); if (ret < 0) return ret; |