Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754576AbbBBPiZ (ORCPT ); Mon, 2 Feb 2015 10:38:25 -0500 Received: from ns.mm-sol.com ([37.157.136.199]:54523 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbbBBPiX (ORCPT ); Mon, 2 Feb 2015 10:38:23 -0500 Message-ID: <54CF99E9.10305@mm-sol.com> Date: Mon, 02 Feb 2015 17:38:17 +0200 From: Stanimir Varbanov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Ivan T. Ivanov" CC: Zhang Rui , Eduardo Valentin , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, David Collins Subject: Re: [PATCH v4] thermal: Add QPNP PMIC temperature alarm driver References: <1422890370-6914-1-git-send-email-iivanov@mm-sol.com> In-Reply-To: <1422890370-6914-1-git-send-email-iivanov@mm-sol.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1812 Lines: 64 On 02/02/2015 05:19 PM, Ivan T. Ivanov wrote: > Add support for the temperature alarm peripheral found inside > Qualcomm plug-and-play (QPNP) PMIC chips. The temperature alarm > peripheral outputs a pulse on an interrupt line whenever the > thermal over temperature stage value changes. > > Register a thermal sensor. The temperature reported by this thermal > sensor device should reflect the actual PMIC die temperature if an > ADC is present on the given PMIC. If no ADC is present, then the > reported temperature should be estimated from the over temperature > stage value. > > Cc: David Collins > Signed-off-by: Ivan T. Ivanov > --- > > + > + ret = qpnp_tm_init(chip); > + if (ret < 0) { > + dev_err(&pdev->dev, "init failed\n"); > + goto fail; > + } > + > + chip->tz_dev = thermal_zone_of_sensor_register(&pdev->dev, 0, chip, > + &qpnp_tm_sensor_ops); > + if (IS_ERR(chip->tz_dev)) { > + dev_err(&pdev->dev, "failed to register sensor\n"); > + ret = PTR_ERR(chip->tz_dev); > + goto fail; > + } > + > + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, qpnp_tm_isr, > + IRQF_ONESHOT, node->name, chip); > + if (ret < 0) > + goto unreg; > + > + return 0; > + > +unreg: > + thermal_zone_of_sensor_unregister(&pdev->dev, chip->tz_dev); Any problem to request_irq before thermal_zone_of_sensor_register? It will avoid having thermal sensor unregister call. > +fail: > + if (!IS_ERR(chip->adc)) > + iio_channel_release(chip->adc); > + > + return ret; > +} -- regards, Stan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/