clock: add APIs to access servo and servo_state
Make servo and it's current state available outside clock.c Signed-off-by: Vedang Patel <vedang.patel@intel.com>
This commit is contained in:
		
							parent
							
								
									630ce719fc
								
							
						
					
					
						commit
						78b4b780da
					
				
							
								
								
									
										10
									
								
								clock.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								clock.c
									
									
									
									
									
								
							@ -1835,3 +1835,13 @@ double clock_rate_ratio(struct clock *c)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	return servo_rate_ratio(c->servo);
 | 
						return servo_rate_ratio(c->servo);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct servo *clock_servo(struct clock *c)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return c->servo;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum servo_state clock_servo_state(struct clock *c)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return c->servo_state;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										14
									
								
								clock.h
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								clock.h
									
									
									
									
									
								
							@ -253,6 +253,20 @@ void clock_set_sde(struct clock *c, int sde);
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
int clock_poll(struct clock *c);
 | 
					int clock_poll(struct clock *c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Obtain the servo struct.
 | 
				
			||||||
 | 
					 * @param c The clock instance.
 | 
				
			||||||
 | 
					 * @return  A pointer to the clock's servo.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					struct servo *clock_servo(struct clock *c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Obtain the current state of clock's servo.
 | 
				
			||||||
 | 
					 * @param c The clock instance.
 | 
				
			||||||
 | 
					 * @return  The current state of the clock's servo.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					enum servo_state clock_servo_state(struct clock *c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Obtain the slave-only flag from a clock's default data set.
 | 
					 * Obtain the slave-only flag from a clock's default data set.
 | 
				
			||||||
 * @param c  The clock instance.
 | 
					 * @param c  The clock instance.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user