[PATCH] hwmon: OMAP4460+: On die temperature sensor driver

2011-09-22 Thread Keerthy
On chip temperature sensor driver. The driver monitors the temperature of
on die subsystems. It sends notifications to the user space if
the temperature crosses user defined thresholds via kobject_uevent interface.
The user is allowed to configure the temperature thresholds vis sysfs nodes
exposed using hwmon interface.

The patch depends on the the following series:
http://comments.gmane.org/gmane.linux.ports.arm.omap/64436
and
http://permalink.gmane.org/gmane.linux.ports.arm.omap/64446

Signed-off-by: Keerthy j-keer...@ti.com
Cc: Jean Delvare kh...@linux-fr.org
Cc: Guenter Roeck guenter.ro...@ericsson.com
Cc: lm-sens...@lm-sensors.org
---
 Documentation/hwmon/omap_temp_sensor |   25 +++
 drivers/hwmon/Kconfig|   11 ++
 drivers/hwmon/Makefile   |1 +
 drivers/hwmon/omap4460plus_temp_sensor.c |  244 ++
 4 files changed, 281 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/hwmon/omap_temp_sensor
 create mode 100644 drivers/hwmon/omap4460plus_temp_sensor.c

Index: linux-omap-2.6/Documentation/hwmon/omap_temp_sensor
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-omap-2.6/Documentation/hwmon/omap_temp_sensor 2011-09-22 
18:57:23.180918857 +0530
@@ -0,0 +1,25 @@
+Kernel driver omap_temp_sensor
+==
+
+Supported chips:
+  * Texas Instruments OMAP4460
+Prefix: 'omap_temp_sensor'
+
+Author:
+J Keerthy j-keer...@ti.com
+
+Description
+---
+
+The Texas Instruments OMAP4 family of chips have a bandgap temperature sensor.
+The temperature sensor feature is used to convert the temperature of the device
+into a decimal value coded on 10 bits. An internal ADC is used for conversion.
+The recommended operating temperatures must be in the range -40 degree Celsius
+to 123 degree celsius for standard conversion.
+The thresholds are programmable and upon crossing the thresholds an interrupt
+is generated. The OMAP temperature sensor has a programmable update rate in
+milli seconds.
+(Currently the driver programs a default of 2000 milliseconds).
+
+The driver provides the common sysfs-interface for temperatures (see
+Documentation/hwmon/sysfs-interface under Temperatures).
Index: linux-omap-2.6/drivers/hwmon/Kconfig
===
--- linux-omap-2.6.orig/drivers/hwmon/Kconfig   2011-09-22 17:48:38.032575702 
+0530
+++ linux-omap-2.6/drivers/hwmon/Kconfig2011-09-22 19:02:28.744575604 
+0530
@@ -323,6 +323,17 @@
  This driver can also be built as a module.  If so, the module
  will be called f71805f.
 
+config SENSORS_OMAP_BANDGAP_TEMP_SENSOR
+   bool OMAP on-die temperature sensor hwmon driver
+   depends on HWMON  ARCH_OMAP  OMAP4460PLUS_SCM
+   help
+ If you say yes here you get support for hardware
+ monitoring features of the OMAP on die temperature
+ sensor.
+
+ Continuous conversion programmable delay
+ mode is used for temperature conversion.
+
 config SENSORS_F71882FG
tristate Fintek F71882FG and compatibles
help
Index: linux-omap-2.6/drivers/hwmon/Makefile
===
--- linux-omap-2.6.orig/drivers/hwmon/Makefile  2011-09-22 17:48:38.020575728 
+0530
+++ linux-omap-2.6/drivers/hwmon/Makefile   2011-09-22 18:57:23.192574712 
+0530
@@ -93,6 +93,7 @@
 obj-$(CONFIG_SENSORS_MAX6642)  += max6642.o
 obj-$(CONFIG_SENSORS_MAX6650)  += max6650.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
+obj-$(CONFIG_SENSORS_OMAP_BANDGAP_TEMP_SENSOR)  += omap4460plus_temp_sensor.o
 obj-$(CONFIG_SENSORS_NTC_THERMISTOR)   += ntc_thermistor.o
 obj-$(CONFIG_SENSORS_PC87360)  += pc87360.o
 obj-$(CONFIG_SENSORS_PC87427)  += pc87427.o
