diff --git a/configure.ac b/configure.ac index fef5d141..ba631028 100644 --- a/configure.ac +++ b/configure.ac @@ -819,6 +819,35 @@ else AC_MSG_RESULT([no]) fi +#------------------------------------------------------------------------------ +# Force the reference clock to OP even if unconfigured +#------------------------------------------------------------------------------ + +AC_MSG_CHECKING([whether to force the reference clock to OP]) + +AC_ARG_ENABLE([refclkop], + AS_HELP_STRING([--enable-refclkop], + [Force reference clock to OP (default: no)]), + [ + case "${enableval}" in + yes) refclkop=1 + ;; + no) refclkop=0 + ;; + *) AC_MSG_ERROR([Invalid value for --enable-refclkop]) + ;; + esac + ], + [refclkop=0] +) + +if test "x${refclkop}" = "x1"; then + AC_DEFINE([EC_REFCLKOP], [1], [Force refclk to OP]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + #------------------------------------------------------------------------------ # Command-line tool #----------------------------------------------------------------------------- diff --git a/master/master.c b/master/master.c index 2b94b19a..d58e7161 100644 --- a/master/master.c +++ b/master/master.c @@ -2224,10 +2224,12 @@ void ec_master_request_op( } } +#ifdef EC_REFCLKOP // always set DC reference clock to OP if (master->dc_ref_clock) { ec_slave_request_state(master->dc_ref_clock, EC_SLAVE_STATE_OP); } +#endif } /******************************************************************************