#!/bin/bash efivarfs_mount=/sys/firmware/efi/efivars test_guid=210be57c-9849-4fc7-a635-e6382d1aec27 check_prereqs() { local msg="skip all tests:" if [ $UID != 0 ]; then echo $msg must be run as root >&2 exit 0 fi if ! grep -q "^\S\+ $efivarfs_mount efivarfs" /proc/mounts; then echo $msg efivarfs is not mounted on $efivarfs_mount >&2 exit 0 fi } run_test() { local test="$1" echo "--------------------" echo "running $test" echo "--------------------" if [ "$(type -t $test)" = 'function' ]; then ( $test ) else ( ./$test ) fi if [ $? -ne 0 ]; then echo " [FAIL]" rc=1 else echo " [PASS]" fi } test_create() { local attrs='\x07\x00\x00\x00' local file=$efivarfs_mount/$FUNCNAME-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file couldn't be created" >&2 exit 1 fi if [ $(stat -c %s $file) -ne 5 ]; then echo "$file has invalid size" >&2 exit 1 fi } test_create_empty() { local file=$efivarfs_mount/$FUNCNAME-$test_guid : > $file if [ ! -e $file ]; then echo "$file can not be created without writing" >&2 exit 1 fi } test_create_read() { local file=$efivarfs_mount/$FUNCNAME-$test_guid ./create-read $file } test_delete() { local attrs='\x07\x00\x00\x00' local file=$efivarfs_mount/$FUNCNAME-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file couldn't be created" >&2 exit 1 fi rm $file 2>/dev/null if [ $? -ne 0 ]; then chattr -i $file rm $file fi if [ -e $file ]; then echo "$file couldn't be deleted" >&2 exit 1 fi } # test that we can remove a variable by issuing a write with only # attributes specified test_zero_size_delete() { local attrs='\x07\x00\x00\x00' local file=$efivarfs_mount/$FUNCNAME-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file does not exist" >&2 exit 1 fi chattr -i $file printf "$attrs" > $file if [ -e $file ]; then echo "$file should have been deleted" >&2 exit 1 fi } test_open_unlink() { local file=$efivarfs_mount/$FUNCNAME-$test_guid ./open-unlink $file } # test that we can create a range of filenames test_valid_filenames() { local attrs='\x07\x00\x00\x00' local ret=0 local file_list="abc dump-type0-11-1-1362436005 1234 -" for f in $file_list; do local file=$efivarfs_mount/$f-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file could not be created" >&2 ret=1 else rm $file 2>/dev/null if [ $? -ne 0 ]; then chattr -i $file rm $file fi fi done exit $ret } test_invalid_filenames() { local attrs='\x07\x00\x00\x00' local ret=0 local file_list=" -1234-1234-1234-123456789abc foo foo-bar -foo- foo-barbazba-foob-foob-foob-foobarbazfoo foo------------------------------------- -12345678-1234-1234-1234-123456789abc a-12345678=1234-1234-1234-123456789abc a-12345678-1234=1234-1234-123456789abc a-12345678-1234-1234=1234-123456789abc a-12345678-1234-1234-1234=123456789abc 1112345678-1234-1234-1234-123456789abc" for f in $file_list; do local file=$efivarfs_mount/$f printf "$attrs\x00" 2>/dev/null > $file if [ -e $file ]; then echo "Creating $file should have failed" >&2 rm $file 2>/dev/null if [ $? -ne 0 ]; then chattr -i $file rm $file fi ret=1 fi done exit $ret } check_prereqs rc=0 run_test test_create run_test test_create_empty run_test test_create_read run_test test_delete run_test test_zero_size_delete run_test test_open_unlink run_test test_valid_filenames run_test test_invalid_filenames exit $rc n value='20'>20space:mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2016-04-26 16:00:51 +0200
committerMark Brown <broonie@kernel.org>2016-04-26 15:57:45 +0100
commit8d4d5c3a7c25e69075e60e5e70c1e05c205aef89 (patch)
tree5e33b3da31b2018aef2c45ad52b703fd33b602d4 /Documentation/arm
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
regulator: axp20x: Fix LDO4 linear voltage range
The current linear voltage range for the LDO4 regulator found in the APX20X PMICs assumes that the voltage is linear between 2.5 and 3.1V. However, the PMIC can output up to 3.3V on that regulator by skipping the 2.6V and 2.9V steps. Fix the ranges to read and set the proper voltages. Fixes: 13d57e64352a ("regulator: axp20x: Use linear voltage ranges for AXP20X LDO4") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/arm')