 a34255b795
			
		
	
	a34255b795
	
	
	
		
			
			Removed upstreamed: bcm27xx/patches-5.15/950-0446-drm-vc4-Fix-timings-for-VEC-modes.patch[1] Manually rebased: patches-5.15/950-0600-xhci-quirks-add-link-TRB-quirk-for-VL805.patch bcm27xx/patches-5.15/950-0606-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch bcm27xx/patches-5.15/950-0717-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch All other patches automatically rebased 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.75&id=2810061452f9b748b096ad023d318690ca519aa3 Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <therealgraysky@proton.me>
		
			
				
	
	
		
			75 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 82985725e071f2a5735052f18e109a32aeac3a0b Mon Sep 17 00:00:00 2001
 | |
| From: David Bauer <mail@david-bauer.net>
 | |
| Date: Sun, 26 Jul 2020 02:38:31 +0200
 | |
| Subject: [PATCH] net: usb: r8152: add LED configuration from OF
 | |
| 
 | |
| This adds the ability to configure the LED configuration register using
 | |
| OF. This way, the correct value for board specific LED configuration can
 | |
| be determined.
 | |
| 
 | |
| Signed-off-by: David Bauer <mail@david-bauer.net>
 | |
| ---
 | |
|  drivers/net/usb/r8152.c | 23 +++++++++++++++++++++++
 | |
|  1 file changed, 23 insertions(+)
 | |
| 
 | |
| --- a/drivers/net/usb/r8152.c
 | |
| +++ b/drivers/net/usb/r8152.c
 | |
| @@ -11,6 +11,7 @@
 | |
|  #include <linux/mii.h>
 | |
|  #include <linux/ethtool.h>
 | |
|  #include <linux/usb.h>
 | |
| +#include <linux/of.h>
 | |
|  #include <linux/crc32.h>
 | |
|  #include <linux/if_vlan.h>
 | |
|  #include <linux/uaccess.h>
 | |
| @@ -6863,6 +6864,22 @@ static void rtl_tally_reset(struct r8152
 | |
|  	ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
 | |
|  }
 | |
|  
 | |
| +static int r8152_led_configuration(struct r8152 *tp)
 | |
| +{
 | |
| +	u32 led_data;
 | |
| +	int ret;
 | |
| +
 | |
| +	ret = of_property_read_u32(tp->udev->dev.of_node, "realtek,led-data",
 | |
| +								&led_data);
 | |
| +
 | |
| +	if (ret)
 | |
| +		return ret;
 | |
| +	
 | |
| +	ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, led_data);
 | |
| +
 | |
| +	return 0;
 | |
| +}
 | |
| +
 | |
|  static void r8152b_init(struct r8152 *tp)
 | |
|  {
 | |
|  	u32 ocp_data;
 | |
| @@ -6904,6 +6921,8 @@ static void r8152b_init(struct r8152 *tp
 | |
|  	ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
 | |
|  	ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
 | |
|  	ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
 | |
| +
 | |
| +	r8152_led_configuration(tp);
 | |
|  }
 | |
|  
 | |
|  static void r8153_init(struct r8152 *tp)
 | |
| @@ -7044,6 +7063,8 @@ static void r8153_init(struct r8152 *tp)
 | |
|  		tp->coalesce = COALESCE_SLOW;
 | |
|  		break;
 | |
|  	}
 | |
| +
 | |
| +	r8152_led_configuration(tp);
 | |
|  }
 | |
|  
 | |
|  static void r8153b_init(struct r8152 *tp)
 | |
| @@ -7126,6 +7147,8 @@ static void r8153b_init(struct r8152 *tp
 | |
|  	rtl_tally_reset(tp);
 | |
|  
 | |
|  	tp->coalesce = 15000;	/* 15 us */
 | |
| +
 | |
| +	r8152_led_configuration(tp);
 | |
|  }
 | |
|  
 | |
|  static void r8153c_init(struct r8152 *tp)
 |