diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2017-11-01 23:44:52 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-11-01 23:45:46 +0100 |
commit | 4ee045f4e9b73c4635ceedbb1ee40e0b3ecbdbcc (patch) | |
tree | f75e20907a3dc01e780ca75b1696f7d30c179944 /arch/mips/ath79 | |
parent | i2c: omap: Trigger bus recovery in lockup case (diff) | |
parent | i2c: gpio: Add support for named gpios in DT (diff) | |
download | linux-4ee045f4e9b73c4635ceedbb1ee40e0b3ecbdbcc.tar.xz linux-4ee045f4e9b73c4635ceedbb1ee40e0b3ecbdbcc.zip |
Merge branch 'for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio into i2c/for-4.15
Refactor i2c-gpio and its users to use gpiod. Done by GPIO maintainer
LinusW.
Diffstat (limited to 'arch/mips/ath79')
-rw-r--r-- | arch/mips/ath79/mach-pb44.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/mips/ath79/mach-pb44.c b/arch/mips/ath79/mach-pb44.c index be78298dffb4..6b2c6f3baefa 100644 --- a/arch/mips/ath79/mach-pb44.c +++ b/arch/mips/ath79/mach-pb44.c @@ -11,7 +11,7 @@ #include <linux/init.h> #include <linux/platform_device.h> #include <linux/i2c.h> -#include <linux/i2c-gpio.h> +#include <linux/gpio/machine.h> #include <linux/platform_data/pcf857x.h> #include "machtypes.h" @@ -33,16 +33,21 @@ #define PB44_KEYS_POLL_INTERVAL 20 /* msecs */ #define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL) -static struct i2c_gpio_platform_data pb44_i2c_gpio_data = { - .sda_pin = PB44_GPIO_I2C_SDA, - .scl_pin = PB44_GPIO_I2C_SCL, +static struct gpiod_lookup_table pb44_i2c_gpiod_table = { + .dev_id = "i2c-gpio", + .table = { + GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SDA, + NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), + GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SCL, + NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), + }, }; static struct platform_device pb44_i2c_gpio_device = { .name = "i2c-gpio", .id = 0, .dev = { - .platform_data = &pb44_i2c_gpio_data, + .platform_data = NULL, } }; @@ -103,6 +108,7 @@ static struct ath79_spi_platform_data pb44_spi_data = { static void __init pb44_init(void) { + gpiod_add_lookup_table(&pb44_i2c_gpiod_table); i2c_register_board_info(0, pb44_i2c_board_info, ARRAY_SIZE(pb44_i2c_board_info)); platform_device_register(&pb44_i2c_gpio_device); |