Index: linux-omap-2.6/drivers/hwmon/omap4460plus_temp_sensor.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-omap-2.6/drivers/hwmon/omap4460plus_temp_sensor.c 2011-09-22 
19:02:11.096575567 +0530
@@ -0,0 +1,242 @@
+/*
+ *
+ * OMAP4460 Plus bandgap on die sensor hwmon driver.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ * J Keerthy j-keer...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, 

Re: [PATCH] hwmon: OMAP4460+: On die temperature sensor driver

2011-09-22 Thread Guenter Roeck
On Thu, 2011-09-22 at 13:36 -0400, Keerthy wrote:
 On chip temperature sensor driver. The driver monitors the temperature of
 on die subsystems. It sends notifications to the user space if
 the temperature crosses user defined thresholds via kobject_uevent interface.
 The user is allowed to configure the temperature thresholds vis sysfs nodes
 exposed using hwmon interface.
 
 The patch depends on the the following series:
 http://comments.gmane.org/gmane.linux.ports.arm.omap/64436
 and
 http://permalink.gmane.org/gmane.linux.ports.arm.omap/64446
 
 Signed-off-by: Keerthy j-keer...@ti.com
 Cc: Jean Delvare kh...@linux-fr.org
 Cc: Guenter Roeck guenter.ro...@ericsson.com
 Cc: lm-sens...@lm-sensors.org
 ---
  Documentation/hwmon/omap_temp_sensor |   25 +++
  drivers/hwmon/Kconfig|   11 ++
  drivers/hwmon/Makefile   |1 +
  drivers/hwmon/omap4460plus_temp_sensor.c |  244 
 ++
  4 files changed, 281 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/hwmon/omap_temp_sensor
  create mode 100644 drivers/hwmon/omap4460plus_temp_sensor.c
 
 Index: linux-omap-2.6/Documentation/hwmon/omap_temp_sensor
 ===
 --- /dev/null 1970-01-01 00:00:00.0 +
 +++ linux-omap-2.6/Documentation/hwmon/omap_temp_sensor   2011-09-22 
 18:57:23.180918857 +0530
 @@ -0,0 +1,25 @@
 +Kernel driver omap_temp_sensor
 +==
 +
 +Supported chips:
 +  * Texas Instruments OMAP4460
 +Prefix: 'omap_temp_sensor'
 +
 +Author:
 +J Keerthy j-keer...@ti.com
 +
 +Description
 +---
 +
 +The Texas Instruments OMAP4 family of chips have a bandgap temperature 
 sensor.
 +The temperature sensor feature is used to convert the temperature of the 
 device
 +into a decimal value coded on 10 bits. An internal ADC is used for 
 conversion.
 +The recommended operating temperatures must be in the range -40 degree 
 Celsius
 +to 123 degree celsius for standard conversion.
 +The thresholds are programmable and upon crossing the thresholds an interrupt
 +is generated. The OMAP temperature sensor has a programmable update rate in
 +milli seconds.
 +(Currently the driver programs a default of 2000 milliseconds).
 +
 +The driver provides the common sysfs-interface for temperatures (see
 +Documentation/hwmon/sysfs-interface under Temperatures).
 Index: linux-omap-2.6/drivers/hwmon/Kconfig
 ===
 --- linux-omap-2.6.orig/drivers/hwmon/Kconfig 2011-09-22 17:48:38.032575702 
 +0530
 +++ linux-omap-2.6/drivers/hwmon/Kconfig  2011-09-22 19:02:28.744575604 
 +0530
 @@ -323,6 +323,17 @@
 This driver can also be built as a module.  If so, the module
 will be called f71805f.
  
 +config SENSORS_OMAP_BANDGAP_TEMP_SENSOR
 + bool OMAP on-die temperature sensor hwmon driver
 + depends on HWMON  ARCH_OMAP  OMAP4460PLUS_SCM
 + help
 +   If you say yes here you get support for hardware
 +   monitoring features of the OMAP on die temperature
 +   sensor.
 +
 +   Continuous conversion programmable delay
 +   mode is used for temperature conversion.
 +
  config SENSORS_F71882FG
   tristate Fintek F71882FG and compatibles
   help
 Index: linux-omap-2.6/drivers/hwmon/Makefile
 ===
 --- linux-omap-2.6.orig/drivers/hwmon/Makefile2011-09-22 
 17:48:38.020575728 +0530
 +++ linux-omap-2.6/drivers/hwmon/Makefile 2011-09-22 18:57:23.192574712 
 +0530
 @@ -93,6 +93,7 @@
  obj-$(CONFIG_SENSORS_MAX6642)+= max6642.o
  obj-$(CONFIG_SENSORS_MAX6650)+= max6650.o
  obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 +obj-$(CONFIG_SENSORS_OMAP_BANDGAP_TEMP_SENSOR)  += omap4460plus_temp_sensor.o
  obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o
  obj-$(CONFIG_SENSORS_PC87360)+= pc87360.o
  obj-$(CONFIG_SENSORS_PC87427)+= pc87427.o
 Index: linux-omap-2.6/drivers/hwmon/omap4460plus_temp_sensor.c
 ===
 --- /dev/null 1970-01-01 00:00:00.0 +
 +++ linux-omap-2.6/drivers/hwmon/omap4460plus_temp_sensor.c   2011-09-22 
 19:02:11.096575567 +0530
 @@ -0,0 +1,242 @@
 +/*
 + *
 + * OMAP4460 Plus bandgap on die sensor hwmon driver.
 + *
 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 + * J Keerthy j-keer...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * version 2 as published by the Free Software Foundation.
 + *
 + * 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 

Re: [PATCH] hwmon: OMAP4460+: On die temperature sensor driver

2011-09-22 Thread J, KEERTHY
Hi Guenter,

Thanks for your quick review comments.

On Thu, Sep 22, 2011 at 11:20 PM, Guenter Roeck
guenter.ro...@ericsson.com wrote:
 On Thu, 2011-09-22 at 13:36 -0400, Keerthy wrote:
 On chip temperature sensor driver. The driver monitors the temperature of
 on die subsystems. It sends notifications to the user space if
 the temperature crosses user defined thresholds via kobject_uevent interface.
 The user is allowed to configure the temperature thresholds vis sysfs nodes
 exposed using hwmon interface.

 The patch depends on the the following series:
 http://comments.gmane.org/gmane.linux.ports.arm.omap/64436
 and
 http://permalink.gmane.org/gmane.linux.ports.arm.omap/64446

 Signed-off-by: Keerthy j-keer...@ti.com
 Cc: Jean Delvare kh...@linux-fr.org
 Cc: Guenter Roeck guenter.ro...@ericsson.com
 Cc: lm-sens...@lm-sensors.org
 ---
  Documentation/hwmon/omap_temp_sensor     |   25 +++
  drivers/hwmon/Kconfig                    |   11 ++
  drivers/hwmon/Makefile                   |    1 +
  drivers/hwmon/omap4460plus_temp_sensor.c |  244 
 ++
  4 files changed, 281 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/hwmon/omap_temp_sensor
  create mode 100644 drivers/hwmon/omap4460plus_temp_sensor.c

 Index: linux-omap-2.6/Documentation/hwmon/omap_temp_sensor
 ===
 --- /dev/null 1970-01-01 00:00:00.0 +
 +++ linux-omap-2.6/Documentation/hwmon/omap_temp_sensor       2011-09-22 
 18:57:23.180918857 +0530
 @@ -0,0 +1,25 @@
 +Kernel driver omap_temp_sensor
 +==
 +
 +Supported chips:
 +  * Texas Instruments OMAP4460
 +    Prefix: 'omap_temp_sensor'
 +
 +Author:
 +        J Keerthy j-keer...@ti.com
 +
 +Description
 +---
 +
 +The Texas Instruments OMAP4 family of chips have a bandgap temperature 
 sensor.
 +The temperature sensor feature is used to convert the temperature of the 
 device
 +into a decimal value coded on 10 bits. An internal ADC is used for 
 conversion.
 +The recommended operating temperatures must be in the range -40 degree 
 Celsius
 +to 123 degree celsius for standard conversion.
 +The thresholds are programmable and upon crossing the thresholds an 
 interrupt
 +is generated. The OMAP temperature sensor has a programmable update rate in
 +milli seconds.
 +(Currently the driver programs a default of 2000 milliseconds).
 +
 +The driver provides the common sysfs-interface for temperatures (see
 +Documentation/hwmon/sysfs-interface under Temperatures).
 Index: linux-omap-2.6/drivers/hwmon/Kconfig
 ===
 --- linux-omap-2.6.orig/drivers/hwmon/Kconfig 2011-09-22 17:48:38.032575702 
 +0530
 +++ linux-omap-2.6/drivers/hwmon/Kconfig      2011-09-22 19:02:28.744575604 
 +0530
 @@ -323,6 +323,17 @@
         This driver can also be built as a module.  If so, the module
         will be called f71805f.

 +config SENSORS_OMAP_BANDGAP_TEMP_SENSOR
 +     bool OMAP on-die temperature sensor hwmon driver
 +     depends on HWMON  ARCH_OMAP  OMAP4460PLUS_SCM
 +     help
 +       If you say yes here you get support for hardware
 +       monitoring features of the OMAP on die temperature
 +       sensor.
 +
 +       Continuous conversion programmable delay
 +       mode is used for temperature conversion.
 +
  config SENSORS_F71882FG
       tristate Fintek F71882FG and compatibles
       help
 Index: linux-omap-2.6/drivers/hwmon/Makefile
 ===
 --- linux-omap-2.6.orig/drivers/hwmon/Makefile        2011-09-22 
 17:48:38.020575728 +0530
 +++ linux-omap-2.6/drivers/hwmon/Makefile     2011-09-22 18:57:23.192574712 
 +0530
 @@ -93,6 +93,7 @@
  obj-$(CONFIG_SENSORS_MAX6642)        += max6642.o
  obj-$(CONFIG_SENSORS_MAX6650)        += max6650.o
  obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 +obj-$(CONFIG_SENSORS_OMAP_BANDGAP_TEMP_SENSOR)  += 
 omap4460plus_temp_sensor.o
  obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o
  obj-$(CONFIG_SENSORS_PC87360)        += pc87360.o
  obj-$(CONFIG_SENSORS_PC87427)        += pc87427.o
 Index: linux-omap-2.6/drivers/hwmon/omap4460plus_temp_sensor.c
 ===
 --- /dev/null 1970-01-01 00:00:00.0 +
 +++ linux-omap-2.6/drivers/hwmon/omap4460plus_temp_sensor.c   2011-09-22 
 19:02:11.096575567 +0530
 @@ -0,0 +1,242 @@
 +/*
 + *
 + * OMAP4460 Plus bandgap on die sensor hwmon driver.
 + *
 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 + * J Keerthy j-keer...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * version 2 as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 +