All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Kiselev <bigunclemax@gmail.com>
To: Conor Dooley <conor@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	 Yangtao Li <tiny.windzz@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	 Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amitk@kernel.org>,
	 Zhang Rui <rui.zhang@intel.com>,
	Rob Herring <robh+dt@kernel.org>,
	 Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,  Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Samuel Holland <samuel@sholland.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Cristian Ciocaltea <cristian.ciocaltea@collabora.com>,
	linux-pm@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v1 3/3] dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller
Date: Sat, 10 Jun 2023 23:31:03 +0300	[thread overview]
Message-ID: <CALHCpMjFNvJAnd2_3-1n_L3QRz4eNc-Egm-BD6jcS6H694dSyg@mail.gmail.com> (raw)
In-Reply-To: <20230610-crumpet-spender-4133090a4728@spud>

сб, 10 июн. 2023 г. в 21:01, Conor Dooley <conor@kernel.org>:

...

> > > > +  - |
> > > > +    thermal-sensor@2009400 {
> > > > +          compatible = "allwinner,sun20i-d1-ths";
> > > > +          reg = <0x02009400 0x400>;
> > > > +          interrupts = <0 90 0>;
> > > > +          clocks = <&ccu 0>;
> > > > +          clock-names = "bus";
> > > > +          resets = <&ccu 2>;
> > > > +          nvmem-cells = <&ths_calibration>;
> > > > +          nvmem-cell-names = "calibration";
> > > > +          #thermal-sensor-cells = <0>;
> > > >
> > > >> Is this calibration required, or optional, for the d1?
> > >
> > > Calibration data for the D1 is optional as for the H6.
> > > (But without it, the sensor data will be inaccurate).
> >
> > Okay. Modulo the signoff:
> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
>
> Wait, that's not what I meant to say... Clearly turned my brain off for
> a moment. If it is not going to function correctly without the
> calibration data, why not make the calibration data required for the
> d1's ths?

I don't really know why, but the calibration data is optional for
other controllers.
So I just did it the same way.
Here is explanation comment about it from the driver:
        /*
         * Even if the external calibration data stored in sid is
         * not accessible, the THS hardware can still work, although
         * the data won't be so accurate.
         *
         * The default value of calibration register is 0x800 for
         * every sensor, and the calibration value is usually 0x7xx
         * or 0x8xx, so they won't be away from the default value
         * for a lot.
         *
         * So here we do not return error if the calibration data is
         * not available, except the probe needs deferring.
         */

WARNING: multiple messages have this Message-ID (diff)
From: Maxim Kiselev <bigunclemax@gmail.com>
To: Conor Dooley <conor@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	 Yangtao Li <tiny.windzz@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	 Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amitk@kernel.org>,
	 Zhang Rui <rui.zhang@intel.com>,
	Rob Herring <robh+dt@kernel.org>,
	 Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,  Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Samuel Holland <samuel@sholland.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Cristian Ciocaltea <cristian.ciocaltea@collabora.com>,
	linux-pm@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v1 3/3] dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller
Date: Sat, 10 Jun 2023 23:31:03 +0300	[thread overview]
Message-ID: <CALHCpMjFNvJAnd2_3-1n_L3QRz4eNc-Egm-BD6jcS6H694dSyg@mail.gmail.com> (raw)
In-Reply-To: <20230610-crumpet-spender-4133090a4728@spud>

сб, 10 июн. 2023 г. в 21:01, Conor Dooley <conor@kernel.org>:

...

> > > > +  - |
> > > > +    thermal-sensor@2009400 {
> > > > +          compatible = "allwinner,sun20i-d1-ths";
> > > > +          reg = <0x02009400 0x400>;
> > > > +          interrupts = <0 90 0>;
> > > > +          clocks = <&ccu 0>;
> > > > +          clock-names = "bus";
> > > > +          resets = <&ccu 2>;
> > > > +          nvmem-cells = <&ths_calibration>;
> > > > +          nvmem-cell-names = "calibration";
> > > > +          #thermal-sensor-cells = <0>;
> > > >
> > > >> Is this calibration required, or optional, for the d1?
> > >
> > > Calibration data for the D1 is optional as for the H6.
> > > (But without it, the sensor data will be inaccurate).
> >
> > Okay. Modulo the signoff:
> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
>
> Wait, that's not what I meant to say... Clearly turned my brain off for
> a moment. If it is not going to function correctly without the
> calibration data, why not make the calibration data required for the
> d1's ths?

I don't really know why, but the calibration data is optional for
other controllers.
So I just did it the same way.
Here is explanation comment about it from the driver:
        /*
         * Even if the external calibration data stored in sid is
         * not accessible, the THS hardware can still work, although
         * the data won't be so accurate.
         *
         * The default value of calibration register is 0x800 for
         * every sensor, and the calibration value is usually 0x7xx
         * or 0x8xx, so they won't be away from the default value
         * for a lot.
         *
         * So here we do not return error if the calibration data is
         * not available, except the probe needs deferring.
         */

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2023-06-10 20:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10 14:17 [PATCH v1 0/3] Add D1/T113s thermal sensor controller support Maksim Kiselev
2023-06-10 14:17 ` Maksim Kiselev
2023-06-10 14:17 ` [PATCH v1 1/3] thermal: sun8i: Add D1/T113s THS " Maksim Kiselev
2023-06-10 14:17   ` Maksim Kiselev
2023-06-10 14:17 ` [PATCH v1 2/3] riscv: dts: allwinner: d1: Add thermal sensor and thermal zone Maksim Kiselev
2023-06-10 14:17   ` Maksim Kiselev
2023-06-10 14:17 ` [PATCH v1 3/3] dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller Maksim Kiselev
2023-06-10 14:17   ` Maksim Kiselev
2023-06-10 14:52   ` Conor Dooley
2023-06-10 14:52     ` Conor Dooley
2023-06-10 15:30     ` Maxim Kiselev
2023-06-10 15:30       ` Maxim Kiselev
2023-06-10 17:59       ` Conor Dooley
2023-06-10 17:59         ` Conor Dooley
2023-06-10 18:01         ` Conor Dooley
2023-06-10 18:01           ` Conor Dooley
2023-06-10 20:31           ` Maxim Kiselev [this message]
2023-06-10 20:31             ` Maxim Kiselev
2023-06-10 22:13             ` Conor Dooley
2023-06-10 22:13               ` Conor Dooley
2023-06-11  7:53               ` Maxim Kiselev
2023-06-11  7:53                 ` Maxim Kiselev
2023-06-11 10:18                 ` Conor Dooley
2023-06-11 10:18                   ` Conor Dooley
2023-06-10 19:04 ` [PATCH v1 0/3] Add D1/T113s thermal sensor controller support Jernej Škrabec
2023-06-10 19:04   ` Jernej Škrabec

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=CALHCpMjFNvJAnd2_3-1n_L3QRz4eNc-Egm-BD6jcS6H694dSyg@mail.gmail.com \
    --to=bigunclemax@gmail.com \
    --cc=amitk@kernel.org \
    --cc=anarsoul@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=samuel@sholland.org \
    --cc=tiny.windzz@gmail.com \
    --cc=wens@csie.org \
    /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 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.