Skip to contentSkip to conversation

I2C Monitor Chip ADT7460 support

PATCH New Ricardo Ribalda Delgado 2 participants 4 messages Jul 11, 2008 Hardware monitoring

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 I2C Monitor Chip ADT7460 support

---
 drivers/hwmon/Makefile  |    1 +
 drivers/hwmon/adt7460.c |   85 +++++++++++++++++++++++++++++++++++++++++++++++
 include/dtt.h           |    3 +-
 3 files changed, 88 insertions(+), 1 deletions(-)
 create mode 100644 drivers/hwmon/adt7460.c
drivers/hwmon/Makefile +1 -0
index 065433a..e301eaa 100644
@@ -37,6 +37,7 @@ COBJS-y += ds1775.o
 COBJS-$(CONFIG_DTT_LM73) += lm73.o
 COBJS-y += lm75.o
 COBJS-y += lm81.o
+COBJS-$(CONFIG_DTT_ADT7460) += adt7460.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/hwmon/adt7460.c new file +85 -0

85 lines not on this page · raw message

include/dtt.h +2 -1
index 4e8aaad..5efe294 100644
@@ -32,7 +32,8 @@
     defined(CONFIG_DTT_DS1775) || \
     defined(CONFIG_DTT_LM81) || \
     defined(CONFIG_DTT_ADM1021) || \
-    defined(CONFIG_DTT_LM73)
+    defined(CONFIG_DTT_LM73) || \
+    defined(CONFIG_DTT_ADT7460)
 
 #define CONFIG_DTT				/* We have a DTT */
 
Signature · 1 line
1.5.6.2
#2 lore raw

PATCH 1/1 I2C Monitor Chip ADT7460 support

Quoted 1 line · Ricardo Ribalda Delgado

Ricardo, please address my (nitpicking) comments below in the next version. You could also run "Lindent" if you don't want to do this coding style cleanup manually.

Quoted 49 lines
---
 drivers/hwmon/Makefile  |    1 +
 drivers/hwmon/adt7460.c |   85
+++++++++++++++++++++++++++++++++++++++++++++++ include/dtt.h           |  
 3 +-
 3 files changed, 88 insertions(+), 1 deletions(-)
 create mode 100644 drivers/hwmon/adt7460.c
drivers/hwmon/Makefile +1 -0
index 065433a..e301eaa 100644
@@ -37,6 +37,7 @@ COBJS-y += ds1775.o
 COBJS-$(CONFIG_DTT_LM73) += lm73.o
 COBJS-y += lm75.o
 COBJS-y += lm81.o
+COBJS-$(CONFIG_DTT_ADT7460) += adt7460.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/hwmon/adt7460.c new file +23 -0
new file mode 100644
index 0000000..28b2eb7
@@ -0,0 +1,85 @@
+/*
+    (C) Copyright 2008
+    Ricado Ribalda-Universidad Autonoma de Madrid, ricardo.ribalda at uam.es
+    This work has been supported by: Q-Technology  http://qtec.com/
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <common.h>
+#include <i2c.h>
+#include <dtt.h>
+

drivers/hwmon/adt7460.c line 33

Quoted 10 lines
drivers/hwmon/adt7460.c new file +10 -0
+#define ADT7460_ADDRESS 	0x2c
+#define ADT7460_INVALID 	128
+#define ADT7460_CONFIG		0x40
+#define ADT7460_REM1_TEMP	0x25
+#define ADT7460_LOCAL_TEMP	0x26
+#define ADT7460_REM2_TEMP	0x27
+
+int dtt_read(int sensor, int reg)
+{
+	u8 dir=reg;

Spaces missing:

	u8 dir = reg;

drivers/hwmon/adt7460.c line 36

Quoted 3 lines
drivers/hwmon/adt7460.c new file +3 -0
+	u8 data;
+
+	if ( i2c_read(ADT7460_ADDRESS,dir,1,&data,1) ==-1 )

This should be:

	if (i2c_read(ADT7460_ADDRESS, dir, 1, &data, 1) == -1)

drivers/hwmon/adt7460.c line 38

Quoted 2 lines
drivers/hwmon/adt7460.c new file +2 -0
+		return -1;
+	if (data==ADT7460_INVALID)

Again spaces. And more below...

I suggest you run Lindent over this file.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#3 lore raw

PATCH 1/1 I2C Monitor Chip ADT7460 support

OK,

I will do it on this and the next patches

Best Regards

Quoted 95 lines · Stefan Roese
Quoted 1 line · Ricardo Ribalda Delgado

Ricardo, please address my (nitpicking) comments below in the next version. You could also run "Lindent" if you don't want to do this coding style cleanup manually.

Quoted 49 lines
---
 drivers/hwmon/Makefile  |    1 +
 drivers/hwmon/adt7460.c |   85
+++++++++++++++++++++++++++++++++++++++++++++++ include/dtt.h           |
 3 +-
 3 files changed, 88 insertions(+), 1 deletions(-)
 create mode 100644 drivers/hwmon/adt7460.c
drivers/hwmon/Makefile +1 -0
index 065433a..e301eaa 100644
@@ -37,6 +37,7 @@ COBJS-y += ds1775.o
 COBJS-$(CONFIG_DTT_LM73) += lm73.o
 COBJS-y += lm75.o
 COBJS-y += lm81.o
+COBJS-$(CONFIG_DTT_ADT7460) += adt7460.o
 
 COBJS        := $(COBJS-y)
 SRCS := $(COBJS:.o=.c)
drivers/hwmon/adt7460.c new file +23 -0
new file mode 100644
index 0000000..28b2eb7
@@ -0,0 +1,85 @@
+/*
+    (C) Copyright 2008
+    Ricado Ribalda-Universidad Autonoma de Madrid, ricardo.ribalda at uam.es
+    This work has been supported by: Q-Technology  http://qtec.com/
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <common.h>
+#include <i2c.h>
+#include <dtt.h>
+

drivers/hwmon/adt7460.c line 33

Quoted 10 lines
drivers/hwmon/adt7460.c new file +10 -0
+#define ADT7460_ADDRESS      0x2c
+#define ADT7460_INVALID      128
+#define ADT7460_CONFIG               0x40
+#define ADT7460_REM1_TEMP    0x25
+#define ADT7460_LOCAL_TEMP   0x26
+#define ADT7460_REM2_TEMP    0x27
+
+int dtt_read(int sensor, int reg)
+{
+     u8 dir=reg;

Spaces missing:

       u8 dir = reg;

drivers/hwmon/adt7460.c line 36

Quoted 3 lines
drivers/hwmon/adt7460.c new file +3 -0
+     u8 data;
+
+     if ( i2c_read(ADT7460_ADDRESS,dir,1,&data,1) ==-1 )

This should be:

       if (i2c_read(ADT7460_ADDRESS, dir, 1, &data, 1) == -1)

drivers/hwmon/adt7460.c line 38

Quoted 2 lines
drivers/hwmon/adt7460.c new file +2 -0
+             return -1;
+     if (data==ADT7460_INVALID)

Again spaces. And more below...

I suggest you run Lindent over this file.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

Signature · 2 lines
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/