From patchwork Fri Jun 7 20:46:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 2689741 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1E69140077 for ; Fri, 7 Jun 2013 20:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756721Ab3FGUqy (ORCPT ); Fri, 7 Jun 2013 16:46:54 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:44017 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755255Ab3FGUqx (ORCPT ); Fri, 7 Jun 2013 16:46:53 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r57KkiTe026056; Fri, 7 Jun 2013 15:46:44 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r57Kkisc026711; Fri, 7 Jun 2013 15:46:44 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Fri, 7 Jun 2013 15:46:44 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r57KkiHX006796; Fri, 7 Jun 2013 15:46:44 -0500 Received: from localhost (h68-13.vpn.ti.com [172.24.68.13]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r57KkdV20714; Fri, 7 Jun 2013 15:46:39 -0500 (CDT) From: Eduardo Valentin To: , CC: , , , Eduardo Valentin , Zhang Rui , Rob Herring , , Subject: [PATCHv3 1/6] thermal: ti-soc-thermal: use standard GPIO DT bindings Date: Fri, 7 Jun 2013 16:46:03 -0400 Message-ID: <1370637968-23299-2-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.8.2.1.342.gfa7285d In-Reply-To: <1370637968-23299-1-git-send-email-eduardo.valentin@ti.com> References: <1370637968-23299-1-git-send-email-eduardo.valentin@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 This change updates the ti-soc-thermal driver to use standard GPIO DT bindings to read the GPIO number associated to thermal shutdown IRQ, in case the device features it. Previously, the code was using a specific DT bindings. As now OMAP supports the standard way to model GPIOs, there is no point in having a ti specific binding. Cc: Zhang Rui Cc: Grant Likely Cc: Rob Herring Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org Signed-off-by: Eduardo Valentin --- drivers/staging/ti-soc-thermal/ti-bandgap.c | 8 ++------ drivers/staging/ti-soc-thermal/ti_soc_thermal.txt | 9 +++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c b/drivers/staging/ti-soc-thermal/ti-bandgap.c index f20c1cf..c7fc0d0 100644 --- a/drivers/staging/ti-soc-thermal/ti-bandgap.c +++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "ti-bandgap.h" @@ -1123,7 +1124,6 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) const struct of_device_id *of_id; struct ti_bandgap *bgp; struct resource *res; - u32 prop; int i; /* just for the sake */ @@ -1167,11 +1167,7 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) } while (res); if (TI_BANDGAP_HAS(bgp, TSHUT)) { - if (of_property_read_u32(node, "ti,tshut-gpio", &prop) < 0) { - dev_err(&pdev->dev, "missing tshut gpio in device tree\n"); - return ERR_PTR(-EINVAL); - } - bgp->tshut_gpio = prop; + bgp->tshut_gpio = of_get_gpio(node, 0); if (!gpio_is_valid(bgp->tshut_gpio)) { dev_err(&pdev->dev, "invalid gpio for tshut (%d)\n", bgp->tshut_gpio); diff --git a/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt b/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt index a4a33d1..382bd98 100644 --- a/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt +++ b/drivers/staging/ti-soc-thermal/ti_soc_thermal.txt @@ -17,8 +17,9 @@ Required properties: - interrupts : this entry should indicate which interrupt line the talert signal is routed to; Specific: -- ti,tshut-gpio : this entry should be used to inform which GPIO -line the tshut signal is routed to; +- gpios : this entry should be used to inform which GPIO +line the tshut signal is routed to. The informed GPIO will +be treated as an IRQ; - regs : this entry must also be specified and it is specific to each bandgap version, because the mapping may change from soc to soc, apart of depending on available features. @@ -37,7 +38,7 @@ bandgap { 0x4a002378 0x18>; compatible = "ti,omap4460-bandgap"; interrupts = <0 126 4>; /* talert */ - ti,tshut-gpio = <86>; + gpios = <&gpio3 22 0>; /* tshut */ }; OMAP4470: @@ -47,7 +48,7 @@ bandgap { 0x4a002378 0x18>; compatible = "ti,omap4470-bandgap"; interrupts = <0 126 4>; /* talert */ - ti,tshut-gpio = <86>; + gpios = <&gpio3 22 0>; /* tshut */ }; OMAP5430: