Re: [U-Boot] [PATCH v2 6/6] sunxi: axp: Remove non driver-model support from the axp gpio code

2015-05-02 Thread Ian Campbell
On Sun, 2015-04-26 at 11:51 +0200, Hans de Goede wrote:
> Now that all sunxi boards are using driver-model for gpio (*), we can remove
> the non driver-model support from the axp gpio code, and the glue to call
> into the axp gpio code from the sunxi_gpio non driver-model code.
> 
> *) For the regular u-boot build, SPL still uses non driver-model gpio for
> now, but the SPL never uses axp gpios support and we were already not building
> axp-gpio support for the SPL.
> 
> Signed-off-by: Hans de Goede 

Acked-by: Ian Campbell 


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 6/6] sunxi: axp: Remove non driver-model support from the axp gpio code

2015-04-28 Thread Simon Glass
On 28 April 2015 at 00:24, Hans de Goede  wrote:
> Hi Simon,
>
> Thanks for the reviews.
>
>
> On 28-04-15 05:20, Simon Glass wrote:
>>
>> Hi Hans,
>>
>> On 26 April 2015 at 03:51, Hans de Goede  wrote:
>>>
>>> Now that all sunxi boards are using driver-model for gpio (*), we can
>>> remove
>>> the non driver-model support from the axp gpio code, and the glue to call
>>> into the axp gpio code from the sunxi_gpio non driver-model code.
>>>
>>> *) For the regular u-boot build, SPL still uses non driver-model gpio for
>>> now, but the SPL never uses axp gpios support and we were already not
>>> building
>>> axp-gpio support for the SPL.
>>>
>>> Signed-off-by: Hans de Goede 
>>> ---
>>>   arch/arm/include/asm/arch-sunxi/gpio.h |  7 ---
>>>   drivers/gpio/axp_gpio.c| 17 -
>>>   drivers/gpio/sunxi_gpio.c  | 32
>>> 
>>>   3 files changed, 8 insertions(+), 48 deletions(-)
>>>
>>> diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h
>>> b/arch/arm/include/asm/arch-sunxi/gpio.h
>>> index 2d66077..081e7d1 100644
>>> --- a/arch/arm/include/asm/arch-sunxi/gpio.h
>>> +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
>>> @@ -225,11 +225,4 @@ int axp_gpio_init(void);
>>>   static inline int axp_gpio_init(void) { return 0; }
>>>   #endif
>>>
>>> -struct udevice;
>>> -
>>> -int axp_gpio_direction_input(struct udevice *dev, unsigned offset);
>>> -int axp_gpio_direction_output(struct udevice *dev, unsigned offset, int
>>> val);
>>> -int axp_gpio_get_value(struct udevice *dev, unsigned offset);
>>> -int axp_gpio_set_value(struct udevice *dev, unsigned offset, int val);
>>> -
>>>   #endif /* _SUNXI_GPIO_H */
>>> diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
>>> index 17358e6..956bb84 100644
>>> --- a/drivers/gpio/axp_gpio.c
>>> +++ b/drivers/gpio/axp_gpio.c
>>> @@ -25,6 +25,8 @@
>>>   #error Unknown AXP model
>>>   #endif
>>>
>>> +static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int
>>> val);
>>> +
>>>   static u8 axp_get_gpio_ctrl_reg(unsigned pin)
>>>   {
>>>  switch (pin) {
>>> @@ -40,7 +42,7 @@ static u8 axp_get_gpio_ctrl_reg(unsigned pin)
>>>  return 0;
>>>   }
>>>
>>> -int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
>>> +static int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
>>>   {
>>>  u8 reg;
>>>
>>> @@ -58,7 +60,8 @@ int axp_gpio_direction_input(struct udevice *dev,
>>> unsigned pin)
>>>  }
>>>   }
>>>
>>> -int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int
>>> val)
>>> +static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
>>> +int val)
>>>   {
>>>  __maybe_unused int ret;
>>>  u8 reg;
>>> @@ -83,7 +86,7 @@ int axp_gpio_direction_output(struct udevice *dev,
>>> unsigned pin, int val)
>>>  }
>>>   }
>>>
>>> -int axp_gpio_get_value(struct udevice *dev, unsigned pin)
>>> +static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
>>>   {
>>>  u8 reg, val, mask;
>>>  int ret;
>>> @@ -115,7 +118,7 @@ int axp_gpio_get_value(struct udevice *dev, unsigned
>>> pin)
>>>  return (val & mask) ? 1 : 0;
>>>   }
>>>
>>> -int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
>>> +static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int
>>> val)
>>>   {
>>>  u8 reg;
>>>
>>> @@ -139,7 +142,6 @@ int axp_gpio_set_value(struct udevice *dev, unsigned
>>> pin, int val)
>>>  }
>>>   }
>>>
>>> -#ifdef CONFIG_DM_GPIO
>>>   static const struct dm_gpio_ops gpio_axp_ops = {
>>>  .direction_input= axp_gpio_direction_input,
>>>  .direction_output   = axp_gpio_direction_output,
>>> @@ -164,23 +166,20 @@ struct driver gpio_axp_driver = {
>>>  .ops= &gpio_axp_ops,
>>>  .probe  = gpio_axp_probe,
>>>   };
>>> -#endif
>>>
>>>   int axp_gpio_init(void)
>>>   {
>>> -   __maybe_unused struct udevice *dev;
>>> +   struct udevice *dev;
>>>  int ret;
>>>
>>>  ret = pmic_bus_init();
>>>  if (ret)
>>>  return ret;
>>>
>>> -#ifdef CONFIG_DM_GPIO
>>>  /* There is no devicetree support for the axp yet, so bind
>>> directly */
>>>  ret = device_bind(dm_root(), &gpio_axp_driver, "AXP", NULL, -1,
>>> &dev);
>>
>>
>> Is there really no compatible string you can use?
>>
>> device_bind_driver(dm_root(), "gpio_axp", "AXP", &dev)
>
>
> That seems like it is a comment on 5/6 not on this patch which only
> removes the #ifdef and #endif lines here.
>
> I did not know I could do something like the above, I'll look into that
> for 5/6 and do a v2 of 5/6 I will put a "u-boot" prefix into the compatible
> so as to not get any conflicts when we do actually get full devicetree
> support for thus in the upstream kernel and dts files.
>
> Since this is really a comment on 5/6 can I have your Reviewed-by for
> this one ?

Ah yes I see, sorry

Re: [U-Boot] [PATCH v2 6/6] sunxi: axp: Remove non driver-model support from the axp gpio code

2015-04-27 Thread Hans de Goede

Hi Simon,

Thanks for the reviews.

On 28-04-15 05:20, Simon Glass wrote:

Hi Hans,

On 26 April 2015 at 03:51, Hans de Goede  wrote:

Now that all sunxi boards are using driver-model for gpio (*), we can remove
the non driver-model support from the axp gpio code, and the glue to call
into the axp gpio code from the sunxi_gpio non driver-model code.

*) For the regular u-boot build, SPL still uses non driver-model gpio for
now, but the SPL never uses axp gpios support and we were already not building
axp-gpio support for the SPL.

Signed-off-by: Hans de Goede 
---
  arch/arm/include/asm/arch-sunxi/gpio.h |  7 ---
  drivers/gpio/axp_gpio.c| 17 -
  drivers/gpio/sunxi_gpio.c  | 32 
  3 files changed, 8 insertions(+), 48 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h 
b/arch/arm/include/asm/arch-sunxi/gpio.h
index 2d66077..081e7d1 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -225,11 +225,4 @@ int axp_gpio_init(void);
  static inline int axp_gpio_init(void) { return 0; }
  #endif

-struct udevice;
-
-int axp_gpio_direction_input(struct udevice *dev, unsigned offset);
-int axp_gpio_direction_output(struct udevice *dev, unsigned offset, int val);
-int axp_gpio_get_value(struct udevice *dev, unsigned offset);
-int axp_gpio_set_value(struct udevice *dev, unsigned offset, int val);
-
  #endif /* _SUNXI_GPIO_H */
diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
index 17358e6..956bb84 100644
--- a/drivers/gpio/axp_gpio.c
+++ b/drivers/gpio/axp_gpio.c
@@ -25,6 +25,8 @@
  #error Unknown AXP model
  #endif

+static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val);
+
  static u8 axp_get_gpio_ctrl_reg(unsigned pin)
  {
 switch (pin) {
@@ -40,7 +42,7 @@ static u8 axp_get_gpio_ctrl_reg(unsigned pin)
 return 0;
  }

-int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
+static int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
  {
 u8 reg;

@@ -58,7 +60,8 @@ int axp_gpio_direction_input(struct udevice *dev, unsigned 
pin)
 }
  }

