mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	Add a directory by kernel instead of a common root, add qnap-301w and rpi4 kernel 6.1 suppport
This commit is contained in:
		
							parent
							
								
									e910436a7a
								
							
						
					
					
						commit
						46837ec4c0
					
				
					 9459 changed files with 362648 additions and 116345 deletions
				
			
		|  | @ -0,0 +1,49 @@ | |||
| From c7323bc2dca42fdb043f32025f1a000e7e486f77 Mon Sep 17 00:00:00 2001 | ||||
| From: Alex Crawford <raspberrypi/linux@code.acrawford.com> | ||||
| Date: Fri, 28 Jan 2022 13:36:51 -0800 | ||||
| Subject: [PATCH 387/726] i2c: bcm2835: Make clock-stretch timeout configurable | ||||
| 
 | ||||
| The default clock-stretch timeout is 35 mS, which works well for | ||||
| SMBus, but there are some I2C devices which can stretch the clock even | ||||
| longer. Rather than trying to prescribe a safe default for everyone, | ||||
| allow the timeout to be configured. | ||||
| 
 | ||||
| Signed-off-by: Alex Crawford <raspberrypi/linux@code.acrawford.com> | ||||
| ---
 | ||||
|  drivers/i2c/busses/i2c-bcm2835.c | 10 +++++++--- | ||||
|  1 file changed, 7 insertions(+), 3 deletions(-) | ||||
| 
 | ||||
| diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
 | ||||
| index d768247c7e50..7408e2c136b0 100644
 | ||||
| --- a/drivers/i2c/busses/i2c-bcm2835.c
 | ||||
| +++ b/drivers/i2c/busses/i2c-bcm2835.c
 | ||||
| @@ -60,6 +60,10 @@ static unsigned int debug;
 | ||||
|  module_param(debug, uint, 0644); | ||||
|  MODULE_PARM_DESC(debug, "1=err, 2=isr, 3=xfer"); | ||||
|   | ||||
| +static unsigned int clk_tout_ms = 35; /* SMBUs-recommended 35ms */
 | ||||
| +module_param(clk_tout_ms, uint, 0644);
 | ||||
| +MODULE_PARM_DESC(clk_tout_ms, "clock-stretch timeout (mS)");
 | ||||
| +
 | ||||
|  #define BCM2835_DEBUG_MAX	512 | ||||
|  struct bcm2835_debug { | ||||
|  	struct i2c_msg *msg; | ||||
| @@ -219,12 +223,12 @@ static int clk_bcm2835_i2c_set_rate(struct clk_hw *hw, unsigned long rate,
 | ||||
|  			   (redl << BCM2835_I2C_REDL_SHIFT)); | ||||
|   | ||||
|  	/* | ||||
| -	 * Set the clock stretch timeout to the SMBUs-recommended 35ms.
 | ||||
| +	 * Set the clock stretch timeout.
 | ||||
|  	 */ | ||||
| -	if (rate > 0xffff*1000/35)
 | ||||
| +	if (rate > 0xffff*1000/clk_tout_ms)
 | ||||
|  	    clk_tout = 0xffff; | ||||
|  	else | ||||
| -	    clk_tout = 35*rate/1000;
 | ||||
| +	    clk_tout = clk_tout_ms*rate/1000;
 | ||||
|   | ||||
|  	bcm2835_i2c_writel(div->i2c_dev, BCM2835_I2C_CLKT, clk_tout); | ||||
|   | ||||
| -- 
 | ||||
| 2.33.1 | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue