mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-30 11:38:15 +00:00 
			
		
		
		
	This extends the pinctrl-sandbox driver to support pin muxing, and adds a test for that behaviour. The test is done in C and not python (like the existing tests for the pinctrl uclass) because it needs to call pinctrl_select_state. Another option could be to add a command that invokes pinctrl_select_state and then test everything in test/py/tests/test_pinmux.py. The pinctrl-sandbox driver now mimics the way that many pinmux devices work. There are two groups of pins which are muxed together, as well as four pins which are muxed individually. I have tried to test all normal paths. However, very few error cases are explicitly checked for. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
		
			
				
	
	
		
			20 lines
		
	
	
		
			453 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			453 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: GPL-2.0 */
 | |
| /*
 | |
|  * Copyright (C) 2020 Sean Anderson <seanga2@gmail.com>
 | |
|  */
 | |
| 
 | |
| #ifndef SANDBOX_PINMUX_H
 | |
| #define SANDBOX_PINMUX_H
 | |
| 
 | |
| #define SANDBOX_PINMUX_UART 0
 | |
| #define SANDBOX_PINMUX_I2C  1
 | |
| #define SANDBOX_PINMUX_SPI  2
 | |
| #define SANDBOX_PINMUX_I2S  3
 | |
| #define SANDBOX_PINMUX_GPIO 4
 | |
| #define SANDBOX_PINMUX_CS   5
 | |
| #define SANDBOX_PINMUX_PWM  6
 | |
| 
 | |
| #define SANDBOX_PINMUX(pin, func) ((func) << 16 | (pin))
 | |
| 
 | |
| #endif /* SANDBOX_PINMUX_H */
 |