Skip to content

VIM3: add support for checking 'Function' button state

Marek Szyprowski u-boot u-boot-amlogic 8 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest5 patches 0 repliesNew
  2. v65 patches 0 repliesSuperseded
  3. v54 patches 0 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v4 posting 2/20 of 3 patches0 repliesSuperseded
v4 posting 1/23 patches2 repliesSuperseded
v36 patches0 repliesSuperseded
v27 patches0 repliesSuperseded
v16 patches0 repliesSuperseded

Changes in v7 from the cover letter

- added linux,code properties to the test.dts

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dt-bindings: input: adc-keys bindings documentationdoc/device-tree-bindings/input/adc-keys.txt+67 -00 replies
2/5button: add a simple Analog to Digital Converter device based button driverdrivers/button/Kconfig drivers/button/Makefile drivers/button/button-adc.c+155 -00 replies
3/5adc: meson-saradc: add support for getting reference voltage valuedrivers/adc/meson-saradc.c+21 -00 replies
4/5configs: khadas-vim3(l): enable Function button supportconfigs/khadas-vim3_defconfig configs/khadas-vim3l_defconfig+4 -00 replies
5/5test: add a simple test for the adc-keys button driverarch/sandbox/dts/test.dts configs/sandbox_defconfig test/dm/button.c+76 -30 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/5] VIM3: add support for checking 'Function' button state

Hi All,

This patchset adds all building blocks needed for checking the 'Function' button state in the boot script on Amlogic A311D based VIM3 board. This button is connected to the ADC line of the SoC, so it required to enable meson SARADC, the clocks needed for it and a simple button-adc drivers.

Once applied, one can use following commands in the boot scripts:
-->8---
echo Checking Func button state: \\c
if button Function
then

	echo Selected alternative boot
	...

fi
--->8---

Best regards
Marek Szyprowski
Samsung R&D Institute Poland

Changelog:
v7:
- added linux,code properties to the test.dts

v6: https://lists.denx.de/pipermail/u-boot/2021-February/441039.html
- added a simple sandbox test for adc-keys
- use of_to_plat and adc_raw_to_uV to simplify code in the adc button driver

v5: https://lists.denx.de/pipermail/u-boot/2021-January/438751.html
- rebased onto latest uboot-amlogic/u-boot-amlogic-next branch
- synchronized adc-keys binding with the recent version from the Linux kernel
- updated adc-keys driver to match behavior from dt-bindings
- added a patch for meson-saradc driver to register vdd reference supply to the ADC framework

v4: https://lists.denx.de/pipermail/u-boot/2020-December/435641.html
- rebased onto uboot-amlogic/u-boot-amlogic-next and dropped merged patches
- added adc-keys bindings docs (copied from Linux kernel)
- minor code adjustments pointed by Simon
- enabled driver also in khadas-vim3l_defconfig

v3: https://lists.denx.de/pipermail/u-boot/2020-December/435072.html
- removed 'button' env variable
- extended kconfig and patch descriptions

v2: https://lists.denx.de/pipermail/u-boot/2020-December/434991.html
- removed Change-Id tags
- split defconfig changes into ADC and button related

v1: https://lists.denx.de/pipermail/u-boot/2020-December/434875.html
- initial submission

Patch summary:

Marek Szyprowski (5):
dt-bindings: input: adc-keys bindings documentation
button: add a simple Analog to Digital Converter device based button
driver
adc: meson-saradc: add support for getting reference voltage value
configs: khadas-vim3(l): enable Function button support
test: add a simple test for the adc-keys button driver

 arch/sandbox/dts/test.dts                   |  27 +++-
 configs/khadas-vim3_defconfig               |   2 +
 configs/khadas-vim3l_defconfig              |   2 +
 configs/sandbox_defconfig                   |   1 +
 doc/device-tree-bindings/input/adc-keys.txt |  67 +++++++++
 drivers/adc/meson-saradc.c                  |  21 +++
 drivers/button/Kconfig                      |   8 ++
 drivers/button/Makefile                     |   1 +
 drivers/button/button-adc.c                 | 146 ++++++++++++++++++++
 test/dm/button.c                            |  50 ++++++-
 10 files changed, 322 insertions(+), 3 deletions(-)
 create mode 100644 doc/device-tree-bindings/input/adc-keys.txt
 create mode 100644 drivers/button/button-adc.c
Signature · 1 line
2.17.1