Skip to contentSkip to conversation

gpio: exar set value handling for hw with gpio pull-up or pull-down

PATCH In review Sai Kumar Cholleti 4 participants 14 messages Jul 30, 2024 – Nov 21, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: exar set value handling for hw with gpio pull-up or pull-down

Setting gpio direction = high, sometimes results in gpio value = 0.

If a gpio is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the gpio direction is changed from input to output, exar_set_value is set to 1, but since direction is input when exar_set_value is called, _regmap_update_bits reads a 1 due to an external pull-up. When force_write is not set (regmap_set_bits has force_write = false), the value is not written. When the direction is then changed, the gpio becomes an output with the value of 0 (the hardware default).

regmap_write_bits sets force_write = true, so the value is always written by exar_set_value and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a gpio is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
---
 drivers/gpio/gpio-exar.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-exar.c +6 -4
index 482f678c893e..de5ce73159cb 100644
@@ -99,11 +99,13 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
 	struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
 	unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset);
 	unsigned int bit = exar_offset_to_bit(exar_gpio, offset);
+	unsigned int bit_value = value ? BIT(bit) : 0;
 
-	if (value)
-		regmap_set_bits(exar_gpio->regmap, addr, BIT(bit));
-	else
-		regmap_clear_bits(exar_gpio->regmap, addr, BIT(bit));
+	/*
+	 * regmap_write_bits forces value to be written when an external
+	 * pull up/down might otherwise indicate value was already set
+	 */
+	regmap_write_bits(exar_gpio->regmap, addr, BIT(bit), bit_value);
 }
 
 static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
Signature · 1 line
2.34.1
Reviewed-by Andy Shevchenko on v1 1/1
#1 lore raw

Hi all,

I worked with Sai on this.

We discovered this problem when we upgraded our kernel from 5.10 to 6.1. The behavior changed with the switch to regmap in 5.11.

commit 36fb7218e87833b17e3042e77f3b102c75129e8f
Author: Bartosz Golaszewski <[email protected]>
Date:   Mon Sep 28 17:00:26 2020 +0200

    gpio: exar: switch to using regmap

    We can simplify the code in gpio-exar by using regmap. This allows us to drop the mutex (regmap provides its own locking) and we can also reuse regmap's bit operations instead of implementing our own update function.

We noticed because we had some gpios tied to reset pins and when we set direction to high, value went to 0, and put devices in reset.

Thanks,
Matthew

Quoted 64 lines · Sai Kumar Cholleti

Setting gpio direction = high, sometimes results in gpio value = 0.

If a gpio is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the gpio direction is changed from input to output, exar_set_value is set to 1, but since direction is input when exar_set_value is called, _regmap_update_bits reads a 1 due to an external pull-up. When force_write is not set (regmap_set_bits has force_write = false), the value is not written. When the direction is then changed, the gpio becomes an output with the value of 0 (the hardware default).

regmap_write_bits sets force_write = true, so the value is always written by exar_set_value and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a gpio is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
---
  drivers/gpio/gpio-exar.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-exar.c +6 -4
index 482f678c893e..de5ce73159cb 100644
@@ -99,11 +99,13 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
  	struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
  	unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset);
  	unsigned int bit = exar_offset_to_bit(exar_gpio, offset);
+	unsigned int bit_value = value ? BIT(bit) : 0;
 
-	if (value)
-		regmap_set_bits(exar_gpio->regmap, addr, BIT(bit));
-	else
-		regmap_clear_bits(exar_gpio->regmap, addr, BIT(bit));
+	/*
+	 * regmap_write_bits forces value to be written when an external
+	 * pull up/down might otherwise indicate value was already set
+	 */
+	regmap_write_bits(exar_gpio->regmap, addr, BIT(bit), bit_value);
  }
 
  static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
#2 lore raw
In reply to Sai Kumar Cholleti

On Tue, Jul 30, 2024 at 07:16:10PM +0530, Sai Kumar Cholleti wrote:

Please, refer to the functions in the text as func(), e.g. exar_set_value(). Use proper acronym, i.e. GPIO (capitalised).

Quoted 29 lines

Setting gpio direction = high, sometimes results in gpio value = 0.

If a gpio is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the gpio direction is changed from input to output, exar_set_value is set to 1, but since direction is input when exar_set_value is called, _regmap_update_bits reads a 1 due to an external pull-up. When force_write is not set (regmap_set_bits has force_write = false), the value is not written. When the direction is then changed, the gpio becomes an output with the value of 0 (the hardware default).

regmap_write_bits sets force_write = true, so the value is always written by exar_set_value and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a gpio is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
Quoted 7 lines
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1

