aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-09-10 17:03:32 -0400
committerLinus Walleij <linus.walleij@linaro.org>2017-10-30 03:42:43 -0400
commit4d0ce62c0a02e41a65cfdcfe277f5be430edc371 (patch)
treed0423ff99969921af3260866c5fae1d6c1117896
parent7bb75029ef34838604357350b4f24d6535e9d01f (diff)
i2c: gpio: Augment all boardfiles to use open drain
We now handle the open drain mode internally in the I2C GPIO driver, but we will get warnings from the gpiolib that we override the default mode of the line so it becomes open drain. We can fix all in-kernel users by simply passing the right flag along in the descriptor table, and we already touched all of these files in the series so let's just tidy it up. Cc: Steven Miao <realmz6@gmail.com> Cc: Ralf Baechle <ralf@linux-mips.org> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Wu, Aaron <Aaron.Wu@analog.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/mach-ep93xx/core.c6
-rw-r--r--arch/arm/mach-ixp4xx/avila-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/fsg-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c4
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c4
-rw-r--r--arch/arm/mach-ks8695/board-acs5k.c6
-rw-r--r--arch/arm/mach-pxa/palmz72.c6
-rw-r--r--arch/arm/mach-pxa/viper.c8
-rw-r--r--arch/arm/mach-sa1100/simpad.c6
-rw-r--r--arch/blackfin/mach-bf533/boards/blackstamp.c4
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c4
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c4
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c4
-rw-r--r--arch/mips/alchemy/board-gpr.c4
-rw-r--r--arch/mips/ath79/mach-pb44.c4
-rw-r--r--drivers/mfd/sm501.c4
18 files changed, 48 insertions, 36 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 7e99fe829ad1..e70feec6fad5 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -326,8 +326,10 @@ static struct gpiod_lookup_table ep93xx_i2c_gpiod_table = {
326 .dev_id = "i2c-gpio", 326 .dev_id = "i2c-gpio",
327 .table = { 327 .table = {
328 /* Use local offsets on gpiochip/port "G" */ 328 /* Use local offsets on gpiochip/port "G" */
329 GPIO_LOOKUP_IDX("G", 1, NULL, 0, GPIO_ACTIVE_HIGH), 329 GPIO_LOOKUP_IDX("G", 1, NULL, 0,
330 GPIO_LOOKUP_IDX("G", 0, NULL, 1, GPIO_ACTIVE_HIGH), 330 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
331 GPIO_LOOKUP_IDX("G", 0, NULL, 1,
332 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
331 }, 333 },
332}; 334};
333 335
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
index 72122b5e7f28..bb6fbfc9b11a 100644
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -53,9 +53,9 @@ static struct gpiod_lookup_table avila_i2c_gpiod_table = {
53 .dev_id = "i2c-gpio", 53 .dev_id = "i2c-gpio",
54 .table = { 54 .table = {
55 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", AVILA_SDA_PIN, 55 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", AVILA_SDA_PIN,
56 NULL, 0, GPIO_ACTIVE_HIGH), 56 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
57 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", AVILA_SCL_PIN, 57 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", AVILA_SCL_PIN,
58 NULL, 1, GPIO_ACTIVE_HIGH), 58 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
59 }, 59 },
60}; 60};
61 61
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 68ccd669051b..af543dd3da5d 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -72,9 +72,9 @@ static struct gpiod_lookup_table dsmg600_i2c_gpiod_table = {
72 .dev_id = "i2c-gpio", 72 .dev_id = "i2c-gpio",
73 .table = { 73 .table = {
74 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SDA_PIN, 74 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SDA_PIN,
75 NULL, 0, GPIO_ACTIVE_HIGH), 75 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
76 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SCL_PIN, 76 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", DSMG600_SCL_PIN,
77 NULL, 1, GPIO_ACTIVE_HIGH), 77 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
78 }, 78 },
79}; 79};
80 80
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index a0350ad15175..8afb3f4db376 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -58,9 +58,9 @@ static struct gpiod_lookup_table fsg_i2c_gpiod_table = {
58 .dev_id = "i2c-gpio", 58 .dev_id = "i2c-gpio",
59 .table = { 59 .table = {
60 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SDA_PIN, 60 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SDA_PIN,
61 NULL, 0, GPIO_ACTIVE_HIGH), 61 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
62 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SCL_PIN, 62 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", FSG_SCL_PIN,
63 NULL, 1, GPIO_ACTIVE_HIGH), 63 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
64 }, 64 },
65}; 65};
66 66
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 8937263cec4a..4f358350a91f 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -126,9 +126,9 @@ static struct gpiod_lookup_table ixdp425_i2c_gpiod_table = {
126 .dev_id = "i2c-gpio", 126 .dev_id = "i2c-gpio",
127 .table = { 127 .table = {
128 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", IXDP425_SDA_PIN, 128 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", IXDP425_SDA_PIN,
129 NULL, 0, GPIO_ACTIVE_HIGH), 129 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
130 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", IXDP425_SCL_PIN, 130 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", IXDP425_SCL_PIN,
131 NULL, 1, GPIO_ACTIVE_HIGH), 131 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
132 }, 132 },
133}; 133};
134 134
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 612ec8c63456..7e59c59c96a3 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -104,9 +104,9 @@ static struct gpiod_lookup_table nas100d_i2c_gpiod_table = {
104 .dev_id = "i2c-gpio", 104 .dev_id = "i2c-gpio",
105 .table = { 105 .table = {
106 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NAS100D_SDA_PIN, 106 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NAS100D_SDA_PIN,
107 NULL, 0, GPIO_ACTIVE_HIGH), 107 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
108 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NAS100D_SCL_PIN, 108 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NAS100D_SCL_PIN,
109 NULL, 1, GPIO_ACTIVE_HIGH), 109 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
110 }, 110 },
111}; 111};
112 112
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 13afb03b50fa..224717eb8ac2 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -72,9 +72,9 @@ static struct gpiod_lookup_table nslu2_i2c_gpiod_table = {
72 .dev_id = "i2c-gpio", 72 .dev_id = "i2c-gpio",
73 .table = { 73 .table = {
74 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NSLU2_SDA_PIN, 74 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NSLU2_SDA_PIN,
75 NULL, 0, GPIO_ACTIVE_HIGH), 75 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
76 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NSLU2_SCL_PIN, 76 GPIO_LOOKUP_IDX("IXP4XX_GPIO_CHIP", NSLU2_SCL_PIN,
77 NULL, 1, GPIO_ACTIVE_HIGH), 77 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
78 }, 78 },
79}; 79};
80 80
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
index f034724e01e1..937eb1d47e7b 100644
--- a/arch/arm/mach-ks8695/board-acs5k.c
+++ b/arch/arm/mach-ks8695/board-acs5k.c
@@ -41,8 +41,10 @@
41static struct gpiod_lookup_table acs5k_i2c_gpiod_table = { 41static struct gpiod_lookup_table acs5k_i2c_gpiod_table = {
42 .dev_id = "i2c-gpio", 42 .dev_id = "i2c-gpio",
43 .table = { 43 .table = {
44 GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0, GPIO_ACTIVE_HIGH), 44 GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0,
45 GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1, GPIO_ACTIVE_HIGH), 45 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
46 GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1,
47 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
46 }, 48 },
47}; 49};
48 50
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 94f75632c007..5877e547cecd 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -324,8 +324,10 @@ static struct soc_camera_link palmz72_iclink = {
324static struct gpiod_lookup_table palmz72_i2c_gpiod_table = { 324static struct gpiod_lookup_table palmz72_i2c_gpiod_table = {
325 .dev_id = "i2c-gpio", 325 .dev_id = "i2c-gpio",
326 .table = { 326 .table = {
327 GPIO_LOOKUP_IDX("gpio-pxa", 118, NULL, 0, GPIO_ACTIVE_HIGH), 327 GPIO_LOOKUP_IDX("gpio-pxa", 118, NULL, 0,
328 GPIO_LOOKUP_IDX("gpio-pxa", 117, NULL, 1, GPIO_ACTIVE_HIGH), 328 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
329 GPIO_LOOKUP_IDX("gpio-pxa", 117, NULL, 1,
330 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
329 }, 331 },
330}; 332};
331 333
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index a680742bee2b..4185e7ff073f 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -463,9 +463,9 @@ static struct gpiod_lookup_table viper_i2c_gpiod_table = {
463 .dev_id = "i2c-gpio", 463 .dev_id = "i2c-gpio",
464 .table = { 464 .table = {
465 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_RTC_I2C_SDA_GPIO, 465 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_RTC_I2C_SDA_GPIO,
466 NULL, 0, GPIO_ACTIVE_HIGH), 466 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
467 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_RTC_I2C_SCL_GPIO, 467 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_RTC_I2C_SCL_GPIO,
468 NULL, 1, GPIO_ACTIVE_HIGH), 468 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
469 }, 469 },
470}; 470};
471 471
@@ -792,9 +792,9 @@ struct gpiod_lookup_table viper_tpm_i2c_gpiod_table = {
792 .dev_id = "i2c-gpio", 792 .dev_id = "i2c-gpio",
793 .table = { 793 .table = {
794 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_TPM_I2C_SDA_GPIO, 794 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_TPM_I2C_SDA_GPIO,
795 NULL, 0, GPIO_ACTIVE_HIGH), 795 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
796 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_TPM_I2C_SCL_GPIO, 796 GPIO_LOOKUP_IDX("gpio-pxa", VIPER_TPM_I2C_SCL_GPIO,
797 NULL, 1, GPIO_ACTIVE_HIGH), 797 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
798 }, 798 },
799}; 799};
800 800
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index c6e7e6d8733a..91526024964b 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -327,8 +327,10 @@ static struct platform_device simpad_gpio_leds = {
327static struct gpiod_lookup_table simpad_i2c_gpiod_table = { 327static struct gpiod_lookup_table simpad_i2c_gpiod_table = {
328 .dev_id = "i2c-gpio", 328 .dev_id = "i2c-gpio",
329 .table = { 329 .table = {
330 GPIO_LOOKUP_IDX("gpio", GPIO_GPIO21, NULL, 0, GPIO_ACTIVE_HIGH), 330 GPIO_LOOKUP_IDX("gpio", GPIO_GPIO21, NULL, 0,
331 GPIO_LOOKUP_IDX("gpio", GPIO_GPIO25, NULL, 1, GPIO_ACTIVE_HIGH), 331 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
332 GPIO_LOOKUP_IDX("gpio", GPIO_GPIO25, NULL, 1,
333 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
332 }, 334 },
333}; 335};
334 336
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
index d801ca5ca6c4..fab69c736515 100644
--- a/arch/blackfin/mach-bf533/boards/blackstamp.c
+++ b/arch/blackfin/mach-bf533/boards/blackstamp.c
@@ -367,9 +367,9 @@ static struct gpiod_lookup_table bfin_i2c_gpiod_table = {
367 .dev_id = "i2c-gpio", 367 .dev_id = "i2c-gpio",
368 .table = { 368 .table = {
369 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF8, NULL, 0, 369 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF8, NULL, 0,
370 GPIO_ACTIVE_HIGH), 370 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
371 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF9, NULL, 1, 371 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF9, NULL, 1,
372 GPIO_ACTIVE_HIGH), 372 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
373 }, 373 },
374}; 374};
375 375
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 463a72358b0e..d64d270e9e62 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -395,9 +395,9 @@ static struct gpiod_lookup_table bfin_i2c_gpiod_table = {
395 .dev_id = "i2c-gpio", 395 .dev_id = "i2c-gpio",
396 .table = { 396 .table = {
397 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF1, NULL, 0, 397 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF1, NULL, 0,
398 GPIO_ACTIVE_HIGH), 398 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
399 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF0, NULL, 1, 399 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF0, NULL, 1,
400 GPIO_ACTIVE_HIGH), 400 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
401 }, 401 },
402}; 402};
403 403
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index d2479359adb7..27cbf2fa2c62 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -517,9 +517,9 @@ static struct gpiod_lookup_table bfin_i2c_gpiod_table = {
517 .dev_id = "i2c-gpio", 517 .dev_id = "i2c-gpio",
518 .table = { 518 .table = {
519 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF2, NULL, 0, 519 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF2, NULL, 0,
520 GPIO_ACTIVE_HIGH), 520 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
521 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF3, NULL, 1, 521 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF3, NULL, 1,
522 GPIO_ACTIVE_HIGH), 522 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
523 }, 523 },
524}; 524};
525 525
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 72f757ebaa84..acc5363f60c6 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -384,9 +384,9 @@ static struct gpiod_lookup_table bfin_i2c_gpiod_table = {
384 .dev_id = "i2c-gpio", 384 .dev_id = "i2c-gpio",
385 .table = { 385 .table = {
386 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF1, NULL, 0, 386 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF1, NULL, 0,
387 GPIO_ACTIVE_HIGH), 387 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
388 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF0, NULL, 1, 388 GPIO_LOOKUP_IDX("BFIN-GPIO", GPIO_PF0, NULL, 1,
389 GPIO_ACTIVE_HIGH), 389 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
390 }, 390 },
391}; 391};
392 392
diff --git a/arch/mips/alchemy/board-gpr.c b/arch/mips/alchemy/board-gpr.c
index daebc36e5ecb..328d697e72b4 100644
--- a/arch/mips/alchemy/board-gpr.c
+++ b/arch/mips/alchemy/board-gpr.c
@@ -235,6 +235,10 @@ static struct gpiod_lookup_table gpr_i2c_gpiod_table = {
235}; 235};
236 236
237static struct i2c_gpio_platform_data gpr_i2c_data = { 237static struct i2c_gpio_platform_data gpr_i2c_data = {
238 /*
239 * The open drain mode is hardwired somewhere or an electrical
240 * property of the alchemy GPIO controller.
241 */
238 .sda_is_open_drain = 1, 242 .sda_is_open_drain = 1,
239 .scl_is_open_drain = 1, 243 .scl_is_open_drain = 1,
240 .udelay = 2, /* ~100 kHz */ 244 .udelay = 2, /* ~100 kHz */
diff --git a/arch/mips/ath79/mach-pb44.c b/arch/mips/ath79/mach-pb44.c
index a95409063847..6b2c6f3baefa 100644
--- a/arch/mips/ath79/mach-pb44.c
+++ b/arch/mips/ath79/mach-pb44.c
@@ -37,9 +37,9 @@ static struct gpiod_lookup_table pb44_i2c_gpiod_table = {
37 .dev_id = "i2c-gpio", 37 .dev_id = "i2c-gpio",
38 .table = { 38 .table = {
39 GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SDA, 39 GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SDA,
40 NULL, 0, GPIO_ACTIVE_HIGH), 40 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
41 GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SCL, 41 GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SCL,
42 NULL, 1, GPIO_ACTIVE_HIGH), 42 NULL, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
43 }, 43 },
44}; 44};
45 45
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 4d40d013a412..ad774161a22d 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1152,7 +1152,7 @@ static int sm501_register_gpio_i2c_instance(struct sm501_devdata *sm,
1152 lookup->table[0].chip_hwnum = iic->pin_sda % 32; 1152 lookup->table[0].chip_hwnum = iic->pin_sda % 32;
1153 lookup->table[0].con_id = NULL; 1153 lookup->table[0].con_id = NULL;
1154 lookup->table[0].idx = 0; 1154 lookup->table[0].idx = 0;
1155 lookup->table[0].flags = GPIO_ACTIVE_HIGH; 1155 lookup->table[0].flags = GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN;
1156 if (iic->pin_scl < 32) 1156 if (iic->pin_scl < 32)
1157 lookup->table[1].chip_label = "SM501-LOW"; 1157 lookup->table[1].chip_label = "SM501-LOW";
1158 else 1158 else
@@ -1160,7 +1160,7 @@ static int sm501_register_gpio_i2c_instance(struct sm501_devdata *sm,
1160 lookup->table[1].chip_hwnum = iic->pin_scl % 32; 1160 lookup->table[1].chip_hwnum = iic->pin_scl % 32;
1161 lookup->table[1].con_id = NULL; 1161 lookup->table[1].con_id = NULL;
1162 lookup->table[1].idx = 1; 1162 lookup->table[1].idx = 1;
1163 lookup->table[1].flags = GPIO_ACTIVE_HIGH; 1163 lookup->table[1].flags = GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN;
1164 gpiod_add_lookup_table(lookup); 1164 gpiod_add_lookup_table(lookup);
1165 1165
1166 icd = dev_get_platdata(&pdev->dev); 1166 icd = dev_get_platdata(&pdev->dev);