FreeBSD/sys/arm/ti/am335x/am335x_dmtpps.c
/*
 * Ask the pinmux driver whether any pin has been configured as a TIMER4..TIMER7
 * input pin.  If so, return the timer number, if not return 0.
 */
Ask the pinmux driver whether any pin has been configured as a TIMER4..TIMER7
input pin.  If so, return the timer number, if not return 0.
Ask the pinmux driver whether any pin has been configured as a TIMER4 .. TIMER7 input pin . If so return the timer number if not return 0 .
static int
dmtpps_find_tmr_num_by_padconf()
{
	int err;
	unsigned int padstate;
	const char * padmux;
	struct padinfo *pi;
	char muxmode[12];
	for (pi = dmtpps_padinfo; pi->ballname != NULL; pi++) {
		err = ti_pinmux_padconf_get(pi->ballname, &padmux, &padstate);
		snprintf(muxmode, sizeof(muxmode), "timer%d", pi->tmr_num);
		if (err == 0 && (padstate & RXACTIVE) != 0 &&
		    strcmp(muxmode, padmux) == 0)
			return (pi->tmr_num);
	}
	return (0);
}
static int dmtpps_find_tmr_num_by_padconf ( ) { int err ; unsigned int padstate ; const char * padmux ; struct padinfo * pi ; char muxmode [ 12 ] ; for ( pi = dmtpps_padinfo ; pi -> ballname != NULL ; pi ++ ) { err = ti_pinmux_padconf_get ( pi -> ballname , & padmux , & padstate ) ; snprintf ( muxmode , sizeof ( muxmode ) , " " , pi -> tmr_num ) ; if ( err == 0 && ( padstate & RXACTIVE ) != 0 && strcmp ( muxmode , padmux ) == 0 ) return ( pi -> tmr_num ) ; } return ( 0 ) ; }
Ask the pinmux driver whether any pin has been configured as a TIMER4..TIMER7
 input pin.
Ask the pinmux driver whether any pin has been configured as a TIMER4 .. TIMER7 input pin .
/* Nothing found, not an error. */