Okay, shouldn't you instead mark the respective registers as volatile or so? I believe regmap has some settings for this case. But I haven't checked myself.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 4 lines · Andy Shevchenko

On Tue, Jul 30, 2024 at 07:16:10PM +0530, Sai Kumar Cholleti wrote:

Please, refer to the functions in the text as func(), e.g. exar_set_value(). Use proper acronym, i.e. GPIO (capitalised).

We will update the patch and send a new version out if the current approach is acceptable.

Quoted 8 lines
Quoted 8 lines

Before the gpio direction is changed from input to output, exar_set_value is set to 1, but since direction is input when exar_set_value is called, _regmap_update_bits reads a 1 due to an external pull-up.  When force_write is not set (regmap_set_bits has force_write = false), the value is not written.  When the direction is then changed, the gpio becomes an output with the value of 0 (the hardware default).

Quoted 6 lines
Quoted 3 lines

regmap_write_bits sets force_write = true, so the value is always written by exar_set_value and an external pull-up doesn't affect the outcome of setting direction = high.

Okay, shouldn't you instead mark the respective registers as volatile or so? I believe regmap has some settings for this case. But I haven't checked myself.

Unfortunately, in addition to marking the regmap volatile, we'd need to define reg_update_bits which means we'd be partially undoing the work from 36fb7218e87833b17e3042e77f3b102c75129e8f to reuse regmap locking and update functions.

Below is the relevant section of _regmap_update_bits().

