All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] system control module device and support for temperature sensor
@ 2011-09-22 15:29 Keerthy
  2011-09-22 15:29 ` [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields Keerthy
                   ` (7 more replies)
  0 siblings, 8 replies; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

The patch series adds support of system control module device and adds support
temperature sensor. The patch series adds hwmod for system control module
and enables the clocks for temperature sensor. The OMAP4460 specific register
set data for the on die mpu temperature sensor is also part of this series.

Benoit Cousson (1):
  OMAP4: Hwmod: system control module hwmod

Keerthy (4):
  OMAP4: Adding the temperature sensor register set bit fields
  OMAP4: Clock: Associate clocks for OMAP temperature sensor
  OMAP4460: Temperature sensor data
  OMAP4: System control module device support

Vishwanath BS (1):
  OMAP4460: Clock: Adding support for 4460 specific clocks

 arch/arm/mach-omap2/Makefile                       |    3 +-
 arch/arm/mach-omap2/clock44xx_data.c               |   16 +-
 .../include/mach/ctrl_module_core_44xx.h           |   70 +++++++--
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c         |   71 ++++++++
 arch/arm/mach-omap2/scm_device.c                   |  125 ++++++++++++++
 arch/arm/mach-omap2/temp_sensor4460_data.c         |  115 +++++++++++++
 arch/arm/plat-omap/Kconfig                         |   12 ++
 arch/arm/plat-omap/include/plat/scm.h              |  175 ++++++++++++++++++++
 8 files changed, 565 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/mach-omap2/scm_device.c
 create mode 100644 arch/arm/mach-omap2/temp_sensor4460_data.c
 create mode 100644 arch/arm/plat-omap/include/plat/scm.h


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
@ 2011-09-22 15:29 ` Keerthy
  2011-09-23  5:16   ` Paul Walmsley
  2011-09-22 15:29 ` [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor Keerthy
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

OMAP4460 specific temperature sensor register bit fields are added.
Existing OMAP4 entries are renamed to OMAP4430.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Cc: tony@atomide.com
---
 .../include/mach/ctrl_module_core_44xx.h           |   70 ++++++++++++++++----
 1 files changed, 57 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
index 2f7ac70..725c1e1 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
+++ b/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
@@ -256,19 +256,63 @@
 #define OMAP4_LDOSRAMCORE_ACTMODE_VSET_OUT_SHIFT	0
 #define OMAP4_LDOSRAMCORE_ACTMODE_VSET_OUT_MASK		(0x1f << 0)
 
-/* TEMP_SENSOR */
-#define OMAP4_BGAP_TEMPSOFF_SHIFT			12
-#define OMAP4_BGAP_TEMPSOFF_MASK			(1 << 12)
-#define OMAP4_BGAP_TSHUT_SHIFT				11
-#define OMAP4_BGAP_TSHUT_MASK				(1 << 11)
-#define OMAP4_BGAP_TEMP_SENSOR_CONTCONV_SHIFT		10
-#define OMAP4_BGAP_TEMP_SENSOR_CONTCONV_MASK		(1 << 10)
-#define OMAP4_BGAP_TEMP_SENSOR_SOC_SHIFT		9
-#define OMAP4_BGAP_TEMP_SENSOR_SOC_MASK			(1 << 9)
-#define OMAP4_BGAP_TEMP_SENSOR_EOCZ_SHIFT		8
-#define OMAP4_BGAP_TEMP_SENSOR_EOCZ_MASK		(1 << 8)
-#define OMAP4_BGAP_TEMP_SENSOR_DTEMP_SHIFT		0
-#define OMAP4_BGAP_TEMP_SENSOR_DTEMP_MASK		(0xff << 0)
+/* TEMP_SENSOR OMAP4430 */
+#define OMAP4430_BGAP_TEMPSOFF_SHIFT			12
+#define OMAP4430_BGAP_TEMPSOFF_MASK			(1 << 12)
+#define OMAP4430_BGAP_TSHUT_SHIFT				11
+#define OMAP4430_BGAP_TSHUT_MASK				(1 << 11)
+#define OMAP4430_BGAP_TEMP_SENSOR_CONTCONV_SHIFT		10
+#define OMAP4430_BGAP_TEMP_SENSOR_CONTCONV_MASK		(1 << 10)
+#define OMAP4430_BGAP_TEMP_SENSOR_SOC_SHIFT		9
+#define OMAP4430_BGAP_TEMP_SENSOR_SOC_MASK			(1 << 9)
+#define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_SHIFT		8
+#define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_MASK		(1 << 8)
+#define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_SHIFT		0
+#define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
+
+/* TEMP_SENSOR OMAP4460 */
+#define OMAP4460_BGAP_TEMPSOFF_SHIFT			13
+#define OMAP4460_BGAP_TEMPSOFF_MASK			(1 << 13)
+#define OMAP4460_BGAP_TEMP_SENSOR_SOC_SHIFT		11
+#define OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK		(1 << 11)
+#define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_SHIFT		10
+#define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK		(1 << 10)
+#define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_SHIFT		0
+#define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
+
+/* BANDGAP_CTRL */
+#define OMAP4460_SINGLE_MODE_SHIFT			31
+#define OMAP4460_SINGLE_MODE_MASK			(1 << 31)
+#define OMAP4460_MASK_HOT_SHIFT				1
+#define OMAP4460_MASK_HOT_MASK				(1 << 1)
+#define OMAP4460_MASK_COLD_SHIFT			0
+#define OMAP4460_MASK_COLD_MASK				(1 << 0)
+
+/* BANDGAP_COUNTER */
+#define OMAP4460_COUNTER_SHIFT				0
+#define OMAP4460_COUNTER_MASK				(0xffffff << 0)
+
+/* BANDGAP_THRESHOLD */
+#define OMAP4460_T_HOT_SHIFT				16
+#define OMAP4460_T_HOT_MASK				(0x3ff << 16)
+#define OMAP4460_T_COLD_SHIFT				0
+#define OMAP4460_T_COLD_MASK				(0x3ff << 0)
+
+/* TSHUT_THRESHOLD */
+#define OMAP4460_TSHUT_HOT_SHIFT			16
+#define OMAP4460_TSHUT_HOT_MASK				(0x3ff << 16)
+#define OMAP4460_TSHUT_COLD_SHIFT			0
+#define OMAP4460_TSHUT_COLD_MASK			(0x3ff << 0)
+
+/* BANDGAP_STATUS */
+#define OMAP4460_CLEAN_STOP_SHIFT			3
+#define OMAP4460_CLEAN_STOP_MASK			(1 << 3)
+#define OMAP4460_BGAP_ALERT_SHIFT			2
+#define OMAP4460_BGAP_ALERT_MASK			(1 << 2)
+#define OMAP4460_HOT_FLAG_SHIFT				1
+#define OMAP4460_HOT_FLAG_MASK				(1 << 1)
+#define OMAP4460_COLD_FLAG_SHIFT			0
+#define OMAP4460_COLD_FLAG_MASK				(1 << 0)
 
 /* DPLL_NWELL_TRIM_0 */
 #define OMAP4_DPLL_ABE_NWELL_TRIM_MUX_CTRL_SHIFT	29
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
  2011-09-22 15:29 ` [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields Keerthy
@ 2011-09-22 15:29 ` Keerthy
  2011-09-23  5:18   ` Paul Walmsley
  2011-09-22 15:29 ` [PATCH 3/6] OMAP4460: Temperature sensor data Keerthy
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

div_ts_ck feeds only the temperature sensor functional clock
and also has a clksel associated (for divider selection). Mapping this
as well as the bandgap_ts_fclk the fclk of temperature sensor in clkdev table,
so a clk_set_rate() on the div_ts_ck in the driver would have the effect of
changing the temperature sensor clock rate indirectly.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Rajendra Nayak <rnayak@ti.com>
Cc: tony@atomide.com
Cc: paul@pwsan.com 
---
 arch/arm/mach-omap2/clock44xx_data.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 946bf04..c51e513 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3185,9 +3185,9 @@ static struct omap_clk omap44xx_clks[] = {
 	CLK(NULL,	"aes2_fck",			&aes2_fck,	CK_443X),
 	CLK(NULL,	"aess_fck",			&aess_fck,	CK_443X),
 	CLK(NULL,	"bandgap_fclk",			&bandgap_fclk,	CK_443X),
-	CLK(NULL,	"bandgap_ts_fclk",		&bandgap_ts_fclk,	CK_446X),
+	CLK("omap4460plus_scm.0",	"fck",		&bandgap_ts_fclk,	CK_446X),
 	CLK(NULL,	"des3des_fck",			&des3des_fck,	CK_443X),
-	CLK(NULL,	"div_ts_ck",			&div_ts_ck,	CK_446X),
+	CLK("omap4460plus_scm.0",	"div_ck",			&div_ts_ck,	CK_446X),
 	CLK(NULL,	"dmic_sync_mux_ck",		&dmic_sync_mux_ck,	CK_443X),
 	CLK(NULL,	"dmic_fck",			&dmic_fck,	CK_443X),
 	CLK(NULL,	"dsp_fck",			&dsp_fck,	CK_443X),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
  2011-09-22 15:29 ` [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields Keerthy
  2011-09-22 15:29 ` [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor Keerthy
@ 2011-09-22 15:29 ` Keerthy
  2011-09-23  6:03   ` Paul Walmsley
  2011-09-22 15:29 ` [PATCH 4/6] OMAP4: Hwmod: system control module hwmod Keerthy
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

The register set and the
bit fields might vary across OMAP versions. Hence
creating a structure comprising of all the registers
and bit fields to make the driver uniform for all the
versions with different register sets. The data file
contains the structure populated with register offsets
and bit fields corresponding to OMAP4460 on die sensor.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Cc: tony@atomide.com
---
 arch/arm/mach-omap2/Makefile               |    2 +-
 arch/arm/mach-omap2/temp_sensor4460_data.c |  115 ++++++++++++++++++
 arch/arm/plat-omap/include/plat/scm.h      |  175 ++++++++++++++++++++++++++++
 3 files changed, 291 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/temp_sensor4460_data.c
 create mode 100644 arch/arm/plat-omap/include/plat/scm.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 46a3497..e6f8d36 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -86,7 +86,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm2xxx_3xxx.o cminst44xx.o \
 					   cm44xx.o prcm_mpu44xx.o \
 					   prminst44xx.o vc44xx_data.o \
-					   vp44xx_data.o
+					   vp44xx_data.o temp_sensor4460_data.o
 
 # OMAP voltage domains
 ifeq ($(CONFIG_PM),y)
diff --git a/arch/arm/mach-omap2/temp_sensor4460_data.c b/arch/arm/mach-omap2/temp_sensor4460_data.c
new file mode 100644
index 0000000..2804615
--- /dev/null
+++ b/arch/arm/mach-omap2/temp_sensor4460_data.c
@@ -0,0 +1,115 @@
+/*
+ * OMAP4460 on die Temperature sensor data file
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ * Author: J Keerthy <j-keerthy@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, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/slab.h>
+#include "control.h"
+#include <plat/scm.h>
+
+/*
+ * OMAP4460 has one instance of thermal sensor for MPU
+ * need to describe the individual bit fields
+ */
+struct omap_temp_sensor_registers omap_mpu_temp_sensor_registers = {
+	.temp_sensor_ctrl		= OMAP4460_TEMP_SENSOR_CTRL_OFFSET,
+	.bgap_tempsoff_mask		= OMAP4460_BGAP_TEMPSOFF_MASK,
+	.bgap_soc_mask			= OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK,
+	.bgap_eocz_mask			= OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK,
+	.bgap_dtemp_mask		= OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK,
+
+	.bgap_mask_ctrl			= OMAP4460_BGAP_CTRL_OFFSET,
+	.mask_hot_mask			= OMAP4460_MASK_HOT_MASK,
+	.mask_cold_mask			= OMAP4460_MASK_COLD_MASK,
+
+	.bgap_mode_ctrl			= OMAP4460_BGAP_CTRL_OFFSET,
+	.mode_ctrl_mask			= OMAP4460_SINGLE_MODE_MASK,
+
+	.bgap_counter			= OMAP4460_BGAP_COUNTER_OFFSET,
+	.counter_mask			= OMAP4460_COUNTER_MASK,
+
+	.bgap_threshold			= OMAP4460_BGAP_THRESHOLD_OFFSET,
+	.threshold_thot_mask		= OMAP4460_T_HOT_MASK,
+	.threshold_tcold_mask		= OMAP4460_T_COLD_MASK,
+
+	.thsut_threshold		= OMAP4460_BGAP_TSHUT_OFFSET,
+	.tshut_hot_mask			= OMAP4460_TSHUT_HOT_MASK,
+	.tshut_cold_mask		= OMAP4460_TSHUT_COLD_MASK,
+
+	.bgap_status			= OMAP4460_BGAP_STATUS_OFFSET,
+	.status_clean_stop_mask		= OMAP4460_CLEAN_STOP_MASK,
+	.status_bgap_alert_mask		= OMAP4460_BGAP_ALERT_MASK,
+	.status_hot_mask		= OMAP4460_HOT_FLAG_MASK,
+	.status_cold_mask		= OMAP4460_COLD_FLAG_MASK,
+
+	.bgap_efuse			= OMAP4460_FUSE_OPP_BGAP,
+};
+
+/*
+ * Temperature values in milli degree celsius
+ * ADC code values from 530 to 923
+ */
+int adc_to_temp[OMAP_ADC_END_VALUE - OMAP_ADC_START_VALUE + 1] = {
+	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
+	-37800, -37300, -36800, -36400, -36000, -35600, -35200, -34800,
+	-34300, -33800, -33400, -33000, -32600, -32200, -31800, -31300,
+	-30800, -30400, -30000, -29600, -29200, -28700, -28200, -27800,
+	-27400, -27000, -26600, -26200, -25700, -25200, -24800, -24400,
+	-24000, -23600, -23200, -22700, -22200, -21800, -21400, -21000,
+	-20600, -20200, -19700, -19200, -18800, -18400, -18000, -17600,
+	-17200, -16700, -16200, -15800, -15400, -15000, -14600, -14200,
+	-13700, -13200, -12800, -12400, -12000, -11600, -11200, -10700,
+	-10200, -9800, -9400, -9000, -8600, -8200, -7700, -7200, -6800,
+	-6400, -6000, -5600, -5200, -4800, -4300, -3800, -3400, -3000,
+	-2600, -2200, -1800, -1300, -800, -400, 0, 400, 800, 1200, 1600,
+	2100, 2600, 3000, 3400, 3800, 4200, 4600, 5100, 5600, 6000, 6400,
+	6800, 7200, 7600, 8000, 8500, 9000, 9400, 9800, 10200, 10600, 11000,
+	11400, 11900, 12400, 12800, 13200, 13600, 14000, 14400, 14800,
+	15300, 15800, 16200, 16600, 17000, 17400, 17800, 18200, 18700,
+	19200, 19600, 20000, 20400, 20800, 21200, 21600, 22100, 22600,
+	23000, 23400, 23800, 24200, 24600, 25000, 25400, 25900, 26400,
+	26800, 27200, 27600, 28000, 28400, 28800, 29300, 29800, 30200,
+	30600, 31000, 31400, 31800, 32200, 32600, 33100, 33600, 34000,
+	34400, 34800, 35200, 35600, 36000, 36400, 36800, 37300, 37800,
+	38200, 38600, 39000, 39400, 39800, 40200, 40600, 41100, 41600,
+	42000, 42400, 42800, 43200, 43600, 44000, 44400, 44800, 45300,
+	45800, 46200, 46600, 47000, 47400, 47800, 48200, 48600, 49000,
+	49500, 50000, 50400, 50800, 51200, 51600, 52000, 52400, 52800,
+	53200, 53700, 54200, 54600, 55000, 55400, 55800, 56200, 56600,
+	57000, 57400, 57800, 58200, 58700, 59200, 59600, 60000, 60400,
+	60800, 61200, 61600, 62000, 62400, 62800, 63300, 63800, 64200,
+	64600, 65000, 65400, 65800, 66200, 66600, 67000, 67400, 67800,
+	68200, 68700, 69200, 69600, 70000, 70400, 70800, 71200, 71600,
+	72000, 72400, 72800, 73200, 73600, 74100, 74600, 75000, 75400,
+	75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600, 79000,
+	79400, 79800, 80300, 80800, 81200, 81600, 82000, 82400, 82800,
+	83200, 83600, 84000, 84400, 84800, 85200, 85600, 86000, 86400,
+	86800, 87300, 87800, 88200, 88600, 89000, 89400, 89800, 90200,
+	90600, 91000, 91400, 91800, 92200, 92600, 93000, 93400, 93800,
+	94200, 94600, 95000, 95500, 96000, 96400, 96800, 97200, 97600,
+	98000, 98400, 98800, 99200, 99600, 100000, 100400, 100800, 101200,
+	101600, 102000, 102400, 102800, 103200, 103600, 104000, 104400,
+	104800, 105200, 105600, 106100, 106600, 107000, 107400, 107800,
+	108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
+	111400, 111800, 112200, 112600, 113000, 113400, 113800, 114200,
+	114600, 115000, 115400, 115800, 116200, 116600, 117000, 117400,
+	117800, 118200, 118600, 119000, 119400, 119800, 120200, 120600,
+	121000, 121400, 121800, 122200, 122600, 123000
+};
diff --git a/arch/arm/plat-omap/include/plat/scm.h b/arch/arm/plat-omap/include/plat/scm.h
new file mode 100644
index 0000000..47aa38f
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/scm.h
@@ -0,0 +1,175 @@
+/*
+ * OMAP system control module header file
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ * Author: J Keerthy <j-keerthy@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, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
+#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
+
+/* Offsets from the base of temperature sensor registers */
+
+#define OMAP4460_TEMP_SENSOR_CTRL_OFFSET	0x32C
+#define OMAP4460_BGAP_CTRL_OFFSET		0x378
+#define OMAP4460_BGAP_COUNTER_OFFSET		0x37C
+#define OMAP4460_BGAP_THRESHOLD_OFFSET		0x380
+#define OMAP4460_BGAP_TSHUT_OFFSET		0x384
+#define OMAP4460_BGAP_STATUS_OFFSET		0x388
+#define OMAP4460_FUSE_OPP_BGAP			-0x260
+
+#define OMAP_ADC_START_VALUE    530
+#define OMAP_ADC_END_VALUE      923
+
+/*
+ * The register offsets and but fields might change across
+ * OMAP versions hence populating them in this structure.
+ */
+struct omap_temp_sensor_registers {
+	u32	temp_sensor_ctrl;
+	u32	bgap_tempsoff_mask;
+	u32	bgap_soc_mask;
+	u32	bgap_eocz_mask;
+	u32	bgap_dtemp_mask;
+
+	u32	bgap_mask_ctrl;
+	u32	mask_hot_mask;
+	u32	mask_cold_mask;
+
+	u32	bgap_mode_ctrl;
+	u32	mode_ctrl_mask;
+
+	u32	bgap_counter;
+	u32	counter_mask;
+
+	u32	bgap_threshold;
+	u32	threshold_thot_mask;
+	u32	threshold_tcold_mask;
+
+	u32	thsut_threshold;
+	u32	tshut_hot_mask;
+	u32	tshut_cold_mask;
+
+	u32	bgap_status;
+	u32	status_clean_stop_mask;
+	u32	status_bgap_alert_mask;
+	u32	status_hot_mask;
+	u32	status_cold_mask;
+
+	u32	bgap_efuse;
+};
+
+/**
+ * struct omap4460plus_scm_dev_attr - device attributes for scm
+ * @cnt - Number of temperature sensors
+ * @list - array of pointers to register sets of temp sensors
+ * @name - array of pointers to names of the temp sensors
+ * @t_shut - Thermal shutdown interrupt handling required
+ */
+struct omap4460plus_scm_dev_attr {
+	int cnt;
+	struct omap_temp_sensor_registers *list[10];
+	const char *name[10];
+	bool t_shut;
+};
+
+/* forward declaration */
+struct scm;
+
+/**
+ * struct temp_sensor_hwmon - temperature sensor hwmon device structure
+ * @scm_ptr - pointer to system control module structure
+ * @pdev - platform device pointer for hwmon device
+ * @name - Name of the hwmon temp sensor device
+ */
+struct temp_sensor_hwmon {
+	struct scm		*scm_ptr;
+	struct platform_device	*pdev;
+	const char		*name;
+};
+
+/**
+ * struct system control module - scm device structure
+ * @dev - device pointer
+ * @registers - Pointer to the list of register offsets and bitfields
+ * @fclock - pointer to functional clock of temperature sensor
+ * @div_clk - pointer to parent clock of temperature sensor fclk
+ * @tsh_ptr - pointer to temperature sesnor hwmon struct
+ * @name - pointer to list of temperature sensor instance names is scm
+ * @scm_mutex - Mutex for sysfs, irq and PM
+ * @irq - MPU Irq number for thermal alert
+ * @phy_base - Physical base of the temp I/O
+ * @clk_rate - Holds current clock rate
+ * @temp_sensor_ctrl - temp sensor control register value
+ * @bg_ctrl - bandgap ctrl register value
+ * @bg_counter - bandgap counter value
+ * @bg_threshold - bandgap threshold register value
+ * @temp_sensor_tshut_threshold - bandgap tshut register value
+ * @cnt - count of temperature sensor device in scm
+ */
+struct scm {
+	struct device			*dev;
+	struct omap_temp_sensor_registers **registers;
+	struct clk		*fclock;
+	struct clk		*div_clk;
+	struct temp_sensor_hwmon *tsh_ptr;
+	const char		**name;
+	struct mutex		scm_mutex; /* Mutex for sysfs, irq and PM */
+	unsigned int		irq;
+	void __iomem		*phy_base;
+	u32			clk_rate;
+	u32			temp_sensor_ctrl;
+	u32			bg_ctrl;
+	u32			bg_counter;
+	u32			bg_threshold;
+	u32			temp_sensor_tshut_threshold;
+	u32			cnt;
+};
+
+extern struct omap_temp_sensor_registers omap_mpu_temp_sensor_registers;
+extern int adc_to_temp[394];
+
+/*
+ * struct omap4460plus_scm_pdata - omap4460plus_scm platform data
+ * @registers -  pointer to list of register sets of temp sensors
+ * @name - pointer to list of names of temp sensors
+ * @cnt	- Number of temperature sensors
+ * @min_freq - The minimum frequency for temp sensor to be operational
+ * @max_freq - The maximum frequency at which temp sensor is operational
+ * @t_shut - Thermal shutdown interrupt handling required
+ */
+struct omap4460plus_scm_pdata {
+	struct omap_temp_sensor_registers **registers;
+	const char **name;
+	int cnt;
+	u32 min_freq;
+	u32 max_freq;
+	bool t_shut;
+};
+
+int omap4460plus_scm_show_temp_max(struct scm *scm_ptr, int id);
+int omap4460plus_scm_show_temp_max_hyst(struct scm *scm_ptr, int id);
+int omap4460plus_scm_set_temp_max(struct scm *scm_ptr, int id, int val);
+int omap4460plus_scm_set_temp_max_hyst(struct scm *scm_ptr,
+							int id, int val);
+int omap4460plus_scm_show_update_interval(struct scm *scm_ptr, int id);
+void omap4460plus_scm_set_update_interval(struct scm *scm_ptr,
+						u32 interval, int id);
+int omap4460plus_scm_read_temp(struct scm *scm_ptr, int id);
+
+#endif
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 4/6] OMAP4: Hwmod: system control module hwmod
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
                   ` (2 preceding siblings ...)
  2011-09-22 15:29 ` [PATCH 3/6] OMAP4460: Temperature sensor data Keerthy
@ 2011-09-22 15:29 ` Keerthy
  2011-09-23  6:15   ` Paul Walmsley
  2011-09-22 15:29 ` [PATCH 5/6] OMAP4: System control module device support Keerthy
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

From: Benoit Cousson <b-cousson@ti.com>

Adding the system control module hwmod.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   71 ++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 393afac..af77ec6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -30,6 +30,7 @@
 #include <plat/mmc.h>
 #include <plat/i2c.h>
 #include <plat/dmtimer.h>
+#include <plat/scm.h>
 
 #include "omap_hwmod_common_data.h"
 
@@ -821,6 +822,73 @@ static struct omap_hwmod omap44xx_aess_hwmod = {
 };
 
 /*
+ * 'ctrl_module' class
+ * attila core control module
+ */
+
+static struct omap_hwmod_class_sysconfig omap44xx_ctrl_module_sysc = {
+	.rev_offs       = 0x0000,
+	.sysc_offs      = 0x0010,
+	.sysc_flags     = SYSC_HAS_SIDLEMODE,
+	.idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+				SIDLE_SMART_WKUP),
+	.sysc_fields    = &omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap44xx_ctrl_module_hwmod_class = {
+	.name   = "ctrl_module",
+	.sysc   = &omap44xx_ctrl_module_sysc,
+};
+
+/* ctrl_module_core */
+static struct omap_hwmod omap44xx_ctrl_module_core_hwmod;
+static struct omap_hwmod_irq_info omap44xx_ctrl_module_core_irqs[] = {
+	{ .name = "sec_evts", .irq = 8 + OMAP44XX_IRQ_GIC_START },
+	{ .name = "thermal_alert", .irq = 126 + OMAP44XX_IRQ_GIC_START },
+};
+
+static struct omap_hwmod_addr_space omap44xx_ctrl_module_core_addrs[] = {
+	{
+		.pa_start       = 0x4a002000,
+		.pa_end         = 0x4a0027ff,
+		.flags          = ADDR_TYPE_RT
+	},
+};
+
+/* l4_cfg -> ctrl_module_core */
+static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ctrl_module_core = {
+	.master         = &omap44xx_l4_cfg_hwmod,
+	.slave          = &omap44xx_ctrl_module_core_hwmod,
+	.clk            = "l4_div_ck",
+	.addr           = omap44xx_ctrl_module_core_addrs,
+	.user           = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+/* ctrl_module_core slave ports */
+static struct omap_hwmod_ocp_if *omap44xx_ctrl_module_core_slaves[] = {
+	&omap44xx_l4_cfg__ctrl_module_core,
+};
+
+/* scm dev_attr */
+static struct omap4460plus_scm_dev_attr scm_dev_attr = {
+	.cnt		= 1,
+	.list[0]	= &omap_mpu_temp_sensor_registers,
+	.name[0]	= "mpu",
+	.t_shut		= 1,
+};
+
+static struct omap_hwmod omap44xx_ctrl_module_core_hwmod = {
+	.name           = "ctrl_module_core",
+	.class          = &omap44xx_ctrl_module_hwmod_class,
+	.mpu_irqs       = omap44xx_ctrl_module_core_irqs,
+	.main_clk       = "l4_div_ck",
+	.slaves         = omap44xx_ctrl_module_core_slaves,
+	.slaves_cnt     = ARRAY_SIZE(omap44xx_ctrl_module_core_slaves),
+	.dev_attr	= &scm_dev_attr,
+	.clkdm_name     = "l4_wkup_clkdm",
+};
+
+/*
  * 'bandgap' class
  * bangap reference for ldo regulators
  */
@@ -5409,6 +5477,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
 	&omap44xx_timer10_hwmod,
 	&omap44xx_timer11_hwmod,
 
+	/* scm hwmod */
+	&omap44xx_ctrl_module_core_hwmod,
+
 	/* uart class */
 	&omap44xx_uart1_hwmod,
 	&omap44xx_uart2_hwmod,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 5/6] OMAP4: System control module device support
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
                   ` (3 preceding siblings ...)
  2011-09-22 15:29 ` [PATCH 4/6] OMAP4: Hwmod: system control module hwmod Keerthy
@ 2011-09-22 15:29 ` Keerthy
  2011-09-22 15:29 ` [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks Keerthy
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

The device file adds the device support for OMAP4 system control module.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Cc: tony@atomide.com
---
 arch/arm/mach-omap2/Makefile     |    1 +
 arch/arm/mach-omap2/scm_device.c |  125 ++++++++++++++++++++++++++++++++++++++
 arch/arm/plat-omap/Kconfig       |   12 ++++
 3 files changed, 138 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/scm_device.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index e6f8d36..3332693 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
+obj-$(CONFIG_OMAP_SCM_DEV)          += scm_device.o
 
 obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
 
diff --git a/arch/arm/mach-omap2/scm_device.c b/arch/arm/mach-omap2/scm_device.c
new file mode 100644
index 0000000..d942f28
--- /dev/null
+++ b/arch/arm/mach-omap2/scm_device.c
@@ -0,0 +1,125 @@
+/*
+ * OMAP4460+ SCM device file
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ * Author: J Keerthy <j-keerthy@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, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/mutex.h>
+#include <linux/idr.h>
+#include <plat/omap_device.h>
+#include "pm.h"
+#include <plat/scm.h>
+
+static struct omap_device_pm_latency scm_latency[] = {
+	{
+		.deactivate_func = NULL,
+		.activate_func =  NULL,
+		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	}
+};
+
+static DEFINE_IDR(scm_device_idr);
+
+static int scm_dev_init(struct omap_hwmod *oh, void *user)
+{
+	struct	omap4460plus_scm_pdata		*scm_pdata;
+	struct	omap_device			*od;
+	struct	omap4460plus_scm_dev_attr	*scm_dev_attr;
+	struct	omap_temp_sensor_registers	*reg_ptr;
+	const	char				*name_ptr;
+	int					ret = 0;
+	int					num, i;
+
+	scm_pdata =
+	    kzalloc(sizeof(*scm_pdata), GFP_KERNEL);
+	if (!scm_pdata) {
+		dev_err(&oh->od->pdev.dev,
+			"Unable to allocate memory for scm pdata\n");
+		return -ENOMEM;
+	}
+
+	ret = idr_pre_get(&scm_device_idr, GFP_KERNEL);
+	if (ret < 0)
+		goto fail_id;
+	ret = idr_get_new(&scm_device_idr, scm_pdata, &num);
+	if (ret < 0)
+		goto fail_id;
+	scm_dev_attr = oh->dev_attr;
+	scm_pdata->cnt = scm_dev_attr->cnt;
+
+	if (scm_dev_attr->cnt > 0) {
+		scm_pdata->name = kzalloc(sizeof(name_ptr) *
+						scm_dev_attr->cnt, GFP_KERNEL);
+		if (!scm_pdata->name) {
+			dev_err(&oh->od->pdev.dev,
+				"Unable to allocate memory for scm name\n");
+			ret = -ENOMEM;
+			goto fail_id;
+		}
+
+		scm_pdata->registers = kzalloc(sizeof(reg_ptr) *
+						scm_dev_attr->cnt, GFP_KERNEL);
+		if (!scm_pdata->name) {
+			dev_err(&oh->od->pdev.dev,
+				"Unable to allocate mem for scm registers\n");
+			ret = -ENOMEM;
+			kfree(scm_pdata->name);
+			goto fail_id;
+		}
+
+		for (i = 0; i < scm_dev_attr->cnt; i++) {
+			scm_pdata->registers[i] = scm_dev_attr->list[i];
+			scm_pdata->name[i] = scm_dev_attr->name[i];
+		}
+	} else {
+		dev_warn(&oh->od->pdev.dev, "Invalid device count\n");
+		ret = -EINVAL;
+		goto fail_id;
+	}
+
+	od = omap_device_build("omap4460plus_scm", num,
+		oh, scm_pdata, sizeof(*scm_pdata),
+		scm_latency,
+		ARRAY_SIZE(scm_latency), 0);
+
+	if (IS_ERR(od)) {
+		dev_warn(&oh->od->pdev.dev,
+			"Could not build omap_device for %s\n", oh->name);
+		ret = PTR_ERR(od);
+	}
+
+fail_id:
+	kfree(scm_pdata);
+
+	return ret;
+}
+
+int __init omap4460plus_devinit_scm(void)
+{
+	if (!cpu_is_omap446x())
+		return 0;
+
+	return omap_hwmod_for_each_by_class("ctrl_module",
+			scm_dev_init, NULL);
+}
+
+arch_initcall(omap4460plus_devinit_scm);
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index bb8f4a6..f1f572b 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -116,6 +116,18 @@ config OMAP_MCBSP
 	  Say Y here if you want support for the OMAP Multichannel
 	  Buffered Serial Port.
 
+config OMAP_SCM_DEV
+	bool "OMAP4 System control module Support"
+	depends on ARCH_OMAP
+	default n
+	help
+	  Say Y here if you want support for the system control
+	  module on OMAP4.
+
+	  This provides the basic support of system control module
+	  subsystem. SCM also includes instance/instances of on die
+	  temperature sensor.
+
 config OMAP_MBOX_FWK
 	tristate "Mailbox framework support"
 	depends on ARCH_OMAP
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
                   ` (4 preceding siblings ...)
  2011-09-22 15:29 ` [PATCH 5/6] OMAP4: System control module device support Keerthy
@ 2011-09-22 15:29 ` Keerthy
  2011-09-23  5:49   ` Paul Walmsley
  2011-09-30  1:12   ` Paul Walmsley
  2011-09-23  5:15 ` [PATCH 0/6] system control module device and support for temperature sensor Paul Walmsley
  2011-09-23  6:35 ` Paul Walmsley
  7 siblings, 2 replies; 32+ messages in thread
From: Keerthy @ 2011-09-22 15:29 UTC (permalink / raw)
  To: linux-omap; +Cc: j-keerthy

From: Vishwanath BS <vishwanath.bs@ti.com>

OMAP4460 specific clocks are not getting added as the
cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
Changing it to add to OMAP4460 specific clocks also.
This is clocks are required of temperature sensor.

Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Cc: paul@pwsan.com 
---
 arch/arm/mach-omap2/clock44xx_data.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index c51e513..f72513b 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -1398,9 +1398,9 @@ static struct clk dss_dss_clk = {
 };
 
 static const struct clksel_rate div3_8to32_rates[] = {
-	{ .div = 8, .val = 0, .flags = RATE_IN_44XX },
-	{ .div = 16, .val = 1, .flags = RATE_IN_44XX },
-	{ .div = 32, .val = 2, .flags = RATE_IN_44XX },
+	{ .div = 8, .val = 0, .flags = RATE_IN_4460 },
+	{ .div = 16, .val = 1, .flags = RATE_IN_4460 },
+	{ .div = 32, .val = 2, .flags = RATE_IN_4460 },
 	{ .div = 0 },
 };
 
@@ -3403,12 +3403,12 @@ int __init omap4xxx_clk_init(void)
 	struct omap_clk *c;
 	u32 cpu_clkflg;
 
-	if (cpu_is_omap44xx()) {
+	if (cpu_is_omap443x()) {
 		cpu_mask = RATE_IN_4430;
 		cpu_clkflg = CK_443X;
 	} else if (cpu_is_omap446x()) {
-		cpu_mask = RATE_IN_4460;
-		cpu_clkflg = CK_446X;
+		cpu_mask = RATE_IN_4460 | RATE_IN_4430;
+		cpu_clkflg = CK_446X | CK_443X;
 	} else {
 		return 0;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/6] system control module device and support for temperature sensor
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
                   ` (5 preceding siblings ...)
  2011-09-22 15:29 ` [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks Keerthy
@ 2011-09-23  5:15 ` Paul Walmsley
  2011-09-23  5:54   ` J, KEERTHY
  2011-09-23  6:35 ` Paul Walmsley
  7 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  5:15 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap

On Thu, 22 Sep 2011, Keerthy wrote:

> The patch series adds support of system control module device and adds support
> temperature sensor. The patch series adds hwmod for system control module
> and enables the clocks for temperature sensor. The OMAP4460 specific register
> set data for the on die mpu temperature sensor is also part of this series.

Please also cc linux-arm-kernel@lists.infradead.org when you post these 
series.

thanks

- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields
  2011-09-22 15:29 ` [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields Keerthy
@ 2011-09-23  5:16   ` Paul Walmsley
  2011-09-23  5:56     ` J, KEERTHY
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  5:16 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap

On Thu, 22 Sep 2011, Keerthy wrote:

> OMAP4460 specific temperature sensor register bit fields are added.
> Existing OMAP4 entries are renamed to OMAP4430.

This patch ignores the comments posted here:

http://marc.info/?l=linux-omap&m=131483545602617&w=2

Please fix.


- Paul


> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Cc: tony@atomide.com
> ---
>  .../include/mach/ctrl_module_core_44xx.h           |   70 ++++++++++++++++----
>  1 files changed, 57 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
> index 2f7ac70..725c1e1 100644
> --- a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
> +++ b/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
> @@ -256,19 +256,63 @@
>  #define OMAP4_LDOSRAMCORE_ACTMODE_VSET_OUT_SHIFT	0
>  #define OMAP4_LDOSRAMCORE_ACTMODE_VSET_OUT_MASK		(0x1f << 0)
>  
> -/* TEMP_SENSOR */
> -#define OMAP4_BGAP_TEMPSOFF_SHIFT			12
> -#define OMAP4_BGAP_TEMPSOFF_MASK			(1 << 12)
> -#define OMAP4_BGAP_TSHUT_SHIFT				11
> -#define OMAP4_BGAP_TSHUT_MASK				(1 << 11)
> -#define OMAP4_BGAP_TEMP_SENSOR_CONTCONV_SHIFT		10
> -#define OMAP4_BGAP_TEMP_SENSOR_CONTCONV_MASK		(1 << 10)
> -#define OMAP4_BGAP_TEMP_SENSOR_SOC_SHIFT		9
> -#define OMAP4_BGAP_TEMP_SENSOR_SOC_MASK			(1 << 9)
> -#define OMAP4_BGAP_TEMP_SENSOR_EOCZ_SHIFT		8
> -#define OMAP4_BGAP_TEMP_SENSOR_EOCZ_MASK		(1 << 8)
> -#define OMAP4_BGAP_TEMP_SENSOR_DTEMP_SHIFT		0
> -#define OMAP4_BGAP_TEMP_SENSOR_DTEMP_MASK		(0xff << 0)
> +/* TEMP_SENSOR OMAP4430 */
> +#define OMAP4430_BGAP_TEMPSOFF_SHIFT			12
> +#define OMAP4430_BGAP_TEMPSOFF_MASK			(1 << 12)
> +#define OMAP4430_BGAP_TSHUT_SHIFT				11
> +#define OMAP4430_BGAP_TSHUT_MASK				(1 << 11)
> +#define OMAP4430_BGAP_TEMP_SENSOR_CONTCONV_SHIFT		10
> +#define OMAP4430_BGAP_TEMP_SENSOR_CONTCONV_MASK		(1 << 10)
> +#define OMAP4430_BGAP_TEMP_SENSOR_SOC_SHIFT		9
> +#define OMAP4430_BGAP_TEMP_SENSOR_SOC_MASK			(1 << 9)
> +#define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_SHIFT		8
> +#define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_MASK		(1 << 8)
> +#define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_SHIFT		0
> +#define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
> +
> +/* TEMP_SENSOR OMAP4460 */
> +#define OMAP4460_BGAP_TEMPSOFF_SHIFT			13
> +#define OMAP4460_BGAP_TEMPSOFF_MASK			(1 << 13)
> +#define OMAP4460_BGAP_TEMP_SENSOR_SOC_SHIFT		11
> +#define OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK		(1 << 11)
> +#define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_SHIFT		10
> +#define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK		(1 << 10)
> +#define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_SHIFT		0
> +#define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
> +
> +/* BANDGAP_CTRL */
> +#define OMAP4460_SINGLE_MODE_SHIFT			31
> +#define OMAP4460_SINGLE_MODE_MASK			(1 << 31)
> +#define OMAP4460_MASK_HOT_SHIFT				1
> +#define OMAP4460_MASK_HOT_MASK				(1 << 1)
> +#define OMAP4460_MASK_COLD_SHIFT			0
> +#define OMAP4460_MASK_COLD_MASK				(1 << 0)
> +
> +/* BANDGAP_COUNTER */
> +#define OMAP4460_COUNTER_SHIFT				0
> +#define OMAP4460_COUNTER_MASK				(0xffffff << 0)
> +
> +/* BANDGAP_THRESHOLD */
> +#define OMAP4460_T_HOT_SHIFT				16
> +#define OMAP4460_T_HOT_MASK				(0x3ff << 16)
> +#define OMAP4460_T_COLD_SHIFT				0
> +#define OMAP4460_T_COLD_MASK				(0x3ff << 0)
> +
> +/* TSHUT_THRESHOLD */
> +#define OMAP4460_TSHUT_HOT_SHIFT			16
> +#define OMAP4460_TSHUT_HOT_MASK				(0x3ff << 16)
> +#define OMAP4460_TSHUT_COLD_SHIFT			0
> +#define OMAP4460_TSHUT_COLD_MASK			(0x3ff << 0)
> +
> +/* BANDGAP_STATUS */
> +#define OMAP4460_CLEAN_STOP_SHIFT			3
> +#define OMAP4460_CLEAN_STOP_MASK			(1 << 3)
> +#define OMAP4460_BGAP_ALERT_SHIFT			2
> +#define OMAP4460_BGAP_ALERT_MASK			(1 << 2)
> +#define OMAP4460_HOT_FLAG_SHIFT				1
> +#define OMAP4460_HOT_FLAG_MASK				(1 << 1)
> +#define OMAP4460_COLD_FLAG_SHIFT			0
> +#define OMAP4460_COLD_FLAG_MASK				(1 << 0)
>  
>  /* DPLL_NWELL_TRIM_0 */
>  #define OMAP4_DPLL_ABE_NWELL_TRIM_MUX_CTRL_SHIFT	29
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor
  2011-09-22 15:29 ` [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor Keerthy
@ 2011-09-23  5:18   ` Paul Walmsley
  2011-09-23  5:53     ` J, KEERTHY
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  5:18 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap

On Thu, 22 Sep 2011, Keerthy wrote:

> div_ts_ck feeds only the temperature sensor functional clock
> and also has a clksel associated (for divider selection). Mapping this
> as well as the bandgap_ts_fclk the fclk of temperature sensor in clkdev table,
> so a clk_set_rate() on the div_ts_ck in the driver would have the effect of
> changing the temperature sensor clock rate indirectly.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Reviewed-by: Rajendra Nayak <rnayak@ti.com>
> Cc: tony@atomide.com
> Cc: paul@pwsan.com 

Your cc's didn't take effect...

> ---
>  arch/arm/mach-omap2/clock44xx_data.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
> index 946bf04..c51e513 100644
> --- a/arch/arm/mach-omap2/clock44xx_data.c
> +++ b/arch/arm/mach-omap2/clock44xx_data.c
> @@ -3185,9 +3185,9 @@ static struct omap_clk omap44xx_clks[] = {
>  	CLK(NULL,	"aes2_fck",			&aes2_fck,	CK_443X),
>  	CLK(NULL,	"aess_fck",			&aess_fck,	CK_443X),
>  	CLK(NULL,	"bandgap_fclk",			&bandgap_fclk,	CK_443X),
> -	CLK(NULL,	"bandgap_ts_fclk",		&bandgap_ts_fclk,	CK_446X),
> +	CLK("omap4460plus_scm.0",	"fck",		&bandgap_ts_fclk,	CK_446X),
>  	CLK(NULL,	"des3des_fck",			&des3des_fck,	CK_443X),
> -	CLK(NULL,	"div_ts_ck",			&div_ts_ck,	CK_446X),
> +	CLK("omap4460plus_scm.0",	"div_ck",			&div_ts_ck,	CK_446X),

Clearly this device is incorrectly named.  You're setting up a clkdev 
entry that's marked as being valid for OMAP4430, but your device is called 
"omap4460plus_scm".  They can't both be right...


>  	CLK(NULL,	"dmic_sync_mux_ck",		&dmic_sync_mux_ck,	CK_443X),
>  	CLK(NULL,	"dmic_fck",			&dmic_fck,	CK_443X),
>  	CLK(NULL,	"dsp_fck",			&dsp_fck,	CK_443X),
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-09-22 15:29 ` [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks Keerthy
@ 2011-09-23  5:49   ` Paul Walmsley
  2011-09-23 19:45     ` Paul Walmsley
  2011-09-30  1:12   ` Paul Walmsley
  1 sibling, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  5:49 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap

On Thu, 22 Sep 2011, Keerthy wrote:

> From: Vishwanath BS <vishwanath.bs@ti.com>
> 
> OMAP4460 specific clocks are not getting added as the
> cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.

> Changing it to add to OMAP4460 specific clocks also.
> This is clocks are required of temperature sensor.
> 
> Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Cc: paul@pwsan.com 
> ---
>  arch/arm/mach-omap2/clock44xx_data.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
> index c51e513..f72513b 100644
> --- a/arch/arm/mach-omap2/clock44xx_data.c
> +++ b/arch/arm/mach-omap2/clock44xx_data.c
> @@ -1398,9 +1398,9 @@ static struct clk dss_dss_clk = {
>  };
>  
>  static const struct clksel_rate div3_8to32_rates[] = {
> -	{ .div = 8, .val = 0, .flags = RATE_IN_44XX },
> -	{ .div = 16, .val = 1, .flags = RATE_IN_44XX },
> -	{ .div = 32, .val = 2, .flags = RATE_IN_44XX },
> +	{ .div = 8, .val = 0, .flags = RATE_IN_4460 },
> +	{ .div = 16, .val = 1, .flags = RATE_IN_4460 },
> +	{ .div = 32, .val = 2, .flags = RATE_IN_4460 },

Are these rates really 4460-specific?  If so, then it looks like something 
is broken in the clock data generator.  Clearly, I should not have acked 
these patches and they should never have been merged.

>  	{ .div = 0 },
>  };
>  
> @@ -3403,12 +3403,12 @@ int __init omap4xxx_clk_init(void)
>  	struct omap_clk *c;
>  	u32 cpu_clkflg;
>  
> -	if (cpu_is_omap44xx()) {
> +	if (cpu_is_omap443x()) {
>  		cpu_mask = RATE_IN_4430;
>  		cpu_clkflg = CK_443X;
>  	} else if (cpu_is_omap446x()) {
> -		cpu_mask = RATE_IN_4460;
> -		cpu_clkflg = CK_446X;
> +		cpu_mask = RATE_IN_4460 | RATE_IN_4430;
> +		cpu_clkflg = CK_446X | CK_443X;

This isn't right.  Until the clock data files are converted to use per-SoC 
lists, what needs to be done here is to define a RATE_IN_44XX and CK_44XX 
that will match all existing 4430/4460/4470 clocks.  Then for rates and 
clocks that are only specific to one of those SoCs, the appropriate 
SoC-specific flag should be set.

>  	} else {
>  		return 0;
>  	}
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor
  2011-09-23  5:18   ` Paul Walmsley
@ 2011-09-23  5:53     ` J, KEERTHY
  2011-09-23  5:58       ` Paul Walmsley
  0 siblings, 1 reply; 32+ messages in thread
From: J, KEERTHY @ 2011-09-23  5:53 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Fri, Sep 23, 2011 at 10:48 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Thu, 22 Sep 2011, Keerthy wrote:
>
>> div_ts_ck feeds only the temperature sensor functional clock
>> and also has a clksel associated (for divider selection). Mapping this
>> as well as the bandgap_ts_fclk the fclk of temperature sensor in clkdev table,
>> so a clk_set_rate() on the div_ts_ck in the driver would have the effect of
>> changing the temperature sensor clock rate indirectly.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> Reviewed-by: Rajendra Nayak <rnayak@ti.com>
>> Cc: tony@atomide.com
>> Cc: paul@pwsan.com
>
> Your cc's didn't take effect...

Yes :(. I mistakenly had supress cc in my git send command.

>
>> ---
>>  arch/arm/mach-omap2/clock44xx_data.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
>> index 946bf04..c51e513 100644
>> --- a/arch/arm/mach-omap2/clock44xx_data.c
>> +++ b/arch/arm/mach-omap2/clock44xx_data.c
>> @@ -3185,9 +3185,9 @@ static struct omap_clk omap44xx_clks[] = {
>>       CLK(NULL,       "aes2_fck",                     &aes2_fck,      CK_443X),
>>       CLK(NULL,       "aess_fck",                     &aess_fck,      CK_443X),
>>       CLK(NULL,       "bandgap_fclk",                 &bandgap_fclk,  CK_443X),
>> -     CLK(NULL,       "bandgap_ts_fclk",              &bandgap_ts_fclk,       CK_446X),
>> +     CLK("omap4460plus_scm.0",       "fck",          &bandgap_ts_fclk,       CK_446X),
>>       CLK(NULL,       "des3des_fck",                  &des3des_fck,   CK_443X),
>> -     CLK(NULL,       "div_ts_ck",                    &div_ts_ck,     CK_446X),
>> +     CLK("omap4460plus_scm.0",       "div_ck",                       &div_ts_ck,     CK_446X),
>
> Clearly this device is incorrectly named.  You're setting up a clkdev
> entry that's marked as being valid for OMAP4430, but your device is called
> "omap4460plus_scm".  They can't both be right...

This is addressed in Patch 06.

>
>
>>       CLK(NULL,       "dmic_sync_mux_ck",             &dmic_sync_mux_ck,      CK_443X),
>>       CLK(NULL,       "dmic_fck",                     &dmic_fck,      CK_443X),
>>       CLK(NULL,       "dsp_fck",                      &dsp_fck,       CK_443X),
>> --
>> 1.7.0.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
> - Paul
>



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/6] system control module device and support for temperature sensor
  2011-09-23  5:15 ` [PATCH 0/6] system control module device and support for temperature sensor Paul Walmsley
@ 2011-09-23  5:54   ` J, KEERTHY
  0 siblings, 0 replies; 32+ messages in thread
From: J, KEERTHY @ 2011-09-23  5:54 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Fri, Sep 23, 2011 at 10:45 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Thu, 22 Sep 2011, Keerthy wrote:
>
>> The patch series adds support of system control module device and adds support
>> temperature sensor. The patch series adds hwmod for system control module
>> and enables the clocks for temperature sensor. The OMAP4460 specific register
>> set data for the on die mpu temperature sensor is also part of this series.
>
> Please also cc linux-arm-kernel@lists.infradead.org when you post these
> series.

Sorry Paul. I missed it. I will fix it.

>
> thanks
>
> - Paul
>



-- 
Regards and Thanks,
Keerthy

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields
  2011-09-23  5:16   ` Paul Walmsley
@ 2011-09-23  5:56     ` J, KEERTHY
  0 siblings, 0 replies; 32+ messages in thread
From: J, KEERTHY @ 2011-09-23  5:56 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Fri, Sep 23, 2011 at 10:46 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Thu, 22 Sep 2011, Keerthy wrote:
>
>> OMAP4460 specific temperature sensor register bit fields are added.
>> Existing OMAP4 entries are renamed to OMAP4430.
>
> This patch ignores the comments posted here:
>
> http://marc.info/?l=linux-omap&m=131483545602617&w=2
>
> Please fix.

Sorry Paul. I missed it my bad. I will fix it.

>
>
> - Paul
>
>
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> Cc: tony@atomide.com
>> ---
>>  .../include/mach/ctrl_module_core_44xx.h           |   70 ++++++++++++++++----
>>  1 files changed, 57 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
>> index 2f7ac70..725c1e1 100644
>> --- a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
>> +++ b/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h
>> @@ -256,19 +256,63 @@
>>  #define OMAP4_LDOSRAMCORE_ACTMODE_VSET_OUT_SHIFT     0
>>  #define OMAP4_LDOSRAMCORE_ACTMODE_VSET_OUT_MASK              (0x1f << 0)
>>
>> -/* TEMP_SENSOR */
>> -#define OMAP4_BGAP_TEMPSOFF_SHIFT                    12
>> -#define OMAP4_BGAP_TEMPSOFF_MASK                     (1 << 12)
>> -#define OMAP4_BGAP_TSHUT_SHIFT                               11
>> -#define OMAP4_BGAP_TSHUT_MASK                                (1 << 11)
>> -#define OMAP4_BGAP_TEMP_SENSOR_CONTCONV_SHIFT                10
>> -#define OMAP4_BGAP_TEMP_SENSOR_CONTCONV_MASK         (1 << 10)
>> -#define OMAP4_BGAP_TEMP_SENSOR_SOC_SHIFT             9
>> -#define OMAP4_BGAP_TEMP_SENSOR_SOC_MASK                      (1 << 9)
>> -#define OMAP4_BGAP_TEMP_SENSOR_EOCZ_SHIFT            8
>> -#define OMAP4_BGAP_TEMP_SENSOR_EOCZ_MASK             (1 << 8)
>> -#define OMAP4_BGAP_TEMP_SENSOR_DTEMP_SHIFT           0
>> -#define OMAP4_BGAP_TEMP_SENSOR_DTEMP_MASK            (0xff << 0)
>> +/* TEMP_SENSOR OMAP4430 */
>> +#define OMAP4430_BGAP_TEMPSOFF_SHIFT                 12
>> +#define OMAP4430_BGAP_TEMPSOFF_MASK                  (1 << 12)
>> +#define OMAP4430_BGAP_TSHUT_SHIFT                            11
>> +#define OMAP4430_BGAP_TSHUT_MASK                             (1 << 11)
>> +#define OMAP4430_BGAP_TEMP_SENSOR_CONTCONV_SHIFT             10
>> +#define OMAP4430_BGAP_TEMP_SENSOR_CONTCONV_MASK              (1 << 10)
>> +#define OMAP4430_BGAP_TEMP_SENSOR_SOC_SHIFT          9
>> +#define OMAP4430_BGAP_TEMP_SENSOR_SOC_MASK                   (1 << 9)
>> +#define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_SHIFT         8
>> +#define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_MASK          (1 << 8)
>> +#define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_SHIFT                0
>> +#define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_MASK         (0x3ff << 0)
>> +
>> +/* TEMP_SENSOR OMAP4460 */
>> +#define OMAP4460_BGAP_TEMPSOFF_SHIFT                 13
>> +#define OMAP4460_BGAP_TEMPSOFF_MASK                  (1 << 13)
>> +#define OMAP4460_BGAP_TEMP_SENSOR_SOC_SHIFT          11
>> +#define OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK           (1 << 11)
>> +#define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_SHIFT         10
>> +#define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK          (1 << 10)
>> +#define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_SHIFT                0
>> +#define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK         (0x3ff << 0)
>> +
>> +/* BANDGAP_CTRL */
>> +#define OMAP4460_SINGLE_MODE_SHIFT                   31
>> +#define OMAP4460_SINGLE_MODE_MASK                    (1 << 31)
>> +#define OMAP4460_MASK_HOT_SHIFT                              1
>> +#define OMAP4460_MASK_HOT_MASK                               (1 << 1)
>> +#define OMAP4460_MASK_COLD_SHIFT                     0
>> +#define OMAP4460_MASK_COLD_MASK                              (1 << 0)
>> +
>> +/* BANDGAP_COUNTER */
>> +#define OMAP4460_COUNTER_SHIFT                               0
>> +#define OMAP4460_COUNTER_MASK                                (0xffffff << 0)
>> +
>> +/* BANDGAP_THRESHOLD */
>> +#define OMAP4460_T_HOT_SHIFT                         16
>> +#define OMAP4460_T_HOT_MASK                          (0x3ff << 16)
>> +#define OMAP4460_T_COLD_SHIFT                                0
>> +#define OMAP4460_T_COLD_MASK                         (0x3ff << 0)
>> +
>> +/* TSHUT_THRESHOLD */
>> +#define OMAP4460_TSHUT_HOT_SHIFT                     16
>> +#define OMAP4460_TSHUT_HOT_MASK                              (0x3ff << 16)
>> +#define OMAP4460_TSHUT_COLD_SHIFT                    0
>> +#define OMAP4460_TSHUT_COLD_MASK                     (0x3ff << 0)
>> +
>> +/* BANDGAP_STATUS */
>> +#define OMAP4460_CLEAN_STOP_SHIFT                    3
>> +#define OMAP4460_CLEAN_STOP_MASK                     (1 << 3)
>> +#define OMAP4460_BGAP_ALERT_SHIFT                    2
>> +#define OMAP4460_BGAP_ALERT_MASK                     (1 << 2)
>> +#define OMAP4460_HOT_FLAG_SHIFT                              1
>> +#define OMAP4460_HOT_FLAG_MASK                               (1 << 1)
>> +#define OMAP4460_COLD_FLAG_SHIFT                     0
>> +#define OMAP4460_COLD_FLAG_MASK                              (1 << 0)
>>
>>  /* DPLL_NWELL_TRIM_0 */
>>  #define OMAP4_DPLL_ABE_NWELL_TRIM_MUX_CTRL_SHIFT     29
>> --
>> 1.7.0.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor
  2011-09-23  5:53     ` J, KEERTHY
@ 2011-09-23  5:58       ` Paul Walmsley
  2011-09-23 13:22         ` J, KEERTHY
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  5:58 UTC (permalink / raw)
  To: J, KEERTHY; +Cc: linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1606 bytes --]

On Fri, 23 Sep 2011, J, KEERTHY wrote:

> On Fri, Sep 23, 2011 at 10:48 AM, Paul Walmsley <paul@pwsan.com> wrote:
> > On Thu, 22 Sep 2011, Keerthy wrote:
> >
> >> ---
> >>  arch/arm/mach-omap2/clock44xx_data.c |    4 ++--
> >>  1 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
> >> index 946bf04..c51e513 100644
> >> --- a/arch/arm/mach-omap2/clock44xx_data.c
> >> +++ b/arch/arm/mach-omap2/clock44xx_data.c
> >> @@ -3185,9 +3185,9 @@ static struct omap_clk omap44xx_clks[] = {
> >>       CLK(NULL,       "aes2_fck",                     &aes2_fck,      CK_443X),
> >>       CLK(NULL,       "aess_fck",                     &aess_fck,      CK_443X),
> >>       CLK(NULL,       "bandgap_fclk",                 &bandgap_fclk,  CK_443X),
> >> -     CLK(NULL,       "bandgap_ts_fclk",              &bandgap_ts_fclk,       CK_446X),
> >> +     CLK("omap4460plus_scm.0",       "fck",          &bandgap_ts_fclk,       CK_446X),
> >>       CLK(NULL,       "des3des_fck",                  &des3des_fck,   CK_443X),
> >> -     CLK(NULL,       "div_ts_ck",                    &div_ts_ck,     CK_446X),
> >> +     CLK("omap4460plus_scm.0",       "div_ck",                       &div_ts_ck,     CK_446X),
> >
> > Clearly this device is incorrectly named.  You're setting up a clkdev
> > entry that's marked as being valid for OMAP4430, but your device is called
> > "omap4460plus_scm".  They can't both be right...
> 
> This is addressed in Patch 06.

How does patch 6 address it? 


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-22 15:29 ` [PATCH 3/6] OMAP4460: Temperature sensor data Keerthy
@ 2011-09-23  6:03   ` Paul Walmsley
  2011-09-23 13:47     ` J, KEERTHY
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  6:03 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap

Hi

some comments

On Thu, 22 Sep 2011, Keerthy wrote:

> The register set and the
> bit fields might vary across OMAP versions. Hence
> creating a structure comprising of all the registers
> and bit fields to make the driver uniform for all the
> versions with different register sets. The data file
> contains the structure populated with register offsets
> and bit fields corresponding to OMAP4460 on die sensor.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Cc: tony@atomide.com
> ---
>  arch/arm/mach-omap2/Makefile               |    2 +-
>  arch/arm/mach-omap2/temp_sensor4460_data.c |  115 ++++++++++++++++++
>  arch/arm/plat-omap/include/plat/scm.h      |  175 ++++++++++++++++++++++++++++
>  3 files changed, 291 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/temp_sensor4460_data.c
>  create mode 100644 arch/arm/plat-omap/include/plat/scm.h
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 46a3497..e6f8d36 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -86,7 +86,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
>  obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm2xxx_3xxx.o cminst44xx.o \
>  					   cm44xx.o prcm_mpu44xx.o \
>  					   prminst44xx.o vc44xx_data.o \
> -					   vp44xx_data.o
> +					   vp44xx_data.o temp_sensor4460_data.o

This is not part of the PRCM, so it should not be added here.

It also should be conditional on CONFIG_SOC_OMAP4460.  If that Kconfig 
entry doesn't exist, it should be added.

>  # OMAP voltage domains
>  ifeq ($(CONFIG_PM),y)
> diff --git a/arch/arm/mach-omap2/temp_sensor4460_data.c b/arch/arm/mach-omap2/temp_sensor4460_data.c
> new file mode 100644
> index 0000000..2804615
> --- /dev/null
> +++ b/arch/arm/mach-omap2/temp_sensor4460_data.c

Is there some reason why this shouldn't go into drivers/ in some form?

> @@ -0,0 +1,115 @@
> +/*
> + * OMAP4460 on die Temperature sensor data file
> + *
> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
> + * Author: J Keerthy <j-keerthy@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, Boston, MA
> + * 02110-1301 USA
> + *
> + */
> +
> +#include <linux/slab.h>
> +#include "control.h"
> +#include <plat/scm.h>
> +
> +/*
> + * OMAP4460 has one instance of thermal sensor for MPU
> + * need to describe the individual bit fields
> + */
> +struct omap_temp_sensor_registers omap_mpu_temp_sensor_registers = {

This is going to break if we want to compile a kernel with support 
for, say, the 4430 and 4460 temperature sensors.

> +	.temp_sensor_ctrl		= OMAP4460_TEMP_SENSOR_CTRL_OFFSET,
> +	.bgap_tempsoff_mask		= OMAP4460_BGAP_TEMPSOFF_MASK,
> +	.bgap_soc_mask			= OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK,
> +	.bgap_eocz_mask			= OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK,
> +	.bgap_dtemp_mask		= OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK,
> +
> +	.bgap_mask_ctrl			= OMAP4460_BGAP_CTRL_OFFSET,
> +	.mask_hot_mask			= OMAP4460_MASK_HOT_MASK,
> +	.mask_cold_mask			= OMAP4460_MASK_COLD_MASK,
> +
> +	.bgap_mode_ctrl			= OMAP4460_BGAP_CTRL_OFFSET,
> +	.mode_ctrl_mask			= OMAP4460_SINGLE_MODE_MASK,
> +
> +	.bgap_counter			= OMAP4460_BGAP_COUNTER_OFFSET,
> +	.counter_mask			= OMAP4460_COUNTER_MASK,
> +
> +	.bgap_threshold			= OMAP4460_BGAP_THRESHOLD_OFFSET,
> +	.threshold_thot_mask		= OMAP4460_T_HOT_MASK,
> +	.threshold_tcold_mask		= OMAP4460_T_COLD_MASK,
> +
> +	.thsut_threshold		= OMAP4460_BGAP_TSHUT_OFFSET,

"tshut" is misspelled.

> +	.tshut_hot_mask			= OMAP4460_TSHUT_HOT_MASK,
> +	.tshut_cold_mask		= OMAP4460_TSHUT_COLD_MASK,
> +
> +	.bgap_status			= OMAP4460_BGAP_STATUS_OFFSET,
> +	.status_clean_stop_mask		= OMAP4460_CLEAN_STOP_MASK,
> +	.status_bgap_alert_mask		= OMAP4460_BGAP_ALERT_MASK,
> +	.status_hot_mask		= OMAP4460_HOT_FLAG_MASK,
> +	.status_cold_mask		= OMAP4460_COLD_FLAG_MASK,
> +
> +	.bgap_efuse			= OMAP4460_FUSE_OPP_BGAP,
> +};
> +
> +/*
> + * Temperature values in milli degree celsius
> + * ADC code values from 530 to 923
> + */
> +int adc_to_temp[OMAP_ADC_END_VALUE - OMAP_ADC_START_VALUE + 1] = {

This too looks likely to break if we want to compile a kernel with support 
for, say, the 4430 and 4460 temperature sensors.

> +	-40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
> +	-37800, -37300, -36800, -36400, -36000, -35600, -35200, -34800,
> +	-34300, -33800, -33400, -33000, -32600, -32200, -31800, -31300,
> +	-30800, -30400, -30000, -29600, -29200, -28700, -28200, -27800,
> +	-27400, -27000, -26600, -26200, -25700, -25200, -24800, -24400,
> +	-24000, -23600, -23200, -22700, -22200, -21800, -21400, -21000,
> +	-20600, -20200, -19700, -19200, -18800, -18400, -18000, -17600,
> +	-17200, -16700, -16200, -15800, -15400, -15000, -14600, -14200,
> +	-13700, -13200, -12800, -12400, -12000, -11600, -11200, -10700,
> +	-10200, -9800, -9400, -9000, -8600, -8200, -7700, -7200, -6800,
> +	-6400, -6000, -5600, -5200, -4800, -4300, -3800, -3400, -3000,
> +	-2600, -2200, -1800, -1300, -800, -400, 0, 400, 800, 1200, 1600,
> +	2100, 2600, 3000, 3400, 3800, 4200, 4600, 5100, 5600, 6000, 6400,
> +	6800, 7200, 7600, 8000, 8500, 9000, 9400, 9800, 10200, 10600, 11000,
> +	11400, 11900, 12400, 12800, 13200, 13600, 14000, 14400, 14800,
> +	15300, 15800, 16200, 16600, 17000, 17400, 17800, 18200, 18700,
> +	19200, 19600, 20000, 20400, 20800, 21200, 21600, 22100, 22600,
> +	23000, 23400, 23800, 24200, 24600, 25000, 25400, 25900, 26400,
> +	26800, 27200, 27600, 28000, 28400, 28800, 29300, 29800, 30200,
> +	30600, 31000, 31400, 31800, 32200, 32600, 33100, 33600, 34000,
> +	34400, 34800, 35200, 35600, 36000, 36400, 36800, 37300, 37800,
> +	38200, 38600, 39000, 39400, 39800, 40200, 40600, 41100, 41600,
> +	42000, 42400, 42800, 43200, 43600, 44000, 44400, 44800, 45300,
> +	45800, 46200, 46600, 47000, 47400, 47800, 48200, 48600, 49000,
> +	49500, 50000, 50400, 50800, 51200, 51600, 52000, 52400, 52800,
> +	53200, 53700, 54200, 54600, 55000, 55400, 55800, 56200, 56600,
> +	57000, 57400, 57800, 58200, 58700, 59200, 59600, 60000, 60400,
> +	60800, 61200, 61600, 62000, 62400, 62800, 63300, 63800, 64200,
> +	64600, 65000, 65400, 65800, 66200, 66600, 67000, 67400, 67800,
> +	68200, 68700, 69200, 69600, 70000, 70400, 70800, 71200, 71600,
> +	72000, 72400, 72800, 73200, 73600, 74100, 74600, 75000, 75400,
> +	75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600, 79000,
> +	79400, 79800, 80300, 80800, 81200, 81600, 82000, 82400, 82800,
> +	83200, 83600, 84000, 84400, 84800, 85200, 85600, 86000, 86400,
> +	86800, 87300, 87800, 88200, 88600, 89000, 89400, 89800, 90200,
> +	90600, 91000, 91400, 91800, 92200, 92600, 93000, 93400, 93800,
> +	94200, 94600, 95000, 95500, 96000, 96400, 96800, 97200, 97600,
> +	98000, 98400, 98800, 99200, 99600, 100000, 100400, 100800, 101200,
> +	101600, 102000, 102400, 102800, 103200, 103600, 104000, 104400,
> +	104800, 105200, 105600, 106100, 106600, 107000, 107400, 107800,
> +	108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
> +	111400, 111800, 112200, 112600, 113000, 113400, 113800, 114200,
> +	114600, 115000, 115400, 115800, 116200, 116600, 117000, 117400,
> +	117800, 118200, 118600, 119000, 119400, 119800, 120200, 120600,
> +	121000, 121400, 121800, 122200, 122600, 123000
> +};
> diff --git a/arch/arm/plat-omap/include/plat/scm.h b/arch/arm/plat-omap/include/plat/scm.h
> new file mode 100644
> index 0000000..47aa38f
> --- /dev/null
> +++ b/arch/arm/plat-omap/include/plat/scm.h

If this is being used by a driver, then this header file should go into 
the appropriate drivers/ subdirectory.  If it is being used by code in 
arch/arm/mach-omap2, then please use the existing 
arch/arm/mach-omap2/control.h instead.

> @@ -0,0 +1,175 @@
> +/*
> + * OMAP system control module header file
> + *
> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
> + * Author: J Keerthy <j-keerthy@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, Boston, MA
> + * 02110-1301 USA
> + *
> + */
> +
> +#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
> +#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H

This macro name doesn't match the filename.

You're also missing important #includes here for things like mutexes
and kernel types that you use later on in the file.

> +
> +/* Offsets from the base of temperature sensor registers */
> +
> +#define OMAP4460_TEMP_SENSOR_CTRL_OFFSET	0x32C
> +#define OMAP4460_BGAP_CTRL_OFFSET		0x378
> +#define OMAP4460_BGAP_COUNTER_OFFSET		0x37C
> +#define OMAP4460_BGAP_THRESHOLD_OFFSET		0x380
> +#define OMAP4460_BGAP_TSHUT_OFFSET		0x384
> +#define OMAP4460_BGAP_STATUS_OFFSET		0x388
> +#define OMAP4460_FUSE_OPP_BGAP			-0x260
> +
> +#define OMAP_ADC_START_VALUE    530
> +#define OMAP_ADC_END_VALUE      923

Are these OMAP4460, OMAP4xxx, or OMAP2+ specific?

> +
> +/*
> + * The register offsets and but fields might change across
> + * OMAP versions hence populating them in this structure.
> + */
> +struct omap_temp_sensor_registers {
> +	u32	temp_sensor_ctrl;
> +	u32	bgap_tempsoff_mask;
> +	u32	bgap_soc_mask;
> +	u32	bgap_eocz_mask;
> +	u32	bgap_dtemp_mask;
> +
> +	u32	bgap_mask_ctrl;
> +	u32	mask_hot_mask;
> +	u32	mask_cold_mask;
> +
> +	u32	bgap_mode_ctrl;
> +	u32	mode_ctrl_mask;
> +
> +	u32	bgap_counter;
> +	u32	counter_mask;
> +
> +	u32	bgap_threshold;
> +	u32	threshold_thot_mask;
> +	u32	threshold_tcold_mask;
> +
> +	u32	thsut_threshold;

"tshut" misspelled here.

> +	u32	tshut_hot_mask;
> +	u32	tshut_cold_mask;
> +
> +	u32	bgap_status;
> +	u32	status_clean_stop_mask;
> +	u32	status_bgap_alert_mask;
> +	u32	status_hot_mask;
> +	u32	status_cold_mask;
> +
> +	u32	bgap_efuse;
> +};
> +
> +/**
> + * struct omap4460plus_scm_dev_attr - device attributes for scm

There are loads of references to 'omap4460plus' when it seems to me that 
much of this driver should also apply to OMAP4430 also.  Shouldn't this 
driver be named something like 'omap4430plus_scm' or even 
better 'omap4_scm' ?

> + * @cnt - Number of temperature sensors
> + * @list - array of pointers to register sets of temp sensors
> + * @name - array of pointers to names of the temp sensors
> + * @t_shut - Thermal shutdown interrupt handling required
> + */

First, thanks for supplying kerneldoc comments.  However, the format of 
your comments does not match Documentation/kernel-doc-nano-HOWTO.txt - 
please go back and review this text file and update your comments 
appropriately.

> +struct omap4460plus_scm_dev_attr {
> +	int cnt;
> +	struct omap_temp_sensor_registers *list[10];
> +	const char *name[10];
> +	bool t_shut;
> +};

You're already passing in lots of data via 
arch/arm/mach-omap2/temp_sensor4460_data.c.  Shouldn't this data go into 
this file?

> +
> +/* forward declaration */
> +struct scm;
> +
> +/**
> + * struct temp_sensor_hwmon - temperature sensor hwmon device structure
> + * @scm_ptr - pointer to system control module structure
> + * @pdev - platform device pointer for hwmon device
> + * @name - Name of the hwmon temp sensor device
> + */
> +struct temp_sensor_hwmon {
> +	struct scm		*scm_ptr;
> +	struct platform_device	*pdev;
> +	const char		*name;
> +};
> +
> +/**
> + * struct system control module - scm device structure
> + * @dev - device pointer
> + * @registers - Pointer to the list of register offsets and bitfields
> + * @fclock - pointer to functional clock of temperature sensor
> + * @div_clk - pointer to parent clock of temperature sensor fclk
> + * @tsh_ptr - pointer to temperature sesnor hwmon struct
> + * @name - pointer to list of temperature sensor instance names is scm
> + * @scm_mutex - Mutex for sysfs, irq and PM
> + * @irq - MPU Irq number for thermal alert
> + * @phy_base - Physical base of the temp I/O
> + * @clk_rate - Holds current clock rate
> + * @temp_sensor_ctrl - temp sensor control register value
> + * @bg_ctrl - bandgap ctrl register value
> + * @bg_counter - bandgap counter value
> + * @bg_threshold - bandgap threshold register value
> + * @temp_sensor_tshut_threshold - bandgap tshut register value
> + * @cnt - count of temperature sensor device in scm
> + */
> +struct scm {
> +	struct device			*dev;
> +	struct omap_temp_sensor_registers **registers;
> +	struct clk		*fclock;
> +	struct clk		*div_clk;
> +	struct temp_sensor_hwmon *tsh_ptr;
> +	const char		**name;
> +	struct mutex		scm_mutex; /* Mutex for sysfs, irq and PM */
> +	unsigned int		irq;
> +	void __iomem		*phy_base;
> +	u32			clk_rate;
> +	u32			temp_sensor_ctrl;
> +	u32			bg_ctrl;
> +	u32			bg_counter;
> +	u32			bg_threshold;
> +	u32			temp_sensor_tshut_threshold;
> +	u32			cnt;
> +};
> +
> +extern struct omap_temp_sensor_registers omap_mpu_temp_sensor_registers;
> +extern int adc_to_temp[394];
> +
> +/*
> + * struct omap4460plus_scm_pdata - omap4460plus_scm platform data
> + * @registers -  pointer to list of register sets of temp sensors
> + * @name - pointer to list of names of temp sensors
> + * @cnt	- Number of temperature sensors
> + * @min_freq - The minimum frequency for temp sensor to be operational
> + * @max_freq - The maximum frequency at which temp sensor is operational
> + * @t_shut - Thermal shutdown interrupt handling required
> + */
> +struct omap4460plus_scm_pdata {
> +	struct omap_temp_sensor_registers **registers;
> +	const char **name;
> +	int cnt;
> +	u32 min_freq;
> +	u32 max_freq;
> +	bool t_shut;
> +};
> +
> +int omap4460plus_scm_show_temp_max(struct scm *scm_ptr, int id);
> +int omap4460plus_scm_show_temp_max_hyst(struct scm *scm_ptr, int id);
> +int omap4460plus_scm_set_temp_max(struct scm *scm_ptr, int id, int val);
> +int omap4460plus_scm_set_temp_max_hyst(struct scm *scm_ptr,
> +							int id, int val);
> +int omap4460plus_scm_show_update_interval(struct scm *scm_ptr, int id);
> +void omap4460plus_scm_set_update_interval(struct scm *scm_ptr,
> +						u32 interval, int id);
> +int omap4460plus_scm_read_temp(struct scm *scm_ptr, int id);
> +
> +#endif
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 4/6] OMAP4: Hwmod: system control module hwmod
  2011-09-22 15:29 ` [PATCH 4/6] OMAP4: Hwmod: system control module hwmod Keerthy
@ 2011-09-23  6:15   ` Paul Walmsley
  2011-09-23 13:49     ` J, KEERTHY
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  6:15 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap, b-cousson

[-- Attachment #1: Type: TEXT/PLAIN, Size: 313 bytes --]

+ Benoît

Hi,

On Thu, 22 Sep 2011, Keerthy wrote:

> From: Benoit Cousson <b-cousson@ti.com>
> 
> Adding the system control module hwmod.

Have the autogeneration scripts been updated ?

> 
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>



- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 0/6] system control module device and support for temperature sensor
  2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
                   ` (6 preceding siblings ...)
  2011-09-23  5:15 ` [PATCH 0/6] system control module device and support for temperature sensor Paul Walmsley
@ 2011-09-23  6:35 ` Paul Walmsley
  7 siblings, 0 replies; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23  6:35 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap

Hi

On Thu, 22 Sep 2011, Keerthy wrote:

> The patch series adds support of system control module device and adds support
> temperature sensor. The patch series adds hwmod for system control module
> and enables the clocks for temperature sensor. The OMAP4460 specific register
> set data for the on die mpu temperature sensor is also part of this series.
> 
> Benoit Cousson (1):
>   OMAP4: Hwmod: system control module hwmod
> 
> Keerthy (4):
>   OMAP4: Adding the temperature sensor register set bit fields
>   OMAP4: Clock: Associate clocks for OMAP temperature sensor
>   OMAP4460: Temperature sensor data
>   OMAP4: System control module device support
> 
> Vishwanath BS (1):
>   OMAP4460: Clock: Adding support for 4460 specific clocks

Also, before you re-post, could you please prefix the subject lines of all 
of these patches with "ARM: " per Arnd Bergmann's recent request?

thanks

- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor
  2011-09-23  5:58       ` Paul Walmsley
@ 2011-09-23 13:22         ` J, KEERTHY
  2011-09-24  7:38           ` Paul Walmsley
  0 siblings, 1 reply; 32+ messages in thread
From: J, KEERTHY @ 2011-09-23 13:22 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Fri, Sep 23, 2011 at 11:28 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Fri, 23 Sep 2011, J, KEERTHY wrote:
>
>> On Fri, Sep 23, 2011 at 10:48 AM, Paul Walmsley <paul@pwsan.com> wrote:
>> > On Thu, 22 Sep 2011, Keerthy wrote:
>> >
>> >> ---
>> >>  arch/arm/mach-omap2/clock44xx_data.c |    4 ++--
>> >>  1 files changed, 2 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
>> >> index 946bf04..c51e513 100644
>> >> --- a/arch/arm/mach-omap2/clock44xx_data.c
>> >> +++ b/arch/arm/mach-omap2/clock44xx_data.c
>> >> @@ -3185,9 +3185,9 @@ static struct omap_clk omap44xx_clks[] = {
>> >>       CLK(NULL,       "aes2_fck",                     &aes2_fck,      CK_443X),
>> >>       CLK(NULL,       "aess_fck",                     &aess_fck,      CK_443X),
>> >>       CLK(NULL,       "bandgap_fclk",                 &bandgap_fclk,  CK_443X),
>> >> -     CLK(NULL,       "bandgap_ts_fclk",              &bandgap_ts_fclk,       CK_446X),
>> >> +     CLK("omap4460plus_scm.0",       "fck",          &bandgap_ts_fclk,       CK_446X),
>> >>       CLK(NULL,       "des3des_fck",                  &des3des_fck,   CK_443X),
>> >> -     CLK(NULL,       "div_ts_ck",                    &div_ts_ck,     CK_446X),
>> >> +     CLK("omap4460plus_scm.0",       "div_ck",                       &div_ts_ck,     CK_446X),
>> >
>> > Clearly this device is incorrectly named.  You're setting up a clkdev
>> > entry that's marked as being valid for OMAP4430, but your device is called
>> > "omap4460plus_scm".  They can't both be right...
>>
>> This is addressed in Patch 06.
>
> How does patch 6 address it?

I am not sure i interpreted the comment right. These clock nodes are specific to
OMAP4460 and are tagged CK_446X hence the device name "omap4460plus_scm.0"

>
>
> - Paul



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-23  6:03   ` Paul Walmsley
@ 2011-09-23 13:47     ` J, KEERTHY
  2011-09-24  7:48       ` Paul Walmsley
  2011-09-24  7:59       ` Paul Walmsley
  0 siblings, 2 replies; 32+ messages in thread
From: J, KEERTHY @ 2011-09-23 13:47 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Fri, Sep 23, 2011 at 11:33 AM, Paul Walmsley <paul@pwsan.com> wrote:
> Hi
>
> some comments
>
> On Thu, 22 Sep 2011, Keerthy wrote:
>
>> The register set and the
>> bit fields might vary across OMAP versions. Hence
>> creating a structure comprising of all the registers
>> and bit fields to make the driver uniform for all the
>> versions with different register sets. The data file
>> contains the structure populated with register offsets
>> and bit fields corresponding to OMAP4460 on die sensor.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> Cc: tony@atomide.com
>> ---
>>  arch/arm/mach-omap2/Makefile               |    2 +-
>>  arch/arm/mach-omap2/temp_sensor4460_data.c |  115 ++++++++++++++++++
>>  arch/arm/plat-omap/include/plat/scm.h      |  175 ++++++++++++++++++++++++++++
>>  3 files changed, 291 insertions(+), 1 deletions(-)
>>  create mode 100644 arch/arm/mach-omap2/temp_sensor4460_data.c
>>  create mode 100644 arch/arm/plat-omap/include/plat/scm.h
>>
>> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
>> index 46a3497..e6f8d36 100644
>> --- a/arch/arm/mach-omap2/Makefile
>> +++ b/arch/arm/mach-omap2/Makefile
>> @@ -86,7 +86,7 @@ obj-$(CONFIG_ARCH_OMAP3)            += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
>>  obj-$(CONFIG_ARCH_OMAP4)             += prcm.o cm2xxx_3xxx.o cminst44xx.o \
>>                                          cm44xx.o prcm_mpu44xx.o \
>>                                          prminst44xx.o vc44xx_data.o \
>> -                                        vp44xx_data.o
>> +                                        vp44xx_data.o temp_sensor4460_data.o
>
> This is not part of the PRCM, so it should not be added here.
>
> It also should be conditional on CONFIG_SOC_OMAP4460.  If that Kconfig
> entry doesn't exist, it should be added.

Ok. I will add it.

>
>>  # OMAP voltage domains
>>  ifeq ($(CONFIG_PM),y)
>> diff --git a/arch/arm/mach-omap2/temp_sensor4460_data.c b/arch/arm/mach-omap2/temp_sensor4460_data.c
>> new file mode 100644
>> index 0000000..2804615
>> --- /dev/null
>> +++ b/arch/arm/mach-omap2/temp_sensor4460_data.c
>
> Is there some reason why this shouldn't go into drivers/ in some form?

This is used by mach-omap2.

>
>> @@ -0,0 +1,115 @@
>> +/*
>> + * OMAP4460 on die Temperature sensor data file
>> + *
>> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
>> + * Author: J Keerthy <j-keerthy@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, Boston, MA
>> + * 02110-1301 USA
>> + *
>> + */
>> +
>> +#include <linux/slab.h>
>> +#include "control.h"
>> +#include <plat/scm.h>
>> +
>> +/*
>> + * OMAP4460 has one instance of thermal sensor for MPU
>> + * need to describe the individual bit fields
>> + */
>> +struct omap_temp_sensor_registers omap_mpu_temp_sensor_registers = {
>
> This is going to break if we want to compile a kernel with support
> for, say, the 4430 and 4460 temperature sensors.

Ok. I will rename this as omap4460_temp_sensor_registers

>
>> +     .temp_sensor_ctrl               = OMAP4460_TEMP_SENSOR_CTRL_OFFSET,
>> +     .bgap_tempsoff_mask             = OMAP4460_BGAP_TEMPSOFF_MASK,
>> +     .bgap_soc_mask                  = OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK,
>> +     .bgap_eocz_mask                 = OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK,
>> +     .bgap_dtemp_mask                = OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK,
>> +
>> +     .bgap_mask_ctrl                 = OMAP4460_BGAP_CTRL_OFFSET,
>> +     .mask_hot_mask                  = OMAP4460_MASK_HOT_MASK,
>> +     .mask_cold_mask                 = OMAP4460_MASK_COLD_MASK,
>> +
>> +     .bgap_mode_ctrl                 = OMAP4460_BGAP_CTRL_OFFSET,
>> +     .mode_ctrl_mask                 = OMAP4460_SINGLE_MODE_MASK,
>> +
>> +     .bgap_counter                   = OMAP4460_BGAP_COUNTER_OFFSET,
>> +     .counter_mask                   = OMAP4460_COUNTER_MASK,
>> +
>> +     .bgap_threshold                 = OMAP4460_BGAP_THRESHOLD_OFFSET,
>> +     .threshold_thot_mask            = OMAP4460_T_HOT_MASK,
>> +     .threshold_tcold_mask           = OMAP4460_T_COLD_MASK,
>> +
>> +     .thsut_threshold                = OMAP4460_BGAP_TSHUT_OFFSET,
>
> "tshut" is misspelled.

I will correct this.

>
>> +     .tshut_hot_mask                 = OMAP4460_TSHUT_HOT_MASK,
>> +     .tshut_cold_mask                = OMAP4460_TSHUT_COLD_MASK,
>> +
>> +     .bgap_status                    = OMAP4460_BGAP_STATUS_OFFSET,
>> +     .status_clean_stop_mask         = OMAP4460_CLEAN_STOP_MASK,
>> +     .status_bgap_alert_mask         = OMAP4460_BGAP_ALERT_MASK,
>> +     .status_hot_mask                = OMAP4460_HOT_FLAG_MASK,
>> +     .status_cold_mask               = OMAP4460_COLD_FLAG_MASK,
>> +
>> +     .bgap_efuse                     = OMAP4460_FUSE_OPP_BGAP,
>> +};
>> +
>> +/*
>> + * Temperature values in milli degree celsius
>> + * ADC code values from 530 to 923
>> + */
>> +int adc_to_temp[OMAP_ADC_END_VALUE - OMAP_ADC_START_VALUE + 1] = {
>
> This too looks likely to break if we want to compile a kernel with support
> for, say, the 4430 and 4460 temperature sensors.

I will change this omap4460_adc_to_temp

>
>> +     -40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
>> +     -37800, -37300, -36800, -36400, -36000, -35600, -35200, -34800,
>> +     -34300, -33800, -33400, -33000, -32600, -32200, -31800, -31300,
>> +     -30800, -30400, -30000, -29600, -29200, -28700, -28200, -27800,
>> +     -27400, -27000, -26600, -26200, -25700, -25200, -24800, -24400,
>> +     -24000, -23600, -23200, -22700, -22200, -21800, -21400, -21000,
>> +     -20600, -20200, -19700, -19200, -18800, -18400, -18000, -17600,
>> +     -17200, -16700, -16200, -15800, -15400, -15000, -14600, -14200,
>> +     -13700, -13200, -12800, -12400, -12000, -11600, -11200, -10700,
>> +     -10200, -9800, -9400, -9000, -8600, -8200, -7700, -7200, -6800,
>> +     -6400, -6000, -5600, -5200, -4800, -4300, -3800, -3400, -3000,
>> +     -2600, -2200, -1800, -1300, -800, -400, 0, 400, 800, 1200, 1600,
>> +     2100, 2600, 3000, 3400, 3800, 4200, 4600, 5100, 5600, 6000, 6400,
>> +     6800, 7200, 7600, 8000, 8500, 9000, 9400, 9800, 10200, 10600, 11000,
>> +     11400, 11900, 12400, 12800, 13200, 13600, 14000, 14400, 14800,
>> +     15300, 15800, 16200, 16600, 17000, 17400, 17800, 18200, 18700,
>> +     19200, 19600, 20000, 20400, 20800, 21200, 21600, 22100, 22600,
>> +     23000, 23400, 23800, 24200, 24600, 25000, 25400, 25900, 26400,
>> +     26800, 27200, 27600, 28000, 28400, 28800, 29300, 29800, 30200,
>> +     30600, 31000, 31400, 31800, 32200, 32600, 33100, 33600, 34000,
>> +     34400, 34800, 35200, 35600, 36000, 36400, 36800, 37300, 37800,
>> +     38200, 38600, 39000, 39400, 39800, 40200, 40600, 41100, 41600,
>> +     42000, 42400, 42800, 43200, 43600, 44000, 44400, 44800, 45300,
>> +     45800, 46200, 46600, 47000, 47400, 47800, 48200, 48600, 49000,
>> +     49500, 50000, 50400, 50800, 51200, 51600, 52000, 52400, 52800,
>> +     53200, 53700, 54200, 54600, 55000, 55400, 55800, 56200, 56600,
>> +     57000, 57400, 57800, 58200, 58700, 59200, 59600, 60000, 60400,
>> +     60800, 61200, 61600, 62000, 62400, 62800, 63300, 63800, 64200,
>> +     64600, 65000, 65400, 65800, 66200, 66600, 67000, 67400, 67800,
>> +     68200, 68700, 69200, 69600, 70000, 70400, 70800, 71200, 71600,
>> +     72000, 72400, 72800, 73200, 73600, 74100, 74600, 75000, 75400,
>> +     75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600, 79000,
>> +     79400, 79800, 80300, 80800, 81200, 81600, 82000, 82400, 82800,
>> +     83200, 83600, 84000, 84400, 84800, 85200, 85600, 86000, 86400,
>> +     86800, 87300, 87800, 88200, 88600, 89000, 89400, 89800, 90200,
>> +     90600, 91000, 91400, 91800, 92200, 92600, 93000, 93400, 93800,
>> +     94200, 94600, 95000, 95500, 96000, 96400, 96800, 97200, 97600,
>> +     98000, 98400, 98800, 99200, 99600, 100000, 100400, 100800, 101200,
>> +     101600, 102000, 102400, 102800, 103200, 103600, 104000, 104400,
>> +     104800, 105200, 105600, 106100, 106600, 107000, 107400, 107800,
>> +     108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
>> +     111400, 111800, 112200, 112600, 113000, 113400, 113800, 114200,
>> +     114600, 115000, 115400, 115800, 116200, 116600, 117000, 117400,
>> +     117800, 118200, 118600, 119000, 119400, 119800, 120200, 120600,
>> +     121000, 121400, 121800, 122200, 122600, 123000
>> +};
>> diff --git a/arch/arm/plat-omap/include/plat/scm.h b/arch/arm/plat-omap/include/plat/scm.h
>> new file mode 100644
>> index 0000000..47aa38f
>> --- /dev/null
>> +++ b/arch/arm/plat-omap/include/plat/scm.h
>
> If this is being used by a driver, then this header file should go into
> the appropriate drivers/ subdirectory.  If it is being used by code in
> arch/arm/mach-omap2, then please use the existing
> arch/arm/mach-omap2/control.h instead.

The header file has structures used both by drivers/ and mach-omap.
So kept it in plat-omap.

>
>> @@ -0,0 +1,175 @@
>> +/*
>> + * OMAP system control module header file
>> + *
>> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
>> + * Author: J Keerthy <j-keerthy@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, Boston, MA
>> + * 02110-1301 USA
>> + *
>> + */
>> +
>> +#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
>> +#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
>
> This macro name doesn't match the filename.

Oops yes. I will correct this.

>
> You're also missing important #includes here for things like mutexes
> and kernel types that you use later on in the file.

Those header files are included in c files.

>
>> +
>> +/* Offsets from the base of temperature sensor registers */
>> +
>> +#define OMAP4460_TEMP_SENSOR_CTRL_OFFSET     0x32C
>> +#define OMAP4460_BGAP_CTRL_OFFSET            0x378
>> +#define OMAP4460_BGAP_COUNTER_OFFSET         0x37C
>> +#define OMAP4460_BGAP_THRESHOLD_OFFSET               0x380
>> +#define OMAP4460_BGAP_TSHUT_OFFSET           0x384
>> +#define OMAP4460_BGAP_STATUS_OFFSET          0x388
>> +#define OMAP4460_FUSE_OPP_BGAP                       -0x260
>> +
>> +#define OMAP_ADC_START_VALUE    530
>> +#define OMAP_ADC_END_VALUE      923
>
> Are these OMAP4460, OMAP4xxx, or OMAP2+ specific?

OMAP4460. I will pass even these values through pdata
since they differ from platform to platform.

>
>> +
>> +/*
>> + * The register offsets and but fields might change across
>> + * OMAP versions hence populating them in this structure.
>> + */
>> +struct omap_temp_sensor_registers {
>> +     u32     temp_sensor_ctrl;
>> +     u32     bgap_tempsoff_mask;
>> +     u32     bgap_soc_mask;
>> +     u32     bgap_eocz_mask;
>> +     u32     bgap_dtemp_mask;
>> +
>> +     u32     bgap_mask_ctrl;
>> +     u32     mask_hot_mask;
>> +     u32     mask_cold_mask;
>> +
>> +     u32     bgap_mode_ctrl;
>> +     u32     mode_ctrl_mask;
>> +
>> +     u32     bgap_counter;
>> +     u32     counter_mask;
>> +
>> +     u32     bgap_threshold;
>> +     u32     threshold_thot_mask;
>> +     u32     threshold_tcold_mask;
>> +
>> +     u32     thsut_threshold;
>
> "tshut" misspelled here.

I will correct this.

>
>> +     u32     tshut_hot_mask;
>> +     u32     tshut_cold_mask;
>> +
>> +     u32     bgap_status;
>> +     u32     status_clean_stop_mask;
>> +     u32     status_bgap_alert_mask;
>> +     u32     status_hot_mask;
>> +     u32     status_cold_mask;
>> +
>> +     u32     bgap_efuse;
>> +};
>> +
>> +/**
>> + * struct omap4460plus_scm_dev_attr - device attributes for scm
>
> There are loads of references to 'omap4460plus' when it seems to me that
> much of this driver should also apply to OMAP4430 also.  Shouldn't this
> driver be named something like 'omap4430plus_scm' or even
> better 'omap4_scm' ?

This is used by hwmod. Hence keeping it in the header file.

>
>> + * @cnt - Number of temperature sensors
>> + * @list - array of pointers to register sets of temp sensors
>> + * @name - array of pointers to names of the temp sensors
>> + * @t_shut - Thermal shutdown interrupt handling required
>> + */
>
> First, thanks for supplying kerneldoc comments.  However, the format of
> your comments does not match Documentation/kernel-doc-nano-HOWTO.txt -
> please go back and review this text file and update your comments
> appropriately.

Ok

>
>> +struct omap4460plus_scm_dev_attr {
>> +     int cnt;
>> +     struct omap_temp_sensor_registers *list[10];
>> +     const char *name[10];
>> +     bool t_shut;
>> +};
>
> You're already passing in lots of data via
> arch/arm/mach-omap2/temp_sensor4460_data.c.  Shouldn't this data go into
> this file?

This is used by hwmod. Hence keeping it in the header file.

>
>> +
>> +/* forward declaration */
>> +struct scm;
>> +
>> +/**
>> + * struct temp_sensor_hwmon - temperature sensor hwmon device structure
>> + * @scm_ptr - pointer to system control module structure
>> + * @pdev - platform device pointer for hwmon device
>> + * @name - Name of the hwmon temp sensor device
>> + */
>> +struct temp_sensor_hwmon {
>> +     struct scm              *scm_ptr;
>> +     struct platform_device  *pdev;
>> +     const char              *name;
>> +};
>> +
>> +/**
>> + * struct system control module - scm device structure
>> + * @dev - device pointer
>> + * @registers - Pointer to the list of register offsets and bitfields
>> + * @fclock - pointer to functional clock of temperature sensor
>> + * @div_clk - pointer to parent clock of temperature sensor fclk
>> + * @tsh_ptr - pointer to temperature sesnor hwmon struct
>> + * @name - pointer to list of temperature sensor instance names is scm
>> + * @scm_mutex - Mutex for sysfs, irq and PM
>> + * @irq - MPU Irq number for thermal alert
>> + * @phy_base - Physical base of the temp I/O
>> + * @clk_rate - Holds current clock rate
>> + * @temp_sensor_ctrl - temp sensor control register value
>> + * @bg_ctrl - bandgap ctrl register value
>> + * @bg_counter - bandgap counter value
>> + * @bg_threshold - bandgap threshold register value
>> + * @temp_sensor_tshut_threshold - bandgap tshut register value
>> + * @cnt - count of temperature sensor device in scm
>> + */
>> +struct scm {
>> +     struct device                   *dev;
>> +     struct omap_temp_sensor_registers **registers;
>> +     struct clk              *fclock;
>> +     struct clk              *div_clk;
>> +     struct temp_sensor_hwmon *tsh_ptr;
>> +     const char              **name;
>> +     struct mutex            scm_mutex; /* Mutex for sysfs, irq and PM */
>> +     unsigned int            irq;
>> +     void __iomem            *phy_base;
>> +     u32                     clk_rate;
>> +     u32                     temp_sensor_ctrl;
>> +     u32                     bg_ctrl;
>> +     u32                     bg_counter;
>> +     u32                     bg_threshold;
>> +     u32                     temp_sensor_tshut_threshold;
>> +     u32                     cnt;
>> +};
>> +
>> +extern struct omap_temp_sensor_registers omap_mpu_temp_sensor_registers;
>> +extern int adc_to_temp[394];
>> +
>> +/*
>> + * struct omap4460plus_scm_pdata - omap4460plus_scm platform data
>> + * @registers -  pointer to list of register sets of temp sensors
>> + * @name - pointer to list of names of temp sensors
>> + * @cnt      - Number of temperature sensors
>> + * @min_freq - The minimum frequency for temp sensor to be operational
>> + * @max_freq - The maximum frequency at which temp sensor is operational
>> + * @t_shut - Thermal shutdown interrupt handling required
>> + */
>> +struct omap4460plus_scm_pdata {
>> +     struct omap_temp_sensor_registers **registers;
>> +     const char **name;
>> +     int cnt;
>> +     u32 min_freq;
>> +     u32 max_freq;
>> +     bool t_shut;
>> +};
>> +
>> +int omap4460plus_scm_show_temp_max(struct scm *scm_ptr, int id);
>> +int omap4460plus_scm_show_temp_max_hyst(struct scm *scm_ptr, int id);
>> +int omap4460plus_scm_set_temp_max(struct scm *scm_ptr, int id, int val);
>> +int omap4460plus_scm_set_temp_max_hyst(struct scm *scm_ptr,
>> +                                                     int id, int val);
>> +int omap4460plus_scm_show_update_interval(struct scm *scm_ptr, int id);
>> +void omap4460plus_scm_set_update_interval(struct scm *scm_ptr,
>> +                                             u32 interval, int id);
>> +int omap4460plus_scm_read_temp(struct scm *scm_ptr, int id);
>> +
>> +#endif
>> --
>> 1.7.0.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
> - Paul
>



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 4/6] OMAP4: Hwmod: system control module hwmod
  2011-09-23  6:15   ` Paul Walmsley
@ 2011-09-23 13:49     ` J, KEERTHY
  0 siblings, 0 replies; 32+ messages in thread
From: J, KEERTHY @ 2011-09-23 13:49 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap, b-cousson

On Fri, Sep 23, 2011 at 11:45 AM, Paul Walmsley <paul@pwsan.com> wrote:
> + Benoît
>
> Hi,
>
> On Thu, 22 Sep 2011, Keerthy wrote:
>
>> From: Benoit Cousson <b-cousson@ti.com>
>>
>> Adding the system control module hwmod.
>
> Have the autogeneration scripts been updated ?

The hwmod is autogenerated. I have taken this from Benoit.
I have added the dev_attr to pass on the information about temperature sensors.

>
>>
>> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>
>
>
> - Paul



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-09-23  5:49   ` Paul Walmsley
@ 2011-09-23 19:45     ` Paul Walmsley
  0 siblings, 0 replies; 32+ messages in thread
From: Paul Walmsley @ 2011-09-23 19:45 UTC (permalink / raw)
  To: Keerthy, Vishwanath BS; +Cc: linux-omap

Hi

On Thu, 22 Sep 2011, Paul Walmsley wrote:

> On Thu, 22 Sep 2011, Keerthy wrote:
> 
> > From: Vishwanath BS <vishwanath.bs@ti.com>
> > 
> > OMAP4460 specific clocks are not getting added as the
> > cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
> 
> > Changing it to add to OMAP4460 specific clocks also.
> > This is clocks are required of temperature sensor.
> > 
> > Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
> > Signed-off-by: Keerthy <j-keerthy@ti.com>
> > Cc: paul@pwsan.com 
> > ---
> >  arch/arm/mach-omap2/clock44xx_data.c |   12 ++++++------
> >  1 files changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
> > index c51e513..f72513b 100644
> > --- a/arch/arm/mach-omap2/clock44xx_data.c
> > +++ b/arch/arm/mach-omap2/clock44xx_data.c
> > @@ -1398,9 +1398,9 @@ static struct clk dss_dss_clk = {
> >  };
> >  
> >  static const struct clksel_rate div3_8to32_rates[] = {
> > -	{ .div = 8, .val = 0, .flags = RATE_IN_44XX },
> > -	{ .div = 16, .val = 1, .flags = RATE_IN_44XX },
> > -	{ .div = 32, .val = 2, .flags = RATE_IN_44XX },
> > +	{ .div = 8, .val = 0, .flags = RATE_IN_4460 },
> > +	{ .div = 16, .val = 1, .flags = RATE_IN_4460 },
> > +	{ .div = 32, .val = 2, .flags = RATE_IN_4460 },
> 
> Are these rates really 4460-specific?  If so, then it looks like something 
> is broken in the clock data generator.  Clearly, I should not have acked 
> these patches and they should never have been merged.
> 
> >  	{ .div = 0 },
> >  };
> >  
> > @@ -3403,12 +3403,12 @@ int __init omap4xxx_clk_init(void)
> >  	struct omap_clk *c;
> >  	u32 cpu_clkflg;
> >  
> > -	if (cpu_is_omap44xx()) {
> > +	if (cpu_is_omap443x()) {
> >  		cpu_mask = RATE_IN_4430;
> >  		cpu_clkflg = CK_443X;
> >  	} else if (cpu_is_omap446x()) {
> > -		cpu_mask = RATE_IN_4460;
> > -		cpu_clkflg = CK_446X;
> > +		cpu_mask = RATE_IN_4460 | RATE_IN_4430;
> > +		cpu_clkflg = CK_446X | CK_443X;
> 
> This isn't right.  Until the clock data files are converted to use per-SoC 
> lists, what needs to be done here is to define a RATE_IN_44XX and CK_44XX 
> that will match all existing 4430/4460/4470 clocks.  Then for rates and 
> clocks that are only specific to one of those SoCs, the appropriate 
> SoC-specific flag should be set.

Ugh.  I see what's going on here, now.  Both of these are good fixes, 
since the existing 4460 clock support is broken.



- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor
  2011-09-23 13:22         ` J, KEERTHY
@ 2011-09-24  7:38           ` Paul Walmsley
  0 siblings, 0 replies; 32+ messages in thread
From: Paul Walmsley @ 2011-09-24  7:38 UTC (permalink / raw)
  To: J, KEERTHY; +Cc: linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2204 bytes --]

On Fri, 23 Sep 2011, J, KEERTHY wrote:

> On Fri, Sep 23, 2011 at 11:28 AM, Paul Walmsley <paul@pwsan.com> wrote:
> > On Fri, 23 Sep 2011, J, KEERTHY wrote:
> >> On Fri, Sep 23, 2011 at 10:48 AM, Paul Walmsley <paul@pwsan.com> wrote:
> >> > On Thu, 22 Sep 2011, Keerthy wrote:
> >> >
> >> >> ---
> >> >>  arch/arm/mach-omap2/clock44xx_data.c |    4 ++--
> >> >>  1 files changed, 2 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
> >> >> index 946bf04..c51e513 100644
> >> >> --- a/arch/arm/mach-omap2/clock44xx_data.c
> >> >> +++ b/arch/arm/mach-omap2/clock44xx_data.c
> >> >> @@ -3185,9 +3185,9 @@ static struct omap_clk omap44xx_clks[] = {
> >> >>       CLK(NULL,       "aes2_fck",                     &aes2_fck,      CK_443X),
> >> >>       CLK(NULL,       "aess_fck",                     &aess_fck,      CK_443X),
> >> >>       CLK(NULL,       "bandgap_fclk",                 &bandgap_fclk,  CK_443X),
> >> >> -     CLK(NULL,       "bandgap_ts_fclk",              &bandgap_ts_fclk,       CK_446X),
> >> >> +     CLK("omap4460plus_scm.0",       "fck",          &bandgap_ts_fclk,       CK_446X),
> >> >>       CLK(NULL,       "des3des_fck",                  &des3des_fck,   CK_443X),
> >> >> -     CLK(NULL,       "div_ts_ck",                    &div_ts_ck,     CK_446X),
> >> >> +     CLK("omap4460plus_scm.0",       "div_ck",                       &div_ts_ck,     CK_446X),
> >> >
> >> > Clearly this device is incorrectly named.  You're setting up a clkdev
> >> > entry that's marked as being valid for OMAP4430, but your device is called
> >> > "omap4460plus_scm".  They can't both be right...
> >>
> >> This is addressed in Patch 06.
> >
> > How does patch 6 address it?
> 
> I am not sure i interpreted the comment right. These clock nodes are specific to
> OMAP4460 and are tagged CK_446X hence the device name "omap4460plus_scm.0"

Looking back over this, I misread the intention of this patch - sorry 
about that.  The right thing to do in this clock file depends on how the 
rest of the code is structured; will write some followup comments about 
that.


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-23 13:47     ` J, KEERTHY
@ 2011-09-24  7:48       ` Paul Walmsley
  2011-09-26  4:25         ` J, KEERTHY
  2011-09-24  7:59       ` Paul Walmsley
  1 sibling, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-24  7:48 UTC (permalink / raw)
  To: J, KEERTHY; +Cc: linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2359 bytes --]

On Fri, 23 Sep 2011, J, KEERTHY wrote:

> On Fri, Sep 23, 2011 at 11:33 AM, Paul Walmsley <paul@pwsan.com> wrote:
> >
> > On Thu, 22 Sep 2011, Keerthy wrote:
> >
> >> @@ -0,0 +1,175 @@
> >> +/*
> >> + * OMAP system control module header file
> >> + *
> >> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
> >> + * Author: J Keerthy <j-keerthy@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, Boston, MA
> >> + * 02110-1301 USA
> >> + *
> >> + */
> >> +
> >> +#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
> >> +#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
> >
> > You're also missing important #includes here for things like mutexes
> > and kernel types that you use later on in the file.
> 
> Those header files are included in c files.

And how does that affect my comment?

> >> +#define OMAP_ADC_START_VALUE    530
> >> +#define OMAP_ADC_END_VALUE      923
> >
> > Are these OMAP4460, OMAP4xxx, or OMAP2+ specific?
> 
> OMAP4460. I will pass even these values through pdata
> since they differ from platform to platform.

So then the macro names need to include "OMAP4460" or whatever SoC
they are first valid for.

> >> +
> >> +/**
> >> + * struct omap4460plus_scm_dev_attr - device attributes for scm
> >
> > There are loads of references to 'omap4460plus' when it seems to me that
> > much of this driver should also apply to OMAP4430 also.  Shouldn't this
> > driver be named something like 'omap4430plus_scm' or even
> > better 'omap4_scm' ?
> 
> This is used by hwmod. Hence keeping it in the header file.

Did you even read my comment before responding?


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-23 13:47     ` J, KEERTHY
  2011-09-24  7:48       ` Paul Walmsley
@ 2011-09-24  7:59       ` Paul Walmsley
  2011-09-24  9:02         ` J, KEERTHY
  1 sibling, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-24  7:59 UTC (permalink / raw)
  To: J, KEERTHY; +Cc: linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1867 bytes --]

On Fri, 23 Sep 2011, J, KEERTHY wrote:

> On Fri, Sep 23, 2011 at 11:33 AM, Paul Walmsley <paul@pwsan.com> wrote:
>
> > On Thu, 22 Sep 2011, Keerthy wrote:
> >
> >> diff --git a/arch/arm/mach-omap2/temp_sensor4460_data.c b/arch/arm/mach-omap2/temp_sensor4460_data.c
> >> new file mode 100644
> >> index 0000000..2804615
> >> --- /dev/null
> >> +++ b/arch/arm/mach-omap2/temp_sensor4460_data.c
> >
> > Is there some reason why this shouldn't go into drivers/ in some form?
> 
> This is used by mach-omap2.

Why does something in mach-omap2 need this data?

> >> diff --git a/arch/arm/plat-omap/include/plat/scm.h b/arch/arm/plat-omap/include/plat/scm.h
> >> new file mode 100644
> >> index 0000000..47aa38f
> >> --- /dev/null
> >> +++ b/arch/arm/plat-omap/include/plat/scm.h
> >
> > If this is being used by a driver, then this header file should go into
> > the appropriate drivers/ subdirectory.  If it is being used by code in
> > arch/arm/mach-omap2, then please use the existing
> > arch/arm/mach-omap2/control.h instead.
> 
> The header file has structures used both by drivers/ and mach-omap.
> So kept it in plat-omap.

The point is, if there are structure definitions and macros that are
only needed by code in drivers/, then those should be split off into a
separate file and placed in drivers/.  Similarly, if there are elements of 
this file that are only used in mach-omap2/, then those should go into 
mach-omap2/control.h.

About the only part off the top of my head that should go into a
plat-omap header file should be the dev_attr structure.  And it's 
debatable whether this driver even needs a dev_attr, or whether all
this data should just go into an omap4460_scm.c MFD driver that uses
a bunch of common code for the parts that are shared with 4430, etc.
Do you have any views on this issue?


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-24  7:59       ` Paul Walmsley
@ 2011-09-24  9:02         ` J, KEERTHY
  0 siblings, 0 replies; 32+ messages in thread
From: J, KEERTHY @ 2011-09-24  9:02 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Sat, Sep 24, 2011 at 1:29 PM, Paul Walmsley <paul@pwsan.com> wrote:
> On Fri, 23 Sep 2011, J, KEERTHY wrote:
>
>> On Fri, Sep 23, 2011 at 11:33 AM, Paul Walmsley <paul@pwsan.com> wrote:
>>
>> > On Thu, 22 Sep 2011, Keerthy wrote:
>> >
>> >> diff --git a/arch/arm/mach-omap2/temp_sensor4460_data.c b/arch/arm/mach-omap2/temp_sensor4460_data.c
>> >> new file mode 100644
>> >> index 0000000..2804615
>> >> --- /dev/null
>> >> +++ b/arch/arm/mach-omap2/temp_sensor4460_data.c
>> >
>> > Is there some reason why this shouldn't go into drivers/ in some form?
>>
>> This is used by mach-omap2.
>
> Why does something in mach-omap2 need this data?

The scm hwmod is populating the pointer to the register set which is
specific to OMAP4460.
So i have kept the OMAP4460 specific data file in mach-omap2.

>
>> >> diff --git a/arch/arm/plat-omap/include/plat/scm.h b/arch/arm/plat-omap/include/plat/scm.h
>> >> new file mode 100644
>> >> index 0000000..47aa38f
>> >> --- /dev/null
>> >> +++ b/arch/arm/plat-omap/include/plat/scm.h
>> >
>> > If this is being used by a driver, then this header file should go into
>> > the appropriate drivers/ subdirectory.  If it is being used by code in
>> > arch/arm/mach-omap2, then please use the existing
>> > arch/arm/mach-omap2/control.h instead.
>>
>> The header file has structures used both by drivers/ and mach-omap.
>> So kept it in plat-omap.
>
> The point is, if there are structure definitions and macros that are
> only needed by code in drivers/, then those should be split off into a
> separate file and placed in drivers/.  Similarly, if there are elements of
> this file that are only used in mach-omap2/, then those should go into
> mach-omap2/control.h.
>
> About the only part off the top of my head that should go into a
> plat-omap header file should be the dev_attr structure.  And it's
> debatable whether this driver even needs a dev_attr, or whether all
> this data should just go into an omap4460_scm.c MFD driver that uses
> a bunch of common code for the parts that are shared with 4430, etc.
> Do you have any views on this issue?

There can be a common omap4_scm.c driver. The temperature sensor
is different from OMAP4430 and OMAP4460. So keeping the temperature
sensor as omap4460plus.

Coming to structure definitions. pdata structure is needed both by mach-omap
device file to populate it and also by the driver t extract it. So
keeping all of the
structure definitions in one header file in plat_omap. My question is which
is the ideal place to keep the common structure definition like pdata?

Since the temperature sensor does not have a separate hwmod of its own
i feel there is a necessity of dev_attr.

>
>
> - Paul



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 3/6] OMAP4460: Temperature sensor data
  2011-09-24  7:48       ` Paul Walmsley
@ 2011-09-26  4:25         ` J, KEERTHY
  0 siblings, 0 replies; 32+ messages in thread
From: J, KEERTHY @ 2011-09-26  4:25 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap

On Sat, Sep 24, 2011 at 1:18 PM, Paul Walmsley <paul@pwsan.com> wrote:
> On Fri, 23 Sep 2011, J, KEERTHY wrote:
>
>> On Fri, Sep 23, 2011 at 11:33 AM, Paul Walmsley <paul@pwsan.com> wrote:
>> >
>> > On Thu, 22 Sep 2011, Keerthy wrote:
>> >
>> >> @@ -0,0 +1,175 @@
>> >> +/*
>> >> + * OMAP system control module header file
>> >> + *
>> >> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
>> >> + * Author: J Keerthy <j-keerthy@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, Boston, MA
>> >> + * 02110-1301 USA
>> >> + *
>> >> + */
>> >> +
>> >> +#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
>> >> +#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_TEMPERATURE_SENSOR_H
>> >
>> > You're also missing important #includes here for things like mutexes
>> > and kernel types that you use later on in the file.
>>
>> Those header files are included in c files.
>
> And how does that affect my comment?
>
>> >> +#define OMAP_ADC_START_VALUE    530
>> >> +#define OMAP_ADC_END_VALUE      923
>> >
>> > Are these OMAP4460, OMAP4xxx, or OMAP2+ specific?
>>
>> OMAP4460. I will pass even these values through pdata
>> since they differ from platform to platform.
>
> So then the macro names need to include "OMAP4460" or whatever SoC
> they are first valid for.
>
>> >> +
>> >> +/**
>> >> + * struct omap4460plus_scm_dev_attr - device attributes for scm
>> >
>> > There are loads of references to 'omap4460plus' when it seems to me that
>> > much of this driver should also apply to OMAP4430 also.  Shouldn't this
>> > driver be named something like 'omap4430plus_scm' or even
>> > better 'omap4_scm' ?
>>
>> This is used by hwmod. Hence keeping it in the header file.
>
> Did you even read my comment before responding?

Sorry about this. OMAP4430 and OMAP4460 temperature sensors are different.
The register layout and the functionalities differ. The OMAP4430 temperature
sensor is not accurate. The SCM driver can be generic but the temperature
sensor driver should be OMAP4460 onwards. Please let me know if this is fine?

>
>
> - Paul



-- 
Regards and Thanks,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-09-22 15:29 ` [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks Keerthy
  2011-09-23  5:49   ` Paul Walmsley
@ 2011-09-30  1:12   ` Paul Walmsley
  2011-10-04  0:43     ` Tony Lindgren
  1 sibling, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-09-30  1:12 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-omap, Vishwanath BS

Hi

On Thu, 22 Sep 2011, Keerthy wrote:

> From: Vishwanath BS <vishwanath.bs@ti.com>
> 
> OMAP4460 specific clocks are not getting added as the
> cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
> Changing it to add to OMAP4460 specific clocks also.
> This is clocks are required of temperature sensor.
> 
> Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Cc: paul@pwsan.com 

Thanks, this patch has been queued for 3.2.


- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-09-30  1:12   ` Paul Walmsley
@ 2011-10-04  0:43     ` Tony Lindgren
  2011-10-04  3:51       ` Paul Walmsley
  0 siblings, 1 reply; 32+ messages in thread
From: Tony Lindgren @ 2011-10-04  0:43 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Keerthy, linux-omap, Vishwanath BS

* Paul Walmsley <paul@pwsan.com> [110929 17:40]:
> Hi
> 
> On Thu, 22 Sep 2011, Keerthy wrote:
> 
> > From: Vishwanath BS <vishwanath.bs@ti.com>
> > 
> > OMAP4460 specific clocks are not getting added as the
> > cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
> > Changing it to add to OMAP4460 specific clocks also.
> > This is clocks are required of temperature sensor.
> > 
> > Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
> > Signed-off-by: Keerthy <j-keerthy@ti.com>
> > Cc: paul@pwsan.com 
> 
> Thanks, this patch has been queued for 3.2.

Should this be a fix for the -rc cycle instead?

Tony

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-10-04  0:43     ` Tony Lindgren
@ 2011-10-04  3:51       ` Paul Walmsley
  2011-10-04  6:24         ` Shilimkar, Santosh
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Walmsley @ 2011-10-04  3:51 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Keerthy, linux-omap, rnayak, santosh.shilimkar, b-cousson, Vishwanath BS

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1225 bytes --]

+ Rajendra, Santosh, Benoît

Hi

On Mon, 3 Oct 2011, Tony Lindgren wrote:

> * Paul Walmsley <paul@pwsan.com> [110929 17:40]:
> > On Thu, 22 Sep 2011, Keerthy wrote:
> > 
> > > From: Vishwanath BS <vishwanath.bs@ti.com>
> > > 
> > > OMAP4460 specific clocks are not getting added as the
> > > cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
> > > Changing it to add to OMAP4460 specific clocks also.
> > > This is clocks are required of temperature sensor.
> > > 
> > > Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
> > > Signed-off-by: Keerthy <j-keerthy@ti.com>
> > > Cc: paul@pwsan.com 
> > 
> > Thanks, this patch has been queued for 3.2.
> 
> Should this be a fix for the -rc cycle instead?

I don't think it's needed for the -rc series, since we don't have any 
in-tree users of the 4460 temperature sensor.  The only impact I can see 
is if the bootloader enables the 4460 temperature sensor clock, and 
doesn't disable it.  I assume that would probably prevent the L4 WKUP 
clockdomain from entering clock stop, which would consume a little more 
power.

But maybe Benoît, Rajendra, or Santosh can correct me if this 
off-the-cuff analysis is incorrect.

- Paul

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-10-04  3:51       ` Paul Walmsley
@ 2011-10-04  6:24         ` Shilimkar, Santosh
  2011-10-06 18:24           ` Tony Lindgren
  0 siblings, 1 reply; 32+ messages in thread
From: Shilimkar, Santosh @ 2011-10-04  6:24 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Tony Lindgren, Keerthy, linux-omap, rnayak, b-cousson, Vishwanath BS

On Tue, Oct 4, 2011 at 9:21 AM, Paul Walmsley <paul@pwsan.com> wrote:
> + Rajendra, Santosh, Benoît
>
> Hi
>
> On Mon, 3 Oct 2011, Tony Lindgren wrote:
>
>> * Paul Walmsley <paul@pwsan.com> [110929 17:40]:
>> > On Thu, 22 Sep 2011, Keerthy wrote:
>> >
>> > > From: Vishwanath BS <vishwanath.bs@ti.com>
>> > >
>> > > OMAP4460 specific clocks are not getting added as the
>> > > cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
>> > > Changing it to add to OMAP4460 specific clocks also.
>> > > This is clocks are required of temperature sensor.
>> > >
>> > > Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
>> > > Signed-off-by: Keerthy <j-keerthy@ti.com>
>> > > Cc: paul@pwsan.com
>> >
>> > Thanks, this patch has been queued for 3.2.
>>
>> Should this be a fix for the -rc cycle instead?
>
> I don't think it's needed for the -rc series, since we don't have any
> in-tree users of the 4460 temperature sensor.  The only impact I can see
> is if the bootloader enables the 4460 temperature sensor clock, and
> doesn't disable it.  I assume that would probably prevent the L4 WKUP
> clockdomain from entering clock stop, which would consume a little more
> power.
>
You are correct Paul. It would have also gated the low power states
but at this point of time on mainline, we aren't supporting CORE/PER
low power states for OMAP44XX.

IIRC, boot-loader isn't enabling the temperature
sensor clock so this patch can wait for next merge window.

Regards
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks
  2011-10-04  6:24         ` Shilimkar, Santosh
@ 2011-10-06 18:24           ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2011-10-06 18:24 UTC (permalink / raw)
  To: Shilimkar, Santosh
  Cc: Paul Walmsley, Keerthy, linux-omap, rnayak, b-cousson, Vishwanath BS

* Shilimkar, Santosh <santosh.shilimkar@ti.com> [111003 22:50]:
> On Tue, Oct 4, 2011 at 9:21 AM, Paul Walmsley <paul@pwsan.com> wrote:
> > + Rajendra, Santosh, Benoît
> >
> > Hi
> >
> > On Mon, 3 Oct 2011, Tony Lindgren wrote:
> >
> >> * Paul Walmsley <paul@pwsan.com> [110929 17:40]:
> >> > On Thu, 22 Sep 2011, Keerthy wrote:
> >> >
> >> > > From: Vishwanath BS <vishwanath.bs@ti.com>
> >> > >
> >> > > OMAP4460 specific clocks are not getting added as the
> >> > > cpu_is_omap44xx is choosing only OMAP4430 specific clock nodes.
> >> > > Changing it to add to OMAP4460 specific clocks also.
> >> > > This is clocks are required of temperature sensor.
> >> > >
> >> > > Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
> >> > > Signed-off-by: Keerthy <j-keerthy@ti.com>
> >> > > Cc: paul@pwsan.com
> >> >
> >> > Thanks, this patch has been queued for 3.2.
> >>
> >> Should this be a fix for the -rc cycle instead?
> >
> > I don't think it's needed for the -rc series, since we don't have any
> > in-tree users of the 4460 temperature sensor.  The only impact I can see
> > is if the bootloader enables the 4460 temperature sensor clock, and
> > doesn't disable it.  I assume that would probably prevent the L4 WKUP
> > clockdomain from entering clock stop, which would consume a little more
> > power.
> >
> You are correct Paul. It would have also gated the low power states
> but at this point of time on mainline, we aren't supporting CORE/PER
> low power states for OMAP44XX.
> 
> IIRC, boot-loader isn't enabling the temperature
> sensor clock so this patch can wait for next merge window.

OK thanks, sounds like v3.2 merge window is safe for this then.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2011-10-06 18:24 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22 15:29 [PATCH 0/6] system control module device and support for temperature sensor Keerthy
2011-09-22 15:29 ` [PATCH 1/6] OMAP4: Adding the temperature sensor register set bit fields Keerthy
2011-09-23  5:16   ` Paul Walmsley
2011-09-23  5:56     ` J, KEERTHY
2011-09-22 15:29 ` [PATCH 2/6] OMAP4: Clock: Associate clocks for OMAP temperature sensor Keerthy
2011-09-23  5:18   ` Paul Walmsley
2011-09-23  5:53     ` J, KEERTHY
2011-09-23  5:58       ` Paul Walmsley
2011-09-23 13:22         ` J, KEERTHY
2011-09-24  7:38           ` Paul Walmsley
2011-09-22 15:29 ` [PATCH 3/6] OMAP4460: Temperature sensor data Keerthy
2011-09-23  6:03   ` Paul Walmsley
2011-09-23 13:47     ` J, KEERTHY
2011-09-24  7:48       ` Paul Walmsley
2011-09-26  4:25         ` J, KEERTHY
2011-09-24  7:59       ` Paul Walmsley
2011-09-24  9:02         ` J, KEERTHY
2011-09-22 15:29 ` [PATCH 4/6] OMAP4: Hwmod: system control module hwmod Keerthy
2011-09-23  6:15   ` Paul Walmsley
2011-09-23 13:49     ` J, KEERTHY
2011-09-22 15:29 ` [PATCH 5/6] OMAP4: System control module device support Keerthy
2011-09-22 15:29 ` [PATCH 6/6] OMAP4460: Clock: Adding support for 4460 specific clocks Keerthy
2011-09-23  5:49   ` Paul Walmsley
2011-09-23 19:45     ` Paul Walmsley
2011-09-30  1:12   ` Paul Walmsley
2011-10-04  0:43     ` Tony Lindgren
2011-10-04  3:51       ` Paul Walmsley
2011-10-04  6:24         ` Shilimkar, Santosh
2011-10-06 18:24           ` Tony Lindgren
2011-09-23  5:15 ` [PATCH 0/6] system control module device and support for temperature sensor Paul Walmsley
2011-09-23  5:54   ` J, KEERTHY
2011-09-23  6:35 ` Paul Walmsley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.