RE: [PATCH v3 2/2] drivers: misc: adi-axi-tdd: Add TDD engine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, October 19, 2023 20:57
> To: Balas, Eliza <Eliza.Balas@xxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx; Rob Herring <robh+dt@xxxxxxxxxx>; Krzysztof Kozlowski
> <krzysztof.kozlowski+dt@xxxxxxxxxx>; Conor Dooley <conor+dt@xxxxxxxxxx>; Derek Kiernan <derek.kiernan@xxxxxxx>; Dragan
> Cvetic <dragan.cvetic@xxxxxxx>; Arnd Bergmann <arnd@xxxxxxxx>
> 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.

Thank you for review,
Eliza









[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux