| /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ |
| * common/cmd_forceupdate.c |
| * Copyright (C) 2020 Amlogic, Inc. All rights reserved. |
| #define CONFIG_SARADC_CH 2 |
| inline int get_source_key(int channel) |
| int adc_val = get_adc_sample_gxbb(adc_chan); |
| //printf("get_source_key (%d) at channel (%d)\n", adc_val,adc_chan); |
| static void check_auto_update(void) |
| int source_key_value = -1; |
| source_key_value = get_source_key(CONFIG_SARADC_CH); |
| if ((source_key_value >= 0) && (source_key_value < 40)) { |
| //printk("press update key!\n"); |
| printf("press update key!\n"); |
| run_command ("run update", 0); |
| static void press_key_into_update(void) |
| static int do_forceupdate(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) |
| forceupdate, 1, 1, do_forceupdate, |
| "forceupdate - press adc key before power on\n" |