On Thu, 31 Oct 2024 21:26:26 +0000
Jonathan Cameron <jic23@kernel.org> wrote:
> On Tue, 29 Oct 2024 14:08:15 -0500
> David Lechner <dlechner@baylibre.com> wrote:
>
> > On 10/28/24 4:45 PM, Angelo Dureghello wrote:
> > > Purpose is to add ad3552r AXI DAC (fpga-based) support.
> > >
> > > The "ad3552r" AXI IP, a variant of the generic "DAC" AXI IP,
> > > has been created to reach the maximum speed (33MUPS) supported
> > > from the ad3552r. To obtain the maximum transfer rate, a custom
> > > IP core module has been implemented with a QSPI interface with
> > > DDR (Double Data Rate) mode.
> > >
> > > The design is actually using the DAC backend since the register
> > > map is the same of the generic DAC IP, except for some customized
> > > bitfields. For this reason, a new "compatible" has been added
> > > in adi-axi-dac.c.
> > >
> > > Also, backend has been extended with all the needed functions
> > > for this use case, keeping the names gneric.
> > >
> > > The following patch is actually applying to linux-iio/testing.
> > >
> > > ---
> > Reviewed-by: David Lechner <dlechner@baylibre.com>
> >
>
> Series applied with 2 tweaks as called out in replies to individual
> patches. Pushed out initially as testing for 0-day to see if there
> are any issues my (admittedly now very lazy) build tests didn't find.
[jic23-iio:testing 104/113] drivers/iio/dac/ad3552r-hs.c:400:17: warning: variable 'goffs' is uninitialized when used here
was a report from 0-day.
I 'think' the fix (based on v6 which is last time anything set this)
is the following and that's what I'll push out for now.
If it should be something else send me a patch on top of my testing branch
so I can quickly apply it.
I've also dropped the explicit select of ADI_AXI_DAC as you can only do that
if you also carry all it's dependencies. (another 0-day report)
Thanks as ever to the lkp team for their incredibly useful service!
diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c
index 97dfc598aec6..7a5b277ee370 100644
--- a/drivers/iio/dac/ad3552r-hs.c
+++ b/drivers/iio/dac/ad3552r-hs.c
@@ -295,7 +295,6 @@ static int ad3552r_hs_setup_custom_gain(struct ad3552r_hs_state *st,
static int ad3552r_hs_setup(struct ad3552r_hs_state *st)
{
- s16 goffs;
u16 id;
u16 gain = 0, offset = 0;
u32 ch, val, range;
@@ -397,7 +396,7 @@ static int ad3552r_hs_setup(struct ad3552r_hs_state *st)
gain = ad3552r_calc_custom_gain(st->ch_data[ch].p,
st->ch_data[ch].n,
st->ch_data[ch].gain_offset);
- offset = abs(goffs);
+ offset = abs(st->ch_data[ch].gain_offset);
st->ch_data[ch].range_override = 1;
>
> Thanks,
>
> Jonathan
>