forked from mirrors/linux
		
	ptp: Allow reassigning calibration pin function
The ptp pin function programming does not allow calibration pin to change function. This is problematic on hardware that uses the default calibration pin for other purposes. Removing this limitation does not impact calibration if userspace does not reprogram the calibration pin. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									e0155950f0
								
							
						
					
					
						commit
						72df7a7244
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -86,17 +86,12 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin,
 | 
			
		|||
			return -EINVAL;
 | 
			
		||||
		break;
 | 
			
		||||
	case PTP_PF_PHYSYNC:
 | 
			
		||||
		pr_err("sorry, cannot reassign the calibration pin\n");
 | 
			
		||||
		if (chan != 0)
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
	default:
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (pin2->func == PTP_PF_PHYSYNC) {
 | 
			
		||||
		pr_err("sorry, cannot reprogram the calibration pin\n");
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (info->verify(info, pin, func, chan)) {
 | 
			
		||||
		pr_err("driver cannot use function %u on pin %u\n", func, chan);
 | 
			
		||||
		return -EOPNOTSUPP;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue