From patchwork Sun Jun 19 04:13:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: khiemnguyen X-Patchwork-Id: 9186043 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6047601C0 for ; Sun, 19 Jun 2016 04:14:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C11B6264F4 for ; Sun, 19 Jun 2016 04:14:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5301269B2; Sun, 19 Jun 2016 04:14:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F348264F4 for ; Sun, 19 Jun 2016 04:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751487AbcFSEOG (ORCPT ); Sun, 19 Jun 2016 00:14:06 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:59121 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751310AbcFSEOD (ORCPT ); Sun, 19 Jun 2016 00:14:03 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 19 Jun 2016 13:14:01 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 65C33489F7; Sun, 19 Jun 2016 13:14:01 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 649662806E; Sun, 19 Jun 2016 13:14:01 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 5EF9B2806D; Sun, 19 Jun 2016 13:14:01 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id PAA20666; Sun, 19 Jun 2016 13:14:01 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="213737958" Received: from unknown (HELO outside-ironport.rvc.renesas.com) ([172.29.139.110]) by relmlii2.idc.renesas.com with ESMTP; 19 Jun 2016 13:14:00 +0900 Received: from rvc-hts-01.rvc.renesas.com ([172.29.139.122]) by inside-ironport.rvc.renesas.com with ESMTP; 19 Jun 2016 11:14:00 +0700 Received: from [172.29.157.15] (172.29.157.15) by rvc-hts-01.rvc.renesas.com (172.29.139.120) with Microsoft SMTP Server id 8.3.83.0; Sun, 19 Jun 2016 11:13:59 +0700 Subject: [PATCH/RFC 1/3] thermal: rcar_gen3_thermal: Modify the shared irq with initialization To: Kuninori Morimoto References: <57661211.7010900@rvc.renesas.com> <57661BB1.3060401@rvc.renesas.com> CC: Wolfram Sang , Geert Uytterhoeven , Magnus Damm , Zhang Rui , Eduardo Valentin , Rob Herring , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Thao Phuong Le. Nguyen" , "Hien Duy. Dang" , Toru Oishi , "linux-renesas-soc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Gaku Inami , Catalin Marinas , Simon Horman , "Khiem Trong. Nguyen" From: Khiem Nguyen Message-ID: <57661C07.9050905@rvc.renesas.com> Date: Sun, 19 Jun 2016 11:13:59 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <57661BB1.3060401@rvc.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In R-CAR Gen3 series, it has some thermal sensors. The interrupt I/F that can be used in thermal sensors is three. So it should be used the interrupt I/F as shared. This patch changes the shared settings for the thermal interrupts. Signed-off-by: Gaku Inami Signed-off-by: Khiem Nguyen --- drivers/thermal/rcar_gen3_thermal.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index a9a372b..e640a14 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -416,6 +416,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) int ret = -ENODEV; int idle; struct device_node *tz_nd, *tmp_nd; + int i, irq_cnt; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -489,13 +490,18 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) rcar_gen3_thermal_irq_enable(priv); /* Interrupt */ - if (irq) { - ret = devm_request_irq(dev, irq->start, - rcar_gen3_thermal_irq, 0, - dev_name(dev), priv); - if (ret) { - dev_err(dev, "IRQ request failed\n "); - goto error_unregister; + if (rcar_has_irq_support(priv)) { + irq_cnt = platform_irq_count(pdev); + for (i = 0; i < irq_cnt; i++) { + irq = platform_get_resource(pdev, IORESOURCE_IRQ, i); + ret = devm_request_irq(dev, irq->start, + rcar_gen3_thermal_irq, + IRQF_SHARED, + dev_name(dev), priv); + if (ret) { + dev_err(dev, "IRQ request failed\n "); + goto error_unregister; + } } }