lkml.org 
[lkml]   [2021]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 RESEND] PCI: imx6: Replace legacy gpio interface for gpiod interface
?
> > /* Some boards don't have PCIe reset GPIO. */
> > - if (gpio_is_valid(imx6_pcie->reset_gpio)) {
> > - gpio_set_value_cansleep(imx6_pcie->reset_gpio,
> > + if (imx6_pcie->reset_gpio) {
> > + gpiod_set_value_cansleep(imx6_pcie->reset_gpio,
> > imx6_pcie->gpio_active_high);
> > msleep(100);
> > - gpio_set_value_cansleep(imx6_pcie->reset_gpio,
> > + gpiod_set_value_cansleep(imx6_pcie->reset_gpio,
> > !imx6_pcie->gpio_active_high);
>
> I don't think this is correct. gpiod_set_value sets the logical line
> state, so if the GPIO is specified as active-low in the DT, the real
> line state will be negated. The only reason why the reset-gpio-active-
> high property even exists is that old DTs might specify the wrong GPIO
> polarity in the reset-gpio DT description. I think you need to use to
> gpiod_set_raw_value API here to get the expected real line state even
> with a broken DT description.
>
> Regards,
> Lucas
>

I'm a beginner in kernel development, so I'm sorry for the question.
If I change gpiod_set_value_cansleep for gpiod_set_raw_value, wouldn't
I change the behavior of the driver? I replaced
gpio_set_value_cansleep for gpiod_set_value_cansleep because they have
the same behavior and I didn't change the logic states. Thank you for
the feedback!

Regards,
Maíra

\
 
 \ /
  Last update: 2021-11-01 15:46    [W:0.049 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site