Skip to content
Snippets Groups Projects
Commit 284d792f authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

[CMD][CONFIG] Add additional check to touch selection and add comments

parent 7e39235e
Branches
No related tags found
1 merge request!192Add touch sub-selection to seco_config
...@@ -1206,18 +1206,32 @@ int selection_touch_mode (touch_mode_t touch_mode_list[], int num_element) { ...@@ -1206,18 +1206,32 @@ int selection_touch_mode (touch_mode_t touch_mode_list[], int num_element) {
} }
int set_touch_mode( int fdt_selected_device ) { int set_touch_mode( int fdt_selected_device ) {
int touch_mode_selection; int touch_mode_selection = -1;
#ifdef CONFIG_OF_LIBFDT_OVERLAY #ifdef CONFIG_OF_LIBFDT_OVERLAY
char touch_overlay_list[256]; char touch_overlay_list[256];
char *fdt_overlay_touch_load; char *fdt_overlay_touch_load;
#endif
/* select touch mode configuration */ /*
* The touch_mode_list might be empty (for devices without
* a configurable touch controller). Double check if the
* list is initialized and exit if not. Also see the general
* checks for ENV_NUM_TOUCH.
*/
if ( ! gd->boot_setup.touch_mode_list )
return 0;
/*
* Show the sub-selection for the touch
* controller and set the user selection.
*/
touch_mode_selection = selection_touch_mode( gd->boot_setup.touch_mode_list, touch_mode_selection = selection_touch_mode( gd->boot_setup.touch_mode_list,
gd->boot_setup.touch_mode_num ); gd->boot_setup.touch_mode_num );
#ifdef CONFIG_OF_LIBFDT_OVERLAY /*
/* touch setting for a fdt overlay file */ * Set the environment command for loading
* the devicetree overlay for the touch controller.
*/
memset( touch_overlay_list, 0, sizeof( touch_overlay_list ) ); memset( touch_overlay_list, 0, sizeof( touch_overlay_list ) );
if ( gd->boot_setup.touch_mode_list[touch_mode_selection].dtbo_conf_file != NULL ) { if ( gd->boot_setup.touch_mode_list[touch_mode_selection].dtbo_conf_file != NULL ) {
...@@ -1234,7 +1248,11 @@ int set_touch_mode( int fdt_selected_device ) { ...@@ -1234,7 +1248,11 @@ int set_touch_mode( int fdt_selected_device ) {
#endif #endif
} }
} else { } else {
/* Clear overlay list and command if nothing is selected */ /*
* Clear the devicetree overlay list and
* command from the environment if nothing
* is selected.
*/
SAVE_FDT_OVERLAY_TOUCH_LIST( "" ); SAVE_FDT_OVERLAY_TOUCH_LIST( "" );
SAVE_FDT_OVERLAY_TOUCH_CMD( "" ); SAVE_FDT_OVERLAY_TOUCH_CMD( "" );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment