Skip to content

Commit

Permalink
NFC: trf7970a: Don't de-assert EN2 unless it was asserted
Browse files Browse the repository at this point in the history
When the trf7970a part has the bug related to 'en2-rf-quirk',
the GPIO connected to the EN2 pin will not be asserted by the
driver when powering up so it shouldn't be de-asserted when
powering down.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Mark Greer authored and Samuel Ortiz committed Jun 18, 2017
1 parent 581132b commit 67dec19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/nfc/trf7970a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,8 +1940,10 @@ static int trf7970a_power_down(struct trf7970a *trf)
}

gpio_set_value(trf->en_gpio, 0);
if (gpio_is_valid(trf->en2_gpio))
gpio_set_value(trf->en2_gpio, 0);

if (!(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
if (gpio_is_valid(trf->en2_gpio))
gpio_set_value(trf->en2_gpio, 0);

ret = regulator_disable(trf->regulator);
if (ret)
Expand Down

0 comments on commit 67dec19

Please sign in to comment.