[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250626131934.4013096-1-paul.geurts@prodrive-technologies.com>
Date: Thu, 26 Jun 2025 15:19:34 +0200
From: Paul Geurts <paul.geurts@...drive-technologies.com>
To: <andrew@...n.ch>
CC: <andrew+netdev@...n.ch>, <conor+dt@...nel.org>, <davem@...emloft.net>,
<devicetree@...r.kernel.org>, <edumazet@...gle.com>, <krzk@...nel.org>,
<kuba@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-wireless@...r.kernel.org>,
<martijn.de.gouw@...drive-technologies.com>, <mgreer@...malcreek.com>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>,
<paul.geurts@...drive-technologies.com>, <robh@...nel.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: net/nfc: ti,trf7970a: Add ti,rx-gain-reduction option
> > > You should include the units, "ti,rx-gain-reduction-db"
> >
> > Well, Currently it's not really a dB value (see below).
> >
> > >
> > > > + $ref: /schemas/types.yaml#/definitions/uint32
> > > > + description: |
> > > > + Specify a RX gain reduction to reduce antenna sensitivity with 5dB per
> > > > + increment, with a maximum of 15dB.
> > >
> > > Given that description i think you can provide a list of values, [0,
> > > 5, 10, 15] and the tools will validate values in .dts files.
> > >
> > > > +
> > > > required:
> > > > - compatible
> > > > - interrupts
> > > > @@ -95,5 +101,6 @@ examples:
> > > > irq-status-read-quirk;
> > > > en2-rf-quirk;
> > > > clock-frequency = <27120000>;
> > > > + ti,rx-gain-reduction = <3>;
> > >
> > > Err, how does 3 fit into 5dB increments?
> >
> > I implemented it in a way that the value of ti,rx-gain-reduction is
> > programmed directly into the RX_GAIN reduction register, and there it
> > means 5 dB/LSB. My description probably was not clear enough about
> > that. So a value of 3 here actually means 15dB.
> > So I could either improve the description here that this is the case,
> > or make the value in here in actual dB, and do some calculations in
> > the driver. What has your preference?
>
> DT should use SI units, Volts, Amps, degrees C, meters, etc. The driver then should do whatever conversion is needed to convert to hardware register values.
>
> Less important, but i'm also wondering if this should be negative, ti,rx-gain-db, with a value of -15. You say this receiver is overly sensitive, so you need to reduce the gain. But are there TI devices where you can actually increase the gain? Ideally the property should be generic and be able to cover that use case as well.
As far as I am aware, I cannot put a negative number in a dts property. I can interpret the property as s32, but that would mean I need to put it in the dts like
ti,rx-gain = <0xfffffff1>;
which looks like a bad idea. I will just convert it to a dB value for v3.
>
> Andrew
>
> ---
> pw-bot: cr
>
Thanks!
Paul
Powered by blists - more mailing lists