* [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
@ 2025-04-17 13:54 Gabriel Shahrouzi
2025-04-18 15:40 ` Jonathan Cameron
2025-04-19 21:46 ` Marcelo Schmitt
0 siblings, 2 replies; 7+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-17 13:54 UTC (permalink / raw)
To: gregkh, jic23, lars, linux-iio, linux-kernel, linux-staging,
Michael.Hennerich
Cc: gshahrouzi, skhan, linux-kernel-mentees, stable
According to the AD9832 datasheet (Table 10, D12 description), setting
the RESET bit forces the phase accumulator to zero, which corresponds to
a full-scale DC output, rather than disabling the output signal.
The correct way to disable the output and enter a low-power state is to
set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
the internal DAC current sources and disables internal clocks.
Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
Cc: stable@vger.kernel.org
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
drivers/staging/iio/frequency/ad9832.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
index db42810c7664b..0872ff4ec4896 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -232,7 +232,7 @@ static ssize_t ad9832_write(struct device *dev, struct device_attribute *attr,
st->ctrl_src &= ~(AD9832_RESET | AD9832_SLEEP |
AD9832_CLR);
else
- st->ctrl_src |= AD9832_RESET;
+ st->ctrl_src |= AD9832_SLEEP;
st->data = cpu_to_be16((AD9832_CMD_SLEEPRESCLR << CMD_SHIFT) |
st->ctrl_src);
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
2025-04-17 13:54 [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output Gabriel Shahrouzi
@ 2025-04-18 15:40 ` Jonathan Cameron
2025-04-18 17:01 ` Gabriel Shahrouzi
2025-04-19 21:46 ` Marcelo Schmitt
1 sibling, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2025-04-18 15:40 UTC (permalink / raw)
To: Gabriel Shahrouzi
Cc: gregkh, lars, linux-iio, linux-kernel, linux-staging,
Michael.Hennerich, skhan, linux-kernel-mentees, stable
On Thu, 17 Apr 2025 09:54:34 -0400
Gabriel Shahrouzi <gshahrouzi@gmail.com> wrote:
> According to the AD9832 datasheet (Table 10, D12 description), setting
> the RESET bit forces the phase accumulator to zero, which corresponds to
> a full-scale DC output, rather than disabling the output signal.
>
> The correct way to disable the output and enter a low-power state is to
> set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
> the internal DAC current sources and disables internal clocks.
>
> Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> ---
Seems reasonable but I'd like some more review of this before picking it up.
So feel free to poke me if nothing happens in say 2 weeks from now.
> drivers/staging/iio/frequency/ad9832.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> index db42810c7664b..0872ff4ec4896 100644
> --- a/drivers/staging/iio/frequency/ad9832.c
> +++ b/drivers/staging/iio/frequency/ad9832.c
> @@ -232,7 +232,7 @@ static ssize_t ad9832_write(struct device *dev, struct device_attribute *attr,
> st->ctrl_src &= ~(AD9832_RESET | AD9832_SLEEP |
> AD9832_CLR);
> else
> - st->ctrl_src |= AD9832_RESET;
> + st->ctrl_src |= AD9832_SLEEP;
>
> st->data = cpu_to_be16((AD9832_CMD_SLEEPRESCLR << CMD_SHIFT) |
> st->ctrl_src);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
2025-04-18 15:40 ` Jonathan Cameron
@ 2025-04-18 17:01 ` Gabriel Shahrouzi
0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-18 17:01 UTC (permalink / raw)
To: Jonathan Cameron
Cc: gregkh, lars, linux-iio, linux-kernel, linux-staging,
Michael.Hennerich, skhan, linux-kernel-mentees, stable
On Fri, Apr 18, 2025 at 11:40 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> On Thu, 17 Apr 2025 09:54:34 -0400
> Gabriel Shahrouzi <gshahrouzi@gmail.com> wrote:
>
> > According to the AD9832 datasheet (Table 10, D12 description), setting
> > the RESET bit forces the phase accumulator to zero, which corresponds to
> > a full-scale DC output, rather than disabling the output signal.
> >
> > The correct way to disable the output and enter a low-power state is to
> > set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
> > the internal DAC current sources and disables internal clocks.
> >
> > Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> > ---
> Seems reasonable but I'd like some more review of this before picking it up.
> So feel free to poke me if nothing happens in say 2 weeks from now.
Sounds good.
>
> > drivers/staging/iio/frequency/ad9832.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> > index db42810c7664b..0872ff4ec4896 100644
> > --- a/drivers/staging/iio/frequency/ad9832.c
> > +++ b/drivers/staging/iio/frequency/ad9832.c
> > @@ -232,7 +232,7 @@ static ssize_t ad9832_write(struct device *dev, struct device_attribute *attr,
> > st->ctrl_src &= ~(AD9832_RESET | AD9832_SLEEP |
> > AD9832_CLR);
> > else
> > - st->ctrl_src |= AD9832_RESET;
> > + st->ctrl_src |= AD9832_SLEEP;
> >
> > st->data = cpu_to_be16((AD9832_CMD_SLEEPRESCLR << CMD_SHIFT) |
> > st->ctrl_src);
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
2025-04-17 13:54 [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output Gabriel Shahrouzi
2025-04-18 15:40 ` Jonathan Cameron
@ 2025-04-19 21:46 ` Marcelo Schmitt
2025-04-20 1:41 ` Gabriel Shahrouzi
1 sibling, 1 reply; 7+ messages in thread
From: Marcelo Schmitt @ 2025-04-19 21:46 UTC (permalink / raw)
To: Gabriel Shahrouzi
Cc: gregkh, jic23, lars, linux-iio, linux-kernel, linux-staging,
Michael.Hennerich, skhan, linux-kernel-mentees, stable
On 04/17, Gabriel Shahrouzi wrote:
> According to the AD9832 datasheet (Table 10, D12 description), setting
> the RESET bit forces the phase accumulator to zero, which corresponds to
> a full-scale DC output, rather than disabling the output signal.
>
> The correct way to disable the output and enter a low-power state is to
> set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
> the internal DAC current sources and disables internal clocks.
>
> Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> ---
Looks okay.
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Unrelated to this patch but, if anybody be looking to work on getting this out
of staging, I think maybe this driver could use out_altvoltage_powerdown ABI
instead of this custom out_altvoltageX_out_enable.
Crazy thing this driver doesn't declare a single IIO channel.
Seems to be somewhat ancient IIO driver.
Regards,
Marcelo
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
2025-04-19 21:46 ` Marcelo Schmitt
@ 2025-04-20 1:41 ` Gabriel Shahrouzi
2025-04-21 11:07 ` Jonathan Cameron
0 siblings, 1 reply; 7+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-20 1:41 UTC (permalink / raw)
To: Marcelo Schmitt
Cc: gregkh, jic23, lars, linux-iio, linux-kernel, linux-staging,
Michael.Hennerich, skhan, linux-kernel-mentees, stable
On Sat, Apr 19, 2025 at 5:45 PM Marcelo Schmitt
<marcelo.schmitt1@gmail.com> wrote:
>
> On 04/17, Gabriel Shahrouzi wrote:
> > According to the AD9832 datasheet (Table 10, D12 description), setting
> > the RESET bit forces the phase accumulator to zero, which corresponds to
> > a full-scale DC output, rather than disabling the output signal.
> >
> > The correct way to disable the output and enter a low-power state is to
> > set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
> > the internal DAC current sources and disables internal clocks.
> >
> > Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> > ---
> Looks okay.
>
> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
>
> Unrelated to this patch but, if anybody be looking to work on getting this out
> of staging, I think maybe this driver could use out_altvoltage_powerdown ABI
> instead of this custom out_altvoltageX_out_enable.
> Crazy thing this driver doesn't declare a single IIO channel.
> Seems to be somewhat ancient IIO driver.
I can start tackling this.
>
> Regards,
> Marcelo
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
2025-04-20 1:41 ` Gabriel Shahrouzi
@ 2025-04-21 11:07 ` Jonathan Cameron
2025-04-21 13:38 ` Gabriel Shahrouzi
0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2025-04-21 11:07 UTC (permalink / raw)
To: Gabriel Shahrouzi
Cc: Marcelo Schmitt, gregkh, lars, linux-iio, linux-kernel,
linux-staging, Michael.Hennerich, skhan, linux-kernel-mentees,
stable
On Sat, 19 Apr 2025 21:41:50 -0400
Gabriel Shahrouzi <gshahrouzi@gmail.com> wrote:
> On Sat, Apr 19, 2025 at 5:45 PM Marcelo Schmitt
> <marcelo.schmitt1@gmail.com> wrote:
> >
> > On 04/17, Gabriel Shahrouzi wrote:
> > > According to the AD9832 datasheet (Table 10, D12 description), setting
> > > the RESET bit forces the phase accumulator to zero, which corresponds to
> > > a full-scale DC output, rather than disabling the output signal.
> > >
> > > The correct way to disable the output and enter a low-power state is to
> > > set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
> > > the internal DAC current sources and disables internal clocks.
> > >
> > > Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> > > ---
> > Looks okay.
> >
> > Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> >
> > Unrelated to this patch but, if anybody be looking to work on getting this out
> > of staging, I think maybe this driver could use out_altvoltage_powerdown ABI
> > instead of this custom out_altvoltageX_out_enable.
> > Crazy thing this driver doesn't declare a single IIO channel.
> > Seems to be somewhat ancient IIO driver.
> I can start tackling this.
This has crossed with a series from Siddarth.
Take a look at what is in:
https://web.git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=aa703203cbbca22ac46d42d4cd41232491827152
Please rebase this one on top of that as I think the bug is still there?
Given there is work going on for this driver and the bugs are ancient, I'll
not take any patches through the fixes tree for now. Instead I'll just queue
them up for the next merge window.
Thanks,
Jonathan
> >
> > Regards,
> > Marcelo
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output
2025-04-21 11:07 ` Jonathan Cameron
@ 2025-04-21 13:38 ` Gabriel Shahrouzi
0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Shahrouzi @ 2025-04-21 13:38 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Marcelo Schmitt, gregkh, lars, linux-iio, linux-kernel,
linux-staging, Michael.Hennerich, skhan, linux-kernel-mentees,
stable
On Mon, Apr 21, 2025 at 7:07 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> On Sat, 19 Apr 2025 21:41:50 -0400
> Gabriel Shahrouzi <gshahrouzi@gmail.com> wrote:
>
> > On Sat, Apr 19, 2025 at 5:45 PM Marcelo Schmitt
> > <marcelo.schmitt1@gmail.com> wrote:
> > >
> > > On 04/17, Gabriel Shahrouzi wrote:
> > > > According to the AD9832 datasheet (Table 10, D12 description), setting
> > > > the RESET bit forces the phase accumulator to zero, which corresponds to
> > > > a full-scale DC output, rather than disabling the output signal.
> > > >
> > > > The correct way to disable the output and enter a low-power state is to
> > > > set the AD9832_SLEEP bit (Table 10, D13 description), which powers down
> > > > the internal DAC current sources and disables internal clocks.
> > > >
> > > > Fixes: ea707584bac1 ("Staging: IIO: DDS: AD9832 / AD9835 driver")
> > > > Cc: stable@vger.kernel.org
> > > > Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
> > > > ---
> > > Looks okay.
> > >
> > > Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> > >
> > > Unrelated to this patch but, if anybody be looking to work on getting this out
> > > of staging, I think maybe this driver could use out_altvoltage_powerdown ABI
> > > instead of this custom out_altvoltageX_out_enable.
> > > Crazy thing this driver doesn't declare a single IIO channel.
> > > Seems to be somewhat ancient IIO driver.
> > I can start tackling this.
> This has crossed with a series from Siddarth.
>
> Take a look at what is in:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=aa703203cbbca22ac46d42d4cd41232491827152
>
> Please rebase this one on top of that as I think the bug is still there?
Got it. Yes, I believe it is still there.
>
> Given there is work going on for this driver and the bugs are ancient, I'll
> not take any patches through the fixes tree for now. Instead I'll just queue
> them up for the next merge window.
Got it.
>
> Thanks,
>
> Jonathan
>
> > >
> > > Regards,
> > > Marcelo
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-04-21 13:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 13:54 [PATCH] iio: frequency: Use SLEEP bit instead of RESET to disable output Gabriel Shahrouzi
2025-04-18 15:40 ` Jonathan Cameron
2025-04-18 17:01 ` Gabriel Shahrouzi
2025-04-19 21:46 ` Marcelo Schmitt
2025-04-20 1:41 ` Gabriel Shahrouzi
2025-04-21 11:07 ` Jonathan Cameron
2025-04-21 13:38 ` Gabriel Shahrouzi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox