mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH v2 5/6] aiodev: Add TEMPMON driver
Date: Fri, 13 May 2016 08:44:45 -0700	[thread overview]
Message-ID: <CAHQ1cqHKZTQn+PbHRkK_4F-YGbSa16cbwW6MqdoagtehgPSOmA@mail.gmail.com> (raw)
In-Reply-To: <20160510060255.GV19714@pengutronix.de>

On Mon, May 9, 2016 at 11:02 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Fri, May 06, 2016 at 07:09:29AM -0700, Andrey Smirnov wrote:
>> Port TEMPMON driver from U-Boot
>>
>> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>> ---
>>  arch/arm/dts/imx6qdl.dtsi    |  14 +++
>>  arch/arm/dts/imx6sx.dtsi     |  14 +++
>>  drivers/aiodev/Kconfig       |   8 ++
>>  drivers/aiodev/Makefile      |   1 +
>>  drivers/aiodev/imx_thermal.c | 239 +++++++++++++++++++++++++++++++++++++++++++
>>  5 files changed, 276 insertions(+)
>>  create mode 100644 drivers/aiodev/imx_thermal.c
>>
>> diff --git a/arch/arm/dts/imx6qdl.dtsi b/arch/arm/dts/imx6qdl.dtsi
>> index 828be9c..0deafbc 100644
>> --- a/arch/arm/dts/imx6qdl.dtsi
>> +++ b/arch/arm/dts/imx6qdl.dtsi
>> @@ -8,3 +8,17 @@
>>               ipu0 = &ipu1;
>>       };
>>  };
>> +
>> +&ocotp {
>> +     #address-cells = <1>;
>> +     #size-cells = <1>;
>> +
>> +     analog1: ocotp_ana1@34 {
>
> @38?
>
>> +             reg = <0x38 0x4>;
>> +     };
>> +};
>> +
>> +&tempmon {
>> +     nvmem-cells = <&analog1>;
>> +     nvmem-cell-names = "ocotp-ana1";
>> +};
>
> Why not use the existing binding? The nvmem binding may be better, but I
> think we should not introduce new bindings without need.

I was using it originally (back when this was a part of HWMON RFC),
but then "cdev_do_open" was removed, so I switched to using "nvmem".
Granted there is not meaningful "open" or "close" operation for ocotp
cdev, but I just liked that approach less. I'll revert to original
code in v3

>
>> +     node = of_parse_phandle(dev->device_node, "fsl,tempmon", 0);
>> +     if (!node) {
>> +             ret = -EINVAL;
>> +             dev_err(dev, "Failed to parse fsl,tempmon\n");
>> +             goto free_calibration_data;
>> +     }
>> +
>> +     anatop = of_find_device_by_node(node);
>> +     if (!anatop) {
>> +             ret = -EINVAL;
>> +             dev_err(dev, "No device corresponds to fsl,tempmon\n");
>> +             goto free_calibration_data;
>> +     }
>
> syscon_base_lookup_by_phandle() instead of
> of_parse_phandle()/of_find_device_by_node()?

Will fix in v3

>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-05-13 15:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 14:09 [PATCH v2 0/6] AIODEV subsystem Andrey Smirnov
2016-05-06 14:09 ` [PATCH v2 1/6] drivers: add nvmem framework from kernel Andrey Smirnov
2016-05-06 14:09 ` [PATCH v2 2/6] ocotp: Register OCOTP with 'nvmem' Andrey Smirnov
2016-05-06 14:09 ` [PATCH v2 3/6] drivers: Introduce AIODEV subsystem Andrey Smirnov
2016-05-06 14:09 ` [PATCH v2 4/6] commands: Add 'hwmon' command Andrey Smirnov
2016-05-06 14:09 ` [PATCH v2 5/6] aiodev: Add TEMPMON driver Andrey Smirnov
2016-05-10  6:02   ` Sascha Hauer
2016-05-13 15:44     ` Andrey Smirnov [this message]
2016-05-06 14:09 ` [PATCH v2 6/6] aiodev: Add basic LM75 temperature driver Andrey Smirnov

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=CAHQ1cqHKZTQn+PbHRkK_4F-YGbSa16cbwW6MqdoagtehgPSOmA@mail.gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox