From patchwork Wed Aug 24 14:37:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 1092942 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7OEbdCs008049 for ; Wed, 24 Aug 2011 14:37:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816Ab1HXOhe (ORCPT ); Wed, 24 Aug 2011 10:37:34 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:59026 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643Ab1HXOha (ORCPT ); Wed, 24 Aug 2011 10:37:30 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7OEbRMo010536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Aug 2011 09:37:29 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7OEbQcb012741; Wed, 24 Aug 2011 20:07:26 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Wed, 24 Aug 2011 20:07:26 +0530 Received: from localhost.localdomain (a0393675-desktop.apr.dhcp.ti.com [172.24.137.178]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7OEbIkH009998; Wed, 24 Aug 2011 20:07:25 +0530 (IST) From: Keerthy To: CC: Benoit Cousson , Keerthy , Subject: [PATCH 4/6 V3] OMAP4: Hwmod: OMAP temperature sensor Date: Wed, 24 Aug 2011 20:07:10 +0530 Message-ID: <1314196632-8207-5-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1314196632-8207-1-git-send-email-j-keerthy@ti.com> References: <1314196632-8207-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 24 Aug 2011 14:37:39 +0000 (UTC) From: Benoit Cousson OMAP4460 temperature sensor hwmod cannot be auto generated since it is part of ctrl module. Hence populating the necessary hwmod info manually. Signed-off-by: Benoit Cousson Signed-off-by: Keerthy Cc: tony@atomide.com Cc: b-cousson@ti.com --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 61 ++++++++++++++++++++++++++++ 1 files changed, 61 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 6201422..28bf6d3 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "omap_hwmod_common_data.h" @@ -832,6 +833,63 @@ static struct omap_hwmod omap44xx_aess_hwmod = { }; /* + * 'temperature_sensor' class + * temperature sensor module inside the bandgap / control module + */ + +static struct omap_hwmod_class omap44xx_temperature_sensor_hwmod_class = { + .name = "temperature_sensor", +}; + +static struct omap_hwmod_irq_info omap44xx_temperature_sensor_irqs[] = { + { .name = "thermal_alert", .irq = 126 + OMAP44XX_IRQ_GIC_START }, +}; + +static struct omap_hwmod_addr_space omap44xx_temperature_sensor_addrs[] = { + { + .pa_start = 0x4a00232c, + .pa_end = 0x4a00238b, + }, +}; + +static struct omap_hwmod omap44xx_temperature_sensor_hwmod; +/* l4_cfg -> ctrl_module_core */ +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__temperature_sensor = { + .master = &omap44xx_l4_cfg_hwmod, + .slave = &omap44xx_temperature_sensor_hwmod, + .clk = "l4_div_ck", + .addr = omap44xx_temperature_sensor_addrs, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* ctrl_module_core slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_temperature_sensor_slaves[] = { + &omap44xx_l4_cfg__temperature_sensor, +}; + +/* temperature sensor dev_attr */ +static struct omap_temp_sensor_dev_attr temp_sensor_dev_attr = { + .name = "mpu", +}; + +static struct omap_hwmod omap44xx_temperature_sensor_hwmod = { + .name = "temperature_sensor_mpu", + .class = &omap44xx_temperature_sensor_hwmod_class, + .mpu_irqs = omap44xx_temperature_sensor_irqs, + .main_clk = "bandgap_ts_fclk", + .slaves = omap44xx_temperature_sensor_slaves, + .slaves_cnt = ARRAY_SIZE(omap44xx_temperature_sensor_slaves), + .clkdm_name = "l4_wkup_clkdm", + .prcm = { + .omap4 = { + .clkctrl_offs = OMAP4_CM_WKUP_BANDGAP_CLKCTRL_OFFSET, + }, + }, + .dev_attr = &temp_sensor_dev_attr, + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), +}; + +/* * 'bandgap' class * bangap reference for ldo regulators */ @@ -5469,6 +5527,9 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { &omap44xx_timer10_hwmod, &omap44xx_timer11_hwmod, + /* temperature sensor hwmod */ + &omap44xx_temperature_sensor_hwmod, + /* uart class */ &omap44xx_uart1_hwmod, &omap44xx_uart2_hwmod,