Merge branch 'denx-coldfire' into coldfire-aug2007
[oweals/u-boot.git] / drivers / sk98lin / sklm80.c
index 51c7cc46ae3a12cf40b61dc7e96a793b69672183..687572b1d24af9c9fd822f64c34da446597146a0 100644 (file)
  *     Revision 1.20  2002/08/13 09:16:27  rschmidt
  *     Changed return value for SkLm80ReadSensor() back to 'int'
  *     Editorial changes
- *     
+ *
  *     Revision 1.19  2002/08/06 09:43:31  jschmalz
  *     Extensions and changes for Yukon
- *     
+ *
  *     Revision 1.18  2002/08/02 12:26:57  rschmidt
  *     Editorial changes
- *     
+ *
  *     Revision 1.17  1999/11/22 13:35:51  cgoos
  *     Changed license header to GPL.
- *     
+ *
  *     Revision 1.16  1999/05/27 14:05:47  malthoff
  *     Fans: Set SenVal to 0 if the fan value is 0 or 0xff. Both values
  *     are outside the limits (0: div zero error, 0xff: value not in
  *     range, assume 0).
- *     
+ *
  *     Revision 1.15  1999/05/27 13:38:51  malthoff
  *     Pervent from Division by zero errors.
- *     
+ *
  *     Revision 1.14  1999/05/20 09:20:01  cgoos
  *     Changes for 1000Base-T (Fan sensors).
- *     
+ *
  *     Revision 1.13  1998/10/22 09:48:14  gklug
  *     fix: SysKonnectFileId typo
- *     
+ *
  *     Revision 1.12  1998/10/09 06:12:06  malthoff
  *     Remove ID_sccs by SysKonnectFileId.
- *     
+ *
  *     Revision 1.11  1998/09/04 08:33:48  malthoff
  *     bug fix: SenState = SK_SEN_IDLE when
  *     leaving SK_SEN_VALEXT state
- *     
+ *
  *     Revision 1.10  1998/08/20 12:02:10  gklug
  *     fix: compiler warnings type mismatch
  *
  *     Revision 1.9  1998/08/20 11:37:38  gklug
  *     chg: change Ioc to IoC
- *     
+ *
  *     Revision 1.8  1998/08/19 12:20:58  gklug
  *     fix: remove struct from C files (see CCC)
- *     
+ *
  *     Revision 1.7  1998/08/17 07:04:57  malthoff
  *     Take SkLm80RcvReg() function from ski2c.c.
  *     Add IoC parameter to BREAK_OR_WAIT() macro.
- *     
+ *
  *     Revision 1.6  1998/08/14 07:11:28  malthoff
  *     remove pAc with pAC.
  *
  ******************************************************************************/
 
 
+#include <config.h>
+
+#ifdef CONFIG_SK98
+
 /*
        LM80 functions
 */
@@ -154,9 +158,9 @@ int         Reg)            /* register to read */
                }
                Val = Val * SK_LM80_TEMP_LSB;
                SkI2cStop(IoC);
-               
+
                TempExt = (int)SkLm80RcvReg(IoC, LM80_ADDR, LM80_TEMP_CTRL);
-               
+
                if (Val > 0) {
                        Val += ((TempExt >> 7) * SK_LM80_TEMPEXT_LSB);
                }
@@ -171,7 +175,7 @@ int         Reg)            /* register to read */
        case LM80_VT3_IN:
                Val = (int)SkI2cRcvByte(IoC, 1) * SK_LM80_VT_LSB;
                break;
-       
+
        default:
                Val = (int)SkI2cRcvByte(IoC, 1);
                break;
@@ -206,11 +210,11 @@ SK_SENSOR *pSen)  /* Sensor to be read */
 
                pSen->SenState = SK_SEN_VALUE ;
                BREAK_OR_WAIT(pAC, IoC, I2C_READ);
-       
+
        case SK_SEN_VALUE:
                /* Read value from data register */
                SK_IN32(IoC, B2_I2C_DATA, ((SK_U32 *)&Value));
-               
+
                Value &= 0xff; /* only least significant byte is valid */
 
                /* Do NOT check the Value against the thresholds */
@@ -254,7 +258,7 @@ SK_SENSOR   *pSen)  /* Sensor to be read */
 
                pSen->SenState = SK_SEN_VALEXT ;
                BREAK_OR_WAIT(pAC, IoC, I2C_READ);
-       
+
        case SK_SEN_VALEXT:
                /* Read value from data register */
                SK_IN32(IoC, B2_I2C_DATA, ((SK_U32 *)&Value));
@@ -275,7 +279,7 @@ SK_SENSOR   *pSen)  /* Sensor to be read */
 
                pSen->SenState = SK_SEN_IDLE ;
                return(1);
-       
+
        default:
                SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E007, SKERR_I2C_E007MSG);
                return(1);
@@ -284,3 +288,5 @@ SK_SENSOR   *pSen)  /* Sensor to be read */
        /* Not completed */
        return(0);
 }
+
+#endif /* CONFIG_SK98 */