From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: "Balas, Eliza" <Eliza.Balas@analog.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Derek Kiernan <derek.kiernan@amd.com>,
Dragan Cvetic <dragan.cvetic@amd.com>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v3 2/2] drivers: misc: adi-axi-tdd: Add TDD engine
Date: Fri, 20 Oct 2023 13:26:05 +0200 [thread overview]
Message-ID: <bae6d751-1dbc-449d-b91f-aec0890caa7b@linaro.org> (raw)
In-Reply-To: <BN7PR03MB4545E7EAB2D72B9098C30C6797DBA@BN7PR03MB4545.namprd03.prod.outlook.com>
On 20/10/2023 13:18, Balas, Eliza wrote:
>> -----Original Message-----
>> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Sent: Thursday, October 19, 2023 20:57
>> To: Balas, Eliza <Eliza.Balas@analog.com>
>> Cc: linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski
>> <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley <conor+dt@kernel.org>; Derek Kiernan <derek.kiernan@amd.com>; Dragan
>> Cvetic <dragan.cvetic@amd.com>; Arnd Bergmann <arnd@arndb.de>
>> Subject: Re: [PATCH v3 2/2] drivers: misc: adi-axi-tdd: Add TDD engine
>>
>> [External]
>>
>> On Thu, Oct 19, 2023 at 03:56:46PM +0300, Eliza Balas wrote:
>>> +config ADI_AXI_TDD
>>> + tristate "Analog Devices TDD Engine support"
>>> + depends on HAS_IOMEM
>>> + select REGMAP_MMIO
>>> + help
>>> + The ADI AXI TDD core is the reworked and generic TDD engine which
>>> + was developed for general use in Analog Devices HDL projects. Unlike
>>> + the previous TDD engine, this core can only be used standalone mode,
>>> + and is not embedded into other devices.
>>
>> What does "previous" mean here? That's not relevant for a kernel help
>> text, is it?
>>
>> Also, what is the module name? Why would someone enable this? What
>> userspace tools use it?
>>
>>
>>> +
>>> config DUMMY_IRQ
>>> tristate "Dummy IRQ handler"
>>> help
>>
>> Why put your entry in this specific location in the file?
>>
>>> +static int adi_axi_tdd_parse_ms(struct adi_axi_tdd_state *st,
>>> + const char *buf,
>>> + u64 *res)
>>> +{
>>> + u64 clk_rate = READ_ONCE(st->clk.rate);
>>> + char *orig_str, *modf_str, *int_part, frac_part[7];
>>> + long ival, frac;
>>> + int ret;
>>> +
>>> + orig_str = kstrdup(buf, GFP_KERNEL);
>>> + int_part = strsep(&orig_str, ".");
>>
>> Why are we parsing floating point in the kernel? Please just keep the
>> api simple so that we don't have to try to do any type of parsing other
>> than turning a single text number into a value.
>>
>
> The adi_axi_tdd_parse_ms function does almost the same thing as the
> iio_str_to_fixpoint() function which already exists in kernel.
> It parses a fixed-point number from a string.
> The __iio_str_to_fixpoint is used in a similar way, as I intend to use adi_axi_tdd_parse_ms.
> It writes to a channel the corresponding scale (micro,nano) for a value.
>
> Since the device is not an iio device, using an iio function would be confusing.
> That is the reason for creating the adi_axi_tdd_parse_ms function, which is easier
> to understand since I don't have to make all the multiplications that are made
> in the __iio_str_to_fixpoint function.
Why did you skip other comments?
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-10-20 11:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 12:56 [PATCH v3 0/2] Add support for ADI TDD Engine Eliza Balas
2023-10-19 12:56 ` [PATCH v3 1/2] dt-bindings: misc: adi,axi-tdd: Add device-tree binding for TDD engine Eliza Balas
2023-10-24 19:09 ` Rob Herring
2023-10-25 10:19 ` Balas, Eliza
2023-10-19 12:56 ` [PATCH v3 2/2] drivers: misc: adi-axi-tdd: Add " Eliza Balas
2023-10-19 17:57 ` Greg Kroah-Hartman
2023-10-20 11:18 ` Balas, Eliza
2023-10-20 11:26 ` Krzysztof Kozlowski [this message]
2023-10-20 12:08 ` Balas, Eliza
2023-10-20 14:31 ` Greg Kroah-Hartman
2023-10-23 12:54 ` Balas, Eliza
2023-10-23 13:00 ` Greg Kroah-Hartman
2023-10-23 13:30 ` Balas, Eliza
2023-10-23 14:19 ` Arnd Bergmann
2023-10-23 14:36 ` Nuno Sá
2023-10-28 16:29 ` Jonathan Cameron
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=bae6d751-1dbc-449d-b91f-aec0890caa7b@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=Eliza.Balas@analog.com \
--cc=arnd@arndb.de \
--cc=conor+dt@kernel.org \
--cc=derek.kiernan@amd.com \
--cc=devicetree@vger.kernel.org \
--cc=dragan.cvetic@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).