On Wed, Sep 23, 2015 at 02:34:27PM -0500, Andreas Dannenberg wrote:
> On Tue, Sep 22, 2015 at 09:37:20PM +0200, Sebastian Reichel wrote:
> > 
> > I guess you can just handle this like an optional gpio
> > 
> > if(bq->pg)
> >     state->power_good = !gpiod_get_value_cansleep(bq->pg);
> > else
> >     ...
> 
> What happens when somebody wants to use GPIO number 0? According to
> gpio_is_valid() this is a valid GPIO so technically I should not use a
> check against zero to see whether the user has configured a GPIO for
> this purpose and wants to use it, no?

Ok never mind I figured it out. bq->pg is of type gpio_desc and not the
actual GPIO number. Together with your suggestion of how to use gpiod_*
in combination with platform data this will be a nice simplification!

Regards,

--
Andreas Dannenberg
Texas Instruments Inc

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to