<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/button.h, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>boot: add support for button commands</title>
<updated>2024-02-13T20:38:49+00:00</updated>
<author>
<name>Caleb Connolly</name>
<email>caleb.connolly@linaro.org</email>
</author>
<published>2024-01-09T11:51:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e761035b64235db8930eb15d2703dc3f43e99224'/>
<id>e761035b64235db8930eb15d2703dc3f43e99224</id>
<content type='text'>
With the relatively new button API in U-Boot, it's now much easier to
model the common usecase of mapping arbitrary actions to different
buttons during boot - for example entering fastboot mode, setting some
additional kernel cmdline arguments, or booting with a custom recovery
ramdisk, to name a few.

Historically, this functionality has been implemented in board code,
making it fixed for a given U-Boot binary and requiring the code be
duplicated and modified for every board.

Implement a generic abstraction to run an arbitrary command during boot
when a specific button is pressed. The button -&gt; command mapping is
configured via environment variables with the following format:

  button_cmd_N_name=&lt;button label&gt;
  button_cmd_N=&lt;command to run&gt;

Where N is the mapping number starting from 0. For example:

  button_cmd_0_name=vol_down
  button_cmd_0=fastboot usb 0

This will cause the device to enter fastboot mode if volume down is held
during boot.

After we enter the cli loop the button commands are no longer valid,
this allows the buttons to additionally be used for navigating a boot
menu.

Tested-by: Svyatoslav Ryhel &lt;clamor95@gmail.com&gt; # Tegra30
Signed-off-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the relatively new button API in U-Boot, it's now much easier to
model the common usecase of mapping arbitrary actions to different
buttons during boot - for example entering fastboot mode, setting some
additional kernel cmdline arguments, or booting with a custom recovery
ramdisk, to name a few.

Historically, this functionality has been implemented in board code,
making it fixed for a given U-Boot binary and requiring the code be
duplicated and modified for every board.

Implement a generic abstraction to run an arbitrary command during boot
when a specific button is pressed. The button -&gt; command mapping is
configured via environment variables with the following format:

  button_cmd_N_name=&lt;button label&gt;
  button_cmd_N=&lt;command to run&gt;

Where N is the mapping number starting from 0. For example:

  button_cmd_0_name=vol_down
  button_cmd_0=fastboot usb 0

This will cause the device to enter fastboot mode if volume down is held
during boot.

After we enter the cli loop the button commands are no longer valid,
this allows the buttons to additionally be used for navigating a boot
menu.

Tested-by: Svyatoslav Ryhel &lt;clamor95@gmail.com&gt; # Tegra30
Signed-off-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: button: add support for linux_code in button-gpio.c driver</title>
<updated>2023-02-10T17:50:01+00:00</updated>
<author>
<name>Dzmitry Sankouski</name>
<email>dsankouski@gmail.com</email>
</author>
<published>2023-01-22T15:21:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ea6fdc135954186ada5df9cca3f063a9a785d1b2'/>
<id>ea6fdc135954186ada5df9cca3f063a9a785d1b2</id>
<content type='text'>
Linux event code must be used in input devices, using buttons.

Signed-off-by: Dzmitry Sankouski &lt;dsankouski@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Linux event code must be used in input devices, using buttons.

Signed-off-by: Dzmitry Sankouski &lt;dsankouski@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>doc: replace @return by Return:</title>
<updated>2022-01-19T17:11:34+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2022-01-19T17:05:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=185f812c419f1b4f0d10d9787d59cf9f11a2a600'/>
<id>185f812c419f1b4f0d10d9787d59cf9f11a2a600</id>
<content type='text'>
Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>button: add udevice forward declaration</title>
<updated>2021-02-22T10:07:57+00:00</updated>
<author>
<name>Neil Armstrong</name>
<email>narmstrong@baylibre.com</email>
</author>
<published>2021-02-19T07:31:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2d339efb1ff941705a770e93494427912689ce18'/>
<id>2d339efb1ff941705a770e93494427912689ce18</id>
<content type='text'>
After 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
build fails with :

drivers/button/button-uclass.c:13:5: error: conflicting types for 'button_get_by_label'
int button_get_by_label(const char *label, struct udevice **devp)
    ^~~~~~~~~~~~~~~~~~~

Adding struct udevice forward declaration in button.h solves the build error.

Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
Suggested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
build fails with :

drivers/button/button-uclass.c:13:5: error: conflicting types for 'button_get_by_label'
int button_get_by_label(const char *label, struct udevice **devp)
    ^~~~~~~~~~~~~~~~~~~

Adding struct udevice forward declaration in button.h solves the build error.

Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header")
Suggested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: button: add an uclass for button</title>
<updated>2020-07-29T01:30:39+00:00</updated>
<author>
<name>Philippe Reynes</name>
<email>philippe.reynes@softathome.com</email>
</author>
<published>2020-07-24T16:19:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=30d66db78725e8396a3bd255cc51592c6cd7879d'/>
<id>30d66db78725e8396a3bd255cc51592c6cd7879d</id>
<content type='text'>
Add a new uclass for button that implements two functions:
- button_get_by_label
- button_get_status

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Philippe Reynes &lt;philippe.reynes@softathome.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new uclass for button that implements two functions:
- button_get_by_label
- button_get_status

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Philippe Reynes &lt;philippe.reynes@softathome.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
