ramips: TP-link archer A6/C6 device tree updates
Set correct GPIO (10) for the WPS button. This matches GPIO settings in vendor GPL sources. Note that GPL sources also mention a USB indicator LED (GPIO 13) but the device has neither an external USB port nor a USB LED. In addition, prefixes (button-, led-) are added to relevant DT entries, as well as color and function specifications for LEDs. Closes: #13736 Reported-by: Waldemar Czabaj <kaball@wp.pl> Signed-off-by: Rani Hod <rani.hod@gmail.com> (added led mitigations for wifi leds) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This commit is contained in:
		 Rani Hod
					Rani Hod
				
			
				
					committed by
					
						 Christian Lamparter
						Christian Lamparter
					
				
			
			
				
	
			
			
			 Christian Lamparter
						Christian Lamparter
					
				
			
						parent
						
							71e2c64bef
						
					
				
				
					commit
					fe5e498777
				
			| @@ -4,6 +4,7 @@ | |||||||
|  |  | ||||||
| #include <dt-bindings/gpio/gpio.h> | #include <dt-bindings/gpio/gpio.h> | ||||||
| #include <dt-bindings/input/input.h> | #include <dt-bindings/input/input.h> | ||||||
|  | #include <dt-bindings/leds/common.h> | ||||||
|  |  | ||||||
| / { | / { | ||||||
| 	aliases { | 	aliases { | ||||||
| @@ -21,14 +22,14 @@ | |||||||
| 	keys { | 	keys { | ||||||
| 		compatible = "gpio-keys"; | 		compatible = "gpio-keys"; | ||||||
|  |  | ||||||
| 		wps { | 		button-wps { | ||||||
| 			label = "wps"; | 			label = "wps"; | ||||||
| 			gpios = <&gpio 28 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 10 GPIO_ACTIVE_LOW>; | ||||||
| 			debounce-interval = <60>; | 			debounce-interval = <60>; | ||||||
| 			linux,code = <KEY_WPS_BUTTON>; | 			linux,code = <KEY_WPS_BUTTON>; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		reset { | 		button-reset { | ||||||
| 			label = "reset"; | 			label = "reset"; | ||||||
| 			gpios = <&gpio 8 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 8 GPIO_ACTIVE_LOW>; | ||||||
| 			debounce-interval = <60>; | 			debounce-interval = <60>; | ||||||
| @@ -39,35 +40,44 @@ | |||||||
| 	leds { | 	leds { | ||||||
| 		compatible = "gpio-leds"; | 		compatible = "gpio-leds"; | ||||||
|  |  | ||||||
| 		led_power: power { | 		led_power: led-power { | ||||||
| 			label = "green:power"; | 			label = "green:power"; | ||||||
|  | 			color = <LED_COLOR_ID_GREEN>; | ||||||
|  | 			function = LED_FUNCTION_POWER; | ||||||
| 			gpios = <&gpio 4 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 4 GPIO_ACTIVE_LOW>; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		wan_orange { | 		led-wan-amber { | ||||||
| 			label = "orange:wan"; | 			color = <LED_COLOR_ID_AMBER>; | ||||||
|  | 			function = LED_FUNCTION_WAN; | ||||||
| 			gpios = <&gpio 14 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 14 GPIO_ACTIVE_LOW>; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		lan { | 		led-lan { | ||||||
| 			label = "green:lan"; | 			color = <LED_COLOR_ID_GREEN>; | ||||||
|  | 			function = LED_FUNCTION_LAN; | ||||||
| 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		wifi5g { | 		led-wifi5g { | ||||||
| 			label = "green:wifi5g"; | 			color = <LED_COLOR_ID_GREEN>; | ||||||
|  | 			function = LED_FUNCTION_WLAN; | ||||||
|  | 			function-enumerator = <5>; | ||||||
| 			gpios = <&gpio 16 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 16 GPIO_ACTIVE_LOW>; | ||||||
| 			linux,default-trigger = "phy1tpt"; | 			linux,default-trigger = "phy1tpt"; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		wifi2g { | 		led-wifi2g { | ||||||
| 			label = "green:wifi2g"; | 			color = <LED_COLOR_ID_GREEN>; | ||||||
|  | 			function = LED_FUNCTION_WLAN; | ||||||
|  | 			function-enumerator = <2>; | ||||||
| 			gpios = <&gpio 18 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 18 GPIO_ACTIVE_LOW>; | ||||||
| 			linux,default-trigger = "phy0tpt"; | 			linux,default-trigger = "phy0tpt"; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		wan_green { | 		led-wan-green { | ||||||
| 			label = "green:wan"; | 			color = <LED_COLOR_ID_GREEN>; | ||||||
|  | 			function = LED_FUNCTION_WAN; | ||||||
| 			gpios = <&gpio 45 GPIO_ACTIVE_LOW>; | 			gpios = <&gpio 45 GPIO_ACTIVE_LOW>; | ||||||
| 		}; | 		}; | ||||||
| 	}; | 	}; | ||||||
|   | |||||||
| @@ -0,0 +1,17 @@ | |||||||
|  | . /lib/functions.sh | ||||||
|  | . /lib/functions/migrations.sh | ||||||
|  |  | ||||||
|  | board=$(board_name) | ||||||
|  |  | ||||||
|  | case "$board" in | ||||||
|  | tplink,archer-a6-v3|\ | ||||||
|  | tplink,archer-c6-v3) | ||||||
|  | 	migrate_leds ':wifi2g$=:wlan-2' ':wifi5g$=:wlan-5' | ||||||
|  | 	;; | ||||||
|  | esac | ||||||
|  |  | ||||||
|  | remove_devicename_leds | ||||||
|  |  | ||||||
|  | migrations_apply system | ||||||
|  |  | ||||||
|  | exit 0 | ||||||
		Reference in New Issue
	
	Block a user