Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static scc_return_t check_register_offset ( uint32_t  register_offset  )  [static]

Check that the offset is with the bounds of the SCC register set.

Parameters:
[in] register_offset register offset of SMN.
SCC_RET_OK if ok, SCC_RET_FAIL if not

Definition at line 2316 of file mxc_scc.c.

References offset_within_scm(), offset_within_smn(), SCC_BYTE_OFFSET, SCC_RET_FAIL, and SCC_RET_OK.

Referenced by scc_read_register(), and scc_write_register().

{
      int return_value = SCC_RET_FAIL;

      /* Is it valid word offset ? */
      if (SCC_BYTE_OFFSET(register_offset) == 0) {
            /* Yes. Is register within SCM? */
            if (offset_within_scm(register_offset)) {
                  return_value = SCC_RET_OK;    /* yes, all ok */
            }
            /* Not in SCM.  Now look within the SMN */
            else if (offset_within_smn(register_offset)) {
                  return_value = SCC_RET_OK;    /* yes, all ok */
            }
      }

      return return_value;
}


Generated by  Doxygen 1.6.0   Back to index