-int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
+static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
+int val)
  {
 __maybe_unused int ret;
 u8 reg;
@@ -83,7 +86,7 @@ int axp_gpio_direction_output(struct udevice *dev, unsigned 
pin, int val)
 }
  }

-int axp_gpio_get_value(struct udevice *dev, unsigned pin)
+static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
  {
 u8 reg, val, mask;
 int ret;
@@ -115,7 +118,7 @@ int axp_gpio_get_value(struct udevice *dev, unsigned pin)
 return (val & mask) ? 1 : 0;
  }

-int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
+static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
  {
 u8 reg;

@@ -139,7 +142,6 @@ int axp_gpio_set_value(struct udevice *dev, unsigned pin, 
int val)
 }
  }

-#ifdef CONFIG_DM_GPIO
  static const struct dm_gpio_ops gpio_axp_ops = {
 .direction_input= axp_gpio_direction_input,
 .direction_output   = axp_gpio_direction_output,
@@ -164,23 +166,20 @@ struct driver gpio_axp_driver = {
 .ops= &gpio_axp_ops,
 .probe  = gpio_axp_probe,
  };
-#endif

  int axp_gpio_init(void)
  {
-   __maybe_unused struct udevice *dev;
+   struct udevice *dev;
 int ret;

 ret = pmic_bus_init();
 if (ret)
 return ret;

-#ifdef CONFIG_DM_GPIO
 /* There is no devicetree support for the axp yet, so bind directly */
 ret = device_bind(dm_root(), &gpio_axp_driver, "AXP", NULL, -1, &dev);


Is there really no compatible string you can use?

device_bind_driver(dm_root(), "gpio_axp", "AXP", &dev)


That seems like it is a comment on 5/6 not on this patch which only
removes the #ifdef and #endif lines here.

I did not know I could do something like the above, I'll look into that
for 5/6 and do a v2 of 5/6 I will put a "u-boot" prefix into the compatible
so as to not get any conflicts when we do actually get full devicetree
support for thus in the upstream kernel and dts files.

Since this is really a comment on 5/6 can I have your Reviewed-by for
this one ?

Regards,

Hans
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 6/6] sunxi: axp: Remove non driver-model support from the axp gpio code

2015-04-27 Thread Simon Glass
Hi Hans,

On 26 April 2015 at 03:51, Hans de Goede  wrote:
> Now that all sunxi boards are using driver-model for gpio (*), we can remove
> the non driver-model support from the axp gpio code, and the glue to call
> into the axp gpio code from the sunxi_gpio non driver-model code.
>
> *) For the regular u-boot build, SPL still uses non driver-model gpio for
> now, but the SPL never uses axp gpios support and we were already not building
> axp-gpio support for the SPL.
>
> Signed-off-by: Hans de Goede 
> ---
>  arch/arm/include/asm/arch-sunxi/gpio.h |  7 ---
>  drivers/gpio/axp_gpio.c| 17 -
>  drivers/gpio/sunxi_gpio.c  | 32 
>  3 files changed, 8 insertions(+), 48 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h 
> b/arch/arm/include/asm/arch-sunxi/gpio.h
> index 2d66077..081e7d1 100644
> --- a/arch/arm/include/asm/arch-sunxi/gpio.h
> +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
> @@ -225,11 +225,4 @@ int axp_gpio_init(void);
>  static inline int axp_gpio_init(void) { return 0; }
>  #endif
>
> -struct udevice;
> -
> -int axp_gpio_direction_input(struct udevice *dev, unsigned offset);
> -int axp_gpio_direction_output(struct udevice *dev, unsigned offset, int val);
> -int axp_gpio_get_value(struct udevice *dev, unsigned offset);
> -int axp_gpio_set_value(struct udevice *dev, unsigned offset, int val);
> -
>  #endif /* _SUNXI_GPIO_H */
> diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
> index 17358e6..956bb84 100644
> --- a/drivers/gpio/axp_gpio.c
> +++ b/drivers/gpio/axp_gpio.c
> @@ -25,6 +25,8 @@
>  #error Unknown AXP model
>  #endif
>
> +static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val);
> +
>  static u8 axp_get_gpio_ctrl_reg(unsigned pin)
>  {
> switch (pin) {
> @@ -40,7 +42,7 @@ static u8 axp_get_gpio_ctrl_reg(unsigned pin)
> return 0;
>  }
>
> -int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
> +static int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
>  {
> u8 reg;
>
> @@ -58,7 +60,8 @@ int axp_gpio_direction_input(struct udevice *dev, unsigned 
> pin)
> }
>  }
>
> -int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
> +static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
> +int val)
>  {
> __maybe_unused int ret;
> u8 reg;
> @@ -83,7 +86,7 @@ int axp_gpio_direction_output(struct udevice *dev, unsigned 
> pin, int val)
> }
>  }
>
> -int axp_gpio_get_value(struct udevice *dev, unsigned pin)
> +static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
>  {
> u8 reg, val, mask;
> int ret;
> @@ -115,7 +118,7 @@ int axp_gpio_get_value(struct udevice *dev, unsigned pin)
> return (val & mask) ? 1 : 0;
>  }
>
> -int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
> +static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
>  {
> u8 reg;
>
> @@ -139,7 +142,6 @@ int axp_gpio_set_value(struct udevice *dev, unsigned pin, 
> int val)
> }
>  }
>
> -#ifdef CONFIG_DM_GPIO
>  static const struct dm_gpio_ops gpio_axp_ops = {
> .direction_input= axp_gpio_direction_input,
> .direction_output   = axp_gpio_direction_output,
> @@ -164,23 +166,20 @@ struct driver gpio_axp_driver = {
> .ops= &gpio_axp_ops,
> .probe  = gpio_axp_probe,
>  };
> -#endif
>
>  int axp_gpio_init(void)
>  {
> -   __maybe_unused struct udevice *dev;
> +   struct udevice *dev;
> int ret;
>
> ret = pmic_bus_init();
> if (ret)
> return ret;
>
> -#ifdef CONFIG_DM_GPIO
> /* There is no devicetree support for the axp yet, so bind directly */
> ret = device_bind(dm_root(), &gpio_axp_driver, "AXP", NULL, -1, &dev);

Is there really no compatible string you can use?

device_bind_driver(dm_root(), "gpio_axp", "AXP", &dev)

> if (ret)
> return ret;
> -#endif
>
> return 0;
>  }
> diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
> index 21c3ff1..f988130 100644
> --- a/drivers/gpio/sunxi_gpio.c
> +++ b/drivers/gpio/sunxi_gpio.c
> @@ -74,10 +74,6 @@ int gpio_free(unsigned gpio)
>
>  int gpio_direction_input(unsigned gpio)
>  {
> -#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
> -   if (gpio >= SUNXI_GPIO_AXP0_START)
> -   return axp_gpio_direction_input(NULL, gpio - 
> SUNXI_GPIO_AXP0_START);
> -#endif
> sunxi_gpio_set_cfgpin(gpio, SUNXI_GPIO_INPUT);
>
> return 0;
> @@ -85,11 +81,6 @@ int gpio_direction_input(unsigned gpio)
>
>  int gpio_direction_output(unsigned gpio, int value)
>  {
> -#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
> -   if (gpio >= SUNXI_GPIO_AXP0_START)
> -   return axp_gpio_direction_output(NULL, gpio - 
> SUNXI_GPIO_AXP0_START,
> -   

[U-Boot] [PATCH v2 6/6] sunxi: axp: Remove non driver-model support from the axp gpio code

2015-04-26 Thread Hans de Goede
Now that all sunxi boards are using driver-model for gpio (*), we can remove
the non driver-model support from the axp gpio code, and the glue to call
into the axp gpio code from the sunxi_gpio non driver-model code.

*) For the regular u-boot build, SPL still uses non driver-model gpio for
now, but the SPL never uses axp gpios support and we were already not building
axp-gpio support for the SPL.

Signed-off-by: Hans de Goede 
---
 arch/arm/include/asm/arch-sunxi/gpio.h |  7 ---
 drivers/gpio/axp_gpio.c| 17 -
 drivers/gpio/sunxi_gpio.c  | 32 
 3 files changed, 8 insertions(+), 48 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h 
b/arch/arm/include/asm/arch-sunxi/gpio.h
index 2d66077..081e7d1 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -225,11 +225,4 @@ int axp_gpio_init(void);
 static inline int axp_gpio_init(void) { return 0; }
 #endif
 
-struct udevice;
-
-int axp_gpio_direction_input(struct udevice *dev, unsigned offset);
-int axp_gpio_direction_output(struct udevice *dev, unsigned offset, int val);
-int axp_gpio_get_value(struct udevice *dev, unsigned offset);
-int axp_gpio_set_value(struct udevice *dev, unsigned offset, int val);
-
 #endif /* _SUNXI_GPIO_H */
diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
index 17358e6..956bb84 100644
--- a/drivers/gpio/axp_gpio.c
+++ b/drivers/gpio/axp_gpio.c
@@ -25,6 +25,8 @@
 #error Unknown AXP model
 #endif
 
+static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val);
+
 static u8 axp_get_gpio_ctrl_reg(unsigned pin)
 {
switch (pin) {
@@ -40,7 +42,7 @@ static u8 axp_get_gpio_ctrl_reg(unsigned pin)
return 0;
 }
 
-int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
+static int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
 {
u8 reg;
 
@@ -58,7 +60,8 @@ int axp_gpio_direction_input(struct udevice *dev, unsigned 
pin)
}
 }
 
-int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
+static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
+int val)
 {
__maybe_unused int ret;
u8 reg;
@@ -83,7 +86,7 @@ int axp_gpio_direction_output(struct udevice *dev, unsigned 
pin, int val)
}
 }
 
