From: Mark Rutland <mark.rutland@arm.com> To: kongxinwei <kong.kongxinwei@hisilicon.com> Cc: "rui.zhuang@intel.com" <rui.zhuang@intel.com>, "edubezval@gmail.com" <edubezval@gmail.com>, "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linuxarm@huawei.com" <linuxarm@huawei.com>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "liguozhu@hisilicon.com" <liguozhu@hisilicon.com>, "xuwei5@hisilicon.com" <xuwei5@hisilicon.com> Subject: Re: [PATCH 1/3] thermal: hisilicon: add new hisilicon thermal sensor driver Date: Thu, 19 Mar 2015 14:17:53 +0000 [thread overview] Message-ID: <20150319141753.GB25967@leverpostej> (raw) In-Reply-To: <1426751849-10604-2-git-send-email-kong.kongxinwei@hisilicon.com> On Thu, Mar 19, 2015 at 07:57:27AM +0000, kongxinwei wrote: > This patch adds the support for hisilicon thermal sensor, within > hisilicon SoC. there will register sensors for thermal framework > and use device tree to bind cooling device. > > Signed-off-by: Leo Yan <leo.yan@linaro.org> > Signed-off-by: kongxinwei <kong.kongxinwei@hisilicon.com> > --- > drivers/thermal/Kconfig | 8 + > drivers/thermal/Makefile | 1 + > drivers/thermal/hisi_thermal.c | 531 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 540 insertions(+) > create mode 100644 drivers/thermal/hisi_thermal.c [...] > + ret = of_property_read_u32(np, "hisilicon,tsensor-lag-value", > + &sensor->lag); This wasn't in the binding. [...] > + ret = of_property_read_u32(np, "hisilicon,tsensor-thres-temp", > + &sensor->thres_temp); > + if (ret) { > + dev_err(&pdev->dev, "failed to get thres value %d: %d\n", > + index, ret); > + return ret; > + } > + > + ret = of_property_read_u32(np, "hisilicon,tsensor-reset-temp", > + &sensor->reset_temp); > + if (ret) { > + dev_err(&pdev->dev, "failed to get reset value %d: %d\n", > + index, ret); > + return ret; > + } I see now that these properties result in the HW being programmed. You should figure out how to reconcile these with thermal-zone trip points rather than having parallel properties. > + > + if (of_property_read_bool(np, "hisilicon,tsensor-bind-irq")) { > + > + if (data->irq_bind_sensor != -1) > + dev_warn(&pdev->dev, "irq has bound to index %d\n", > + data->irq_bind_sensor); > + > + /* bind irq to this sensor */ > + data->irq_bind_sensor = index; > + } I don't see why this should be specified in the DT. Why do you believe it should? [...] > +static int hisi_thermal_probe(struct platform_device *pdev) > +{ > + struct hisi_thermal_data *data; > + struct resource *res; > + int i; > + int ret; > + > + if (!cpufreq_get_current_driver()) { > + dev_dbg(&pdev->dev, "no cpufreq driver!"); > + return -EPROBE_DEFER; > + } Surely we care about not burning out the board even if we don't have cpufreq? Is there any ordering guarantee between the probing of this driver and cpufreq? [...] > + data->clk = devm_clk_get(&pdev->dev, NULL); You gave this clock a name in the binding. Use it or drop it. Mark.
WARNING: multiple messages have this Message-ID (diff)
From: mark.rutland@arm.com (Mark Rutland) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] thermal: hisilicon: add new hisilicon thermal sensor driver Date: Thu, 19 Mar 2015 14:17:53 +0000 [thread overview] Message-ID: <20150319141753.GB25967@leverpostej> (raw) In-Reply-To: <1426751849-10604-2-git-send-email-kong.kongxinwei@hisilicon.com> On Thu, Mar 19, 2015 at 07:57:27AM +0000, kongxinwei wrote: > This patch adds the support for hisilicon thermal sensor, within > hisilicon SoC. there will register sensors for thermal framework > and use device tree to bind cooling device. > > Signed-off-by: Leo Yan <leo.yan@linaro.org> > Signed-off-by: kongxinwei <kong.kongxinwei@hisilicon.com> > --- > drivers/thermal/Kconfig | 8 + > drivers/thermal/Makefile | 1 + > drivers/thermal/hisi_thermal.c | 531 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 540 insertions(+) > create mode 100644 drivers/thermal/hisi_thermal.c [...] > + ret = of_property_read_u32(np, "hisilicon,tsensor-lag-value", > + &sensor->lag); This wasn't in the binding. [...] > + ret = of_property_read_u32(np, "hisilicon,tsensor-thres-temp", > + &sensor->thres_temp); > + if (ret) { > + dev_err(&pdev->dev, "failed to get thres value %d: %d\n", > + index, ret); > + return ret; > + } > + > + ret = of_property_read_u32(np, "hisilicon,tsensor-reset-temp", > + &sensor->reset_temp); > + if (ret) { > + dev_err(&pdev->dev, "failed to get reset value %d: %d\n", > + index, ret); > + return ret; > + } I see now that these properties result in the HW being programmed. You should figure out how to reconcile these with thermal-zone trip points rather than having parallel properties. > + > + if (of_property_read_bool(np, "hisilicon,tsensor-bind-irq")) { > + > + if (data->irq_bind_sensor != -1) > + dev_warn(&pdev->dev, "irq has bound to index %d\n", > + data->irq_bind_sensor); > + > + /* bind irq to this sensor */ > + data->irq_bind_sensor = index; > + } I don't see why this should be specified in the DT. Why do you believe it should? [...] > +static int hisi_thermal_probe(struct platform_device *pdev) > +{ > + struct hisi_thermal_data *data; > + struct resource *res; > + int i; > + int ret; > + > + if (!cpufreq_get_current_driver()) { > + dev_dbg(&pdev->dev, "no cpufreq driver!"); > + return -EPROBE_DEFER; > + } Surely we care about not burning out the board even if we don't have cpufreq? Is there any ordering guarantee between the probing of this driver and cpufreq? [...] > + data->clk = devm_clk_get(&pdev->dev, NULL); You gave this clock a name in the binding. Use it or drop it. Mark.
next prev parent reply other threads:[~2015-03-19 14:18 UTC|newest] Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-19 7:57 [PATCH 0/3] 96boards: add thermal senor support to hikey board kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 7:57 ` [PATCH 1/3] thermal: hisilicon: add new hisilicon thermal sensor driver kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 14:17 ` Mark Rutland [this message] 2015-03-19 14:17 ` Mark Rutland 2015-03-19 14:17 ` Mark Rutland 2015-03-20 6:06 ` Leo Yan 2015-03-20 6:06 ` Leo Yan 2015-03-20 6:06 ` Leo Yan 2015-03-20 11:24 ` Mark Rutland 2015-03-20 11:24 ` Mark Rutland 2015-03-20 11:24 ` Mark Rutland 2015-03-20 14:53 ` Leo Yan 2015-03-20 14:53 ` Leo Yan 2015-03-20 14:53 ` Leo Yan 2015-03-20 15:55 ` Mark Rutland 2015-03-20 15:55 ` Mark Rutland 2015-03-20 15:55 ` Mark Rutland 2015-03-23 4:46 ` Leo Yan 2015-03-23 4:46 ` Leo Yan 2015-03-23 4:46 ` Leo Yan 2015-03-23 8:30 ` kongxinwei 2015-03-23 8:30 ` kongxinwei 2015-03-23 8:30 ` kongxinwei 2015-03-20 15:27 ` Xinwei Kong 2015-03-20 15:27 ` Xinwei Kong 2015-03-20 15:27 ` Xinwei Kong 2015-03-20 7:37 ` kongxinwei 2015-03-20 7:37 ` kongxinwei 2015-03-20 7:37 ` kongxinwei 2015-03-19 7:57 ` [PATCH 2/3] dts: hi6220: enable thermal sensor for hisilicon SoC kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 7:57 ` [PATCH 3/3] dt-bindings: Document the hi6220 thermal sensor bindings kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 7:57 ` kongxinwei 2015-03-19 14:08 ` Mark Rutland 2015-03-19 14:08 ` Mark Rutland 2015-03-19 14:08 ` Mark Rutland 2015-03-19 13:59 ` [PATCH 0/3] 96boards: add thermal senor support to hikey board Mark Rutland 2015-03-19 13:59 ` Mark Rutland 2015-03-19 13:59 ` Mark Rutland 2015-03-20 3:10 ` kongxinwei 2015-03-20 3:10 ` kongxinwei 2015-03-20 3:10 ` kongxinwei 2015-03-20 6:13 ` Leo Yan 2015-03-20 6:13 ` Leo Yan 2015-03-20 6:13 ` Leo Yan 2015-03-20 7:41 ` kongxinwei 2015-03-20 7:41 ` kongxinwei 2015-03-20 7:41 ` kongxinwei
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20150319141753.GB25967@leverpostej \ --to=mark.rutland@arm.com \ --cc=devicetree@vger.kernel.org \ --cc=edubezval@gmail.com \ --cc=kong.kongxinwei@hisilicon.com \ --cc=liguozhu@hisilicon.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=linuxarm@huawei.com \ --cc=rui.zhuang@intel.com \ --cc=xuwei5@hisilicon.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.