Replaced jumpdrive functionality with charging mode functionality
This commit is contained in:
parent
be697e378d
commit
fe4060e455
15
Makefile
15
Makefile
|
@ -16,15 +16,16 @@ pine64-pinephone.img: fat-pine64-pinephone.img u-boot-sunxi-with-spl.bin
|
|||
fat-pine64-pinephone.img: initramfs-pine64-pinephone.gz kernel-sunxi.gz pine64-pinephone.scr dtbs/sunxi/sun50i-a64-pinephone-1.2.dtb
|
||||
@echo "MKFS $@"
|
||||
@rm -f $@
|
||||
@truncate --size 40M $@
|
||||
@truncate --size 50M $@
|
||||
@mkfs.fat -F32 $@
|
||||
|
||||
@mcopy -i $@ kernel-sunxi.gz ::Image.gz
|
||||
@mcopy -i $@ dtbs/sunxi/sun50i-a64-pinephone-1.2.dtb ::sun50i-a64-pinephone-1.2.dtb
|
||||
@mcopy -i $@ dtbs/sunxi/sun50i-a64-pinephone-1.1.dtb ::sun50i-a64-pinephone-1.1.dtb
|
||||
@mcopy -i $@ dtbs/sunxi/sun50i-a64-pinephone-1.0.dtb ::sun50i-a64-pinephone-1.0.dtb
|
||||
@mcopy -i $@ initramfs-pine64-pinephone.gz ::initramfs.gz
|
||||
@mcopy -i $@ pine64-pinephone.scr ::boot.scr
|
||||
mcopy -i $@ kernel-sunxi.gz ::Image.gz
|
||||
mcopy -i $@ dtbs/sunxi/sun50i-a64-pinephone-1.2.dtb ::sun50i-a64-pinephone-1.2.dtb
|
||||
mcopy -i $@ dtbs/sunxi/sun50i-a64-pinephone-1.1.dtb ::sun50i-a64-pinephone-1.1.dtb
|
||||
mcopy -i $@ dtbs/sunxi/sun50i-a64-pinephone-1.0.dtb ::sun50i-a64-pinephone-1.0.dtb
|
||||
mcopy -i $@ initramfs-pine64-pinephone.gz ::initramfs.gz
|
||||
mcopy -i $@ pine64-pinephone.scr ::boot.scr
|
||||
echo "OH NO"
|
||||
|
||||
pine64-pinetab.img: fat-pine64-pinetab.img u-boot-sunxi-with-spl.bin
|
||||
rm -f $@
|
||||
|
|
|
@ -35,29 +35,5 @@ mount -t configfs -o nodev,noexec,nosuid configfs /config
|
|||
mkdir -p /dev/pts
|
||||
mount -t devpts devpts /dev/pts
|
||||
|
||||
# LED indicator for MMC r/w access
|
||||
if [ -n "$LED" ]; then
|
||||
echo $TRIGGER > /sys/class/leds/$LED/trigger
|
||||
fi
|
||||
|
||||
if [ -n "$SLEEP" ]; then
|
||||
echo "Waiting for hardware to initialize..."
|
||||
sleep $SLEEP
|
||||
fi
|
||||
|
||||
# Create device nodes
|
||||
echo "Creating device nodes..."
|
||||
mknod /dev/null c 1 3
|
||||
mknod /dev/tty c 5 0
|
||||
mdev -s
|
||||
|
||||
# Finishing rescue setup
|
||||
start_serial_getty
|
||||
setup_usb_configfs
|
||||
start_udhcpd
|
||||
setup_telnetd
|
||||
|
||||
gzip -c -d splash.ppm.gz > /splash.ppm
|
||||
fbsplash -s /splash.ppm
|
||||
|
||||
loop_charging
|
||||
loop_forever
|
||||
|
|
|
@ -157,3 +157,21 @@ loop_forever() {
|
|||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
loop_charging() {
|
||||
while true; do
|
||||
echo 0 > /sys/class/backlight/*/brightness
|
||||
level=`cat /sys/devices/platform/soc/1f03400.rsb/sunxi-rsb-3a3/axp20x-battery-power-supply/power_supply/axp20x-battery/capacity`
|
||||
if [ "$level" -lt "50" ]; then
|
||||
echo 1 > /sys/devices/platform/leds/leds/red:indicator/brightness
|
||||
fi
|
||||
if [ "$level" -gt "5" ]; then
|
||||
echo 1 > /sys/devices/platform/leds/leds/green:indicator/brightness
|
||||
fi
|
||||
sleep 1
|
||||
echo 0 > /sys/devices/platform/leds/leds/red:indicator/brightness
|
||||
echo 0 > /sys/devices/platform/leds/leds/green:indicator/brightness
|
||||
echo 0 > /sys/devices/platform/leds/leds/blue:indicator/brightness
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
|
|
@ -1686,13 +1686,15 @@ CONFIG_POWER_SUPPLY_HWMON=y
|
|||
# CONFIG_BATTERY_DS2782 is not set
|
||||
# CONFIG_BATTERY_LEGO_EV3 is not set
|
||||
CONFIG_BATTERY_SBS=y
|
||||
CONFIG_BATTERY_AXP20X=y
|
||||
CONFIG_CHARGER_AXP20X=y
|
||||
# CONFIG_CHARGER_SBS is not set
|
||||
# CONFIG_MANAGER_SBS is not set
|
||||
CONFIG_BATTERY_BQ27XXX=y
|
||||
CONFIG_BATTERY_BQ27XXX_I2C=y
|
||||
# CONFIG_BATTERY_BQ27XXX_DT_UPDATES_NVM is not set
|
||||
CONFIG_AXP20X_POWER=y
|
||||
# CONFIG_AXP288_FUEL_GAUGE is not set
|
||||
CONFIG_AXP288_FUEL_GAUGE=y
|
||||
# CONFIG_BATTERY_MAX17040 is not set
|
||||
# CONFIG_BATTERY_MAX17042 is not set
|
||||
# CONFIG_CHARGER_ISP1704 is not set
|
||||
|
@ -2242,7 +2244,7 @@ CONFIG_FB_DEFERRED_IO=y
|
|||
#
|
||||
# CONFIG_LCD_CLASS_DEVICE is not set
|
||||
CONFIG_BACKLIGHT_CLASS_DEVICE=y
|
||||
CONFIG_BACKLIGHT_PWM=y
|
||||
CONFIG_BACKLIGHT_PWM=n
|
||||
# CONFIG_BACKLIGHT_QCOM_WLED is not set
|
||||
# CONFIG_BACKLIGHT_ADP8860 is not set
|
||||
# CONFIG_BACKLIGHT_ADP8870 is not set
|
||||
|
@ -3089,7 +3091,7 @@ CONFIG_IIO=y
|
|||
# CONFIG_AD7606_IFACE_PARALLEL is not set
|
||||
# CONFIG_AD799X is not set
|
||||
# CONFIG_ADI_AXI_ADC is not set
|
||||
# CONFIG_AXP20X_ADC is not set
|
||||
CONFIG_AXP20X_ADC=y
|
||||
# CONFIG_AXP288_ADC is not set
|
||||
# CONFIG_CC10001_ADC is not set
|
||||
# CONFIG_ENVELOPE_DETECTOR is not set
|
||||
|
|
Loading…
Reference in New Issue