-int axp_gpio_get_value(struct udevice *dev, unsigned pin)
+static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
 {
u8 reg, val, mask;
int ret;
@@ -115,7 +118,7 @@ int axp_gpio_get_value(struct udevice *dev, unsigned pin)
return (val & mask) ? 1 : 0;
 }
 
-int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
+static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
 {
u8 reg;
 
@@ -139,7 +142,6 @@ int axp_gpio_set_value(struct udevice *dev, unsigned pin, 
int val)
}
 }
 
-#ifdef CONFIG_DM_GPIO
 static const struct dm_gpio_ops gpio_axp_ops = {
.direction_input= axp_gpio_direction_input,
.direction_output   = axp_gpio_direction_output,
@@ -164,23 +166,20 @@ struct driver gpio_axp_driver = {
.ops= &gpio_axp_ops,
.probe  = gpio_axp_probe,
 };
-#endif
 
 int axp_gpio_init(void)
 {
-   __maybe_unused struct udevice *dev;
+   struct udevice *dev;
int ret;
 
ret = pmic_bus_init();
if (ret)
return ret;
 
-#ifdef CONFIG_DM_GPIO
/* There is no devicetree support for the axp yet, so bind directly */
ret = device_bind(dm_root(), &gpio_axp_driver, "AXP", NULL, -1, &dev);
if (ret)
return ret;
-#endif
 
return 0;
 }
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 21c3ff1..f988130 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -74,10 +74,6 @@ int gpio_free(unsigned gpio)
 
 int gpio_direction_input(unsigned gpio)
 {
-#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
-   if (gpio >= SUNXI_GPIO_AXP0_START)
-   return axp_gpio_direction_input(NULL, gpio - 
SUNXI_GPIO_AXP0_START);
-#endif
sunxi_gpio_set_cfgpin(gpio, SUNXI_GPIO_INPUT);
 
return 0;
@@ -85,11 +81,6 @@ int gpio_direction_input(unsigned gpio)
 
 int gpio_direction_output(unsigned gpio, int value)
 {
-#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
-   if (gpio >= SUNXI_GPIO_AXP0_START)
-   return axp_gpio_direction_output(NULL, gpio - 
SUNXI_GPIO_AXP0_START,
-value);
-#endif
sunxi_gpio_set_cfgpin(gpio, SUNXI_GPIO_OUTPUT);
 
return sunxi_gpio_output(gpio, value);
@@ -97,19 +88,11 @@ int gpio_direction_output(unsigned gpio, int value)
 
 int gpio_get_value(unsigned gpio)
 {
-#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
-   if (gpio >= SUNXI_GPIO_AXP0_START)
-   return axp_gpio_get_value(NULL, gpi