diff mbox series

[2/2] package/avrdude: add support for Linux sysfs GPIO interface

Message ID 20220110085850.11095-2-yegorslists@googlemail.com
State Changes Requested
Headers show
Series [1/2] DEVELOPERS: add entry for avrdude to Yegor Yefremov | expand

Commit Message

Frager, Neal via buildroot Jan. 10, 2022, 8:58 a.m. UTC
From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/avrdude/Config.in  | 3 +++
 package/avrdude/avrdude.mk | 6 ++++++
 2 files changed, 9 insertions(+)

Comments

Yann E. MORIN Jan. 10, 2022, 2:04 p.m. UTC | #1
Yegor, All,

On 2022-01-10 09:58 +0100, yegorslists--- via buildroot spake thusly:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  package/avrdude/Config.in  | 3 +++
>  package/avrdude/avrdude.mk | 6 ++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/package/avrdude/Config.in b/package/avrdude/Config.in
> index 89558a5ff5..57a8df66ea 100644
> --- a/package/avrdude/Config.in
> +++ b/package/avrdude/Config.in
> @@ -17,6 +17,9 @@ config BR2_PACKAGE_AVRDUDE
>  
>  if BR2_PACKAGE_AVRDUDE
>  
> +config BR2_PACKAGE_AVRDUDE_LINUXGPIO
> +	bool "Linux sysfs GPIO interface support"
> +
>  config BR2_PACKAGE_AVRDUDE_SPI
>  	bool "SPI support"
>  	default y # Backward compatibility
> diff --git a/package/avrdude/avrdude.mk b/package/avrdude/avrdude.mk
> index accd92c1d5..3ccba80d8e 100644
> --- a/package/avrdude/avrdude.mk
> +++ b/package/avrdude/avrdude.mk
> @@ -16,6 +16,12 @@ AVRDUDE_CONF_OPTS = --enable-linuxgpio
>  AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \
>  	host-flex host-bison
>  
> +ifeq ($(BR2_PACKAGE_AVRDUDE_LINUXGPIO),y)
> +AVRDUDE_CONF_OPTS += --enable-linuxgpio
> +else
> +AVRDUDE_CONF_OPTS += --disable-linuxgpio
> +endif

We already have an unconditional activation of those:

    https://github.com/buildroot/buildroot/blob/master/package/avrdude/avrdude.mk#L15

(which you can btw. incidentally also notice as part the hunk header).

So, if the intention was to be able to enable linux-gpio, then this is a
noop as they are already enabled. If the intention was to be able to
disable them, then the unconditional enable should be dropped.

But then, does it make sense to be able to disable linux GPIO?

And what if both SPI and GPIO are disabled?

Regards,
Yann E. MORIN.

>  ifeq ($(BR2_PACKAGE_AVRDUDE_SPI),y)
>  AVRDUDE_CONF_OPTS += --enable-linuxspi
>  else
> -- 
> 2.17.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Yegor Yefremov Jan. 10, 2022, 5:59 p.m. UTC | #2
Hi Yann, all,

On Mon, Jan 10, 2022 at 3:04 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Yegor, All,
>
> On 2022-01-10 09:58 +0100, yegorslists--- via buildroot spake thusly:
> > From: Yegor Yefremov <yegorslists@googlemail.com>
> >
> > Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> > ---
> >  package/avrdude/Config.in  | 3 +++
> >  package/avrdude/avrdude.mk | 6 ++++++
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/package/avrdude/Config.in b/package/avrdude/Config.in
> > index 89558a5ff5..57a8df66ea 100644
> > --- a/package/avrdude/Config.in
> > +++ b/package/avrdude/Config.in
> > @@ -17,6 +17,9 @@ config BR2_PACKAGE_AVRDUDE
> >
> >  if BR2_PACKAGE_AVRDUDE
> >
> > +config BR2_PACKAGE_AVRDUDE_LINUXGPIO
> > +     bool "Linux sysfs GPIO interface support"
> > +
> >  config BR2_PACKAGE_AVRDUDE_SPI
> >       bool "SPI support"
> >       default y # Backward compatibility
> > diff --git a/package/avrdude/avrdude.mk b/package/avrdude/avrdude.mk
> > index accd92c1d5..3ccba80d8e 100644
> > --- a/package/avrdude/avrdude.mk
> > +++ b/package/avrdude/avrdude.mk
> > @@ -16,6 +16,12 @@ AVRDUDE_CONF_OPTS = --enable-linuxgpio
> >  AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \
> >       host-flex host-bison
> >
> > +ifeq ($(BR2_PACKAGE_AVRDUDE_LINUXGPIO),y)
> > +AVRDUDE_CONF_OPTS += --enable-linuxgpio
> > +else
> > +AVRDUDE_CONF_OPTS += --disable-linuxgpio
> > +endif
>
> We already have an unconditional activation of those:
>
>     https://github.com/buildroot/buildroot/blob/master/package/avrdude/avrdude.mk#L15
>
> (which you can btw. incidentally also notice as part the hunk header).

My bad. I have just overlooked this setting. You can drop the patch.

Regards,
Yegor

> So, if the intention was to be able to enable linux-gpio, then this is a
> noop as they are already enabled. If the intention was to be able to
> disable them, then the unconditional enable should be dropped.
>
> But then, does it make sense to be able to disable linux GPIO?
>
> And what if both SPI and GPIO are disabled?
>
> Regards,
> Yann E. MORIN.
>
> >  ifeq ($(BR2_PACKAGE_AVRDUDE_SPI),y)
> >  AVRDUDE_CONF_OPTS += --enable-linuxspi
> >  else
> > --
> > 2.17.0
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
diff mbox series

Patch

diff --git a/package/avrdude/Config.in b/package/avrdude/Config.in
index 89558a5ff5..57a8df66ea 100644
--- a/package/avrdude/Config.in
+++ b/package/avrdude/Config.in
@@ -17,6 +17,9 @@  config BR2_PACKAGE_AVRDUDE
 
 if BR2_PACKAGE_AVRDUDE
 
+config BR2_PACKAGE_AVRDUDE_LINUXGPIO
+	bool "Linux sysfs GPIO interface support"
+
 config BR2_PACKAGE_AVRDUDE_SPI
 	bool "SPI support"
 	default y # Backward compatibility
diff --git a/package/avrdude/avrdude.mk b/package/avrdude/avrdude.mk
index accd92c1d5..3ccba80d8e 100644
--- a/package/avrdude/avrdude.mk
+++ b/package/avrdude/avrdude.mk
@@ -16,6 +16,12 @@  AVRDUDE_CONF_OPTS = --enable-linuxgpio
 AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \
 	host-flex host-bison
 
+ifeq ($(BR2_PACKAGE_AVRDUDE_LINUXGPIO),y)
+AVRDUDE_CONF_OPTS += --enable-linuxgpio
+else
+AVRDUDE_CONF_OPTS += --disable-linuxgpio
+endif
+
 ifeq ($(BR2_PACKAGE_AVRDUDE_SPI),y)
 AVRDUDE_CONF_OPTS += --enable-linuxspi
 else