static int _regmap_update_bits(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, bool *change, bool force_write)
...
        if (regmap_volatile(map, reg) && map->reg_update_bits) {
...
        } else {
...
                if (force_write || (tmp != orig) || map->force_write_field) { ret = _regmap_write(map, reg, tmp);
                        if (ret == 0 && change)
                                *change = true;
...

I suspect this might be a common problem with other GPIO drivers as well.

Thank you,
Matthew

#4 lore raw
Quoted 49 lines · Matthew McClain
Quoted 3 lines · Andy Shevchenko

On Tue, Jul 30, 2024 at 07:16:10PM +0530, Sai Kumar Cholleti wrote:

Please, refer to the functions in the text as func(), e.g.

exar_set_value().

Quoted 1 line

Use proper acronym, i.e. GPIO (capitalised).

We will update the patch and send a new version out if the current approach is acceptable.

Quoted 8 lines
Quoted 8 lines

Before the gpio direction is changed from input to output, exar_set_value is set to 1, but since direction is input when exar_set_value is called, _regmap_update_bits reads a 1 due to an external pull-up.  When force_write is not set (regmap_set_bits has force_write = false), the value is not written.  When the direction is then changed, the gpio becomes an output with the value of 0 (the hardware default).

Quoted 5 lines
Quoted 3 lines

regmap_write_bits sets force_write = true, so the value is always written by exar_set_value and an external pull-up doesn't affect the outcome of setting direction = high.

Okay, shouldn't you instead mark the respective registers as volatile or

so?

Quoted 1 line

I believe regmap has some settings for this case. But I haven't checked

myself.

Unfortunately, in addition to marking the regmap volatile, we'd need to define reg_update_bits which means we'd be partially undoing the work from 36fb7218e87833b17e3042e77f3b102c75129e8f to reuse regmap locking and update functions.

Below is the relevant section of _regmap_update_bits().

static int _regmap_update_bits(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, bool *change, bool force_write)
...
        if (regmap_volatile(map, reg) && map->reg_update_bits) {
...
        } else {
...
                if (force_write || (tmp != orig) || map->force_write_field) {
                        ret = _regmap_write(map, reg, tmp);
                        if (ret == 0 && change)
                                *change = true;
...

Quoted 2 lines

I suspect this might be a common problem with other GPIO drivers as well.

Sorry, this message went to cracks somehow. Can you update the commit message and comments as mentioned above, add Fixes tag and send a v2 for a review. Also use 'gpio: exar: ...' in the Subject.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw

PATCH v2 1/1 gpio: exar: set value when external pull-up or pull-down is present

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the GPIO direction is changed from an input to an output, exar_set_value() is called with value = 1, but since the GPIO is an input when exar_set_value() is called, _regmap_update_bits() reads a 1 due to an external pull-up. regmap_set_bits() sets force_write = false, so the value (1) is not written. When the direction is then changed, the GPIO becomes an output with the value of 0 (the hardware default).

regmap_write_bits() sets force_write = true, so the value is always written by exar_set_value() and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a GPIO is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction 
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction 
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction 
$ cat /sys/class/gpio/gpio351/value
1
Fixes 36fb7218e878 ("gpio: exar: switch to using regmap")
---
 drivers/gpio/gpio-exar.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-exar.c +6 -4
index 5170fe7599cd..dfc7a9ca3e62 100644
@@ -99,11 +99,13 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
 	struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
 	unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset);
 	unsigned int bit = exar_offset_to_bit(exar_gpio, offset);
+	unsigned int bit_value = value ? BIT(bit) : 0;
 
-	if (value)
-		regmap_set_bits(exar_gpio->regmap, addr, BIT(bit));
-	else
-		regmap_clear_bits(exar_gpio->regmap, addr, BIT(bit));
+	/*
+	 * regmap_write_bits forces value to be written when an external
+	 * pull up/down might otherwise indicate value was already set
+	 */
+	regmap_write_bits(exar_gpio->regmap, addr, BIT(bit), bit_value);
 }
 
 static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH v2] gpio: exar: set value when external pull-up or pull-down is present

Quoted 22 lines · Sai Kumar Cholleti

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the GPIO direction is changed from an input to an output, exar_set_value() is called with value = 1, but since the GPIO is an input when exar_set_value() is called, _regmap_update_bits() reads a 1 due to an external pull-up. regmap_set_bits() sets force_write = false, so the value (1) is not written. When the direction is then changed, the GPIO becomes an output with the value of 0 (the hardware default).

regmap_write_bits() sets force_write = true, so the value is always written by exar_set_value() and an external pull-up doesn't affect the outcome of setting direction = high.

Quoted 5 lines

The same can happen when a GPIO is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction 

This...

Quoted 4 lines
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction 

...this...

Quoted 4 lines
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction 

...this...

Quoted 4 lines
$ cat /sys/class/gpio/gpio351/value
1
Fixes 36fb7218e878 ("gpio: exar: switch to using regmap")

...and this lines have a trailing space.

Quoted 2 lines

Hmm... Missing Co-developed-by?
This SoB chain puzzles me a bit, the committer should go last AFAIR.

...

drivers/gpio/gpio-exar.c static void exar_set_value(struct gpio_chip *chip, unsigned int offset, · line 105

Quoted 2 lines
drivers/gpio/gpio-exar.c +2 -0
+	/*
+	 * regmap_write_bits forces value to be written when an external

regmap_write_bits()

drivers/gpio/gpio-exar.c static void exar_set_value(struct gpio_chip *chip, unsigned int offset, · line 106

Quoted 1 line
drivers/gpio/gpio-exar.c +1 -0
+	 * pull up/down might otherwise indicate value was already set

Missing period at the end.

drivers/gpio/gpio-exar.c static void exar_set_value(struct gpio_chip *chip, unsigned int offset, · line 107

Quoted 1 line
drivers/gpio/gpio-exar.c +1 -0
+	 */

...

Other than above LGTM.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw

PATCH v3 1/1 gpio: exar: set value when external pull-up or pull-down is present

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the GPIO direction is changed from an input to an output, exar_set_value() is called with value = 1, but since the GPIO is an input when exar_set_value() is called, _regmap_update_bits() reads a 1 due to an external pull-up. regmap_set_bits() sets force_write = false, so the value (1) is not written. When the direction is then changed, the GPIO becomes an output with the value of 0 (the hardware default).

regmap_write_bits() sets force_write = true, so the value is always written by exar_set_value() and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a GPIO is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
Fixes 36fb7218e878 ("gpio: exar: switch to using regmap")
---
 drivers/gpio/gpio-exar.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-exar.c +6 -4
index 5170fe7599cd..d5909a4f0433 100644
@@ -99,11 +99,13 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset,
 	struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip);
 	unsigned int addr = exar_offset_to_lvl_addr(exar_gpio, offset);
 	unsigned int bit = exar_offset_to_bit(exar_gpio, offset);
+	unsigned int bit_value = value ? BIT(bit) : 0;
 
-	if (value)
-		regmap_set_bits(exar_gpio->regmap, addr, BIT(bit));
-	else
-		regmap_clear_bits(exar_gpio->regmap, addr, BIT(bit));
+	/*
+	 * regmap_write_bits() forces value to be written when an external
+	 * pull up/down might otherwise indicate value was already set.
+	 */
+	regmap_write_bits(exar_gpio->regmap, addr, BIT(bit), bit_value);
 }
 
 static int exar_direction_output(struct gpio_chip *chip, unsigned int offset,
Signature · 1 line
2.34.1
Reviewed-by on v3 1/1
#8 lore raw

Re: [PATCH v3] gpio: exar: set value when external pull-up or pull-down is present

Quoted 29 lines · Sai Kumar Cholleti

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the GPIO direction is changed from an input to an output, exar_set_value() is called with value = 1, but since the GPIO is an input when exar_set_value() is called, _regmap_update_bits() reads a 1 due to an external pull-up. regmap_set_bits() sets force_write = false, so the value (1) is not written. When the direction is then changed, the GPIO becomes an output with the value of 0 (the hardware default).

regmap_write_bits() sets force_write = true, so the value is always written by exar_set_value() and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a GPIO is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
Quoted 7 lines
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#9 lore raw

Re: [PATCH v3] gpio: exar: set value when external pull-up or pull-down is present

Quoted 34 lines · Andy Shevchenko
Quoted 33 lines · Sai Kumar Cholleti

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the GPIO direction is changed from an input to an output, exar_set_value() is called with value = 1, but since the GPIO is an input when exar_set_value() is called, _regmap_update_bits() reads a 1 due to an external pull-up. regmap_set_bits() sets force_write = false, so the value (1) is not written. When the direction is then changed, the GPIO becomes an output with the value of 0 (the hardware default).

regmap_write_bits() sets force_write = true, so the value is always written by exar_set_value() and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a GPIO is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
Quoted 5 lines
Quoted 3 lines
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1

Does this need to be applied, Bart?
Seems it is missed in your branches...

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#10 lore raw

Re: [PATCH v3] gpio: exar: set value when external pull-up or pull-down is present

Quoted 36 lines · Andy Shevchenko
Quoted 34 lines · Andy Shevchenko
Quoted 33 lines · Sai Kumar Cholleti

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

Before the GPIO direction is changed from an input to an output, exar_set_value() is called with value = 1, but since the GPIO is an input when exar_set_value() is called, _regmap_update_bits() reads a 1 due to an external pull-up. regmap_set_bits() sets force_write = false, so the value (1) is not written. When the direction is then changed, the GPIO becomes an output with the value of 0 (the hardware default).

regmap_write_bits() sets force_write = true, so the value is always written by exar_set_value() and an external pull-up doesn't affect the outcome of setting direction = high.

The same can happen when a GPIO is pulled low, but the scenario is a little more complicated.

$ echo high > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1
$ echo in > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
0
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
$ echo low > /sys/class/gpio/gpio351/direction
$ cat /sys/class/gpio/gpio351/value
1

Does this need to be applied, Bart?
Seems it is missed in your branches...

Maybe if the author used get_maintainers.pl as they should, I would have noticed this earlier?

I have some other fixes to pick up so I'll send this later in the merge window.

Bart

#11 lore raw

Re: [PATCH v3] gpio: exar: set value when external pull-up or pull-down is present

Quoted 4 lines · Bartosz Golaszewski
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Andy Shevchenko

On Tue, Nov 05, 2024 at 12:45:23PM +0530, Sai Kumar Cholleti wrote:

...

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Does this need to be applied, Bart?
Seems it is missed in your branches...

Maybe if the author used get_maintainers.pl as they should, I would have noticed this earlier?

Ah good catch!

Sai, FYI, I use my script [1] which does all required stuff for me. Feel free to use it, patch, comment, etc...

Quoted 1 line

I have some other fixes to pick up so I'll send this later in the merge window.

Thanks!

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#12 lore raw

Re: [PATCH v3] gpio: exar: set value when external pull-up or pull-down is present

Thanks Andy and Bart.

Quoted 33 lines · Andy Shevchenko
Quoted 4 lines · Bartosz Golaszewski
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Andy Shevchenko

On Tue, Nov 05, 2024 at 12:45:23PM +0530, Sai Kumar Cholleti wrote:

...

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Does this need to be applied, Bart?
Seems it is missed in your branches...

Maybe if the author used get_maintainers.pl as they should, I would have noticed this earlier?

Ah good catch!

Sai, FYI, I use my script [1] which does all required stuff for me. Feel free to use it, patch, comment, etc...

Quoted 1 line

I have some other fixes to pick up so I'll send this later in the merge window.

Thanks!

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

--
With Best Regards,
Andy Shevchenko

#13 lore raw

Re: [PATCH v3] gpio: exar: set value when external pull-up or pull-down is present

In reply to Sai Kumar Cholleti

From: Bartosz Golaszewski <[email protected]>

Quoted 10 lines · Sai Kumar Cholleti

Setting GPIO direction = high, sometimes results in GPIO value = 0.

If a GPIO is pulled high, the following construction results in the value being 0 when the desired value is 1:

$ echo "high" > /sys/class/gpio/gpio336/direction
$ cat /sys/class/gpio/gpio336/value
0

[...]

Applied, thanks!

[1/1] gpio: exar: set value when external pull-up or pull-down is present

      commit: 72cef64180de04a7b055b4773c138d78f4ebdb77

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>